mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix Smarty_Resource::parseResourceName incompatible with Google AppEngine (https://github.com/smarty-php/smarty/issues/22)
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== 3.1.22-dev ===== (xx.xx.2015)
|
||||
04.05.2015
|
||||
- bugfix Smarty_Resource::parseResourceName incompatible with Google AppEngine (https://github.com/smarty-php/smarty/issues/22)
|
||||
|
||||
28.04.2015
|
||||
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508) 2nd fix
|
||||
|
||||
|
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.22-dev/21';
|
||||
const SMARTY_VERSION = '3.1.22-dev/22';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@@ -218,15 +218,15 @@ abstract class Smarty_Resource
|
||||
*/
|
||||
public static function parseResourceName($resource_name, $default_resource)
|
||||
{
|
||||
$parts = explode(':', $resource_name, 2);
|
||||
if (!isset($parts[1]) || !isset($parts[0][1])) {
|
||||
if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]/', $resource_name, $match)) {
|
||||
$type = $match[1];
|
||||
$name = substr($resource_name, strlen($match[0]));
|
||||
} else {
|
||||
// no resource given, use default
|
||||
// or single character before the colon is not a resource type, but part of the filepath
|
||||
$type = $default_resource;
|
||||
$name = $resource_name;
|
||||
} else {
|
||||
$type = $parts[0];
|
||||
$name = $parts[1];
|
||||
|
||||
}
|
||||
return array($name, $type);
|
||||
}
|
||||
|
Reference in New Issue
Block a user