mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-03 02:26:41 +03:00
Fixed formating.
This commit is contained in:
parent
a44777f52f
commit
4d5e433e61
@ -189,7 +189,7 @@ class Context
|
|||||||
*/
|
*/
|
||||||
public function get($variableName, $strict = false)
|
public function get($variableName, $strict = false)
|
||||||
{
|
{
|
||||||
if ($variableName instanceof \Handlebars\String){
|
if ($variableName instanceof \Handlebars\String) {
|
||||||
return (string)$variableName;
|
return (string)$variableName;
|
||||||
}
|
}
|
||||||
$variableName = trim($variableName);
|
$variableName = trim($variableName);
|
||||||
|
@ -434,10 +434,10 @@ class Template
|
|||||||
preg_match_all('#(?<!\\\\)("|\')(?:[^\\\\]|\\\\.)*?\1|\S+#s', $string, $args);
|
preg_match_all('#(?<!\\\\)("|\')(?:[^\\\\]|\\\\.)*?\1|\S+#s', $string, $args);
|
||||||
$args = isset($args[0])?$args[0]:array();
|
$args = isset($args[0])?$args[0]:array();
|
||||||
|
|
||||||
for($x=0, $argc = count($args); $x<$argc;$x++){
|
for ($x=0, $argc = count($args); $x<$argc;$x++) {
|
||||||
// check to see if argument is a quoted string literal
|
// check to see if argument is a quoted string literal
|
||||||
if ($args[$x][0] == "'" || $args[$x][0] == '"'){
|
if ($args[$x][0] == "'" || $args[$x][0] == '"') {
|
||||||
if ($args[$x][0] === substr($args[$x], -1)){
|
if ($args[$x][0] === substr($args[$x], -1)) {
|
||||||
// remove enclosing quotes and unescape
|
// remove enclosing quotes and unescape
|
||||||
$args[$x] = new \Handlebars\String(stripcslashes(substr($args[$x], 1, strlen($args[$x]) -2)));
|
$args[$x] = new \Handlebars\String(stripcslashes(substr($args[$x], 1, strlen($args[$x]) -2)));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user