Merge branch 'master' into frontend

This commit is contained in:
touffies
2013-10-09 13:29:48 +02:00
3 changed files with 5 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ class Assetic extends AbstractSmartyPlugin
{
$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');
}

View File

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