Merge branch 'master' of https://github.com/thelia/thelia into coupon

* 'master' of https://github.com/thelia/thelia:
  fix issue concerning absoluteUrl
  do not display some information about template file
  escape view parameter
This commit is contained in:
Kahn
2013-10-10 22:12:42 +02:00
4 changed files with 6 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ class Assetic extends AbstractSmartyPlugin
{ {
$web_root = THELIA_WEB_DIR; $web_root = THELIA_WEB_DIR;
$asset_dir_from_web_root = ConfigQuery::read('asset_dir_from_web_root', 'assets'); $asset_dir_from_web_root = ConfigQuery::read('asset_dir_from_web_root', 'assets/');
$this->assetManager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root, $developmentMode == 'dev'); $this->assetManager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root, $developmentMode == 'dev');
} }

View File

@@ -212,14 +212,14 @@ class SmartyParser extends Smarty implements ParserInterface
$templateDir = realpath(THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/"); $templateDir = realpath(THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
if (strpos($pathFileName, $templateDir) !== 0) { if (strpos($pathFileName, $templateDir) !== 0) {
throw new ResourceNotFoundException(sprintf("'%s' view does not exists", $file)); throw new ResourceNotFoundException(sprintf("this view does not exists"));
} }
if (!file_exists($fileName)) { if (!file_exists($fileName)) {
$fileName .= ".html"; $fileName .= ".html";
if (!file_exists($fileName)) { if (!file_exists($fileName)) {
throw new ResourceNotFoundException(sprintf("'%s' file not found in %s template", $file, $this->template)); throw new ResourceNotFoundException(sprintf("file not found in %s template", $this->template));
} }
} }

View File

@@ -129,8 +129,9 @@ class URL
// If only a path is requested, be sure to remove the script name (index.php or index_dev.php), if any. // If only a path is requested, be sure to remove the script name (index.php or index_dev.php), if any.
if ($path_only == self::PATH_TO_FILE) { if ($path_only == self::PATH_TO_FILE) {
// As the base_url always ends with '/', if we don't find / at the end, we have a script. // As the base_url always ends with '/', if we don't find / at the end, we have a script.
if (substr($base_url, -1) != '/') $base_url = dirname($base_url); if (substr($base_url, -3) == 'php') $base_url = dirname($base_url);
} }
// Normalize the given path // Normalize the given path

View File

@@ -28,7 +28,7 @@ URL: http://www.thelia.net
{block name="meta"}{/block} {block name="meta"}{/block}
<!-- StyleSheet --> <!-- StyleSheet -->
{stylesheets file='assets/less/styles.less' filters='less,cssembed'} {stylesheets file='assets/less/styles.less' filters='less,cssembed,cssrewrite'}
<link rel="stylesheet" href="{$asset_url}"> <link rel="stylesheet" href="{$asset_url}">
{/stylesheets} {/stylesheets}
{debugbar_rendercss} {debugbar_rendercss}