summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--change_log.txt366
-rw-r--r--libs/Smarty.class.php30
-rw-r--r--libs/plugins/block.textformat.php4
-rw-r--r--libs/plugins/function.counter.php2
-rw-r--r--libs/plugins/function.cycle.php4
-rw-r--r--libs/plugins/function.fetch.php44
-rw-r--r--libs/plugins/function.html_checkboxes.php28
-rw-r--r--libs/plugins/function.html_image.php14
-rw-r--r--libs/plugins/function.html_options.php22
-rw-r--r--libs/plugins/function.html_radios.php22
-rw-r--r--libs/plugins/function.html_select_date.php28
-rw-r--r--libs/plugins/function.html_select_time.php16
-rw-r--r--libs/plugins/function.html_table.php8
-rw-r--r--libs/plugins/function.mailto.php6
-rw-r--r--libs/plugins/function.math.php8
-rw-r--r--libs/plugins/modifier.capitalize.php2
-rw-r--r--libs/plugins/modifier.date_format.php6
-rw-r--r--libs/plugins/modifier.debug_print_var.php4
-rw-r--r--libs/plugins/modifier.truncate.php2
-rw-r--r--libs/plugins/modifiercompiler.count_characters.php2
-rw-r--r--libs/plugins/modifiercompiler.strip_tags.php2
-rw-r--r--libs/plugins/modifiercompiler.unescape.php2
-rw-r--r--libs/plugins/outputfilter.trimwhitespace.php2
-rw-r--r--libs/plugins/shared.make_timestamp.php4
-rw-r--r--libs/plugins/shared.mb_unicode.php10
-rw-r--r--libs/sysplugins/smarty_cacheresource_custom.php2
-rw-r--r--libs/sysplugins/smarty_cacheresource_keyvaluestore.php8
-rw-r--r--libs/sysplugins/smarty_data.php4
-rw-r--r--libs/sysplugins/smarty_internal_block.php2
-rw-r--r--libs/sysplugins/smarty_internal_cacheresource_file.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_assign.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_block.php14
-rw-r--r--libs/sysplugins/smarty_internal_compile_break.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_call.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_eval.php5
-rw-r--r--libs/sysplugins/smarty_internal_compile_extends.php12
-rw-r--r--libs/sysplugins/smarty_internal_compile_for.php12
-rw-r--r--libs/sysplugins/smarty_internal_compile_foreach.php14
-rw-r--r--libs/sysplugins/smarty_internal_compile_function.php8
-rw-r--r--libs/sysplugins/smarty_internal_compile_if.php18
-rw-r--r--libs/sysplugins/smarty_internal_compile_include.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_include_php.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_insert.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_block_plugin.php11
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_foreachsection.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_function_plugin.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_modifier.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_object_function.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_php.php34
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_print_expression.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_registered_block.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_registered_function.php4
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_special_variable.php2
-rw-r--r--libs/sysplugins/smarty_internal_compile_section.php58
-rw-r--r--libs/sysplugins/smarty_internal_compile_while.php4
-rw-r--r--libs/sysplugins/smarty_internal_compilebase.php15
-rw-r--r--libs/sysplugins/smarty_internal_config_file_compiler.php2
-rw-r--r--libs/sysplugins/smarty_internal_data.php6
-rw-r--r--libs/sysplugins/smarty_internal_debug.php28
-rw-r--r--libs/sysplugins/smarty_internal_extension_handler.php6
-rw-r--r--libs/sysplugins/smarty_internal_method_append.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_appendbyref.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_assignbyref.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_assignglobal.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php6
-rw-r--r--libs/sysplugins/smarty_internal_method_compilealltemplates.php8
-rw-r--r--libs/sysplugins/smarty_internal_method_configload.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_gettags.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_loadfilter.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_loadplugin.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_mustcompile.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php2
-rw-r--r--libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_registerfilter.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_registerplugin.php4
-rw-r--r--libs/sysplugins/smarty_internal_method_setautoloadfilters.php2
-rw-r--r--libs/sysplugins/smarty_internal_nocache_insert.php9
-rw-r--r--libs/sysplugins/smarty_internal_parsetree_code.php2
-rw-r--r--libs/sysplugins/smarty_internal_parsetree_dq.php4
-rw-r--r--libs/sysplugins/smarty_internal_parsetree_tag.php2
-rw-r--r--libs/sysplugins/smarty_internal_parsetree_template.php12
-rw-r--r--libs/sysplugins/smarty_internal_resource_extends.php2
-rw-r--r--libs/sysplugins/smarty_internal_resource_php.php4
-rw-r--r--libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php16
-rw-r--r--libs/sysplugins/smarty_internal_runtime_capture.php2
-rw-r--r--libs/sysplugins/smarty_internal_runtime_codeframe.php9
-rw-r--r--libs/sysplugins/smarty_internal_runtime_filterhandler.php4
-rw-r--r--libs/sysplugins/smarty_internal_runtime_inheritance.php10
-rw-r--r--libs/sysplugins/smarty_internal_runtime_updatecache.php9
-rw-r--r--libs/sysplugins/smarty_internal_template.php30
-rw-r--r--libs/sysplugins/smarty_internal_templatebase.php33
-rw-r--r--libs/sysplugins/smarty_internal_templatecompilerbase.php37
-rw-r--r--libs/sysplugins/smarty_internal_testinstall.php2
-rw-r--r--libs/sysplugins/smarty_resource_recompiled.php2
-rw-r--r--libs/sysplugins/smarty_resource_uncompiled.php2
-rw-r--r--libs/sysplugins/smarty_security.php6
-rw-r--r--libs/sysplugins/smarty_template_cached.php7
-rw-r--r--libs/sysplugins/smarty_template_compiled.php16
-rw-r--r--libs/sysplugins/smarty_undefined_variable.php2
99 files changed, 600 insertions, 621 deletions
diff --git a/change_log.txt b/change_log.txt
index f214d270..5121a950 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -1,8 +1,9 @@
===== 3.1.32 - dev ===
-05.11.2017 3.1.32-dev-32
+05.11.2017
- lexer/parser optimization
+ - code cleanup and optimizations
-26.10.2017 3.1.32-dev-28
+26.10.2017
- bugfix Smarty version was not filled in header comment of compiled and cached files
- optimization replace internal Smarty::$ds property by DIRECTORY_SEPARATOR
- deprecate functions Smarty::muteExpectedErrors() and Smarty::unmuteExpectedErrors()
@@ -98,12 +99,11 @@
https://github.com/smarty-php/smarty/issues/347
14.4.2017
- - merge pull requests https://github.com/smarty-php/smarty/pull/349, https://github.com/smarty-php/smarty/pull/322 and
- https://github.com/smarty-php/smarty/pull/337 to fix spelling and annotation
+ - merge pull requests https://github.com/smarty-php/smarty/pull/349, https://github.com/smarty-php/smarty/pull/322 and https://github.com/smarty-php/smarty/pull/337 to fix spelling and annotation
13.4.2017
- bugfix array_merge() parameter should be checked https://github.com/smarty-php/smarty/issues/350
-
+
===== 3.1.31 ===== (14.12.2016)
23.11.2016
- move template object cache into static variables
@@ -142,7 +142,7 @@
19.10.2016
- bugfix {make_nocache $var} did fail when variable value did contain '\' https://github.com/smarty-php/smarty/issues/305
- bugfix {make_nocache $var} remove spaces from variable value https://github.com/smarty-php/smarty/issues/304
-
+
12.10.2016
- bugfix {include} with template names including variable or constants could fail after bugfix from
28.09.2016 https://github.com/smarty-php/smarty/issues/302
@@ -201,7 +201,7 @@
01.09.2016
- performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280
-
+
26.08.2016
- bugfix change of 23.08.2016 failed on linux when use_include_path = true
@@ -224,47 +224,47 @@
- bugfix update of 04.08.2016 was incomplete
05.08.2016
- - bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264
+ - bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264
- updated error checking at template and config default handler
-
+
04.08.2016
- improvement move template function source parameter into extension
-
+
26.07.2016
- optimization unneeded loading of compiled resource
-
+
24.07.2016
- regression this->addPluginsDir('/abs/path/to/dir') adding absolute path without trailing '/' did fail https://github.com/smarty-php/smarty/issues/260
-
+
23.07.2016
- bugfix setTemplateDir('/') and setTemplateDir('') did create wrong absolute filepath https://github.com/smarty-php/smarty/issues/245
- optimization of filepath normalization
- improvement remove double function declaration in plugin shared.escape_special_cars.php https://github.com/smarty-php/smarty/issues/229
-
+
19.07.2016
- bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246
- bugfix {math} shell injection vulnerability patch provided by Tim Weber
-
+
18.07.2016
- bugfix {foreach} if key variable and item@key attribute have been used both the key variable was not updated https://github.com/smarty-php/smarty/issues/254
- bugfix modifier on plugins like {plugin|modifier ... } did fail when the plugin does return an array https://github.com/smarty-php/smarty/issues/228
- bugfix avoid opcache_invalidate to result in ErrorException when opcache.restrict_api is not empty https://github.com/smarty-php/smarty/pull/244
- bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246
-
+
14.07.2016
- bugfix wrong parameter on compileAllTemplates() and compileAllConfig() https://github.com/smarty-php/smarty/issues/231
-
+
13.07.2016
- bugfix PHP 7 compatibility on registered compiler plugins https://github.com/smarty-php/smarty/issues/241
- update testInstall() https://github.com/smarty-php/smarty/issues/248https://github.com/smarty-php/smarty/issues/248
- bugfix enable debugging could fail when template objects did already exists https://github.com/smarty-php/smarty/issues/237
- bugfix template function data should be merged when loading subtemplate https://github.com/smarty-php/smarty/issues/240
- bugfix wrong parameter on compileAllTemplates() https://github.com/smarty-php/smarty/issues/231
-
+
12.07.2016
- bugfix {foreach} item variable must be created also on empty from array https://github.com/smarty-php/smarty/issues/238 and https://github.com/smarty-php/smarty/issues/239
- bugfix enableSecurity() must init cache flags https://github.com/smarty-php/smarty/issues/247
-
+
27.05.2016
- bugfix/improvement of compileAlltemplates() follow symlinks in template folder (PHP >= 5.3.1) https://github.com/smarty-php/smarty/issues/224
clear internal cache and expension handler for each template to avoid possible conflicts https://github.com/smarty-php/smarty/issues/231
@@ -307,26 +307,26 @@
11.03.2016
- optimization of capture and security handling
- improvement $smarty->clearCompiledTemplate() should return on recompiled or uncompiled resources
-
+
10.03.2016
- optimization of resource processing
-
+
09.03.2016
- improvement rework of 'scope' attribute handling see see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/194
https://github.com/smarty-php/smarty/issues/186 https://github.com/smarty-php/smarty/issues/179
- bugfix correct Autoloader update of 2.3.2014 https://github.com/smarty-php/smarty/issues/199
-
+
04.03.2016
- bugfix change from 01.03.2016 will cause $smarty->isCached(..) failure if called multiple time for same template
(forum topic 25935)
-
+
02.03.2016
- revert autoloader optimizations because of unexplainable warning when using plugins https://github.com/smarty-php/smarty/issues/199
-
+
01.03.2016
- bugfix template objects must be cached on $smarty->fetch('foo.tpl) calls incase the template is fetched
multiple times (forum topic 25909)
-
+
25.02.2016
- bugfix wrong _realpath with 4 or more parent-directories https://github.com/smarty-php/smarty/issues/190
- optimization of _realpath
@@ -335,10 +335,10 @@
20.02.2016
- bugfix {strip} must keep space between hmtl tags. Broken by changes of 10.2.2016 https://github.com/smarty-php/smarty/issues/184
- new feature/bugfix {foreach}{section} add 'properties' attribute to force compilation of loop properties
- see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/189
-
+ see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/189
+
19.02.2016
- - revert output buffer flushing on display, echo content again because possible problems when PHP files had
+ - revert output buffer flushing on display, echo content again because possible problems when PHP files had
characters (newline} after ?> at file end https://github.com/smarty-php/smarty/issues/187
14.02.2016
@@ -349,33 +349,33 @@
- optimization make compiler tag object cache static for higher compilation speed
11.02.2016
- - improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82
+ - improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82
https://github.com/smarty-php/smarty/pull/181
-
+
10.02.2016
- bugfix {strip} must keep space on output creating smarty tags within html tags https://github.com/smarty-php/smarty/issues/177
- bugfix wrong precedence on special if conditions like '$foo is ... by $bar' could cause wrong code https://github.com/smarty-php/smarty/issues/178
- improvement because of ambiguities the inline constant support has been removed from the $foo.bar syntax https://github.com/smarty-php/smarty/issues/149
- - bugfix other {strip} error with output tags between hmtl https://github.com/smarty-php/smarty/issues/180
+ - bugfix other {strip} error with output tags between hmtl https://github.com/smarty-php/smarty/issues/180
09.02.2016
- move some code from parser into compiler
- reformat all code for unique style
- update/bugfix scope attribute handling reworked. Read the newfeatures.txt file
-
+
05.02.2016
- improvement internal compiler changes
-
+
01.02.2016
- bugfix {foreach} compilation failed when $smarty->merge_compiled_includes = true and pre-filters are used.
29.01.2016
- bugfix implement replacement code for _tag_stack property https://github.com/smarty-php/smarty/issues/151
-
+
28.01.2016
- bugfix allow windows network filepath or wrapper (forum topic 25876) https://github.com/smarty-php/smarty/issues/170
- bugfix if fetch('foo.tpl') is called on a template object the $parent parameter should default to the calling template object https://github.com/smarty-php/smarty/issues/152
-
+
27.01.2016
- revert bugfix compiling {section} did create warning
- bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161
@@ -385,7 +385,7 @@
- bugfix {extends} with relative file path did not work https://github.com/smarty-php/smarty/issues/154
https://github.com/smarty-php/smarty/issues/158
- bugfix {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153
-
+
26.01.2016
- improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169
- bugfix compiling {section} did create warning
@@ -395,28 +395,28 @@
- update scope handling
- optimize block plugin compiler
- improvement runtime checks if registered block plugins are callable
-
+
01.01.2016
- remove Smarty::$resource_cache_mode property
-
+
31.12.2015
- optimization of {assign}, {if} and {while} compiled code
-
+
30.12.2015
- bugfix plugin names starting with "php" did not compile https://github.com/smarty-php/smarty/issues/147
29.12.2015
- bugfix Smarty::error_reporting was not observed when display() or fetch() was called on template objects https://github.com/smarty-php/smarty/issues/145
-
+
28.12.2015
- optimization of {foreach} code size and processing
-
+
27.12.2015
- improve inheritance code
- update external methods
- code fixes
- PHPdoc updates
-
+
25.12.2015
- compile {block} tag code and its processing into classes
- optimization replace hhvm extension by inline code
@@ -430,45 +430,45 @@
- optimization move internal method decodeProperties back into template object
- optimization move subtemplate processing back into template object
- new feature Caching does now observe the template_dir setting and will create separate cache files if required
-
+
22.12.2015
- change $xxx_dir properties from private to protected in case Smarty class gets extended
- code optimizations
-
+
21.12.2015
- bugfix a filepath starting with '/' or '\' on windows should normalize to the root dir
of current working drive https://github.com/smarty-php/smarty/issues/134
- optimization of filepath normalization
- bugfix {strip} must remove all blanks between html tags https://github.com/smarty-php/smarty/issues/136
-
+
===== 3.1.29 ===== (21.12.2015)
21.12.2015
- optimization improve speed of filetime checks on extends and extendsall resource
-
+
20.12.2015
- bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123
- update compilation of Smarty special variables
- bugfix add addition check for OS type on normalization of file path https://github.com/smarty-php/smarty/issues/134
- bugfix the source uid of the extendsall resource must contain $template_dir settings https://github.com/smarty-php/smarty/issues/123
-
+
19.12.2015
- bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138
- bugfix broken PHP 5.2 compatibility https://github.com/smarty-php/smarty/issues/139
- remove no longer used code
- improvement make sure that compiled and cache templates never can contain a trailing '?>?
-
+
18.12.2015
- bugfix regression when modifier parameter was followed by math https://github.com/smarty-php/smarty/issues/132
-
+
17.12.2015
- bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135
- bugfix using {block append/prepend} on same block in multiple levels of inheritance templates could fail (forum topic 25827)
- bugfix text content consisting of just a single '0' like in {if true}0{/if} was suppressed (forum topic 25834)
-
+
16.12.2015
- bugfix {foreach} did fail if from atrribute is a Generator class https://github.com/smarty-php/smarty/issues/128
- bugfix direct access $smarty->template_dir = 'foo'; should call Smarty::setTemplateDir() https://github.com/smarty-php/smarty/issues/121
-
+
15.12.2015
- bugfix {$smarty.cookies.foo} did return the $_COOKIE array not the 'foo' value https://github.com/smarty-php/smarty/issues/122
- bugfix a call to clearAllCache() and other should clear all internal template object caches (forum topic 25828)
@@ -476,25 +476,25 @@
14.12.2015
- bugfix {$smarty.config.foo} broken in 3.1.28 https://github.com/smarty-php/smarty/issues/120
- bugfix multiple calls of {section} with same name droped E_NOTICE error https://github.com/smarty-php/smarty/issues/118
-
+
===== 3.1.28 ===== (13.12.2015)
13.12.2015
- bugfix {foreach} and {section} with uppercase characters in name attribute did not work (forum topic 25819)
- bugfix $smarty->debugging_ctrl = 'URL' did not work (forum topic 25811)
- bugfix Debug Console could display incorrect data when using subtemplates
-
+
09.12.2015
- bugfix Smarty did fail under PHP 7.0.0 with use_include_path = true;
-
+
09.12.2015
- bugfix {strip} should exclude some html tags from stripping, related to fix for https://github.com/smarty-php/smarty/issues/111
-
+
08.12.2015
- bugfix internal template function data got stored in wrong compiled file https://github.com/smarty-php/smarty/issues/114
-
+
05.12.2015
-bugfix {strip} should insert a single space https://github.com/smarty-php/smarty/issues/111
-
+
25.11.2015
-bugfix a left delimter like '[%' did fail on [%$var_[%$variable%]%] (forum topic 25798)
@@ -503,7 +503,7 @@
01.11.2015
- update config file processing
-
+
31.10.2015
- bugfix add missing $trusted_dir property to SmartyBC class (forum topic 25751)
@@ -527,7 +527,7 @@
18.09.2015
- bugfix {if $foo instanceof $bar} failed to compile if 2nd value is a variable https://github.com/smarty-php/smarty/issues/92
-
+
17.09.2015
- bugfix {foreach} first attribute was not correctly reset since commit 05a8fa2 of 02.08.2015 https://github.com/smarty-php/smarty/issues/90
@@ -541,7 +541,7 @@
- move code of {call} processing back into Smarty_Internal_Template class
- improvement invalidate OPCACHE for cleared compiled and cached template files (forum topic 25557)
- bugfix unintended multiple debug windows (forum topic 25699)
-
+
30.08.2015
- size optimization move some runtime functions into extension
- optimize inline template processing
@@ -690,10 +690,10 @@
01.06.2015
- bugfix <?xml ... ?> including template variables broken since 3.1.22 https://github.com/smarty-php/smarty/issues/47
-
+
27.05.2015
- bugfix {include} with variable file name must not create by default individual cache file (since 3.1.22) https://github.com/smarty-php/smarty/issues/43
-
+
24.05.2015
- bugfix if condition string 'neq' broken due to a typo https://github.com/smarty-php/smarty/issues/42
@@ -701,11 +701,11 @@
23.05.2015
- improvement on php_handling to allow very large PHP sections, better error handling
- improvement allow extreme large comment sections (forum 25538)
-
+
21.05.2015
- bugfix broken PHP 5.2 compatibility when compiling <?php tags https://github.com/smarty-php/smarty/issues/40
- bugfix named {foreach} comparison like $smarty.foreach.foobar.index > 1 did compile into wrong code https://github.com/smarty-php/smarty/issues/41
-
+
19.05.2015
- bugfix compiler did overwrite existing variable value when setting the nocache attribute https://github.com/smarty-php/smarty/issues/39
- bugfix output filter trimwhitespace could run into the pcre.backtrack_limit on large output (code.google issue 220)
@@ -713,14 +713,14 @@
18.05.2015
- improvement introduce shortcuts in lexer/parser rules for most frequent terms for higher
- compilation speed
+ compilation speed
16.05.2015
- bugfix {php}{/php} did work just for single lines https://github.com/smarty-php/smarty/issues/33
- improvement remove not needed ?><?php transitions from compiled code
- improvement reduce number of lexer tokens on operators and if conditions
- improvement higher compilation speed by modified lexer/parser generator at "smarty/smarty-lexer"
-
+
13.05.2015
- improvement remove not needed ?><?php transitions from compiled code
- improvement of debugging:
@@ -729,7 +729,7 @@
- display Smarty version number
- Truncate lenght of Origin display and extend strin value display to 80 character
- bugfix in Smarty_Security 'nl2br' should be a trusted modifier, not PHP function (code.google issue 223)
-
+
12.05.2015
- bugfix {$smarty.constant.TEST} did fail on undefined constant https://github.com/smarty-php/smarty/issues/28
- bugfix access to undefined config variable like {#undef#} did fail https://github.com/smarty-php/smarty/issues/29
@@ -739,7 +739,7 @@
12.05.2015
- bugfix of smaller performance issue introduce in 3.1.22 when caching is enabled
- bugfix missig entry for smarty-temmplate-config in autoloader
-
+
===== 3.1.22 ===== tag was deleted because 3.1.22 did fail caused by the missing entry for smarty-temmplate-config in autoloader
10.05.2015
- bugfix custom cache resource did not observe compile_id and cache_id when $cache_locking == true
@@ -753,14 +753,14 @@
06.05.2015
- bugfix in 3.1.22-dev cache resource must not be loaded for subtemplates
- bugfix/improvement in 3.1.22-dev cache locking did not work as expected
-
+
05.05.2015
- optimization on cache update when main template is modified
- optimization move <?php ?> handling from parser to new compiler module
05.05.2015
- bugfix code could be messed up when {tags} are used in multiple attributes https://github.com/smarty-php/smarty/issues/23
-
+
04.05.2015
- bugfix Smarty_Resource::parseResourceName incompatible with Google AppEngine (https://github.com/smarty-php/smarty/issues/22)
- improvement use is_file() checks to avoid errors suppressed by @ which could still cause problems (https://github.com/smarty-php/smarty/issues/24)
@@ -770,13 +770,13 @@
28.04.2015
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508)
-
- 23.04.2015
+
+ 23.04.2015
- bugfix a nocache template variable used as parameter at {insert} was by mistake cached
-
+
20.04.2015
- bugfix at a template function containing nocache code a parmeter could overwrite a template variable of same name
-
+
27.03.2015
- bugfix Smarty_Security->allow_constants=false; did also disable true, false and null (change of 16.03.2015)
- improvement added a whitelist for trusted constants to security Smarty_Security::$trusted_constants (forum topic 25471)
@@ -784,39 +784,39 @@
20.03.2015
- bugfix make sure that function properties get saved only in compiled files containing the fuction definition {forum topic 25452}
- bugfix correct update of global variable values on exit of template functions. (reported under Smarty Developers)
-
+
16.03.2015
- bugfix problems with {function}{/function} and {call} tags in different subtemplate cache files {forum topic 25452}
- bugfix Smarty_Security->allow_constants=false; did not disallow direct usage of defined constants like {SMARTY_DIR} {forum topic 25457}
- bugfix {block}{/block} tags did not work inside double quoted strings https://github.com/smarty-php/smarty/issues/18
-
-
+
+
15.03.2015
- bugfix $smarty->compile_check must be restored before rendering of a just updated cache file {forum 25452}
-
+
14.03.2015
- bugfix {nocache} {/nocache} tags corrupted code when used within a nocache section caused by a nocache template variable.
-
+
- bugfix template functions defined with {function} in an included subtemplate could not be called in nocache
mode with {call... nocache} if the subtemplate had it's own cache file {forum 25452}
-
+
10.03.2015
- bugfix {include ... nocache} whith variable file or compile_id attribute was not executed in nocache mode.
-
+
12.02.2015
- bugfix multiple Smarty::fetch() of same template when $smarty->merge_compiled_includes = true; could cause function already defined error
-
+
11.02.2015
- bugfix recursive {includes} did create E_NOTICE message when $smarty->merge_compiled_includes = true; (github issue #16)
-
+
22.01.2015
- new feature security can now control access to static methods and properties
see also NEW_FEATURES.txt
21.01.2015
- bugfix clearCompiledTemplates(), clearAll() and clear() could try to delete whole drive at wrong path permissions because realpath() fail (forum 25397)
- - bugfix 'self::' and 'parent::' was interpreted in template syntax as static class
-
+ - bugfix 'self::' and 'parent::' was interpreted in template syntax as static class
+
04.01.2015
- push last weeks changes to github
@@ -827,10 +827,10 @@
- optimization restructure config file processing
31.12.2014
- - bugfix use function_exists('mb_get_info') for setting Smarty::$_MBSTRING.
+ - bugfix use function_exists('mb_get_info') for setting Smarty::$_MBSTRING.
Function mb_split could be overloaded depending on php.ini mbstring.func_overload
-
-
+
+
29.12.2014
- new feature security can now limit the template nesting level by property $max_template_nesting
see also NEW_FEATURES.txt (forum 25370)
@@ -844,14 +844,14 @@
13.12.2014
- improvement optimization of lexer and parser resulting in a up to 30% higher compiling speed
-
+
11.12.2014
- bugfix resolve parser ambiguity between constant print tag {CONST} and other smarty tags after change of 09.12.2014
-
+
09.12.2014
- bugfix variables $null, $true and $false did not work after the change of 12.11.2014 (forum 25342)
- bugfix call of template function by a variable name did not work after latest changes (forum 25342)
-
+
23.11.2014
- bugfix a plugin with attached modifier could fail if the tag was immediately followed by another Smarty tag (since 3.1.21) (forum 25326)
@@ -869,12 +869,12 @@
04.11.2014
- new feature $smarty->debugging = true; => overwrite existing Debug Console window (old behaviour)
$smarty->debugging = 2; => individual Debug Console window by template name
-
+
03.11.2014
- bugfix Debug Console did not show included subtemplates since 3.1.17 (forum 25301)
- bugfix Modifier debug_print_var did not limit recursion or prevent recursive object display at Debug Console
(ATTENTION: parameter order has changed to be able to specify maximum recursion)
- - bugfix Debug consol did not include subtemplate information with $smarty->merge_compiled_includes = true
+ - bugfix Debug consol did not include subtemplate information with $smarty->merge_compiled_includes = true
- improvement The template variables are no longer displayed as objects on the Debug Console
- improvement $smarty->createData($parent = null, $name = null) new optional name parameter for display at Debug Console
- addition of some hooks for future extension of Debug Console
@@ -891,7 +891,7 @@
26.10.2014
- bugfix E_NOTICE message was created during compilation when ASP tags '<%' or '%>' are in template source text
- bugfix merge_compiled_includes option failed when caching enables and same subtemplate was included cached and not cached
-
+
===== 3.1.21 ===== (18.10.2014)
18.10.2014
- composer moved to github
@@ -918,143 +918,143 @@
===== 3.1.20 ===== (09.10.2014)
08.10.2014
- bugfix security mode of "<script language=php>" must be controlled by $php_handling property (Thue Kristensen)
-
+
01.10.2014
- bugfix template resource of inheritance blocks could get invalid if the default resource type is not 'file'(Issue 202)
- bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259)
-
+
02.08.2014
- bugfix modifier wordwrap did output break string wrong if first word was exceeding length with cut = true (topic 25193)
-
+
24.07.2014
- bugfix cache clear when cache folder does not exist
16.07.2014
- enhancement remove BOM automatically from template source (topic 25161)
-
+
04.07.2014
- bugfix the bufix of 02.06.2014 broke correct handling of child templates with same name but different template folders in extends resource (issue 194 and topic 25099)
-
+
===== 3.1.19 ===== (30.06.2014)
20.06.2014
- bugfix template variables could not be passed as parameter in {include} when the include was in a {nocache} section (topic 25131)
-
+
17.06.2014
- bugfix large template text of some charsets could cause parsing errors (topic 24630)
-
+
08.06.2014
- bugfix registered objects did not work after spelling fixes of 06.06.2014
- bugfix {block} tags within {literal} .. {/literal} got not displayed correctly (topic 25024)
- bugfix UNC WINDOWS PATH like "\\psf\path\to\dir" did not work as template directory (Issue 192)
- bugfix {html_image} security check did fail on files relative to basedir (Issue 191)
-
+
06.06.2014
- fixed PHPUnit outputFilterTrimWhitespaceTests.php assertion of test result
- fixed spelling, PHPDoc , minor errors, code cleanup
-
+
02.06.2014
- using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099)
-
+
19.04.2014
- bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189)
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
-
+
18.04.2014
- revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems
===== 3.1.18 ===== (07.04.2014)
- 06.04.2014
+ 06.04.2014
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
- bugfix update of composer file (Issue 168 and 184)
05.04.2014
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165)
-
+
26.03.2014
- bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183)
-
+
24.03.2014
- bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182)
-
+
20.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
-
+
18.03.2014
- revert change of 17.03.2014
-
+
17.03.2014
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
-
+
15.03.2014
- bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169)
13.03.2014
- bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867)
-
+
===== 3.1.17 =====
08.03.2014
- bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)
-
+
17.02.2014
- bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343)
-
+
16.02.2014
- bugfix a '//' or '\\' in template_dir path could produce wrong path on relative filepath in {include} (Issue 175)
-
+
05.02.2014
- bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group)
-
+
27.01.2014
- bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764)
- bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171)
-
+
26.01.2014
- bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762)
-
+
18.01.2014
- bugfix the compiler did fail when using template inheritance and recursive {include} (smarty-developers group)
-
+
11.01.2014
- bugfix "* }" (spaces before right delimiter) was interpreted by mistake as comment end tag (Issue 170)
- internals content cache should be clear when updating cache file
-
+
08.01.2014
- bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 169)
- bugfix SmartyBC.class.php should use require_once to load Smarty.class.php (forum topic 24683)
-
+
===== 3.1.16 =====
15.12.2013
- bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161)
Read 3.1.16_RELEASE_NOTES for more details
- enhancement additional debug output at $smarty->_parserdebug = true;
-
+
07.11.2013
- bugfix too restrictive handling of {include} within {block} tags. 3.1.15 did throw errors where 3.1.14 did not (forum topic 24599)
- bugfix compiler could fail if PHP mbstring.func_overload is enabled (Issue 164)
-
+
28.10.2013
- bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163)
- bugfix notice "Trying to get property of non-object" removed (Issue 163)
- bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159)
- - bugfix multiple {block}s with same name in parent did not work (forum topic 24631)
-
+ - bugfix multiple {block}s with same name in parent did not work (forum topic 24631)
+
20.10.2013
- bugfix a variable file name at {extends} tag did fail (forum topic 24618)
-
+
14.10.2013
- bugfix yesterdays fix could result in an undefined variable
-
+
13.10.2013
- bugfix variable names on {include} in template inheritance did unextepted error message (forum topic 24594) (Issue 161)
-.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161)
+.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161)
04.10.2013
- - bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of
+ - bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of
template inheritance of 24.08.2013 (forum topic 24585)
-
+
03.10.2013
- bugfix loops using modifier capitalize did eat up memory (issue 159)
-
+
===== Smarty 3.1.15 =====
01.10.2013
- use current delimiters in compiler error messages (issue 157)
@@ -1065,7 +1065,7 @@
16.09.2013
- bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320)
-
+
13.09.2013
- bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549)
@@ -1083,7 +1083,7 @@
- The {strip} tag can now be placed outside {block} tags in child templates (forum topic 24289)
- change SmartyException::$escape is now false by default
- change PHP traceback has been remove for SmartyException and SmartyCompilerException
-
+
14.08.2013
- bugfix compiled filepath of config file did not observe different config_dir (forum topic 24493)
@@ -1139,7 +1139,7 @@
25.04.2013
- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache}
section but caching is disabled (Forum Topic 24260)
-
+
05.04.2013
- bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094)
- bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199)
@@ -1169,7 +1169,7 @@
- bugfix wrong variable usage in smarty_internal_utility.php (Issue #125)
26.11.2012
-- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)
+- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)
24.11.2012
- made SmartyBC loadable via composer (Issue #124)
@@ -1201,7 +1201,7 @@
Either we get MBstring's full package, or we pretend it's not there at all.
21.08.2012
-- bugfix $auto_literal = false did not work with { block} tags in child templates
+- bugfix $auto_literal = false did not work with { block} tags in child templates
(problem was reintroduced after fix in 3.1.7)(Forum Topic 20581)
17.08.2012
@@ -1218,16 +1218,16 @@
- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608)
30.07.2012
--bugfix {assign} in a nocache section should not overwrite existing variable values
+-bugfix {assign} in a nocache section should not overwrite existing variable values
during compilation (issue 109)
-
+
28.07.2012
- bugfix array access of config variables did not work (Forum Topic 22527)
19.07.2012
- bugfix the default plugin handler did create wrong compiled code for static class methods
from external script files (issue 108)
-
+
===== Smarty-3.1.11 =====
30.06.2012
- bugfix {block.. hide} did not work as nested child (Forum Topic 22216)
@@ -1344,7 +1344,7 @@
- bugfix template inheritace did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680)
20.12.2011
-- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return
+- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return
content after {$smarty.block.child} (Forum Topic 20564)
===== Smarty-3.1.7 =====
@@ -1355,7 +1355,7 @@
- bugfix unregisterObject() raised notice when object to unregister did not exist
- changed internals to use Smarty::$_MBSTRING ($_CHARSET, $_DATE_FORMAT) for better unit testing
- added Smarty::$_UTF8_MODIFIER for proper PCRE charset handling (Forum Topic 20452)
-- added Smarty_Security::isTrustedUri() and Smarty_Security::$trusted_uri to validate
+- added Smarty_Security::isTrustedUri() and Smarty_Security::$trusted_uri to validate
remote resource calls through {fetch} and {html_image} (Forum Topic 20627)
17.12.2011
@@ -1367,11 +1367,11 @@
9.12.2011
- bugfix {capture} tags around recursive {include} calls did throw exception (Forum Topic 20549)
- bugfix $auto_literal = false did not work with { block} tags in child templates (Forum Topic 20581)
-- bugfix template inheritance: do not include code of {include} in overloaded {block} into compiled
+- bugfix template inheritance: do not include code of {include} in overloaded {block} into compiled
parent template (Issue #66}
- bugfix template inheritance: {$smarty.block.child} in nested child {block} tags did not return expected
result (Forum Topic 20564)
-
+
===== Smarty-3.1.6 =====
30.11.2011
- bugfix is_cache() for individual cached subtemplates with $smarty->caching = CACHING_OFF did produce
@@ -1381,7 +1381,7 @@
- bugfix added exception if the default plugin handler did return a not static callback (Forum Topic 20512)
25.11.2011
-- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified
+- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified
since r4432 (issue 60)
24.11.2011
@@ -1411,7 +1411,7 @@
22.10.2011
- bugfix smarty_mb_from_unicode() would not decode unicode-points properly
-- bugfix use catch Exception instead UnexpectedValueException in
+- bugfix use catch Exception instead UnexpectedValueException in
clearCompiledTemplate to be PHP 5.2 compatible
21.10.2011
@@ -1452,7 +1452,7 @@
11.10.2011
- add runtime checks for not matching {capture}/{/capture} calls (Forum Topic 20120)
-
+
10.10.2011
- bugfix variable name typo in {html_options} and {html_checkboxes} (Issue #54)
- bugfix <?xml> tag did create wrong output when caching enabled and the tag was in included subtemplate
@@ -1480,7 +1480,7 @@
04.10.2011
- bugfix assign() in plugins called in subtemplates did change value also in parent template
-- bugfix of problem introduced with r4342 on math plugin
+- bugfix of problem introduced with r4342 on math plugin
- bugfix output filter should not run on individually cached subtemplates
- add unloadFilter() method
- bugfix has_nocache_code flag was not reset before compilation
@@ -1521,7 +1521,7 @@
- remove unused properties
- optimization use real function instead anonymous function for preg_replace_callback
- bugfix a relative {include} in child template blocks failed
-- bugfix direct setting of $template_dir, $config_dir, $plugins_dir in __construct() of an
+- bugfix direct setting of $template_dir, $config_dir, $plugins_dir in __construct() of an
extended Smarty class created problems
- bugfix error muting was not implemented for cache locking
@@ -1714,7 +1714,7 @@
- removed experimental setOption() getOption() methods
- output returned content also on opening tag calls of block plugins
- rewrite of default plugin handler
-- compile code of variable filters for better performance
+- compile code of variable filters for better performance
20/04/2011
- allow {php} {include_php} tags and PHP_ALLOW handling only with the SmartyBC class
@@ -1751,7 +1751,7 @@
21/02/2011
- added new new compile_check mode COMPILECHECK_CACHEMISS
- corrected new cloning behaviour of createTemplate()
-- do no longer store the compiler object as property in the compile_tag classes to avoid possible memory leaks
+- do no longer store the compiler object as property in the compile_tag classes to avoid possible memory leaks
during compilation
19/02/2011
@@ -1887,7 +1887,7 @@
01/03/2011
- bugfix replace modifier did not work in 3.0.7 on systems without multibyte support
-- bugfix {$smarty.template} could return in 3.0.7 parent template name instead of
+- bugfix {$smarty.template} could return in 3.0.7 parent template name instead of
child name when it needed to compile
25/02/2011
@@ -2056,7 +2056,7 @@
- reactivated $error_reporting property handling
- fixed typo in compile_continue
- fixed security in {fetch} plugin
-- changed back plugin parameters to two. second is template object
+- changed back plugin parameters to two. second is template object
with transparent access to Smarty object
- fixed {config_load} scoping form compile time to run time
@@ -2078,7 +2078,7 @@ request_use_auto_globals
security is enabled.
01/11/2010
-- bugfix related to E_NOTICE change. {if empty($foo)} did fail when $foo contained a string
+- bugfix related to E_NOTICE change. {if empty($foo)} did fail when $foo contained a string
28/10/2010
- bugfix on compiling modifiers within $smarty special vars like {$smarty.post.{$foo|lower}}
@@ -2239,7 +2239,7 @@ request_use_auto_globals
21/06/2010
- removed use of PHP shortags SMARTY_PHP_PASSTHRU mode
-- improved speed of cache->clear() when a compile_id was specified and use_sub_dirs is true
+- improved speed of cache->clear() when a compile_id was specified and use_sub_dirs is true
20/06/2010
- replace internal get_time() calls with standard PHP5 microtime(true) calls
@@ -2299,13 +2299,13 @@ request_use_auto_globals
- reverted the change 0f 30/04/2010. With the exception of forward references template functions can be again called by a standard tag.
10/05/2010
-- bugfix on {foreach} and {for} optimizations of 27/04/2010
+- bugfix on {foreach} and {for} optimizations of 27/04/2010
09/05/2010
-- update of template and config file parser because of minor parser generator bugs
+- update of template and config file parser because of minor parser generator bugs
07/05/2010
-- bugfix on {insert}
+- bugfix on {insert}
06/05/2010
- bugfix when merging compiled templates and objects are passed as parameter of the {include} tag
@@ -2313,7 +2313,7 @@ request_use_auto_globals
05/05/2010
- bugfix on {insert} to cache parameter
- implementation of $smarty->default_modifiers as in Smarty2
-- bugfix on getTemplateVars method
+- bugfix on getTemplateVars method
01/05/2010
- bugfix on handling of variable method names at object chaning
@@ -2345,7 +2345,7 @@ request_use_auto_globals
- removed parser restrictions in using true,false and null as ID
07/04/2010
-- bugfix typo in smarty_internal_templatecompilerbase
+- bugfix typo in smarty_internal_templatecompilerbase
31/03/2010
- compile locking by touching old compiled files to avoid concurrent compilations
@@ -2357,7 +2357,7 @@ request_use_auto_globals
25/03/2010
- change of utility->compileAllTemplates() log messages
-- bugfix on nocache code in {function} tags
+- bugfix on nocache code in {function} tags
- new method utility->compileAllConfig() to compile all config files
24/03/2010
@@ -2382,7 +2382,7 @@ request_use_auto_globals
16/03/2010
- bugfix on assign attribute at registered template objects
- make handling of modifiers on expression BC to Smarty2
-
+
15/03/2010
- bugfix on block plugin calls
@@ -2401,7 +2401,7 @@ request_use_auto_globals
- bugfix on nocache code in {block} tags if child template was included by {include}
27/02/2010
-- allow block tags inside double quoted string
+- allow block tags inside double quoted string
26/02/2010
- cache modified check implemented
@@ -2483,15 +2483,15 @@ request_use_auto_globals
- bugfix on backslash within single quoted strings
- bugfix allow absolute filepath for config files
- bugfix on special Smarty variable $smarty.cookies
-- revert handling of newline on no output tags like {if...}
+- revert handling of newline on no output tags like {if...}
- allow special characters in config file section names for Smarty2 BC
01/13/2010
-- bugfix on {if} tags
+- bugfix on {if} tags
01/12/2010
- changed back modifier handling in parser. Some restrictions still apply:
- if modifiers are used in side {if...} expression or in mathematical expressions
+ if modifiers are used in side {if...} expression or in mathematical expressions
parentheses must be used.
- bugfix the {function..} tag did not accept the name attribute in double quotes
- closed possible security hole at <?php ... ?> tags
@@ -2521,7 +2521,7 @@ request_use_auto_globals
- bugfix for custom delimiter at extends resource and {extends} tag
01/05/2010
-- bugfix sha1() calculations at extends resource and some general improvments on sha1() handling
+- bugfix sha1() calculations at extends resource and some general improvments on sha1() handling
01/03/2010
@@ -2551,7 +2551,7 @@ request_use_auto_globals
- use sha1() for filepath encoding
- updates on nocache_hash handling
- internal change on merging some data
-- fixed cache filename for custom resources
+- fixed cache filename for custom resources
12/28/2009
- update for security fixes
@@ -2703,12 +2703,12 @@ request_use_auto_globals
- fixed preg_qoute on delimiters
11/09/2009
-- lexer/parser bugfix
+- lexer/parser bugfix
- new SMARTY_SPL_AUTOLOAD constant to control the autoloader option
- bugfix for {function} block tags in included templates
11/08/2009
-- fixed alphanumeric array index
+- fixed alphanumeric array index
- bugfix on complex double quoted strings
11/05/2009
@@ -2726,7 +2726,7 @@ request_use_auto_globals
- new security_class property (default is Smarty_Security)
11/02/2009
-- added neq,lte,gte,mod as aliases to if conditions
+- added neq,lte,gte,mod as aliases to if conditions
- throw exception on illegal Smarty() constructor calls
10/31/2009
@@ -2757,7 +2757,7 @@ request_use_auto_globals
- added {$foo++}{$foo--} syntax
- buxfix changed PHP "if (..):" to "if (..){" because of possible bad code when concenating PHP tags
- autoload Smarty internal classes
-- fixed file dependency for config files
+- fixed file dependency for config files
- some code optimizations
- fixed function definitions on some autoloaded methods
- fixed nocache variable inside if condition of {if} tag
@@ -2768,7 +2768,7 @@ request_use_auto_globals
10/19/2009
- fixed compiled template merging on variable double quoted strings as name
-- fixed bug in caching mode 2 and cache_lifetime -1
+- fixed bug in caching mode 2 and cache_lifetime -1
- fixed modifier support on block tags
10/17/2009
@@ -2967,7 +2967,7 @@ NOTICE: existing compiled template and cache files must be deleted
05/05/2009
- fixed E_STRICT incompabilities
-- {function} tag bug fix
+- {function} tag bug fix
- security policy definitions have been moved from plugins folder to file Security.class.php in libs folder
- added allow_super_global configuration to security
@@ -3027,9 +3027,9 @@ NOTICE: existing compiled template and cache files must be deleted
04/10/2009
- check if mb string functions available otherwise fallback to normal string functions
-- added global variable scope SMARTY_GLOBAL_SCOPE
+- added global variable scope SMARTY_GLOBAL_SCOPE
- enable 'variable' filter by default
-- fixed {$smarty.block.parent.foo}
+- fixed {$smarty.block.parent.foo}
- implementation of a 'variable' filter as replacement for default modifier
04/09/2009
@@ -3069,7 +3069,7 @@ NOTICE: existing compiled template and cache files must be deleted
03/31/2009
- bugfix smarty.class and internal.security_handler
-- added compile_check configuration
+- added compile_check configuration
- added setter/getter methods
03/30/2009
@@ -3102,7 +3102,7 @@ NOTICE: existing compiled template and cache files must be deleted
- fixed exceptions in function plugins
- fixed notice error in Smarty.class.php
- allow chained objects to span multiple lines
-- fixed error in modifiers
+- fixed error in modifiers
03/20/2009
- moved /plugins folder into /libs folder
@@ -3111,14 +3111,14 @@ NOTICE: existing compiled template and cache files must be deleted
03/19/2009
- allow array definition as modifier parameter
-- changed modifier to use multi byte string funktions.
+- changed modifier to use multi byte string funktions.
03/17/2009
-- bugfix
+- bugfix
03/15/2009
- added {include_php} tag for BC
-- removed @ error suppression
+- removed @ error suppression
- bugfix fetch did always repeat output of first call when calling same template several times
- PHPunit tests extended
@@ -3215,7 +3215,7 @@ NOTICE: existing compiled template and cache files must be deleted
- changed search order on modifiers to look at plugins folder first
- parser bug fix for modifier on array elements $foo.bar|modifier
- parser bug fix on single quoted srings
-- internal: splitted up compiler plugin files
+- internal: splitted up compiler plugin files
02/01/2009
- allow method chaining on static classes
@@ -3279,7 +3279,7 @@ NOTICE: existing compiled template and cache files must be deleted
- optimization of plugin loading
12/30/2008
-- added compiler support of registered object
+- added compiler support of registered object
- added backtick support in doubled quoted strings for backward compatibility
- some minor bug fixes and improvments
@@ -3290,7 +3290,7 @@ NOTICE: existing compiled template and cache files must be deleted
- finished work on (un)register_modifier method
- plugin handling from plugins folder changed for modifier plugins
deleted - internal.modifier.php
-- added modifier chaining to parser
+- added modifier chaining to parser
12/17/2008
- finished (un)register_function method
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
index 4bae469d..d497602a 100644
--- a/libs/Smarty.class.php
+++ b/libs/Smarty.class.php
@@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
- const SMARTY_VERSION = '3.1.32-dev-32';
+ const SMARTY_VERSION = '3.1.32-dev-34';
/**
* define variable scopes
*/
@@ -167,14 +167,6 @@ class Smarty extends Smarty_Internal_TemplateBase
const PLUGIN_MODIFIER = 'modifier';
const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';
/**
- * Resource caching modes
- * (not used since 3.1.30)
- */
- const RESOURCE_CACHE_OFF = 0;
- const RESOURCE_CACHE_AUTOMATIC = 1; // cache template objects by rules
- const RESOURCE_CACHE_TEMPLATE = 2; // cache all template objects
- const RESOURCE_CACHE_ON = 4; // cache source and compiled resources
- /**
* assigned global tpl vars
*/
public static $global_tpl_vars = array();
@@ -283,13 +275,7 @@ class Smarty extends Smarty_Internal_TemplateBase
* @var boolean
*/
public $force_compile = false;
- /**
- * check template for modifications?
- *
- * @var boolean
- */
- public $compile_check = true;
- /**
+ /**
* use sub dirs for compiled/cached files?
*
* @var boolean
@@ -980,10 +966,10 @@ class Smarty extends Smarty_Internal_TemplateBase
$tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val);
}
}
- if ($this->debugging || $this->debugging_ctrl == 'URL') {
+ if ($this->debugging || $this->debugging_ctrl === 'URL') {
$tpl->smarty->_debug = new Smarty_Internal_Debug();
// check URL debugging control
- if (!$this->debugging && $this->debugging_ctrl == 'URL') {
+ if (!$this->debugging && $this->debugging_ctrl === 'URL') {
$tpl->smarty->_debug->debugUrl($tpl->smarty);
}
}
@@ -1101,14 +1087,6 @@ class Smarty extends Smarty_Internal_TemplateBase
}
/**
- * @param boolean $compile_check
- */
- public function setCompileCheck($compile_check)
- {
- $this->compile_check = $compile_check;
- }
-
- /**
* @param boolean $use_sub_dirs
*/
public function setUseSubDirs($use_sub_dirs)
diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php
index 1e5c0fef..2ca6a5c8 100644
--- a/libs/plugins/block.textformat.php
+++ b/libs/plugins/block.textformat.php
@@ -75,11 +75,11 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
break;
default:
- trigger_error("textformat: unknown attribute '$_key'");
+ trigger_error("textformat: unknown attribute '{$_key}'");
}
}
- if ($style == 'email') {
+ if ($style === 'email') {
$wrap = 72;
}
// split into paragraphs
diff --git a/libs/plugins/function.counter.php b/libs/plugins/function.counter.php
index bcc8f498..e3862102 100644
--- a/libs/plugins/function.counter.php
+++ b/libs/plugins/function.counter.php
@@ -63,7 +63,7 @@ function smarty_function_counter($params, $template)
$counter[ 'direction' ] = $params[ 'direction' ];
}
- if ($counter[ 'direction' ] == "down") {
+ if ($counter[ 'direction' ] === 'down') {
$counter[ 'count' ] -= $counter[ 'skip' ];
} else {
$counter[ 'count' ] += $counter[ 'skip' ];
diff --git a/libs/plugins/function.cycle.php b/libs/plugins/function.cycle.php
index a76d49ae..ab9c844a 100644
--- a/libs/plugins/function.cycle.php
+++ b/libs/plugins/function.cycle.php
@@ -55,12 +55,12 @@ function smarty_function_cycle($params, $template)
if (!isset($params[ 'values' ])) {
if (!isset($cycle_vars[ $name ][ 'values' ])) {
- trigger_error("cycle: missing 'values' parameter");
+ trigger_error('cycle: missing \'values\' parameter');
return;
}
} else {
- if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] != $params[ 'values' ]) {
+ if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] !== $params[ 'values' ]) {
$cycle_vars[ $name ][ 'index' ] = 0;
}
$cycle_vars[ $name ][ 'values' ] = $params[ 'values' ];
diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php
index cb60dd91..84bf40d7 100644
--- a/libs/plugins/function.fetch.php
+++ b/libs/plugins/function.fetch.php
@@ -25,7 +25,7 @@
function smarty_function_fetch($params, $template)
{
if (empty($params[ 'file' ])) {
- trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE);
+ trigger_error('[plugin] fetch parameter \'file\' cannot be empty', E_USER_NOTICE);
return;
}
@@ -55,15 +55,15 @@ function smarty_function_fetch($params, $template)
}
$content = '';
- if ($protocol == 'http') {
+ if ($protocol === 'http') {
// http fetch
if ($uri_parts = parse_url($params[ 'file' ])) {
// set defaults
$host = $server_name = $uri_parts[ 'host' ];
$timeout = 30;
- $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
- $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION;
- $referer = "";
+ $accept = 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
+ $agent = 'Smarty Template Engine ' . Smarty::SMARTY_VERSION;
+ $referer = '';
$uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/';
$uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : '';
$_is_proxy = false;
@@ -81,29 +81,29 @@ function smarty_function_fetch($params, $template)
// loop through parameters, setup headers
foreach ($params as $param_key => $param_value) {
switch ($param_key) {
- case "file":
- case "assign":
- case "assign_headers":
+ case 'file':
+ case 'assign':
+ case 'assign_headers':
break;
- case "user":
+ case 'user':
if (!empty($param_value)) {
$user = $param_value;
}
break;
- case "pass":
+ case 'pass':
if (!empty($param_value)) {
$pass = $param_value;
}
break;
- case "accept":
+ case 'accept':
if (!empty($param_value)) {
$accept = $param_value;
}
break;
- case "header":
+ case 'header':
if (!empty($param_value)) {
if (!preg_match('![\w\d-]+: .+!', $param_value)) {
- trigger_error("[plugin] invalid header format '" . $param_value . "'", E_USER_NOTICE);
+ trigger_error("[plugin] invalid header format '{$param_value}'", E_USER_NOTICE);
return;
} else {
@@ -111,41 +111,41 @@ function smarty_function_fetch($params, $template)
}
}
break;
- case "proxy_host":
+ case 'proxy_host':
if (!empty($param_value)) {
$proxy_host = $param_value;
}
break;
- case "proxy_port":
+ case 'proxy_port':
if (!preg_match('!\D!', $param_value)) {
$proxy_port = (int) $param_value;
} else {
- trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE);
+ trigger_error("[plugin] invalid value for attribute '{$param_key }'", E_USER_NOTICE);
return;
}
break;
- case "agent":
+ case 'agent':
if (!empty($param_value)) {
$agent = $param_value;
}
break;
- case "referer":
+ case 'referer':
if (!empty($param_value)) {
$referer = $param_value;
}
break;
- case "timeout":
+ case 'timeout':
if (!preg_match('!\D!', $param_value)) {
$timeout = (int) $param_value;
} else {
- trigger_error("[plugin] invalid value for attribute '" . $param_key . "'", E_USER_NOTICE);
+ trigger_error("[plugin] invalid value for attribute '{$param_key}'", E_USER_NOTICE);
return;
}
break;
default:
- trigger_error("[plugin] unrecognized attribute '" . $param_key . "'", E_USER_NOTICE);
+ trigger_error("[plugin] unrecognized attribute '{$param_key}'", E_USER_NOTICE);
return;
}
@@ -185,7 +185,7 @@ function smarty_function_fetch($params, $template)
}
}
if (!empty($user) && !empty($pass)) {
- fputs($fp, "Authorization: BASIC " . base64_encode("$user:$pass") . "\r\n");
+ fputs($fp, 'Authorization: BASIC ' . base64_encode("$user:$pass") . "\r\n");
}
fputs($fp, "\r\n");
diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php
index e7a3f725..ae918fee 100644
--- a/libs/plugins/function.html_checkboxes.php
+++ b/libs/plugins/function.html_checkboxes.php
@@ -90,11 +90,11 @@ function smarty_function_html_checkboxes($params, $template)
$selected = array();
foreach ($_val as $_sel) {
if (is_object($_sel)) {
- if (method_exists($_sel, "__toString")) {
+ if (method_exists($_sel, '__toString')) {
$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
} else {
- trigger_error("html_checkboxes: selected attribute contains an object of class '" .
- get_class($_sel) . "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_checkboxes: selected attribute contains an object of class \'' .
+ get_class($_sel) . '\' without __toString() method', E_USER_NOTICE);
continue;
}
} else {
@@ -103,11 +103,11 @@ function smarty_function_html_checkboxes($params, $template)
$selected[ $_sel ] = true;
}
} elseif (is_object($_val)) {
- if (method_exists($_val, "__toString")) {
+ if (method_exists($_val, '__toString')) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
- trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_checkboxes: selected attribute is an object of class \'' . get_class($_val) .
+ '\' without __toString() method', E_USER_NOTICE);
}
} else {
$selected = smarty_function_escape_special_chars((string) $_val);
@@ -130,7 +130,7 @@ function smarty_function_html_checkboxes($params, $template)
case 'readonly':
if (!empty($params[ 'strict' ])) {
if (!is_scalar($_val)) {
- trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute",
+ trigger_error("html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute",
E_USER_NOTICE);
}
@@ -146,7 +146,7 @@ function smarty_function_html_checkboxes($params, $template)
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
- trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ trigger_error("html_checkboxes: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -198,11 +198,11 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
$_output = '';
if (is_object($value)) {
- if (method_exists($value, "__toString")) {
+ if (method_exists($value, '__toString')) {
$value = (string) $value->__toString();
} else {
- trigger_error("html_options: value is an object of class '" . get_class($value) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: value is an object of class \'' . get_class($value) .
+ '\' without __toString() method', E_USER_NOTICE);
return '';
}
@@ -211,11 +211,11 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
}
if (is_object($output)) {
- if (method_exists($output, "__toString")) {
+ if (method_exists($output, '__toString')) {
$output = (string) $output->__toString();
} else {
- trigger_error("html_options: output is an object of class '" . get_class($output) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: output is an object of class \'' . get_class($output) .
+ '\' without __toString() method', E_USER_NOTICE);
return '';
}
diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php
index 3218634a..9b9ba7b2 100644
--- a/libs/plugins/function.html_image.php
+++ b/libs/plugins/function.html_image.php
@@ -67,7 +67,7 @@ function smarty_function_html_image($params, $template)
if (!is_array($_val)) {
$$_key = smarty_function_escape_special_chars($_val);
} else {
- throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ throw new SmartyException ("html_image: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
@@ -81,19 +81,19 @@ function smarty_function_html_image($params, $template)
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
- throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ throw new SmartyException ("html_image: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
}
if (empty($file)) {
- trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+ trigger_error('html_image: missing \'file\' parameter', E_USER_NOTICE);
return;
}
- if ($file[ 0 ] == '/') {
+ if ($file[ 0 ] === '/') {
$_image_path = $basedir . $file;
} else {
$_image_path = $file;
@@ -127,15 +127,15 @@ function smarty_function_html_image($params, $template)
// FIXME: (rodneyrehm) getimagesize() loads the complete file off a remote resource, use custom [jpg,png,gif]header reader!
if (!$_image_data = @getimagesize($_image_path)) {
if (!file_exists($_image_path)) {
- trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+ trigger_error("html_image: unable to find '{$_image_path}'", E_USER_NOTICE);
return;
} elseif (!is_readable($_image_path)) {
- trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+ trigger_error("html_image: unable to read '{$_image_path}'", E_USER_NOTICE);
return;
} else {
- trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+ trigger_error("html_image: '{$_image_path}' is not a valid image file", E_USER_NOTICE);
return;
}
diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php
index d0e79452..7b14dc67 100644
--- a/libs/plugins/function.html_options.php
+++ b/libs/plugins/function.html_options.php
@@ -74,11 +74,11 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat
$selected = array();
foreach ($_val as $_sel) {
if (is_object($_sel)) {
- if (method_exists($_sel, "__toString")) {
+ if (method_exists($_sel, '__toString')) {
$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
} else {
- trigger_error("html_options: selected attribute contains an object of class '" .
- get_class($_sel) . "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: selected attribute contains an object of class \'' .
+ get_class($_sel) . '\' without __toString() method', E_USER_NOTICE);
continue;
}
} else {
@@ -87,11 +87,11 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat
$selected[ $_sel ] = true;
}
} elseif (is_object($_val)) {
- if (method_exists($_val, "__toString")) {
+ if (method_exists($_val, '__toString')) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
- trigger_error("html_options: selected attribute is an object of class '" . get_class($_val) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: selected attribute is an object of class \'' . get_class($_val) .
+ '\' without __toString() method', E_USER_NOTICE);
}
} else {
$selected = smarty_function_escape_special_chars((string) $_val);
@@ -105,7 +105,7 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat
case 'readonly':
if (!empty($params[ 'strict' ])) {
if (!is_scalar($_val)) {
- trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute",
+ trigger_error("html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute",
E_USER_NOTICE);
}
@@ -121,7 +121,7 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
- trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ trigger_error("html_options: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -182,11 +182,11 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c
$_html_class = !empty($class) ? ' class="' . $class . ' option"' : '';
$_html_id = !empty($id) ? ' id="' . $id . '-' . $idx . '"' : '';
if (is_object($value)) {
- if (method_exists($value, "__toString")) {
+ if (method_exists($value, '__toString')) {
$value = smarty_function_escape_special_chars((string) $value->__toString());
} else {
- trigger_error("html_options: value is an object of class '" . get_class($value) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: value is an object of class \'' . get_class($value) .
+ '\' without __toString() method', E_USER_NOTICE);
return '';
}
diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php
index 2d71b1c3..1547c27c 100644
--- a/libs/plugins/function.html_radios.php
+++ b/libs/plugins/function.html_radios.php
@@ -73,11 +73,11 @@ function smarty_function_html_radios($params, $template)
if (is_array($_val)) {
trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
} elseif (is_object($_val)) {
- if (method_exists($_val, "__toString")) {
+ if (method_exists($_val, '__toString')) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
- trigger_error("html_radios: selected attribute is an object of class '" . get_class($_val) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_radios: selected attribute is an object of class \'' . get_class($_val) .
+ '\' without __toString() method', E_USER_NOTICE);
}
} else {
$selected = (string) $_val;
@@ -115,7 +115,7 @@ function smarty_function_html_radios($params, $template)
case 'readonly':
if (!empty($params[ 'strict' ])) {
if (!is_scalar($_val)) {
- trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute",
+ trigger_error("html_options: {$_key} attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute",
E_USER_NOTICE);
}
@@ -131,7 +131,7 @@ function smarty_function_html_radios($params, $template)
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
- trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ trigger_error("html_radios: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -185,11 +185,11 @@ function smarty_function_html_radios_output($name, $value, $output, $selected, $
$_output = '';
if (is_object($value)) {
- if (method_exists($value, "__toString")) {
+ if (method_exists($value, '__toString')) {
$value = (string) $value->__toString();
} else {
- trigger_error("html_options: value is an object of class '" . get_class($value) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: value is an object of class \'' . get_class($value) .
+ '\' without __toString() method', E_USER_NOTICE);
return '';
}
@@ -198,11 +198,11 @@ function smarty_function_html_radios_output($name, $value, $output, $selected, $
}
if (is_object($output)) {
- if (method_exists($output, "__toString")) {
+ if (method_exists($output, '__toString')) {
$output = (string) $output->__toString();
} else {
- trigger_error("html_options: output is an object of class '" . get_class($output) .
- "' without __toString() method", E_USER_NOTICE);
+ trigger_error('html_options: output is an object of class \'' . get_class($output) .
+ '\' without __toString() method', E_USER_NOTICE);
return '';
}
diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php
index 0506c5a9..454e7714 100644
--- a/libs/plugins/function.html_select_date.php
+++ b/libs/plugins/function.html_select_date.php
@@ -65,18 +65,18 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
}
/* Default values. */
- $prefix = "Date_";
+ $prefix = 'Date_';
$start_year = null;
$end_year = null;
$display_days = true;
$display_months = true;
$display_years = true;
- $month_format = "%B";
+ $month_format = '%B';
/* Write months as numbers by default GL */
- $month_value_format = "%m";
- $day_format = "%02d";
+ $month_value_format = '%m';
+ $day_format = '%02d';
/* Write day values using this format MB */
- $day_value_format = "%d";
+ $day_value_format = '%d';
$year_as_text = false;
/* Display years in reverse order? Ie. 2000,1999,.... */
$reverse_years = false;
@@ -122,10 +122,10 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
break;
case 'month_names':
- if (is_array($_value) && count($_value) == 12) {
+ if (is_array($_value) && count($_value) === 12) {
$$_key = $_value;
} else {
- trigger_error("html_select_date: month_names must be an array of 12 strings", E_USER_NOTICE);
+ trigger_error('html_select_date: month_names must be an array of 12 strings', E_USER_NOTICE);
}
break;
@@ -170,7 +170,7 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
if (!is_array($_value)) {
$extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
} else {
- trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ trigger_error("html_select_date: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -220,9 +220,9 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
$t = $$key;
if ($t === null) {
$$key = (int) $_current_year;
- } elseif ($t[ 0 ] == '+') {
+ } elseif ($t[ 0 ] === '+') {
$$key = (int) ($_current_year + (int) trim(substr($t, 1)));
- } elseif ($t[ 0 ] == '-') {
+ } elseif ($t[ 0 ] === '-') {
$$key = (int) ($_current_year - (int) trim(substr($t, 1)));
} else {
$$key = (int) $$key;
@@ -310,8 +310,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
for ($i = 1; $i <= 12; $i ++) {
$_val = sprintf('%02d', $i);
$_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) :
- ($month_format == "%m" ? $_val : strftime($month_format, $_month_timestamps[ $i ]));
- $_value = $month_value_format == "%m" ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]);
+ ($month_format === '%m' ? $_val : strftime($month_format, $_month_timestamps[ $i ]));
+ $_value = $month_value_format === '%m' ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]);
$_html_months .= '<option value="' . $_value . '"' . ($_val == $_month ? ' selected="selected"' : '') .
'>' . $_text . '</option>' . $option_separator;
}
@@ -348,8 +348,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
for ($i = 1; $i <= 31; $i ++) {
$_val = sprintf('%02d', $i);
- $_text = $day_format == '%02d' ? $_val : sprintf($day_format, $i);
- $_value = $day_value_format == '%02d' ? $_val : sprintf($day_value_format, $i);
+ $_text = $day_format === '%02d' ? $_val : sprintf($day_format, $i);
+ $_value = $day_value_format === '%02d' ? $_val : sprintf($day_value_format, $i);
$_html_days .= '<option value="' . $_value . '"' . ($_val == $_day ? ' selected="selected"' : '') . '>' .
$_text . '</option>' . $option_separator;
}
diff --git a/libs/plugins/function.html_select_time.php b/libs/plugins/function.html_select_time.php
index c15d38f0..9333f6dd 100644
--- a/libs/plugins/function.html_select_time.php
+++ b/libs/plugins/function.html_select_time.php
@@ -34,7 +34,7 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
$template->smarty->_cache[ '_required_smt' ] = true;
}
- $prefix = "Time_";
+ $prefix = 'Time_';
$field_array = null;
$field_separator = "\n";
$option_separator = "\n";
@@ -143,7 +143,7 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
if (!is_array($_value)) {
$extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
} else {
- trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ trigger_error("html_select_date: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -224,8 +224,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
$end = $use_24_hours ? 23 : 12;
for ($i = $start; $i <= $end; $i ++) {
$_val = sprintf('%02d', $i);
- $_text = $hour_format == '%02d' ? $_val : sprintf($hour_format, $i);
- $_value = $hour_value_format == '%02d' ? $_val : sprintf($hour_value_format, $i);
+ $_text = $hour_format === '%02d' ? $_val : sprintf($hour_format, $i);
+ $_value = $hour_value_format === '%02d' ? $_val : sprintf($hour_value_format, $i);
if (!$use_24_hours) {
$_hour12 = $_hour == 0 ? 12 : ($_hour <= 12 ? $_hour : $_hour - 12);
@@ -271,8 +271,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
$selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null;
for ($i = 0; $i <= 59; $i += $minute_interval) {
$_val = sprintf('%02d', $i);
- $_text = $minute_format == '%02d' ? $_val : sprintf($minute_format, $i);
- $_value = $minute_value_format == '%02d' ? $_val : sprintf($minute_value_format, $i);
+ $_text = $minute_format === '%02d' ? $_val : sprintf($minute_format, $i);
+ $_value = $minute_value_format === '%02d' ? $_val : sprintf($minute_value_format, $i);
$_html_minutes .= '<option value="' . $_value . '"' . ($selected === $i ? ' selected="selected"' : '') .
'>' . $_text . '</option>' . $option_separator;
}
@@ -312,8 +312,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
$selected = $_second !== null ? ($_second - $_second % $second_interval) : null;
for ($i = 0; $i <= 59; $i += $second_interval) {
$_val = sprintf('%02d', $i);
- $_text = $second_format == '%02d' ? $_val : sprintf($second_format, $i);
- $_value = $second_value_format == '%02d' ? $_val : sprintf($second_value_format, $i);
+ $_text = $second_format === '%02d' ? $_val : sprintf($second_format, $i);
+ $_value = $second_value_format === '%02d' ? $_val : sprintf($second_value_format, $i);
$_html_seconds .= '<option value="' . $_value . '"' . ($selected === $i ? ' selected="selected"' : '') .
'>' . $_text . '</option>' . $option_separator;
}
diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php
index 7efcdbd2..420d61af 100644
--- a/libs/plugins/function.html_table.php
+++ b/libs/plugins/function.html_table.php
@@ -127,7 +127,7 @@ function smarty_function_html_table($params)
}
if (is_array($cols)) {
- $cols = ($hdir == 'right') ? $cols : array_reverse($cols);
+ $cols = ($hdir === 'right') ? $cols : array_reverse($cols);
$output .= "<thead><tr>\n";
for ($r = 0; $r < $cols_count; $r ++) {
@@ -141,11 +141,11 @@ function smarty_function_html_table($params)
$output .= "<tbody>\n";
for ($r = 0; $r < $rows; $r ++) {
$output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
- $rx = ($vdir == 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count;
+ $rx = ($vdir === 'down') ? $r * $cols_count : ($rows - 1 - $r) * $cols_count;
for ($c = 0; $c < $cols_count; $c ++) {
- $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count - 1 - $c;
- if ($inner != 'cols') {
+ $x = ($hdir === 'right') ? $rx + $c : $rx + $cols_count - 1 - $c;
+ if ($inner !== 'cols') {
/* shuffle x to loop over rows*/
$x = floor($x / $cols_count) + ($x % $cols_count) * $rows;
}
diff --git a/libs/plugins/function.mailto.php b/libs/plugins/function.mailto.php
index d47b75dc..9a8e7e80 100644
--- a/libs/plugins/function.mailto.php
+++ b/libs/plugins/function.mailto.php
@@ -103,7 +103,7 @@ function smarty_function_mailto($params)
return;
}
// FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed!
- if ($encode == 'javascript') {
+ if ($encode === 'javascript') {
$string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');';
$js_encode = '';
@@ -112,7 +112,7 @@ function smarty_function_mailto($params)
}
return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';
- } elseif ($encode == 'javascript_charcode') {
+ } elseif ($encode === 'javascript_charcode') {
$string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
for ($x = 0, $y = strlen($string); $x < $y; $x ++) {
@@ -123,7 +123,7 @@ function smarty_function_mailto($params)
implode(',', $ord) . "))" . "}\n" . "</script>\n";
return $_ret;
- } elseif ($encode == 'hex') {
+ } elseif ($encode === 'hex') {
preg_match('!^(.*)(\?.*)$!', $address, $match);
if (!empty($match[ 2 ])) {
trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.", E_USER_WARNING);
diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php
index fc5db335..18054cbf 100644
--- a/libs/plugins/function.math.php
+++ b/libs/plugins/function.math.php
@@ -38,7 +38,7 @@ function smarty_function_math($params, $template)
$equation = $params[ 'equation' ];
// make sure parenthesis are balanced
- if (substr_count($equation, "(") != substr_count($equation, ")")) {
+ if (substr_count($equation, '(') !== substr_count($equation, ')')) {
trigger_error("math: unbalanced parenthesis", E_USER_WARNING);
return;
@@ -59,9 +59,9 @@ function smarty_function_math($params, $template)
}
foreach ($params as $key => $val) {
- if ($key != "equation" && $key != "format" && $key != "assign") {
+ if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {
// make sure value is not empty
- if (strlen($val) == 0) {
+ if (strlen($val) === 0) {
trigger_error("math: parameter '{$key}' is empty", E_USER_WARNING);
return;
@@ -86,7 +86,7 @@ function smarty_function_math($params, $template)
}
foreach ($params as $key => $val) {
- if ($key != "equation" && $key != "format" && $key != "assign") {
+ if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') {
$equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
}
}
diff --git a/libs/plugins/modifier.capitalize.php b/libs/plugins/modifier.capitalize.php
index 79c1a4fe..686f869a 100644
--- a/libs/plugins/modifier.capitalize.php
+++ b/libs/plugins/modifier.capitalize.php
@@ -72,7 +72,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
return $upper_string;
}
-/*
+/*
*
* Bug: create_function() use exhausts memory when used in long loops
* Fix: use declared functions for callbacks instead of using create_function()
diff --git a/libs/plugins/modifier.date_format.php b/libs/plugins/modifier.date_format.php
index 37cf85f2..325d43b6 100644
--- a/libs/plugins/modifier.date_format.php
+++ b/libs/plugins/modifier.date_format.php
@@ -42,14 +42,14 @@ function smarty_modifier_date_format($string, $format = null, $default_date = ''
}
$is_loaded = true;
}
- if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') {
+ if ($string !== '' && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') {
$timestamp = smarty_make_timestamp($string);
- } elseif ($default_date != '') {
+ } elseif ($default_date !== '') {
$timestamp = smarty_make_timestamp($default_date);
} else {
return;
}
- if ($formatter == 'strftime' || ($formatter == 'auto' && strpos($format, '%') !== false)) {
+ if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) {
if (Smarty::$_IS_WINDOWS) {
$_win_from = array('%D',
'%h',
diff --git a/libs/plugins/modifier.debug_print_var.php b/libs/plugins/modifier.debug_print_var.php
index 34f85dcd..2eb61dd8 100644
--- a/libs/plugins/modifier.debug_print_var.php
+++ b/libs/plugins/modifier.debug_print_var.php
@@ -28,7 +28,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
switch (gettype($var)) {
case 'array' :
$results = '<b>Array (' . count($var) . ')</b>';
- if ($depth == $max) {
+ if ($depth === $max) {
break;
}
foreach ($var as $curr_key => $curr_val) {
@@ -46,7 +46,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth =
$results .= ' called recursive';
break;
}
- if ($depth == $max) {
+ if ($depth === $max) {
break;
}
$objects[] = $var;
diff --git a/libs/plugins/modifier.truncate.php b/libs/plugins/modifier.truncate.php
index 6fe84425..0f79dd26 100644
--- a/libs/plugins/modifier.truncate.php
+++ b/libs/plugins/modifier.truncate.php
@@ -27,7 +27,7 @@
*/
function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)
{
- if ($length == 0) {
+ if ($length === 0) {
return '';
}
diff --git a/libs/plugins/modifiercompiler.count_characters.php b/libs/plugins/modifiercompiler.count_characters.php
index f752d861..d2c9a4cf 100644
--- a/libs/plugins/modifiercompiler.count_characters.php
+++ b/libs/plugins/modifiercompiler.count_characters.php
@@ -21,7 +21,7 @@
*/
function smarty_modifiercompiler_count_characters($params)
{
- if (!isset($params[ 1 ]) || $params[ 1 ] != 'true') {
+ if (!isset($params[ 1 ]) || $params[ 1 ] !== 'true') {
return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[ 0 ] . ', $tmp)';
}
if (Smarty::$_MBSTRING) {
diff --git a/libs/plugins/modifiercompiler.strip_tags.php b/libs/plugins/modifiercompiler.strip_tags.php
index e56bf931..af2c3911 100644
--- a/libs/plugins/modifiercompiler.strip_tags.php
+++ b/libs/plugins/modifiercompiler.strip_tags.php
@@ -21,7 +21,7 @@
*/
function smarty_modifiercompiler_strip_tags($params)
{
- if (!isset($params[ 1 ]) || $params[ 1 ] === true || trim($params[ 1 ], '"') == 'true') {
+ if (!isset($params[ 1 ]) || $params[ 1 ] === true || trim($params[ 1 ], '"') === 'true') {
return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
} else {
return 'strip_tags(' . $params[ 0 ] . ')';
diff --git a/libs/plugins/modifiercompiler.unescape.php b/libs/plugins/modifiercompiler.unescape.php
index a3409bc7..396ad7ea 100644
--- a/libs/plugins/modifiercompiler.unescape.php
+++ b/libs/plugins/modifiercompiler.unescape.php
@@ -26,7 +26,7 @@ function smarty_modifiercompiler_unescape($params)
if (!isset($params[ 2 ])) {
$params[ 2 ] = '\'' . addslashes(Smarty::$_CHARSET) . '\'';
} else {
- $params[ 2 ] = "'" . $params[ 2 ] . "'";
+ $params[ 2 ] = "'{$params[ 2 ]}'";
}
switch (trim($params[ 1 ], '"\'')) {
diff --git a/libs/plugins/outputfilter.trimwhitespace.php b/libs/plugins/outputfilter.trimwhitespace.php
index 1a67123a..70a66d3d 100644
--- a/libs/plugins/outputfilter.trimwhitespace.php
+++ b/libs/plugins/outputfilter.trimwhitespace.php
@@ -24,7 +24,7 @@ function smarty_outputfilter_trimwhitespace($source)
$_offset = 0;
// Unify Line-Breaks to \n
- $source = preg_replace("/\015\012|\015|\012/", "\n", $source);
+ $source = preg_replace('/\015\012|\015|\012/', "\n", $source);
// capture Internet Explorer and KnockoutJS Conditional Comments
if (preg_match_all('#<!--((\[[^\]]+\]>.*?<!\[[^\]]+\])|(\s*/?ko\s+.+))-->#is', $source, $matches,
diff --git a/libs/plugins/shared.make_timestamp.php b/libs/plugins/shared.make_timestamp.php
index 67f86244..02881166 100644
--- a/libs/plugins/shared.make_timestamp.php
+++ b/libs/plugins/shared.make_timestamp.php
@@ -25,7 +25,7 @@ function smarty_make_timestamp($string)
(interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface)
) {
return (int) $string->format('U'); // PHP 5.2 BC
- } elseif (strlen($string) == 14 && ctype_digit($string)) {
+ } elseif (strlen($string) === 14 && ctype_digit($string)) {
// it is mysql timestamp format of YYYYMMDDHHMMSS?
return mktime(substr($string, 8, 2), substr($string, 10, 2), substr($string, 12, 2), substr($string, 4, 2),
substr($string, 6, 2), substr($string, 0, 4));
@@ -35,7 +35,7 @@ function smarty_make_timestamp($string)
} else {
// strtotime should handle it
$time = strtotime($string);
- if ($time == - 1 || $time === false) {
+ if ($time === - 1 || $time === false) {
// strtotime() was not able to parse $string, use "now":
return time();
}
diff --git a/libs/plugins/shared.mb_unicode.php b/libs/plugins/shared.mb_unicode.php
index 0f790b56..7450148a 100644
--- a/libs/plugins/shared.mb_unicode.php
+++ b/libs/plugins/shared.mb_unicode.php
@@ -20,12 +20,12 @@
function smarty_mb_to_unicode($string, $encoding = null)
{
if ($encoding) {
- $expanded = mb_convert_encoding($string, "UTF-32BE", $encoding);
+ $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);
} else {
- $expanded = mb_convert_encoding($string, "UTF-32BE");
+ $expanded = mb_convert_encoding($string, 'UTF-32BE');
}
- return unpack("N*", $expanded);
+ return unpack('N*', $expanded);
}
/**
@@ -46,8 +46,8 @@ function smarty_mb_from_unicode($unicode, $encoding = null)
$encoding = mb_internal_encoding();
}
foreach ((array) $unicode as $utf32be) {
- $character = pack("N*", $utf32be);
- $t .= mb_convert_encoding($character, $encoding, "UTF-32BE");
+ $character = pack('N*', $utf32be);
+ $t .= mb_convert_encoding($character, $encoding, 'UTF-32BE');
}
return $t;
diff --git a/libs/sysplugins/smarty_cacheresource_custom.php b/libs/sysplugins/smarty_cacheresource_custom.php
index b3f4c1b2..7a5920f4 100644
--- a/libs/sysplugins/smarty_cacheresource_custom.php
+++ b/libs/sysplugins/smarty_cacheresource_custom.php
@@ -138,7 +138,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
$_smarty_tpl->compile_id, $content, $timestamp);
}
if (isset($content)) {
- eval("?>" . $content);
+ eval('?>' . $content);
$cached->content = null;
return true;
}
diff --git a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
index 47e010a7..ff065a27 100644
--- a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
+++ b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
@@ -104,7 +104,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
}
}
if (isset($content)) {
- eval("?>" . $content);
+ eval('?>' . $content);
return true;
}
@@ -273,8 +273,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
*/
protected function addMetaTimestamp(&$content)
{
- $mt = explode(" ", microtime());
- $ts = pack("NN", $mt[ 1 ], (int) ($mt[ 0 ] * 100000000));
+ $mt = explode(' ', microtime());
+ $ts = pack('NN', $mt[ 1 ], (int) ($mt[ 0 ] * 100000000));
$content = $ts . $content;
}
@@ -371,7 +371,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
/**
* Translate a CacheID into the list of applicable InvalidationKeys.
- * Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )
+ * Splits 'some|chain|into|an|array' into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )
*
* @param string $cid CacheID to translate
* @param string $resource_name template name
diff --git a/libs/sysplugins/smarty_data.php b/libs/sysplugins/smarty_data.php
index b9f5de9a..743b117b 100644
--- a/libs/sysplugins/smarty_data.php
+++ b/libs/sysplugins/smarty_data.php
@@ -61,8 +61,8 @@ class Smarty_Data extends Smarty_Internal_Data
foreach ($_parent as $_key => $_val) {
$this->tpl_vars[ $_key ] = new Smarty_Variable($_val);
}
- } elseif ($_parent != null) {
- throw new SmartyException("Wrong type for template variables");
+ } elseif ($_parent !== null) {
+ throw new SmartyException('Wrong type for template variables');
}
}
}
diff --git a/libs/sysplugins/smarty_internal_block.php b/libs/sysplugins/smarty_internal_block.php
index 596b6a30..780319f1 100644
--- a/libs/sysplugins/smarty_internal_block.php
+++ b/libs/sysplugins/smarty_internal_block.php
@@ -67,7 +67,7 @@ class Smarty_Internal_Block
/**
* Smarty_Internal_Block constructor.
- * - if outer level {block} of child template ($state == 1) save it as child root block
+ * - if outer level {block} of child template ($state === 1) save it as child root block
* - otherwise process inheritance and render
*
* @param string $name block name
diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php
index 942c003c..f6ef0930 100644
--- a/libs/sysplugins/smarty_internal_cacheresource_file.php
+++ b/libs/sysplugins/smarty_internal_cacheresource_file.php
@@ -93,7 +93,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
{
$_smarty_tpl->cached->valid = false;
if ($update && defined('HHVM_VERSION')) {
- eval("?>" . file_get_contents($_smarty_tpl->cached->filepath));
+ eval('?>' . file_get_contents($_smarty_tpl->cached->filepath));
return true;
} else {
return @include $_smarty_tpl->cached->filepath;
@@ -116,7 +116,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
$_template->smarty) === true
) {
if (function_exists('opcache_invalidate') &&
- (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api"))) < 1
+ (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1
) {
opcache_invalidate($_template->cached->filepath, true);
} else if (function_exists('apc_compile_file')) {
diff --git a/libs/sysplugins/smarty_internal_compile_assign.php b/libs/sysplugins/smarty_internal_compile_assign.php
index 3bd33847..5ec7a183 100644
--- a/libs/sysplugins/smarty_internal_compile_assign.php
+++ b/libs/sysplugins/smarty_internal_compile_assign.php
@@ -71,7 +71,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase
$_scope = $compiler->convertScope($_attr, $this->valid_scopes);
}
// optional parameter
- $_params = "";
+ $_params = '';
if ($_nocache || $_scope) {
$_params .= ' ,' . var_export($_nocache, true);
}
diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php
index e3239031..753e6d8e 100644
--- a/libs/sysplugins/smarty_internal_compile_block.php
+++ b/libs/sysplugins/smarty_internal_compile_block.php
@@ -67,7 +67,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher
if (!isset($compiler->_cache['blockNesting'])) {
$compiler->_cache['blockNesting'] = 0;
}
- if ($compiler->_cache['blockNesting'] == 0) {
+ if ($compiler->_cache['blockNesting'] === 0) {
// make sure that inheritance gets initialized in template code
$this->registerInit($compiler);
$this->option_flags = array('hide', 'nocache', 'append', 'prepend');
@@ -115,12 +115,12 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher
{
$name = isset($parameter[1]) ? $compiler->getId($parameter[1]) : false;
if (!$name) {
- $compiler->trigger_template_error("invalid \"\$smarty.block\" expected \"\$smarty.block.child\" or \"\$smarty.block.parent\"",
+ $compiler->trigger_template_error("invalid '\$smarty.block' expected '\$smarty.block.child' or '\$smarty.block.parent'",
null,
true);
}
if (!isset($compiler->_cache['blockNesting'])) {
- $compiler->trigger_template_error(" \"\$smarty.block.{$name}\" used outside {block} tags ",
+ $compiler->trigger_template_error(" '\$smarty.block.{$name}' used outside {block} tags ",
$compiler->parser->lex->taglineno);
}
$compiler->has_code = true;
@@ -134,7 +134,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher
return '$_smarty_tpl->inheritance->callParent($_smarty_tpl, $this, null, true)';
break;
default:
- $compiler->trigger_template_error("invalid \"\$smarty.block.{$name}\" expected \"\$smarty.block.child\" or \"\$smarty.block.parent\"",
+ $compiler->trigger_template_error("invalid '\$smarty.block.{$name}' expected '\$smarty.block.child' or '\$smarty.block.parent'",
null,
true);
}
@@ -166,7 +166,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_
$_assign = isset($_attr['assign']) ? $_attr['assign'] : null;
unset($_attr['assign'], $_attr['name']);
foreach ($_attr as $name => $stat) {
- if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat != 'false')) {
+ if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat !== 'false')) {
$_block[ $name ] = 'true';
}
}
@@ -225,14 +225,14 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_
$compiler->nocache = $_nocache;
$compiler->parser->current_buffer = $_buffer;
$output = "<?php \n";
- if ($compiler->_cache['blockNesting'] == 1) {
+ if ($compiler->_cache['blockNesting'] === 1) {
$output .= "\$_smarty_tpl->inheritance->instanceBlock(\$_smarty_tpl, '$_className', $_name);\n";
} else {
$output .= "\$_smarty_tpl->inheritance->instanceBlock(\$_smarty_tpl, '$_className', $_name, \$this->tplIndex);\n";
}
$output .= "?>\n";
$compiler->_cache['blockNesting']--;
- if ($compiler->_cache['blockNesting'] == 0) {
+ if ($compiler->_cache['blockNesting'] === 0) {
unset($compiler->_cache['blockNesting']);
}
$compiler->has_code = true;
diff --git a/libs/sysplugins/smarty_internal_compile_break.php b/libs/sysplugins/smarty_internal_compile_break.php
index ce162cb5..8879dff9 100644
--- a/libs/sysplugins/smarty_internal_compile_break.php
+++ b/libs/sysplugins/smarty_internal_compile_break.php
@@ -99,7 +99,7 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase
}
$stack_count --;
}
- if ($level_count != 0) {
+ if ($level_count !== 0) {
$compiler->trigger_template_error("cannot {$tag} {$levels} level(s)", null, true);
}
if ($lastTag === 'foreach' && $tag === 'break') {
diff --git a/libs/sysplugins/smarty_internal_compile_call.php b/libs/sysplugins/smarty_internal_compile_call.php
index 739df5ec..eb444d35 100644
--- a/libs/sysplugins/smarty_internal_compile_call.php
+++ b/libs/sysplugins/smarty_internal_compile_call.php
@@ -57,7 +57,7 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase
// output will be stored in a smarty variable instead of being displayed
$_assign = $_attr[ 'assign' ];
}
- //$_name = trim($_attr['name'], "'\"");
+ //$_name = trim($_attr['name'], "''");
$_name = $_attr[ 'name' ];
unset($_attr[ 'name' ], $_attr[ 'assign' ], $_attr[ 'nocache' ]);
// set flag (compiled code of {function} must be included in cache file
@@ -74,7 +74,7 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase
$_paramsArray[] = "'$_key'=>$_value";
}
}
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
//$compiler->suppressNocacheProcessing = true;
// was there an assign attribute
if (isset($_assign)) {
diff --git a/libs/sysplugins/smarty_internal_compile_eval.php b/libs/sysplugins/smarty_internal_compile_eval.php
index 97a3c29c..550f194e 100644
--- a/libs/sysplugins/smarty_internal_compile_eval.php
+++ b/libs/sysplugins/smarty_internal_compile_eval.php
@@ -58,13 +58,12 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase
}
// create template object
- $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'." . $_attr[ 'var' ] .
- ", \$_smarty_tpl->smarty, \$_smarty_tpl);";
+ $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.{$_attr[ 'var' ]}, \$_smarty_tpl->smarty, \$_smarty_tpl);";
//was there an assign attribute?
if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());";
} else {
- $_output .= "echo \$_template->fetch();";
+ $_output .= 'echo $_template->fetch();';
}
return "<?php $_output ?>";
diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php
index 5e0b5899..7617f3af 100644
--- a/libs/sysplugins/smarty_internal_compile_extends.php
+++ b/libs/sysplugins/smarty_internal_compile_extends.php
@@ -64,18 +64,18 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh
// add code to initialize inheritance
$this->registerInit($compiler, true);
$file = trim($_attr[ 'file' ], '\'"');
- if (strlen($file) > 8 && substr($file, 0, 8) == 'extends:') {
+ if (strlen($file) > 8 && substr($file, 0, 8) === 'extends:') {
// generate code for each template
$files = array_reverse(explode('|', substr($file, 8)));
$i = 0;
foreach ($files as $file) {
- if ($file[ 0 ] == '"') {
+ if ($file[ 0 ] === '"') {
$file = trim($file, '".');
} else {
$file = "'{$file}'";
}
$i ++;
- if ($i == count($files) && isset($_attr[ 'extends_resource' ])) {
+ if ($i === count($files) && isset($_attr[ 'extends_resource' ])) {
$this->compileEndChild($compiler);
}
$this->compileInclude($compiler, $file);
@@ -104,14 +104,14 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh
$inlineUids = '';
if (isset($template) && $compiler->smarty->merge_compiled_includes) {
$code = $compiler->compileTag('include', array($template, array('scope' => 'parent')));
- if (preg_match("/([,][\s]*['][a-z0-9]+['][,][\s]*[']content.*['])[)]/", $code, $match)) {
+ if (preg_match('/([,][\s]*[\'][a-z0-9]+[\'][,][\s]*[\']content.*[\'])[)]/', $code, $match)) {
$inlineUids = $match[ 1 ];
}
}
$compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser,
- "<?php \$_smarty_tpl->inheritance->endChild(\$_smarty_tpl" .
+ '<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl' .
(isset($template) ?
- ', ' . $template . $inlineUids :
+ ", {$template}{$inlineUids}" :
'') . ");\n?>\n");
}
diff --git a/libs/sysplugins/smarty_internal_compile_for.php b/libs/sysplugins/smarty_internal_compile_for.php
index e5e7c61c..f899769b 100644
--- a/libs/sysplugins/smarty_internal_compile_for.php
+++ b/libs/sysplugins/smarty_internal_compile_for.php
@@ -35,7 +35,7 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase
public function compile($args, $compiler, $parameter)
{
$compiler->loopNesting ++;
- if ($parameter == 0) {
+ if ($parameter === 0) {
$this->required_attributes = array('start', 'to');
$this->optional_attributes = array('max', 'step');
} else {
@@ -47,7 +47,7 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase
$_attr = $this->getAttributes($compiler, $args);
$output = "<?php\n";
- if ($parameter == 1) {
+ if ($parameter === 1) {
foreach ($_attr[ 'start' ] as $_statement) {
if (is_array($_statement[ 'var' ])) {
$var = $_statement[ 'var' ][ 'var' ];
@@ -89,10 +89,10 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase
}
$output .= "if (\$_smarty_tpl->tpl_vars[$var]->total > 0) {\n";
$output .= "for (\$_smarty_tpl->tpl_vars[$var]->value{$index} = $_statement[value], \$_smarty_tpl->tpl_vars[$var]->iteration = 1;\$_smarty_tpl->tpl_vars[$var]->iteration <= \$_smarty_tpl->tpl_vars[$var]->total;\$_smarty_tpl->tpl_vars[$var]->value{$index} += \$_smarty_tpl->tpl_vars[$var]->step, \$_smarty_tpl->tpl_vars[$var]->iteration++) {\n";
- $output .= "\$_smarty_tpl->tpl_vars[$var]->first = \$_smarty_tpl->tpl_vars[$var]->iteration == 1;";
- $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration == \$_smarty_tpl->tpl_vars[$var]->total;";
+ $output .= "\$_smarty_tpl->tpl_vars[$var]->first = \$_smarty_tpl->tpl_vars[$var]->iteration === 1;";
+ $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration === \$_smarty_tpl->tpl_vars[$var]->total;";
}
- $output .= "?>";
+ $output .= '?>';
$this->openTag($compiler, 'for', array('for', $compiler->nocache));
// maybe nocache because of nocache variables
@@ -161,7 +161,7 @@ class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase
list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse'));
$output = "<?php }\n";
- if ($openTag != 'forelse') {
+ if ($openTag !== 'forelse') {
$output .= "}\n";
}
$output .= "?>\n";
diff --git a/libs/sysplugins/smarty_internal_compile_foreach.php b/libs/sysplugins/smarty_internal_compile_foreach.php
index 932d1b03..b6971a19 100644
--- a/libs/sysplugins/smarty_internal_compile_foreach.php
+++ b/libs/sysplugins/smarty_internal_compile_foreach.php
@@ -118,7 +118,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
$fromName = $compiler->getVariableName($_attr[ 'from' ]);
if ($fromName) {
foreach (array('item', 'key') as $a) {
- if (isset($attributes[ $a ]) && $attributes[ $a ] == $fromName) {
+ if (isset($attributes[ $a ]) && $attributes[ $a ] === $fromName) {
$compiler->trigger_template_error("'{$a}' and 'from' may not have same variable name '{$fromName}'",
null, true);
}
@@ -137,7 +137,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
if (!empty($this->matchResults[ 'named' ])) {
$namedAttr = $this->matchResults[ 'named' ];
}
- if (isset($_attr[ 'properties' ]) && preg_match_all("/['](.*?)[']/", $_attr[ 'properties' ], $match)) {
+ if (isset($_attr[ 'properties' ]) && preg_match_all('/[\'](.*?)[\']/', $_attr[ 'properties' ], $match)) {
foreach ($match[ 1 ] as $prop) {
if (in_array($prop, $this->itemProperties)) {
$itemAttr[ $prop ] = true;
@@ -229,7 +229,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
$output .= "{$itemVar}->first = !{$itemVar}->index;\n";
}
if (isset($itemAttr[ 'last' ])) {
- $output .= "{$itemVar}->last = {$itemVar}->iteration == {$itemVar}->total;\n";
+ $output .= "{$itemVar}->last = {$itemVar}->iteration === {$itemVar}->total;\n";
}
if (isset($foreachVar)) {
if (isset($namedAttr[ 'iteration' ])) {
@@ -242,13 +242,13 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo
$output .= "{$foreachVar}->value['first'] = !{$foreachVar}->value['index'];\n";
}
if (isset($namedAttr[ 'last' ])) {
- $output .= "{$foreachVar}->value['last'] = {$foreachVar}->value['iteration'] == {$foreachVar}->value['total'];\n";
+ $output .= "{$foreachVar}->value['last'] = {$foreachVar}->value['iteration'] === {$foreachVar}->value['total'];\n";
}
}
if (!empty($itemAttr)) {
$output .= "{$local}saved = {$itemVar};\n";
}
- $output .= "?>";
+ $output .= '?>';
return $output;
}
@@ -290,7 +290,7 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase
list($openTag, $nocache, $local, $itemVar, $restore) = $this->closeTag($compiler, array('foreach'));
$this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $itemVar, 0));
$output = "<?php\n";
- if ($restore == 2) {
+ if ($restore === 2) {
$output .= "{$itemVar} = {$local}saved;\n";
}
$output .= "}\n} else {\n?>\n";
@@ -327,7 +327,7 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase
$this->closeTag($compiler, array('foreach', 'foreachelse'));
$output = "<?php\n";
- if ($restore == 2) {
+ if ($restore === 2) {
$output .= "{$itemVar} = {$local}saved;\n";
}
if ($restore > 0) {
diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php
index 3badf8ce..bcb1f8aa 100644
--- a/libs/sysplugins/smarty_internal_compile_function.php
+++ b/libs/sysplugins/smarty_internal_compile_function.php
@@ -59,7 +59,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase
$compiler->trigger_template_error('nocache option not allowed', null, true);
}
unset($_attr[ 'nocache' ]);
- $_name = trim($_attr[ 'name' ], "'\"");
+ $_name = trim($_attr[ 'name' ], '\'"');
$compiler->parent_compiler->tpl_function[ $_name ] = array();
$save = array($_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code,
$compiler->template->caching);
@@ -100,7 +100,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
$this->compiler = $compiler;
$saved_data = $this->closeTag($compiler, array('function'));
$_attr = $saved_data[ 0 ];
- $_name = trim($_attr[ 'name' ], "'\"");
+ $_name = trim($_attr[ 'name' ], '\'"');
$compiler->parent_compiler->tpl_function[ $_name ][ 'compiled_filepath' ] =
$compiler->parent_compiler->template->compiled->filepath;
$compiler->parent_compiler->tpl_function[ $_name ][ 'uid' ] = $compiler->template->source->uid;
@@ -116,7 +116,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
}
}
if (!empty($_paramsArray)) {
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
$_paramsCode = "\$params = array_merge($_params, \$params);\n";
} else {
$_paramsCode = '';
@@ -198,7 +198,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
/**
* Remove nocache code
- *
+ *
* @param $match
*
* @return string
diff --git a/libs/sysplugins/smarty_internal_compile_if.php b/libs/sysplugins/smarty_internal_compile_if.php
index bf4e04e3..82436c26 100644
--- a/libs/sysplugins/smarty_internal_compile_if.php
+++ b/libs/sysplugins/smarty_internal_compile_if.php
@@ -34,8 +34,8 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase
// must whole block be nocache ?
$compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
- if (!array_key_exists("if condition", $parameter)) {
- $compiler->trigger_template_error("missing if condition", null, true);
+ if (!isset($parameter['if condition'])) {
+ $compiler->trigger_template_error('missing if condition', null, true);
}
if (is_array($parameter[ 'if condition' ])) {
@@ -49,9 +49,9 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase
$compiler->setNocacheInVariable($var);
}
$prefixVar = $compiler->getNewPrefixVariable();
- $_output = "<?php {$prefixVar} = " . $parameter[ 'if condition' ][ 'value' ] . ";?>\n";
+ $_output = "<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\n";
$assignAttr = array();
- $assignAttr[][ 'value' ] = "{$prefixVar}";
+ $assignAttr[][ 'value' ] = $prefixVar;
$assignCompiler = new Smarty_Internal_Compile_Assign();
if (is_array($parameter[ 'if condition' ][ 'var' ])) {
$assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];
@@ -90,7 +90,7 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase
list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
$this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache));
- return "<?php } else { ?>";
+ return '<?php } else { ?>';
}
}
@@ -119,8 +119,8 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase
list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif'));
- if (!array_key_exists("if condition", $parameter)) {
- $compiler->trigger_template_error("missing elseif condition", null, true);
+ if (!isset($parameter['if condition'])) {
+ $compiler->trigger_template_error('missing elseif condition', null, true);
}
$assignCode = '';
@@ -137,10 +137,10 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase
$compiler->setNocacheInVariable($var);
}
$prefixVar = $compiler->getNewPrefixVariable();
- $assignCode = "<?php {$prefixVar} = " . $parameter[ 'if condition' ][ 'value' ] . ";?>\n";
+ $assignCode = "<?php {$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]};?>\n";
$assignCompiler = new Smarty_Internal_Compile_Assign();
$assignAttr = array();
- $assignAttr[][ 'value' ] = "{$prefixVar}";
+ $assignAttr[][ 'value' ] = $prefixVar;
if (is_array($parameter[ 'if condition' ][ 'var' ])) {
$assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];
$assignCode .= $assignCompiler->compile($assignAttr, $compiler,
diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php
index 02b09f7a..f6d456cb 100644
--- a/libs/sysplugins/smarty_internal_compile_include.php
+++ b/libs/sysplugins/smarty_internal_compile_include.php
@@ -312,7 +312,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase
$compiled_code .= $tpl->compiler->postFilter($tpl->compiler->blockOrFunctionCode);
$compiled_code .= "<?php\n\n";
$compiled_code .= "/* End inline template \"{$sourceInfo}\" =============================*/\n";
- $compiled_code .= "?>";
+ $compiled_code .= '?>';
unset($tpl->compiler);
if ($tpl->compiled->has_nocache_code) {
// replace nocache_hash
diff --git a/libs/sysplugins/smarty_internal_compile_include_php.php b/libs/sysplugins/smarty_internal_compile_include_php.php
index ce96b7ec..e0aca93b 100644
--- a/libs/sysplugins/smarty_internal_compile_include_php.php
+++ b/libs/sysplugins/smarty_internal_compile_include_php.php
@@ -81,7 +81,7 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase
}
}
}
- if ($_filepath == false) {
+ if ($_filepath === false) {
$compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", null, true);
}
if (isset($compiler->smarty->security_policy)) {
@@ -93,7 +93,7 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase
}
$_once = '_once';
if (isset($_attr[ 'once' ])) {
- if ($_attr[ 'once' ] == 'false') {
+ if ($_attr[ 'once' ] === 'false') {
$_once = '';
}
}
diff --git a/libs/sysplugins/smarty_internal_compile_insert.php b/libs/sysplugins/smarty_internal_compile_insert.php
index bcab8a81..bac0c801 100644
--- a/libs/sysplugins/smarty_internal_compile_insert.php
+++ b/libs/sysplugins/smarty_internal_compile_insert.php
@@ -70,7 +70,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
// output will be stored in a smarty variable instead of being displayed
$_assign = $_attr[ 'assign' ];
// create variable to make sure that the compiler knows about its nocache status
- $var = trim($_attr[ 'assign' ], "'");
+ $var = trim($_attr[ 'assign' ], '\'');
if (isset($compiler->template->tpl_vars[ $var ])) {
$compiler->template->tpl_vars[ $var ]->nocache = true;
} else {
@@ -101,7 +101,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase
}
}
}
- if ($_filepath == false) {
+ if ($_filepath === false) {
$compiler->trigger_template_error("{insert} missing script file '{$_script}'", null, true);
}
// code for script file loading
diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
index 49837e66..7f8a379c 100644
--- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
+++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
@@ -46,14 +46,14 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
*/
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null)
{
- if (!isset($tag[ 5 ]) || substr($tag, - 5) != 'close') {
+ if (!isset($tag[ 5 ]) || substr($tag, - 5) !== 'close') {
// opening tag of block plugin
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
$this->nesting ++;
unset($_attr[ 'nocache' ]);
list($callback, $_paramsArray, $callable) = $this->setup($compiler, $_attr, $tag, $function);
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
// compile code
$output = "<?php ";
@@ -90,11 +90,8 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
array('modifierlist' => $parameter[ 'modifier_list' ],
'value' => 'ob_get_clean()')) . ";\n";
}
- $output = "<?php " . $mod_content . "\$_block_repeat=false;\n" . $mod_pre .
- "echo {$callback}({$_params}, " . $mod_content2 .
- ", \$_smarty_tpl, \$_block_repeat);\n" . $mod_post . "}\n";
- $output .= "array_pop(\$_smarty_tpl->smarty->_cache['_tag_stack']);";
- $output .= "?>";
+ $output = "<?php {$mod_content}\$_block_repeat=false;\n{$mod_pre}echo {$callback}({$_params}, {$mod_content2}, \$_smarty_tpl, \$_block_repeat);\n{$mod_post}}\n";
+ $output .= 'array_pop($_smarty_tpl->smarty->_cache[\'_tag_stack\']);?>';
}
return $output . "\n";
}
diff --git a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
index 2fcd8578..6a2ac07d 100644
--- a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
+++ b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
@@ -175,7 +175,7 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
if ($compiler !== $nextCompiler) {
// get template source
$_content = $nextCompiler->template->source->getContent();
- if ($_content != '') {
+ if ($_content !== '') {
// run pre filter if required
if ((isset($nextCompiler->smarty->autoload_filters[ 'pre' ]) ||
isset($nextCompiler->smarty->registered_filters[ 'pre' ]))
diff --git a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
index 7ecf61d2..a6b4b295 100644
--- a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
+++ b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
@@ -60,7 +60,7 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
$_paramsArray[] = "'$_key'=>$_value";
}
}
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
// compile code
$output = "{$function}({$_params},\$_smarty_tpl)";
if (!empty($parameter[ 'modifierlist' ])) {
diff --git a/libs/sysplugins/smarty_internal_compile_private_modifier.php b/libs/sysplugins/smarty_internal_compile_private_modifier.php
index 3a39c2ba..ad442a3f 100644
--- a/libs/sysplugins/smarty_internal_compile_private_modifier.php
+++ b/libs/sysplugins/smarty_internal_compile_private_modifier.php
@@ -143,7 +143,7 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa
}
}
if (!isset($compiler->known_modifier_type[ $modifier ])) {
- $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", null, true);
+ $compiler->trigger_template_error("unknown modifier '{$modifier}'", null, true);
}
}
diff --git a/libs/sysplugins/smarty_internal_compile_private_object_function.php b/libs/sysplugins/smarty_internal_compile_private_object_function.php
index 4ef108fb..c10d1222 100644
--- a/libs/sysplugins/smarty_internal_compile_private_object_function.php
+++ b/libs/sysplugins/smarty_internal_compile_private_object_function.php
@@ -62,10 +62,10 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
$_paramsArray[] = "'$_key'=>$_value";
}
}
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
$output = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)";
} else {
- $_params = implode(",", $_attr);
+ $_params = implode(',', $_attr);
$output = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})";
}
} else {
diff --git a/libs/sysplugins/smarty_internal_compile_private_php.php b/libs/sysplugins/smarty_internal_compile_private_php.php
index 9080c487..1d100f0d 100644
--- a/libs/sysplugins/smarty_internal_compile_private_php.php
+++ b/libs/sysplugins/smarty_internal_compile_private_php.php
@@ -40,38 +40,34 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
$compiler->has_code = false;
- if ($_attr[ 'type' ] == 'xml') {
+ if ($_attr[ 'type' ] === 'xml') {
$compiler->tag_nocache = true;
$output = addcslashes($_attr[ 'code' ], "'\\");
$compiler->parser->current_buffer->append_subtree($compiler->parser,
new Smarty_Internal_ParseTree_Tag($compiler->parser,
- $compiler->processNocacheCode("<?php echo '" .
- $output .
- "';?>",
+ $compiler->processNocacheCode("<?php echo '{$output}';?>",
true)));
return '';
}
- if ($_attr[ 'type' ] != 'tag') {
- if ($compiler->php_handling == Smarty::PHP_REMOVE) {
+ if ($_attr[ 'type' ] !== 'tag') {
+ if ($compiler->php_handling === Smarty::PHP_REMOVE) {
return '';
- } elseif ($compiler->php_handling == Smarty::PHP_QUOTE) {
+ } elseif ($compiler->php_handling === Smarty::PHP_QUOTE) {
$output =
preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i',
array($this, 'quote'), $_attr[ 'code' ]);
$compiler->parser->current_buffer->append_subtree($compiler->parser,
new Smarty_Internal_ParseTree_Text($output));
return '';
- } elseif ($compiler->php_handling == Smarty::PHP_PASSTHRU || $_attr[ 'type' ] == 'unmatched') {
+ } elseif ($compiler->php_handling === Smarty::PHP_PASSTHRU || $_attr[ 'type' ] === 'unmatched') {
$compiler->tag_nocache = true;
$output = addcslashes($_attr[ 'code' ], "'\\");
$compiler->parser->current_buffer->append_subtree($compiler->parser,
new Smarty_Internal_ParseTree_Tag($compiler->parser,
- $compiler->processNocacheCode("<?php echo '" .
- $output .
- "';?>",
+ $compiler->processNocacheCode("<?php echo '{$output}';?>",
true)));
return '';
- } elseif ($compiler->php_handling == Smarty::PHP_ALLOW) {
+ } elseif ($compiler->php_handling === Smarty::PHP_ALLOW) {
if (!($compiler->smarty instanceof SmartyBC)) {
$compiler->trigger_template_error('$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it',
null, true);
@@ -91,10 +87,10 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
$rdel = preg_quote($compiler->smarty->right_delimiter, '#');
preg_match("#^({$ldel}php\\s*)((.)*?)({$rdel})#", $_attr[ 'code' ], $match);
if (!empty($match[ 2 ])) {
- if ('nocache' == trim($match[ 2 ])) {
+ if ('nocache' === trim($match[ 2 ])) {
$compiler->tag_nocache = true;
} else {
- $compiler->trigger_template_error("illegal value of option flag \"{$match[2]}\"", null, true);
+ $compiler->trigger_template_error("illegal value of option flag '{$match[2]}'", null, true);
}
}
return preg_replace(array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#", "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"),
@@ -144,16 +140,16 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
return;
}
$closeTag = "{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}";
- if ($lex->value == $closeTag) {
+ if ($lex->value === $closeTag) {
$lex->compiler->trigger_template_error("unexpected closing tag '{$closeTag}'");
}
$lex->phpType = 'tag';
}
- if ($lex->phpType == 'unmatched') {
+ if ($lex->phpType === 'unmatched') {
return;
}
- if (($lex->phpType == 'php' || $lex->phpType == 'asp') &&
- ($lex->compiler->php_handling == Smarty::PHP_PASSTHRU || $lex->compiler->php_handling == Smarty::PHP_QUOTE)
+ if (($lex->phpType === 'php' || $lex->phpType === 'asp') &&
+ ($lex->compiler->php_handling === Smarty::PHP_PASSTHRU || $lex->compiler->php_handling === Smarty::PHP_QUOTE)
) {
return;
}
@@ -173,7 +169,7 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
$body = false;
} else {
$start = $pos + strlen($value);
- $phpCommentStart = $value == '/*';
+ $phpCommentStart = $value === '/*';
if ($phpCommentStart) {
$phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start);
if ($phpCommentEnd) {
diff --git a/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/libs/sysplugins/smarty_internal_compile_private_print_expression.php
index 55d70915..7e39a355 100644
--- a/libs/sysplugins/smarty_internal_compile_private_print_expression.php
+++ b/libs/sysplugins/smarty_internal_compile_private_print_expression.php
@@ -67,7 +67,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/',
$single_default_modifier, $mod_array);
for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i ++) {
- if ($mod_array[ 0 ][ $i ] != ':') {
+ if ($mod_array[ 0 ][ $i ] !== ':') {
$modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];
}
}
@@ -110,7 +110,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
}
}
foreach ($compiler->variable_filters as $filter) {
- if (count($filter) == 1 &&
+ if (count($filter) === 1 &&
($result = $this->compile_output_filter($compiler, $filter[ 0 ], $output)) !== false
) {
$output = $result;
diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php
index 987bc96f..bd88f1bf 100644
--- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php
+++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php
@@ -61,7 +61,7 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C
if (is_int($_key)) {
$_paramsArray[] = "$_key=>$_value";
} elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {
- $_value = str_replace("'", "^#^", $_value);
+ $_value = str_replace('\'', "^#^", $_value);
$_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
} else {
$_paramsArray[] = "'$_key'=>$_value";
diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/libs/sysplugins/smarty_internal_compile_private_registered_function.php
index 48c719e0..14a04c3b 100644
--- a/libs/sysplugins/smarty_internal_compile_private_registered_function.php
+++ b/libs/sysplugins/smarty_internal_compile_private_registered_function.php
@@ -56,13 +56,13 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
if (is_int($_key)) {
$_paramsArray[] = "$_key=>$_value";
} elseif ($compiler->template->caching && in_array($_key, $tag_info[ 2 ])) {
- $_value = str_replace("'", "^#^", $_value);
+ $_value = str_replace('\'', "^#^", $_value);
$_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
} else {
$_paramsArray[] = "'$_key'=>$_value";
}
}
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
// compile code
if ($is_registered) {
$output =
diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php
index 967b186f..7982a005 100644
--- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php
+++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php
@@ -114,7 +114,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
case 'rdelim':
return "\$_smarty_tpl->smarty->right_delimiter";
default:
- $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], "'") . ' is not defined');
+ $compiler->trigger_template_error('$smarty.' . trim($_index[ 0 ], '\'') . ' is not defined');
break;
}
if (isset($_index[ 1 ])) {
diff --git a/libs/sysplugins/smarty_internal_compile_section.php b/libs/sysplugins/smarty_internal_compile_section.php
index c530cc76..e3e4dc34 100644
--- a/libs/sysplugins/smarty_internal_compile_section.php
+++ b/libs/sysplugins/smarty_internal_compile_section.php
@@ -143,10 +143,10 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
}
if (isset($namedAttr[ 'loop' ])) {
$initNamedProperty[ 'loop' ] = "'loop' => {$v}";
- if ($t == 1) {
+ if ($t === 1) {
$v = "{$sectionVar}->value['loop']";
}
- } elseif ($t == 1) {
+ } elseif ($t === 1) {
$initLocal[ 'loop' ] = $v;
$v = "{$local}loop";
}
@@ -163,11 +163,11 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
case 'step':
if (is_numeric($attr_value)) {
$v = (int) $attr_value;
- $v = ($v == 0) ? 1 : $v;
+ $v = ($v === 0) ? 1 : $v;
$t = 0;
break;
}
- $initLocal[ 'step' ] = "((int)@$attr_value) == 0 ? 1 : (int)@$attr_value";
+ $initLocal[ 'step' ] = "((int)@$attr_value) === 0 ? 1 : (int)@$attr_value";
$v = "{$local}step";
$t = 2;
break;
@@ -183,7 +183,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
$t = 3;
break;
}
- if ($t == 3 && $compiler->getId($attr_value)) {
+ if ($t === 3 && $compiler->getId($attr_value)) {
$t = 1;
}
$propValue[ $attr_name ] = $v;
@@ -199,8 +199,8 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
$incFor[ 'iteration' ] = "{$propValue['iteration']}++";
$initFor[ 'iteration' ] = "{$propValue['iteration']} = 1";
- if ($propType[ 'step' ] == 0) {
- if ($propValue[ 'step' ] == 1) {
+ if ($propType[ 'step' ] === 0) {
+ if ($propValue[ 'step' ] === 1) {
$incFor[ 'index' ] = "{$sectionVar}->value['index']++";
} elseif ($propValue[ 'step' ] > 1) {
$incFor[ 'index' ] = "{$sectionVar}->value['index'] += {$propValue['step']}";
@@ -214,7 +214,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
if (!isset($propValue[ 'max' ])) {
$propValue[ 'max' ] = $propValue[ 'loop' ];
$propType[ 'max' ] = $propType[ 'loop' ];
- } elseif ($propType[ 'max' ] != 0) {
+ } elseif ($propType[ 'max' ] !== 0) {
$propValue[ 'max' ] = "{$propValue['max']} < 0 ? {$propValue['loop']} : {$propValue['max']}";
$propType[ 'max' ] = 1;
} else {
@@ -227,11 +227,11 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
if (!isset($propValue[ 'start' ])) {
$start_code =
array(1 => "{$propValue['step']} > 0 ? ", 2 => '0', 3 => ' : ', 4 => $propValue[ 'loop' ], 5 => ' - 1');
- if ($propType[ 'loop' ] == 0) {
+ if ($propType[ 'loop' ] === 0) {
$start_code[ 5 ] = '';
$start_code[ 4 ] = $propValue[ 'loop' ] - 1;
}
- if ($propType[ 'step' ] == 0) {
+ if ($propType[ 'step' ] === 0) {
if ($propValue[ 'step' ] > 0) {
$start_code = array(1 => '0');
$propType[ 'start' ] = 0;
@@ -249,9 +249,9 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
5 => ' : ', 6 => '-1', 7 => ', ', 8 => "{$propValue['start']} + {$propValue['loop']}", 10 => ')',
11 => ' : ', 12 => 'min(', 13 => $propValue[ 'start' ], 14 => ', ',
15 => "{$propValue['step']} > 0 ? ", 16 => $propValue[ 'loop' ], 17 => ' : ',
- 18 => $propType[ 'loop' ] == 0 ? $propValue[ 'loop' ] - 1 : "{$propValue['loop']} - 1",
+ 18 => $propType[ 'loop' ] === 0 ? $propValue[ 'loop' ] - 1 : "{$propValue['loop']} - 1",
19 => ')');
- if ($propType[ 'step' ] == 0) {
+ if ($propType[ 'step' ] === 0) {
$start_code[ 3 ] = $start_code[ 5 ] = $start_code[ 15 ] = $start_code[ 17 ] = '';
if ($propValue[ 'step' ] > 0) {
$start_code[ 6 ] = $start_code[ 18 ] = '';
@@ -259,8 +259,8 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
$start_code[ 4 ] = $start_code[ 16 ] = '';
}
}
- if ($propType[ 'start' ] == 0) {
- if ($propType[ 'loop' ] == 0) {
+ if ($propType[ 'start' ] === 0) {
+ if ($propType[ 'loop' ] === 0) {
$start_code[ 8 ] = $propValue[ 'start' ] + $propValue[ 'loop' ];
}
$propType[ 'start' ] = $propType[ 'step' ] + $propType[ 'loop' ];
@@ -269,7 +269,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
for ($i = 11; $i <= 19; $i ++) {
$start_code[ $i ] = '';
}
- if ($propType[ 'start' ] == 0) {
+ if ($propType[ 'start' ] === 0) {
$start_code = array(max($propValue[ 'step' ] > 0 ? 0 : - 1,
$propValue[ 'start' ] + $propValue[ 'loop' ]));
}
@@ -277,7 +277,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
for ($i = 1; $i <= 11; $i ++) {
$start_code[ $i ] = '';
}
- if ($propType[ 'start' ] == 0) {
+ if ($propType[ 'start' ] === 0) {
$start_code =
array(min($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] : $propValue[ 'loop' ] - 1,
$propValue[ 'start' ]));
@@ -286,7 +286,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
}
$propValue[ 'start' ] = join('', $start_code);
}
- if ($propType[ 'start' ] != 0) {
+ if ($propType[ 'start' ] !== 0) {
$initLocal[ 'start' ] = $propValue[ 'start' ];
$propValue[ 'start' ] = "{$local}start";
}
@@ -299,7 +299,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
} else {
$propType[ 'total' ] =
$propType[ 'start' ] + $propType[ 'loop' ] + $propType[ 'step' ] + $propType[ 'max' ];
- if ($propType[ 'total' ] == 0) {
+ if ($propType[ 'total' ] === 0) {
$propValue[ 'total' ] =
min(ceil(($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] - $propValue[ 'start' ] :
(int) $propValue[ 'start' ] + 1) / abs($propValue[ 'step' ])), $propValue[ 'max' ]);
@@ -311,17 +311,17 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
if (!isset($propValue[ 'max' ])) {
$total_code[ 1 ] = $total_code[ 17 ] = '';
}
- if ($propType[ 'loop' ] + $propType[ 'start' ] == 0) {
+ if ($propType[ 'loop' ] + $propType[ 'start' ] === 0) {
$total_code[ 5 ] = $propValue[ 'loop' ] - $propValue[ 'start' ];
$total_code[ 6 ] = $total_code[ 7 ] = '';
}
- if ($propType[ 'start' ] == 0) {
+ if ($propType[ 'start' ] === 0) {
$total_code[ 9 ] = (int) $propValue[ 'start' ] + 1;
$total_code[ 10 ] = '';
}
- if ($propType[ 'step' ] == 0) {
+ if ($propType[ 'step' ] === 0) {
$total_code[ 13 ] = $total_code[ 15 ] = '';
- if ($propValue[ 'step' ] == 1 || $propValue[ 'step' ] == - 1) {
+ if ($propValue[ 'step' ] === 1 || $propValue[ 'step' ] === - 1) {
$total_code[ 2 ] = $total_code[ 12 ] = $total_code[ 14 ] = $total_code[ 16 ] = '';
} elseif ($propValue[ 'step' ] < 0) {
$total_code[ 14 ] = - $propValue[ 'step' ];
@@ -358,9 +358,9 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
$_vars = 'array(' . join(', ', $initNamedProperty) . ')';
$output .= "{$sectionVar} = new Smarty_Variable({$_vars});\n";
- $cond_code = "{$propValue['total']} != 0";
- if ($propType[ 'total' ] == 0) {
- if ($propValue[ 'total' ] == 0) {
+ $cond_code = "{$propValue['total']} !== 0";
+ if ($propType[ 'total' ] === 0) {
+ if ($propValue[ 'total' ] === 0) {
$cond_code = 'false';
} else {
$cond_code = 'true';
@@ -369,7 +369,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
if ($propType[ 'show' ] > 0) {
$output .= "{$local}show = {$propValue['show']} ? {$cond_code} : false;\n";
$output .= "if ({$local}show) {\n";
- } elseif ($propValue[ 'show' ] == 'true') {
+ } elseif ($propValue[ 'show' ] === 'true') {
$output .= "if ({$cond_code}) {\n";
} else {
$output .= "if (false) {\n";
@@ -388,10 +388,10 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
$output .= "{$sectionVar}->value['index_next'] = {$propValue['index']} + {$propValue['step']};\n";
}
if (isset($namedAttr[ 'first' ])) {
- $output .= "{$sectionVar}->value['first'] = ({$propValue['iteration']} == 1);\n";
+ $output .= "{$sectionVar}->value['first'] = ({$propValue['iteration']} === 1);\n";
}
if (isset($namedAttr[ 'last' ])) {
- $output .= "{$sectionVar}->value['last'] = ({$propValue['iteration']} == {$propValue['total']});\n";
+ $output .= "{$sectionVar}->value['last'] = ({$propValue['iteration']} === {$propValue['total']});\n";
}
$output .= "?>";
@@ -455,7 +455,7 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase
$this->closeTag($compiler, array('section', 'sectionelse'));
$output = "<?php\n";
- if ($openTag == 'sectionelse') {
+ if ($openTag === 'sectionelse') {
$output .= "}\n";
} else {
$output .= "}\n}\n";
diff --git a/libs/sysplugins/smarty_internal_compile_while.php b/libs/sysplugins/smarty_internal_compile_while.php
index 6025798c..4689ef9d 100644
--- a/libs/sysplugins/smarty_internal_compile_while.php
+++ b/libs/sysplugins/smarty_internal_compile_while.php
@@ -55,12 +55,12 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase
$assignAttr[][ 'value' ] = "{$prefixVar}";
if (is_array($parameter[ 'if condition' ][ 'var' ])) {
$assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ];
- $_output = "<?php while ({$prefixVar} = " . $parameter[ 'if condition' ][ 'value' ] . ") {?>";
+ $_output = "<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>";
$_output .= $assignCompiler->compile($assignAttr, $compiler,
array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]));
} else {
$assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ];
- $_output = "<?php while ({$prefixVar} = " . $parameter[ 'if condition' ][ 'value' ] . ") {?>";
+ $_output = "<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>";
$_output .= $assignCompiler->compile($assignAttr, $compiler, array());
}
diff --git a/libs/sysplugins/smarty_internal_compilebase.php b/libs/sysplugins/smarty_internal_compilebase.php
index 3fae8acd..656672b9 100644
--- a/libs/sysplugins/smarty_internal_compilebase.php
+++ b/libs/sysplugins/smarty_internal_compilebase.php
@@ -46,14 +46,14 @@ abstract class Smarty_Internal_CompileBase
/**
* Mapping array for boolean option value
- *
+ *
* @var array
*/
public $optionMap = array(1 => true, 0 => false, 'true' => true, 'false' => false);
/**
* Mapping array with attributes as key
- *
+ *
* @var array
*/
public $mapCache = array();
@@ -117,11 +117,11 @@ abstract class Smarty_Internal_CompileBase
// check if all required attributes present
foreach ($this->required_attributes as $attr) {
if (!isset($_indexed_attr[ $attr ])) {
- $compiler->trigger_template_error("missing \"" . $attr . "\" attribute", null, true);
+ $compiler->trigger_template_error("missing '{$attr}' attribute", null, true);
}
}
// check for not allowed attributes
- if ($this->optional_attributes != array('_any')) {
+ if ($this->optional_attributes !== array('_any')) {
if (!isset($this->mapCache[ 'all' ])) {
$this->mapCache[ 'all' ] =
array_fill_keys(array_merge($this->required_attributes, $this->optional_attributes,
@@ -129,7 +129,7 @@ abstract class Smarty_Internal_CompileBase
}
foreach ($_indexed_attr as $key => $dummy) {
if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) {
- $compiler->trigger_template_error("unexpected \"" . $key . "\" attribute", null, true);
+ $compiler->trigger_template_error("unexpected '{$key}' attribute", null, true);
}
}
}
@@ -183,13 +183,12 @@ abstract class Smarty_Internal_CompileBase
}
}
// wrong nesting of tags
- $compiler->trigger_template_error("unclosed {$compiler->smarty->left_delimiter}" . $_openTag .
- "{$compiler->smarty->right_delimiter} tag");
+ $compiler->trigger_template_error("unclosed '{$compiler->smarty->left_delimiter}{$_openTag}{$compiler->smarty->right_delimiter}' tag");
return;
}
// wrong nesting of tags
- $compiler->trigger_template_error("unexpected closing tag", null, true);
+ $compiler->trigger_template_error('unexpected closing tag', null, true);
return;
}
diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php
index 6b5d1e75..ada38869 100644
--- a/libs/sysplugins/smarty_internal_config_file_compiler.php
+++ b/libs/sysplugins/smarty_internal_config_file_compiler.php
@@ -152,7 +152,7 @@ class Smarty_Internal_Config_File_Compiler
$template_header =
"<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") .
"\n";
- $template_header .= " compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";
+ $template_header .= " compiled from '{$this->template->source->filepath}' */ ?>\n";
$code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .
var_export($this->config_data, true) . '); ?>';
diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php
index 58febbf2..37b917b1 100644
--- a/libs/sysplugins/smarty_internal_data.php
+++ b/libs/sysplugins/smarty_internal_data.php
@@ -29,7 +29,7 @@
* @method Smarty_Internal_Data clearConfig(string $varName = null)
* @method Smarty_Internal_Data configLoad(string $config_file, mixed $sections = null, string $scope = 'local')
*/
-class Smarty_Internal_Data
+abstract class Smarty_Internal_Data
{
/**
* This object type (Smarty = 1, template = 2, data = 4)
@@ -55,7 +55,7 @@ class Smarty_Internal_Data
/**
* parent template (if any)
*
- * @var Smarty|Smarty_Internal_Template|Smarty_Internal_Data
+ * @var Smarty|Smarty_Internal_Template|Smarty_Data
*/
public $parent = null;
@@ -101,7 +101,7 @@ class Smarty_Internal_Data
$this->assign($_key, $_val, $nocache);
}
} else {
- if ($tpl_var != '') {
+ if ($tpl_var !== '') {
if ($this->_objType === 2) {
/** @var Smarty_Internal_Template $this */
$this->_assignInScope($tpl_var, $value, $nocache);
diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php
index 20d72381..c826a178 100644
--- a/libs/sysplugins/smarty_internal_debug.php
+++ b/libs/sysplugins/smarty_internal_debug.php
@@ -213,7 +213,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
// init properties by hand as user may have edited the original Smarty class
$debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir());
$debObj->force_compile = false;
- $debObj->compile_check = true;
+ $debObj->compile_check = Smarty::COMPILECHECK_ON;
$debObj->left_delimiter = '{';
$debObj->right_delimiter = '}';
$debObj->security_policy = null;
@@ -227,7 +227,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
$debObj->autoload_filters = array();
$debObj->default_modifiers = array();
$debObj->escape_html = true;
- $debObj->caching = false;
+ $debObj->caching = Smarty::CACHING_OFF;
$debObj->compile_id = null;
$debObj->cache_id = null;
// prepare information of assigned variables
@@ -242,7 +242,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
if ($obj->_isTplObj()) {
$_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
}
- if ($obj->_objType == 1 || $full) {
+ if ($obj->_objType === 1 || $full) {
$_template->assign('template_data', $this->template_data[ $this->index ]);
} else {
$_template->assign('template_data', null);
@@ -250,7 +250,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
$_template->assign('assigned_vars', $_assigned_vars);
$_template->assign('config_vars', $_config_vars);
$_template->assign('execution_time', microtime(true) - $smarty->start_time);
- $_template->assign('display_mode', $debugging == 2 || !$full);
+ $_template->assign('display_mode', $debugging === 2 || !$full);
$_template->assign('offset', $this->offset * 50);
echo $_template->fetch();
if (isset($full)) {
@@ -284,15 +284,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
$tpl_vars = array();
foreach ($obj->tpl_vars as $key => $var) {
foreach ($var as $varkey => $varvalue) {
- if ($varkey == 'value') {
+ if ($varkey === 'value') {
$tpl_vars[ $key ][ $varkey ] = $varvalue;
} else {
- if ($varkey == 'nocache') {
- if ($varvalue == true) {
+ if ($varkey === 'nocache') {
+ if ($varvalue === true) {
$tpl_vars[ $key ][ $varkey ] = $varvalue;
}
} else {
- if ($varkey != 'scope' || $varvalue !== 0) {
+ if ($varkey !== 'scope' || $varvalue !== 0) {
$tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;
}
}
@@ -326,15 +326,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
foreach (Smarty::$global_tpl_vars as $key => $var) {
if (!array_key_exists($key, $tpl_vars)) {
foreach ($var as $varkey => $varvalue) {
- if ($varkey == 'value') {
+ if ($varkey === 'value') {
$tpl_vars[ $key ][ $varkey ] = $varvalue;
} else {
- if ($varkey == 'nocache') {
- if ($varvalue == true) {
+ if ($varkey === 'nocache') {
+ if ($varvalue === true) {
$tpl_vars[ $key ][ $varkey ] = $varvalue;
}
} else {
- if ($varkey != 'scope' || $varvalue !== 0) {
+ if ($varkey !== 'scope' || $varvalue !== 0) {
$tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue;
}
}
@@ -359,7 +359,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
{
static $_is_stringy = array('string' => true, 'eval' => true);
// calculate Uid if not already done
- if ($template->source->uid == '') {
+ if ($template->source->uid === '') {
$template->source->filepath;
}
$key = $template->source->uid;
@@ -389,7 +389,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
public function ignore(Smarty_Internal_Template $template)
{
// calculate Uid if not already done
- if ($template->source->uid == '') {
+ if ($template->source->uid === '') {
$template->source->filepath;
}
$this->ignore_uid[ $template->source->uid ] = true;
diff --git a/libs/sysplugins/smarty_internal_extension_handler.php b/libs/sysplugins/smarty_internal_extension_handler.php
index cdda69fa..4d7b04fa 100644
--- a/libs/sysplugins/smarty_internal_extension_handler.php
+++ b/libs/sysplugins/smarty_internal_extension_handler.php
@@ -111,9 +111,9 @@ class Smarty_Internal_Extension_Handler
}
if ($propertyType) {
$obj = $propertyType === 1 ? $data : $smarty;
- if ($match[2] == 'get') {
+ if ($match[2] === 'get') {
return $obj->$property;
- } else if ($match[2] == 'set') {
+ } else if ($match[2] === 'set') {
return $obj->$property = $args[0];
}
}
@@ -154,7 +154,7 @@ class Smarty_Internal_Extension_Handler
public function __get($property_name)
{
// object properties of runtime template extensions will start with '_'
- if ($property_name[0] == '_') {
+ if ($property_name[0] === '_') {
$class = 'Smarty_Internal_Runtime' . $this->upperCase($property_name);
} else {
$class = 'Smarty_Internal_Method_' . $this->upperCase($property_name);
diff --git a/libs/sysplugins/smarty_internal_method_append.php b/libs/sysplugins/smarty_internal_method_append.php
index af693591..a1422cf5 100644
--- a/libs/sysplugins/smarty_internal_method_append.php
+++ b/libs/sysplugins/smarty_internal_method_append.php
@@ -38,12 +38,12 @@ class Smarty_Internal_Method_Append
if (is_array($tpl_var)) {
// $tpl_var is an array, ignore $value
foreach ($tpl_var as $_key => $_val) {
- if ($_key != '') {
+ if ($_key !== '') {
$this->append($data, $_key, $_val, $merge, $nocache);
}
}
} else {
- if ($tpl_var != '' && isset($value)) {
+ if ($tpl_var !== '' && isset($value)) {
if (!isset($data->tpl_vars[ $tpl_var ])) {
$tpl_var_inst = $data->ext->getTemplateVars->_getVariable($data, $tpl_var, null, true, false);
if ($tpl_var_inst instanceof Smarty_Undefined_Variable) {
diff --git a/libs/sysplugins/smarty_internal_method_appendbyref.php b/libs/sysplugins/smarty_internal_method_appendbyref.php
index 532ac950..9185a8e8 100644
--- a/libs/sysplugins/smarty_internal_method_appendbyref.php
+++ b/libs/sysplugins/smarty_internal_method_appendbyref.php
@@ -27,7 +27,7 @@ class Smarty_Internal_Method_AppendByRef
*/
public static function appendByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $merge = false)
{
- if ($tpl_var != '' && isset($value)) {
+ if ($tpl_var !== '' && isset($value)) {
if (!isset($data->tpl_vars[ $tpl_var ])) {
$data->tpl_vars[ $tpl_var ] = new Smarty_Variable();
}
diff --git a/libs/sysplugins/smarty_internal_method_assignbyref.php b/libs/sysplugins/smarty_internal_method_assignbyref.php
index 0060bbc5..1c513ce9 100644
--- a/libs/sysplugins/smarty_internal_method_assignbyref.php
+++ b/libs/sysplugins/smarty_internal_method_assignbyref.php
@@ -24,7 +24,7 @@ class Smarty_Internal_Method_AssignByRef
*/
public function assignByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $nocache)
{
- if ($tpl_var != '') {
+ if ($tpl_var !== '') {
$data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);
$data->tpl_vars[ $tpl_var ]->value = &$value;
if ($data->_isTplObj() && $data->scope) {
diff --git a/libs/sysplugins/smarty_internal_method_assignglobal.php b/libs/sysplugins/smarty_internal_method_assignglobal.php
index 3c2b2604..0e169041 100644
--- a/libs/sysplugins/smarty_internal_method_assignglobal.php
+++ b/libs/sysplugins/smarty_internal_method_assignglobal.php
@@ -30,7 +30,7 @@ class Smarty_Internal_Method_AssignGlobal
*/
public function assignGlobal(Smarty_Internal_Data $data, $varName, $value = null, $nocache = false)
{
- if ($varName != '') {
+ if ($varName !== '') {
Smarty::$global_tpl_vars[ $varName ] = new Smarty_Variable($value, $nocache);
$ptr = $data;
while ($ptr->_isTplObj()) {
diff --git a/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php
index 6a3292d0..c019c59d 100644
--- a/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php
+++ b/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php
@@ -44,7 +44,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate
$_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
if (isset($resource_name)) {
$_save_stat = $smarty->caching;
- $smarty->caching = false;
+ $smarty->caching = Smarty::CACHING_OFF;
/* @var Smarty_Internal_Template $tpl */
$tpl = $smarty->createTemplate($resource_name);
$smarty->caching = $_save_stat;
@@ -104,7 +104,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate
$_resource_part_2_length) === 0))
) {
if (isset($exp_time)) {
- if (is_file($_filepath) && time() - @filemtime($_filepath) >= $exp_time) {
+ if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) {
$unlink = true;
}
} else {
@@ -114,7 +114,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate
if ($unlink && is_file($_filepath) && @unlink($_filepath)) {
$_count++;
if (function_exists('opcache_invalidate')
- && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1)
+ && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1)
) {
opcache_invalidate($_filepath, true);
} else if (function_exists('apc_delete_file')) {
diff --git a/libs/sysplugins/smarty_internal_method_compilealltemplates.php b/libs/sysplugins/smarty_internal_method_compilealltemplates.php
index 95486085..99b9df46 100644
--- a/libs/sysplugins/smarty_internal_method_compilealltemplates.php
+++ b/libs/sysplugins/smarty_internal_method_compilealltemplates.php
@@ -72,10 +72,10 @@ class Smarty_Internal_Method_CompileAllTemplates
$_dir_2 = new RecursiveIteratorIterator($_dir_1);
foreach ($_dir_2 as $_fileinfo) {
$_file = $_fileinfo->getFilename();
- if (substr(basename($_fileinfo->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) {
+ if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) {
continue;
}
- if (!substr_compare($_file, $extension, -strlen($extension)) == 0) {
+ if (!substr_compare($_file, $extension, -strlen($extension)) === 0) {
continue;
}
if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) {
@@ -85,7 +85,7 @@ class Smarty_Internal_Method_CompileAllTemplates
flush();
$_start_time = microtime(true);
$_smarty = clone $smarty;
- //
+ //
$_smarty->_cache = array();
$_smarty->ext = new Smarty_Internal_Extension_Handler();
$_smarty->ext->objType = $_smarty->_objType;
@@ -113,7 +113,7 @@ class Smarty_Internal_Method_CompileAllTemplates
// free memory
unset($_tpl);
$_smarty->_clearTemplateCache();
- if ($max_errors !== null && $_error_count == $max_errors) {
+ if ($max_errors !== null && $_error_count === $max_errors) {
echo "\n<br><br>too many errors\n";
exit();
}
diff --git a/libs/sysplugins/smarty_internal_method_configload.php b/libs/sysplugins/smarty_internal_method_configload.php
index d33c3d15..eb8672fe 100644
--- a/libs/sysplugins/smarty_internal_method_configload.php
+++ b/libs/sysplugins/smarty_internal_method_configload.php
@@ -83,7 +83,7 @@ class Smarty_Internal_Method_ConfigLoad
$this->_assignConfigVars($tpl->parent->config_vars, $tpl, $new_config_vars);
$tagScope = $tpl->source->scope;
if ($tagScope >= 0) {
- if ($tagScope == Smarty::SCOPE_LOCAL) {
+ if ($tagScope === Smarty::SCOPE_LOCAL) {
$this->_updateVarStack($tpl, $new_config_vars);
$tagScope = 0;
if (!$tpl->scope) {
diff --git a/libs/sysplugins/smarty_internal_method_gettags.php b/libs/sysplugins/smarty_internal_method_gettags.php
index f195fc46..afaa4b91 100644
--- a/libs/sysplugins/smarty_internal_method_gettags.php
+++ b/libs/sysplugins/smarty_internal_method_gettags.php
@@ -53,11 +53,11 @@ class Smarty_Internal_Method_GetTags
$tpl->_cache[ 'used_tags' ] = array();
$tpl->smarty->merge_compiled_includes = false;
$tpl->smarty->disableSecurity();
- $tpl->caching = false;
+ $tpl->caching = Smarty::CACHING_OFF;
$tpl->loadCompiler();
$tpl->compiler->compileTemplate($tpl);
return $tpl->_cache[ 'used_tags' ];
}
- throw new SmartyException("Missing template specification");
+ throw new SmartyException('Missing template specification');
}
} \ No newline at end of file
diff --git a/libs/sysplugins/smarty_internal_method_loadfilter.php b/libs/sysplugins/smarty_internal_method_loadfilter.php
index d092d876..239fd6dd 100644
--- a/libs/sysplugins/smarty_internal_method_loadfilter.php
+++ b/libs/sysplugins/smarty_internal_method_loadfilter.php
@@ -58,7 +58,7 @@ class Smarty_Internal_Method_LoadFilter
return true;
}
}
- throw new SmartyException("{$type}filter \"{$name}\" not found or callable");
+ throw new SmartyException("{$type}filter '{$name}' not found or callable");
}
/**
@@ -71,7 +71,7 @@ class Smarty_Internal_Method_LoadFilter
public function _checkFilterType($type)
{
if (!isset($this->filterTypes[ $type ])) {
- throw new SmartyException("Illegal filter type \"{$type}\"");
+ throw new SmartyException("Illegal filter type '{$type}'");
}
}
} \ No newline at end of file
diff --git a/libs/sysplugins/smarty_internal_method_loadplugin.php b/libs/sysplugins/smarty_internal_method_loadplugin.php
index 50f3bfc2..2454d9c9 100644
--- a/libs/sysplugins/smarty_internal_method_loadplugin.php
+++ b/libs/sysplugins/smarty_internal_method_loadplugin.php
@@ -76,7 +76,7 @@ class Smarty_Internal_Method_LoadPlugin
}
}
$_file_names = array($_plugin_filename);
- if ($_lower_filename != $_plugin_filename) {
+ if ($_lower_filename !== $_plugin_filename) {
$_file_names[] = $_lower_filename;
}
$_p_dirs = $smarty->getPluginsDir();
diff --git a/libs/sysplugins/smarty_internal_method_mustcompile.php b/libs/sysplugins/smarty_internal_method_mustcompile.php
index 0950ba9c..62c16f62 100644
--- a/libs/sysplugins/smarty_internal_method_mustcompile.php
+++ b/libs/sysplugins/smarty_internal_method_mustcompile.php
@@ -41,7 +41,7 @@ class Smarty_Internal_Method_MustCompile
if ($_template->mustCompile === null) {
$_template->mustCompile = (!$_template->source->handler->uncompiled &&
($_template->smarty->force_compile || $_template->source->handler->recompiled ||
- !$_template->compiled->exists || ($_template->smarty->compile_check &&
+ !$_template->compiled->exists || ($_template->compile_check &&
$_template->compiled->getTimeStamp() <
$_template->source->getTimeStamp())));
}
diff --git a/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php b/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php
index 43088a1d..c8c5ae73 100644
--- a/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php
+++ b/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php
@@ -35,7 +35,7 @@ class Smarty_Internal_Method_RegisterDefaultConfigHandler
if (is_callable($callback)) {
$smarty->default_config_handler_func = $callback;
} else {
- throw new SmartyException("Default config handler not callable");
+ throw new SmartyException('Default config handler not callable');
}
return $obj;
}
diff --git a/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php b/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php
index 569ea106..4c5d396e 100644
--- a/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php
+++ b/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php
@@ -35,7 +35,7 @@ class Smarty_Internal_Method_RegisterDefaultTemplateHandler
if (is_callable($callback)) {
$smarty->default_template_handler_func = $callback;
} else {
- throw new SmartyException("Default template handler not callable");
+ throw new SmartyException('Default template handler not callable');
}
return $obj;
}
@@ -62,7 +62,7 @@ class Smarty_Internal_Method_RegisterDefaultTemplateHandler
if ($source->exists) {
$source->timestamp = filemtime($_return);
} else {
- throw new SmartyException("Default handler: Unable to load " .
+ throw new SmartyException('Default handler: Unable to load ' .
($source->isConfig ? 'config' : 'template') .
" default file '{$_return}' for '{$source->type}:{$source->name}'");
}
diff --git a/libs/sysplugins/smarty_internal_method_registerfilter.php b/libs/sysplugins/smarty_internal_method_registerfilter.php
index ea8f75a8..77e41f37 100644
--- a/libs/sysplugins/smarty_internal_method_registerfilter.php
+++ b/libs/sysplugins/smarty_internal_method_registerfilter.php
@@ -46,7 +46,7 @@ class Smarty_Internal_Method_RegisterFilter
$this->_checkFilterType($type);
$name = isset($name) ? $name : $this->_getFilterName($callback);
if (!is_callable($callback)) {
- throw new SmartyException("{$type}filter \"{$name}\" not callable");
+ throw new SmartyException("{$type}filter '{$name}' not callable");
}
$smarty->registered_filters[ $type ][ $name ] = $callback;
return $obj;
@@ -82,7 +82,7 @@ class Smarty_Internal_Method_RegisterFilter
public function _checkFilterType($type)
{
if (!isset($this->filterTypes[ $type ])) {
- throw new SmartyException("Illegal filter type \"{$type}\"");
+ throw new SmartyException("Illegal filter type '{$type}'");
}
}
} \ No newline at end of file
diff --git a/libs/sysplugins/smarty_internal_method_registerplugin.php b/libs/sysplugins/smarty_internal_method_registerplugin.php
index 91f06592..64bf0ef1 100644
--- a/libs/sysplugins/smarty_internal_method_registerplugin.php
+++ b/libs/sysplugins/smarty_internal_method_registerplugin.php
@@ -40,9 +40,9 @@ class Smarty_Internal_Method_RegisterPlugin
{
$smarty = $obj->_getSmartyObj();
if (isset($smarty->registered_plugins[ $type ][ $name ])) {
- throw new SmartyException("Plugin tag \"{$name}\" already registered");
+ throw new SmartyException("Plugin tag '{$name}' already registered");
} elseif (!is_callable($callback)) {
- throw new SmartyException("Plugin \"{$name}\" not callable");
+ throw new SmartyException("Plugin '{$name}' not callable");
} else {
$smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool) $cacheable, (array) $cache_attr);
}
diff --git a/libs/sysplugins/smarty_internal_method_setautoloadfilters.php b/libs/sysplugins/smarty_internal_method_setautoloadfilters.php
index ebcfe727..29653b08 100644
--- a/libs/sysplugins/smarty_internal_method_setautoloadfilters.php
+++ b/libs/sysplugins/smarty_internal_method_setautoloadfilters.php
@@ -65,7 +65,7 @@ class Smarty_Internal_Method_SetAutoloadFilters
public function _checkFilterType($type)
{
if (!isset($this->filterTypes[ $type ])) {
- throw new SmartyException("Illegal filter type \"{$type}\"");
+ throw new SmartyException("Illegal filter type '{$type}'");
}
}
} \ No newline at end of file
diff --git a/libs/sysplugins/smarty_internal_nocache_insert.php b/libs/sysplugins/smarty_internal_nocache_insert.php
index 65fc143c..2629d51f 100644
--- a/libs/sysplugins/smarty_internal_nocache_insert.php
+++ b/libs/sysplugins/smarty_internal_nocache_insert.php
@@ -30,7 +30,7 @@ class Smarty_Internal_Nocache_Insert
public static function compile($_function, $_attr, $_template, $_script, $_assign = null)
{
$_output = '<?php ';
- if ($_script != 'null') {
+ if ($_script !== 'null') {
// script which must be included
// code for script file loading
$_output .= "require_once '{$_script}';";
@@ -38,16 +38,15 @@ class Smarty_Internal_Nocache_Insert
// call insert
if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) .
- ",\$_smarty_tpl), true);?>";
+ ',\$_smarty_tpl), true);?>';
} else {
- $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";
+ $_output .= "echo {$_function}(" . var_export($_attr, true) . ',$_smarty_tpl);?>';
}
$_tpl = $_template;
while ($_tpl->_isSubTpl()) {
$_tpl = $_tpl->parent;
}
- return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/" . $_output .
- "/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/";
+ return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/";
}
}
diff --git a/libs/sysplugins/smarty_internal_parsetree_code.php b/libs/sysplugins/smarty_internal_parsetree_code.php
index d0f0b3fd..7bd0bc45 100644
--- a/libs/sysplugins/smarty_internal_parsetree_code.php
+++ b/libs/sysplugins/smarty_internal_parsetree_code.php
@@ -37,6 +37,6 @@ class Smarty_Internal_ParseTree_Code extends Smarty_Internal_ParseTree
*/
public function to_smarty_php(Smarty_Internal_Templateparser $parser)
{
- return sprintf("(%s)", $this->data);
+ return sprintf('(%s)', $this->data);
}
}
diff --git a/libs/sysplugins/smarty_internal_parsetree_dq.php b/libs/sysplugins/smarty_internal_parsetree_dq.php
index 8c2e0d99..a57e629c 100644
--- a/libs/sysplugins/smarty_internal_parsetree_dq.php
+++ b/libs/sysplugins/smarty_internal_parsetree_dq.php
@@ -74,8 +74,8 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree
{
$code = '';
foreach ($this->subtrees as $subtree) {
- if ($code !== "") {
- $code .= ".";
+ if ($code !== '') {
+ $code .= '.';
}
if ($subtree instanceof Smarty_Internal_ParseTree_Tag) {
$more_php = $subtree->assign_to_var($parser);
diff --git a/libs/sysplugins/smarty_internal_parsetree_tag.php b/libs/sysplugins/smarty_internal_parsetree_tag.php
index 9058aabf..8e19ec29 100644
--- a/libs/sysplugins/smarty_internal_parsetree_tag.php
+++ b/libs/sysplugins/smarty_internal_parsetree_tag.php
@@ -62,7 +62,7 @@ class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree
$var = $parser->compiler->getNewPrefixVariable();
$tmp = $parser->compiler->appendCode('<?php ob_start();?>', $this->data);
$tmp = $parser->compiler->appendCode($tmp, "<?php {$var}=ob_get_clean();?>");
- $parser->compiler->prefix_code[] = sprintf("%s", $tmp);
+ $parser->compiler->prefix_code[] = sprintf('%s', $tmp);
return $var;
}
diff --git a/libs/sysplugins/smarty_internal_parsetree_template.php b/libs/sysplugins/smarty_internal_parsetree_template.php
index f6032351..26612d4c 100644
--- a/libs/sysplugins/smarty_internal_parsetree_template.php
+++ b/libs/sysplugins/smarty_internal_parsetree_template.php
@@ -91,14 +91,14 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text) {
$subtree = $this->subtrees[ $key ]->to_smarty_php($parser);
while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Text ||
- $this->subtrees[ $key + 1 ]->data == '')) {
+ $this->subtrees[ $key + 1 ]->data === '')) {
$key ++;
- if ($this->subtrees[ $key ]->data == '') {
+ if ($this->subtrees[ $key ]->data === '') {
continue;
}
$subtree .= $this->subtrees[ $key ]->to_smarty_php($parser);
}
- if ($subtree == '') {
+ if ($subtree === '') {
continue;
}
$code .= preg_replace('/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', "<?php echo '\$1'; ?>\n",
@@ -108,14 +108,14 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Tag) {
$subtree = $this->subtrees[ $key ]->to_smarty_php($parser);
while ($key + 1 < $cnt && ($this->subtrees[ $key + 1 ] instanceof Smarty_Internal_ParseTree_Tag ||
- $this->subtrees[ $key + 1 ]->data == '')) {
+ $this->subtrees[ $key + 1 ]->data === '')) {
$key ++;
- if ($this->subtrees[ $key ]->data == '') {
+ if ($this->subtrees[ $key ]->data === '') {
continue;
}
$subtree = $parser->compiler->appendCode($subtree, $this->subtrees[ $key ]->to_smarty_php($parser));
}
- if ($subtree == '') {
+ if ($subtree === '') {
continue;
}
$code .= $subtree;
diff --git a/libs/sysplugins/smarty_internal_resource_extends.php b/libs/sysplugins/smarty_internal_resource_extends.php
index 147b5851..23a62472 100644
--- a/libs/sysplugins/smarty_internal_resource_extends.php
+++ b/libs/sysplugins/smarty_internal_resource_extends.php
@@ -42,7 +42,7 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource
foreach ($components as $component) {
/* @var \Smarty_Template_Source $_s */
$_s = Smarty_Template_Source::load(null, $smarty, $component);
- if ($_s->type == 'php') {
+ if ($_s->type === 'php') {
throw new SmartyException("Resource type {$_s->type} cannot be used with the extends resource type");
}
$sources[ $_s->uid ] = $_s;
diff --git a/libs/sysplugins/smarty_internal_resource_php.php b/libs/sysplugins/smarty_internal_resource_php.php
index 6e9351d9..6f685abe 100644
--- a/libs/sysplugins/smarty_internal_resource_php.php
+++ b/libs/sysplugins/smarty_internal_resource_php.php
@@ -85,10 +85,10 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File
public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)
{
if (!$source->smarty->allow_php_templates) {
- throw new SmartyException("PHP templates are disabled");
+ throw new SmartyException('PHP templates are disabled');
}
if (!$source->exists) {
- throw new SmartyException("Unable to load template {$source->type} '{$source->name}'" .
+ throw new SmartyException("Unable to load template '{$source->type}:{$source->name}'" .
($_template->_isSubTpl() ? " in '{$_template->parent->template_resource}'" : ''));
}
diff --git a/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php b/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php
index 59863ad0..a9ff5789 100644
--- a/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php
+++ b/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php
@@ -32,7 +32,7 @@ class Smarty_Internal_Runtime_CacheResourceFile
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
$_dir = $smarty->getCacheDir();
- if ($_dir == '/') { //We should never want to delete this!
+ if ($_dir === '/') { //We should never want to delete this!
return 0;
}
$_dir_length = strlen($_dir);
@@ -47,7 +47,7 @@ class Smarty_Internal_Runtime_CacheResourceFile
}
if (isset($resource_name)) {
$_save_stat = $smarty->caching;
- $smarty->caching = true;
+ $smarty->caching = Smarty::CACHING_LIFETIME_CURRENT;
$tpl = new $smarty->template_class($resource_name, $smarty);
$smarty->caching = $_save_stat;
// remove from template cache
@@ -64,7 +64,7 @@ class Smarty_Internal_Runtime_CacheResourceFile
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($_cache as $_file) {
- if (substr(basename($_file->getPathname()), 0, 1) == '.') {
+ if (substr(basename($_file->getPathname()), 0, 1) === '.') {
continue;
}
$_filepath = (string)$_file;
@@ -83,13 +83,13 @@ class Smarty_Internal_Runtime_CacheResourceFile
$_parts_count = count($_parts);
// check name
if (isset($resource_name)) {
- if ($_parts[ $_parts_count - 1 ] != $_resourcename_parts) {
+ if ($_parts[ $_parts_count - 1 ] !== $_resourcename_parts) {
continue;
}
}
// check compile id
if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) ||
- $_parts[ $_parts_count - 2 - $_compile_id_offset ] != $_compile_id)
+ $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id)
) {
continue;
}
@@ -102,7 +102,7 @@ class Smarty_Internal_Runtime_CacheResourceFile
continue;
}
for ($i = 0; $i < $_cache_id_parts_count; $i++) {
- if ($_parts[ $i ] != $_cache_id_parts[ $i ]) {
+ if ($_parts[ $i ] !== $_cache_id_parts[ $i ]) {
continue 2;
}
}
@@ -112,11 +112,11 @@ class Smarty_Internal_Runtime_CacheResourceFile
if (isset($exp_time)) {
if ($exp_time < 0) {
preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_filepath), $match);
- if ($_time < (@filemtime($_filepath) + $match[ 1 ])) {
+ if ($_time < (filemtime($_filepath) + $match[ 1 ])) {
continue;
}
} else {
- if ($_time - @filemtime($_filepath) < $exp_time) {
+ if ($_time - filemtime($_filepath) < $exp_time) {
continue;
}
}
diff --git a/libs/sysplugins/smarty_internal_runtime_capture.php b/libs/sysplugins/smarty_internal_runtime_capture.php
index 18da7e8a..80ffa35b 100644
--- a/libs/sysplugins/smarty_internal_runtime_capture.php
+++ b/libs/sysplugins/smarty_internal_runtime_capture.php
@@ -130,7 +130,7 @@ class Smarty_Internal_Runtime_Capture
*/
public function error(Smarty_Internal_Template $_template)
{
- throw new SmartyException("Not matching {capture}{/capture} in \"{$_template->template_resource}\"");
+ throw new SmartyException("Not matching {capture}{/capture} in '{$_template->template_resource}'");
}
/**
diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php
index fb1e9510..5dd560b2 100644
--- a/libs/sysplugins/smarty_internal_runtime_codeframe.php
+++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php
@@ -42,15 +42,16 @@ class Smarty_Internal_Runtime_CodeFrame
}
$output = "<?php\n";
$output .= "/* Smarty version {$properties[ 'version' ]}, created on " . strftime("%Y-%m-%d %H:%M:%S") .
- "\n from \"" . str_replace('*/','* /',$_template->source->filepath) . "\" */\n\n";
+ "\n from '" . str_replace('*/','* /',$_template->source->filepath) . "' */\n\n";
$output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n";
$dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' .
- ($cache ? 'true' : 'false') . ")";
+ ($cache ? 'true' : 'false') . ')';
$output .= "if ({$dec}) {\n";
$output .= "function {$properties['unifunc']} (Smarty_Internal_Template \$_smarty_tpl) {\n";
if (!$cache && !empty($compiler->tpl_function)) {
- $output .= "\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
- var_export($compiler->tpl_function, true) . ");\n";
+ $output .= '$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, ';
+ $output .= var_export($compiler->tpl_function, true);
+ $output .= ");\n";
}
if ($cache && isset($_template->smarty->ext->_tplFunction)) {
$output .= "\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
diff --git a/libs/sysplugins/smarty_internal_runtime_filterhandler.php b/libs/sysplugins/smarty_internal_runtime_filterhandler.php
index f6cfa7c4..9d7d2db2 100644
--- a/libs/sysplugins/smarty_internal_runtime_filterhandler.php
+++ b/libs/sysplugins/smarty_internal_runtime_filterhandler.php
@@ -48,11 +48,11 @@ class Smarty_Internal_Runtime_FilterHandler
// loaded class of filter plugin
$callback = array($plugin_name, 'execute');
} else {
- throw new SmartyException("Auto load {$type}-filter plugin method \"{$plugin_name}::execute\" not callable");
+ throw new SmartyException("Auto load {$type}-filter plugin method '{$plugin_name}::execute' not callable");
}
} else {
// nothing found, throw exception
- throw new SmartyException("Unable to auto load {$type}-filter plugin \"{$plugin_name}\"");
+ throw new SmartyException("Unable to auto load {$type}-filter plugin '{$plugin_name}'");
}
$content = call_user_func($callback, $content, $template);
}
diff --git a/libs/sysplugins/smarty_internal_runtime_inheritance.php b/libs/sysplugins/smarty_internal_runtime_inheritance.php
index cca2c74a..84607ad6 100644
--- a/libs/sysplugins/smarty_internal_runtime_inheritance.php
+++ b/libs/sysplugins/smarty_internal_runtime_inheritance.php
@@ -70,7 +70,7 @@ class Smarty_Internal_Runtime_Inheritance
public function init(Smarty_Internal_Template $tpl, $initChild, $blockNames = array())
{
// if called while executing parent template it must be a sub-template with new inheritance root
- if ($initChild && $this->state == 3 && (strpos($tpl->template_resource, 'extendsall') === false)) {
+ if ($initChild && $this->state === 3 && (strpos($tpl->template_resource, 'extendsall') === false)) {
$tpl->inheritance = new Smarty_Internal_Runtime_Inheritance();
$tpl->inheritance->init($tpl, $initChild, $blockNames);
return;
@@ -90,7 +90,7 @@ class Smarty_Internal_Runtime_Inheritance
// $tpl->endRenderCallbacks[ 'inheritance' ] = array($this, 'subTemplateEnd');
}
// if state was waiting for parent change state to parent
- if ($this->state == 2) {
+ if ($this->state === 2) {
$this->state = 3;
}
}
@@ -131,7 +131,7 @@ class Smarty_Internal_Runtime_Inheritance
/**
* Smarty_Internal_Block constructor.
- * - if outer level {block} of child template ($state == 1) save it as child root block
+ * - if outer level {block} of child template ($state === 1) save it as child root block
* - otherwise process inheritance and render
*
* @param \Smarty_Internal_Template $tpl
@@ -147,7 +147,7 @@ class Smarty_Internal_Runtime_Inheritance
if (isset($this->childRoot[ $name ])) {
$block->child = $this->childRoot[ $name ];
}
- if ($this->state == 1) {
+ if ($this->state === 1) {
$this->childRoot[ $name ] = $block;
return;
}
@@ -226,7 +226,7 @@ class Smarty_Internal_Runtime_Inheritance
}
/**
- * Render parent block on $smarty.block.parent or {block append/prepend} *
+ * Render parent block on $smarty.block.parent or {block append/prepend}
*
* @param \Smarty_Internal_Template $tpl
* @param \Smarty_Internal_Block $block
diff --git a/libs/sysplugins/smarty_internal_runtime_updatecache.php b/libs/sysplugins/smarty_internal_runtime_updatecache.php
index ceee3b71..fbed94b3 100644
--- a/libs/sysplugins/smarty_internal_runtime_updatecache.php
+++ b/libs/sysplugins/smarty_internal_runtime_updatecache.php
@@ -91,15 +91,15 @@ class Smarty_Internal_Runtime_UpdateCache
$_template->smarty->_debug->start_cache($_template);
}
$this->removeNoCacheHash($cached, $_template, $no_output_filter);
- $compile_check = $_template->smarty->compile_check;
- $_template->smarty->compile_check = false;
+ $compile_check = (int)$_template->compile_check;
+ $_template->compile_check = Smarty::COMPILECHECK_OFF;
if ($_template->_isSubTpl()) {
$_template->compiled->unifunc = $_template->parent->compiled->unifunc;
}
if (!$_template->cached->processed) {
$_template->cached->process($_template, true);
}
- $_template->smarty->compile_check = $compile_check;
+ $_template->compile_check = $compile_check;
$cached->getRenderedTemplateCode($_template);
if ($_template->smarty->debugging) {
$_template->smarty->_debug->end_cache($_template);
@@ -117,8 +117,7 @@ class Smarty_Internal_Runtime_UpdateCache
*/
public function writeCachedContent(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
{
- if ($_template->source->handler->recompiled || !($_template->caching == Smarty::CACHING_LIFETIME_CURRENT ||
- $_template->caching == Smarty::CACHING_LIFETIME_SAVED)
+ if ($_template->source->handler->recompiled || !$_template->caching
) {
// don't write cache file
return false;
diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php
index 15c79f6a..d26f7c7a 100644
--- a/libs/sysplugins/smarty_internal_template.php
+++ b/libs/sysplugins/smarty_internal_template.php
@@ -110,7 +110,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
public static $tplObjCache = array();
/**
- * Template object cache for Smarty::isCached() == true
+ * Template object cache for Smarty::isCached() === true
*
* @var Smarty_Internal_Template[]
*/
@@ -150,11 +150,9 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
// Smarty parameter
$this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;
$this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;
- $this->caching = $_caching === null ? $this->smarty->caching : $_caching;
- if ($this->caching === true) {
- $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
- }
+ $this->caching = (int)($_caching === null ? $this->smarty->caching : $_caching);
$this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime;
+ $this->compile_check = (int)$smarty->compile_check;
$this->parent = $_parent;
// Template resource
$this->template_resource = $template_resource;
@@ -190,12 +188,10 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
}
// disable caching for evaluated code
if ($this->source->handler->recompiled) {
- $this->caching = false;
+ $this->caching = Smarty::CACHING_OFF;
}
// read from cache or render
- $isCacheTpl =
- $this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED;
- if ($isCacheTpl) {
+ if ($this->caching === Smarty::CACHING_LIFETIME_CURRENT || $this->caching === Smarty::CACHING_LIFETIME_SAVED) {
if (!isset($this->cached) || $this->cached->cache_id !== $this->cache_id ||
$this->cached->compile_id !== $this->compile_id
) {
@@ -283,7 +279,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
$smarty = &$this->smarty;
$_templateId = $smarty->_getTemplateId($template, $cache_id, $compile_id, $caching, $tpl);
// recursive call ?
- if (isset($tpl->templateId) ? $tpl->templateId : $tpl->_getTemplateId() != $_templateId) {
+ if (isset($tpl->templateId) ? $tpl->templateId : $tpl->_getTemplateId() !== $_templateId) {
// already in template cache?
if (isset(self::$tplObjCache[ $_templateId ])) {
// copy data from cached object
@@ -298,7 +294,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
} else {
unset($tpl->compiled);
}
- if ($caching != 9999 && isset($cachedTpl->cached)) {
+ if ($caching !== 9999 && isset($cachedTpl->cached)) {
$tpl->cached = $cachedTpl->cached;
} else {
unset($tpl->cached);
@@ -320,7 +316,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
$tpl->source = Smarty_Template_Source::load($tpl);
unset($tpl->compiled);
}
- if ($caching != 9999) {
+ if ($caching !== 9999) {
unset($tpl->cached);
}
}
@@ -348,7 +344,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
$tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val, $this->isRenderingCache);
}
}
- if ($tpl->caching == 9999) {
+ if ($tpl->caching === 9999) {
if (!isset($tpl->compiled)) {
$this->loadCompiled(true);
}
@@ -456,12 +452,12 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
}
$is_valid = true;
if (!empty($properties[ 'file_dependency' ]) &&
- ((!$cache && $tpl->smarty->compile_check) || $tpl->smarty->compile_check == 1)
+ ((!$cache && $tpl->compile_check) || $tpl->compile_check === Smarty::COMPILECHECK_ON)
) {
// check file dependencies at compiled code
foreach ($properties[ 'file_dependency' ] as $_file_to_check) {
- if ($_file_to_check[ 2 ] == 'file' || $_file_to_check[ 2 ] == 'php') {
- if ($tpl->source->filepath == $_file_to_check[ 0 ]) {
+ if ($_file_to_check[ 2 ] === 'file' || $_file_to_check[ 2 ] === 'php') {
+ if ($tpl->source->filepath === $_file_to_check[ 0 ]) {
// do not recheck current template
continue;
//$mtime = $tpl->source->getTimeStamp();
@@ -546,7 +542,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
*/
public function capture_error()
{
- throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\"");
+ throw new SmartyException("Not matching {capture} open/close in '{$this->template_resource}'");
}
/**
diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php
index ca2b4496..6b959404 100644
--- a/libs/sysplugins/smarty_internal_templatebase.php
+++ b/libs/sysplugins/smarty_internal_templatebase.php
@@ -67,9 +67,16 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
/**
* caching enabled
*
- * @var boolean
+ * @var int
*/
- public $caching = false;
+ public $caching = Smarty::CACHING_OFF;
+
+ /**
+ * check template for modifications?
+ *
+ * @var int
+ */
+ public $compile_check = Smarty::COMPILECHECK_ON;
/**
* cache lifetime in seconds
@@ -180,26 +187,28 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
$saveVars = false;
$template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);
- if ($this->_objType == 1) {
+ if ($this->_objType === 1) {
// set caching in template object
$template->caching = $this->caching;
}
}
+ // make sure we have integer values
+ $template->caching = (int)$template->caching;
// fetch template content
$level = ob_get_level();
try {
$_smarty_old_error_level =
isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null;
- if ($this->_objType == 2) {
+ if ($this->_objType === 2) {
/* @var Smarty_Internal_Template $this */
$template->tplFunctions = $this->tplFunctions;
$template->inheritance = $this->inheritance;
}
/* @var Smarty_Internal_Template $parent */
- if (isset($parent->_objType) && ($parent->_objType == 2) && !empty($parent->tplFunctions)) {
+ if (isset($parent->_objType) && ($parent->_objType === 2) && !empty($parent->tplFunctions)) {
$template->tplFunctions = array_merge($parent->tplFunctions, $template->tplFunctions);
}
- if ($function == 2) {
+ if ($function === 2) {
if ($template->caching) {
// return cache status of template
if (!isset($template->cached)) {
@@ -327,11 +336,19 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
}
/**
- * @param boolean $caching
+ * @param int $compile_check
+ */
+ public function setCompileCheck($compile_check)
+ {
+ $this->compile_check = (int)$compile_check;
+ }
+
+ /**
+ * @param int $caching
*/
public function setCaching($caching)
{
- $this->caching = $caching;
+ $this->caching = (int)$caching;
}
/**
diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php
index f34ce4ac..5ca53662 100644
--- a/libs/sysplugins/smarty_internal_templatecompilerbase.php
+++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php
@@ -500,7 +500,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
*/
public function compileVariable($variable)
{
- if (strpos($variable, '(') == 0) {
+ if (!strpos($variable, '(')) {
// not a variable variable
$var = trim($variable, '\'');
$this->tag_nocache = $this->tag_nocache |
@@ -554,11 +554,11 @@ abstract class Smarty_Internal_TemplateCompilerBase
foreach ($parameter as $p) {
$pa[] = (strpos($p, '(') === false) ? ('isset(' . $p . ')') : ('(' . $p . ' !== null )');
}
- return "(" . implode(' && ', $pa) . ")";
+ return '(' . implode(' && ', $pa) . ')';
} else {
$isset_par = str_replace("')->value", "',null,true,false)->value", $par);
}
- return $name . "(" . $isset_par . ")";
+ return $name . '(' . $isset_par . ')';
} else if (in_array($func_name,
array('empty',
'reset',
@@ -571,7 +571,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
}
if ($func_name === 'empty') {
if ($parHasFuction && version_compare(PHP_VERSION, '5.5.0', '<')) {
- return '(' . $parameter[ 0 ] . ' == false )';
+ return '(' . $parameter[ 0 ] . ' === false )';
} else {
return $func_name . '(' .
str_replace("')->value", "',null,true,false)->value", $parameter[ 0 ]) . ')';
@@ -580,10 +580,10 @@ abstract class Smarty_Internal_TemplateCompilerBase
return $func_name . '(' . $parameter[ 0 ] . ')';
}
} else {
- return $name . "(" . implode(',', $parameter) . ")";
+ return $name . '(' . implode(',', $parameter) . ')';
}
} else {
- $this->trigger_template_error("unknown function \"" . $name . "\"");
+ $this->trigger_template_error("unknown function '{$name}'");
}
}
}
@@ -808,7 +808,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
}
require_once $script;
} else {
- $this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
+ $this->trigger_template_error("Default plugin handler: Returned script file '{$script}' for '{$tag}' not found");
}
}
if (is_callable($callback)) {
@@ -817,7 +817,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
array());
return true;
} else {
- $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable");
+ $this->trigger_template_error("Default plugin handler: Returned callback for '{$tag}' not callable");
}
}
return false;
@@ -863,9 +863,8 @@ abstract class Smarty_Internal_TemplateCompilerBase
) {
$this->template->compiled->has_nocache_code = true;
$_output = addcslashes($content, '\'\\');
- $_output = str_replace("^#^", "'", $_output);
- $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output .
- "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
+ $_output = str_replace('^#^', '\'', $_output);
+ $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
// make sure we include modifier plugins for nocache code
foreach ($this->modifier_plugins as $plugin_name => $dummy) {
if (isset($this->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) {
@@ -944,11 +943,11 @@ abstract class Smarty_Internal_TemplateCompilerBase
{
$_scope = 0;
if (isset($_attr[ 'scope' ])) {
- $_scopeName = trim($_attr[ 'scope' ], "'\"");
+ $_scopeName = trim($_attr[ 'scope' ], '\'"');
if (is_numeric($_scopeName) && in_array($_scopeName, $validScopes)) {
$_scope = $_scopeName;
} else if (is_string($_scopeName)) {
- $_scopeName = trim($_scopeName, "'\"");
+ $_scopeName = trim($_scopeName, '\'"');
$_scope = isset($validScopes[ $_scopeName ]) ? $validScopes[ $_scopeName ] : false;
} else {
$_scope = false;
@@ -971,7 +970,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
public function makeNocacheCode($code)
{
return "echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/<?php " .
- str_replace("^#^", "'", addcslashes($code, '\'\\')) .
+ str_replace('^#^', '\'', addcslashes($code, '\'\\')) .
"?>/*/%%SmartyNocache:{$this->nocache_hash}%%*/';\n";
}
@@ -1137,7 +1136,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
{
if (array_pop($this->_tag_stack_count) !== $this->getTagStackCount()) {
$tag = $this->getOpenBlockTag();
- $this->trigger_template_error("unclosed \"{{$tag}}\" in doubled quoted string",
+ $this->trigger_template_error("unclosed '{{$tag}}' in doubled quoted string",
null,
true);
}
@@ -1326,7 +1325,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
$this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false)
) {
// template defined by {template} tag
- $args[ '_attr' ][ 'name' ] = "'" . $tag . "'";
+ $args[ '_attr' ][ 'name' ] = "'{$tag}'";
$_output = $this->callTagCompiler('call', $args, $parameter);
}
}
@@ -1434,7 +1433,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
return $plugin_object->compile($args, $this);
}
}
- throw new SmartyException("Plugin \"{$tag}\" not callable");
+ throw new SmartyException("Plugin '{$tag}' not callable");
} else {
if ($function = $this->getPlugin($tag, $plugin_type)) {
if (!isset($this->smarty->security_policy) ||
@@ -1553,10 +1552,10 @@ abstract class Smarty_Internal_TemplateCompilerBase
return $plugin_object->compile($args, $this);
}
}
- throw new SmartyException("Plugin \"{$tag}\" not callable");
+ throw new SmartyException("Plugin '{$tag}' not callable");
}
}
- $this->trigger_template_error("unknown tag \"" . $tag . "\"", null, true);
+ $this->trigger_template_error("unknown tag '{$tag}'", null, true);
}
}
}
diff --git a/libs/sysplugins/smarty_internal_testinstall.php b/libs/sysplugins/smarty_internal_testinstall.php
index 7213b5d5..ac353b77 100644
--- a/libs/sysplugins/smarty_internal_testinstall.php
+++ b/libs/sysplugins/smarty_internal_testinstall.php
@@ -200,7 +200,7 @@ class Smarty_Internal_TestInstall
} else {
$errors[ 'plugins_dir' ] = $message;
}
- } else if ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
+ } else if ($_core_plugins_dir && $_core_plugins_dir === realpath($plugin_dir)) {
$_core_plugins_available = true;
if ($errors === null) {
echo "$plugin_dir is OK.\n";
diff --git a/libs/sysplugins/smarty_resource_recompiled.php b/libs/sysplugins/smarty_resource_recompiled.php
index 1465124c..322cdabf 100644
--- a/libs/sysplugins/smarty_resource_recompiled.php
+++ b/libs/sysplugins/smarty_resource_recompiled.php
@@ -49,7 +49,7 @@ abstract class Smarty_Resource_Recompiled extends Smarty_Resource
$_smarty_tpl->loadCompiler();
// call compiler
try {
- eval("?>" . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl));
+ eval('?>' . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl));
}
catch (Exception $e) {
unset($_smarty_tpl->compiler);
diff --git a/libs/sysplugins/smarty_resource_uncompiled.php b/libs/sysplugins/smarty_resource_uncompiled.php
index 554f3aea..a11e2c14 100644
--- a/libs/sysplugins/smarty_resource_uncompiled.php
+++ b/libs/sysplugins/smarty_resource_uncompiled.php
@@ -29,7 +29,7 @@ abstract class Smarty_Resource_Uncompiled extends Smarty_Resource
* @var bool
*/
public $hasCompiledHandler = true;
-
+
/**
* populate compiled object with compiled filepath
*
diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php
index 60abd2ef..e501cd82 100644
--- a/libs/sysplugins/smarty_security.php
+++ b/libs/sysplugins/smarty_security.php
@@ -322,7 +322,7 @@ class Smarty_Security
// fall back
return $this->isTrustedStaticClass($class_name, $compiler);
}
- if ($params[ 2 ] == 'method') {
+ if ($params[ 2 ] === 'method') {
$allowed = $this->trusted_static_methods;
$name = substr($params[ 0 ], 0, strpos($params[ 0 ], '('));
} else {
@@ -627,7 +627,7 @@ class Smarty_Security
$this->_checkDir($this->smarty->_realpath($filepath, true), $this->_php_resource_dir);
return true;
}
-
+
/**
* Check if file is inside a valid directory
*
@@ -680,7 +680,7 @@ class Smarty_Security
} elseif (is_object($security_class)) {
throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security.");
}
- if ($security_class == null) {
+ if ($security_class === null) {
$security_class = $smarty->security_class;
}
if (!class_exists($security_class)) {
diff --git a/libs/sysplugins/smarty_template_cached.php b/libs/sysplugins/smarty_template_cached.php
index 59eb09ad..45c83c89 100644
--- a/libs/sysplugins/smarty_template_cached.php
+++ b/libs/sysplugins/smarty_template_cached.php
@@ -107,8 +107,7 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base
$_template->cached = new Smarty_Template_Cached($_template);
$_template->cached->handler->populate($_template->cached, $_template);
// caching enabled ?
- if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT ||
- $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->handler->recompiled
+ if (!$_template->caching || $_template->source->handler->recompiled
) {
$_template->cached->valid = false;
}
@@ -164,13 +163,13 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base
} else {
$this->valid = true;
}
- if ($this->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT &&
+ if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_CURRENT &&
$_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime)
) {
// lifetime expired
$this->valid = false;
}
- if ($this->valid && $_template->smarty->compile_check == 1 &&
+ if ($this->valid && $_template->compile_check === Smarty::COMPILECHECK_ON &&
$_template->source->getTimeStamp() > $this->timestamp
) {
$this->valid = false;
diff --git a/libs/sysplugins/smarty_template_compiled.php b/libs/sysplugins/smarty_template_compiled.php
index d82d23b1..7ca2ebcb 100644
--- a/libs/sysplugins/smarty_template_compiled.php
+++ b/libs/sysplugins/smarty_template_compiled.php
@@ -136,22 +136,22 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base
$source->handler->process($_smarty_tpl);
} else if (!$source->handler->uncompiled) {
if (!$this->exists || $smarty->force_compile ||
- ($smarty->compile_check && $source->getTimeStamp() > $this->getTimeStamp())
+ ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp())
) {
$this->compileTemplateSource($_smarty_tpl);
- $compileCheck = $smarty->compile_check;
- $smarty->compile_check = false;
+ $compileCheck = $_smarty_tpl->compile_check;
+ $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;
$this->loadCompiledTemplate($_smarty_tpl);
- $smarty->compile_check = $compileCheck;
+ $_smarty_tpl->compile_check = $compileCheck;
} else {
$_smarty_tpl->mustCompile = true;
@include($this->filepath);
if ($_smarty_tpl->mustCompile) {
$this->compileTemplateSource($_smarty_tpl);
- $compileCheck = $smarty->compile_check;
- $smarty->compile_check = false;
+ $compileCheck = $_smarty_tpl->compile_check;
+ $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF;
$this->loadCompiledTemplate($_smarty_tpl);
- $smarty->compile_check = $compileCheck;
+ $_smarty_tpl->compile_check = $compileCheck;
}
}
$_smarty_tpl->_subTemplateRegister();
@@ -250,7 +250,7 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base
apc_compile_file($this->filepath);
}
if (defined('HHVM_VERSION')) {
- eval("?>" . file_get_contents($this->filepath));
+ eval('?>' . file_get_contents($this->filepath));
} else {
include($this->filepath);
}
diff --git a/libs/sysplugins/smarty_undefined_variable.php b/libs/sysplugins/smarty_undefined_variable.php
index 67e8714f..e064f655 100644
--- a/libs/sysplugins/smarty_undefined_variable.php
+++ b/libs/sysplugins/smarty_undefined_variable.php
@@ -28,6 +28,6 @@ class Smarty_Undefined_Variable extends Smarty_Variable
*/
public function __toString()
{
- return "";
+ return '';
}
}