diff options
242 files changed, 5916 insertions, 5197 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 75e8843d6..cf5b2e004 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -635,7 +635,6 @@ class Ping extends \Zotlabs\Web\Controller { $forums = get_forum_channels(local_channel()); if($forums) { - $perms_sql = item_permissions_sql(local_channel()); $item_normal = item_normal(); $fcount = count($forums); $forums['total'] = 0; @@ -644,14 +643,14 @@ class Ping extends \Zotlabs\Web\Controller { $p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'", intval(local_channel()), intval(TERM_FORUM), - dbesc($forums[$x]['xchan_hash']) + dbesc($forums[$x]['xchan_name']) ); $p_str = ids_to_querystr($p, 'parent'); $p_sql = (($p_str) ? "OR parent IN ( $p_str )" : ''); - $r = q("select sum(item_unseen) as unseen from item - where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $perms_sql $item_normal", + $r = q("select count(id) as unseen from item + where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal", intval(local_channel()), dbesc($forums[$x]['xchan_hash']), dbesc($forums[$x]['xchan_hash']) diff --git a/Zotlabs/Widget/Wiki_list.php b/Zotlabs/Widget/Wiki_list.php index c8d83cbe8..64c988ee7 100644 --- a/Zotlabs/Widget/Wiki_list.php +++ b/Zotlabs/Widget/Wiki_list.php @@ -6,10 +6,6 @@ class Wiki_list { function widget($arr) { - if(argc() < 3) { - return; - } - $channel = channelx_by_n(\App::$profile_uid); $wikis = \Zotlabs\Lib\NativeWiki::listwikis($channel,get_observer_hash()); diff --git a/composer.lock b/composer.lock index d352ad29a..edeba994d 100644 --- a/composer.lock +++ b/composer.lock @@ -157,16 +157,16 @@ }, { "name": "league/html-to-markdown", - "version": "4.7.0", + "version": "4.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "76c076483cef89860d32a3fd25312f5a42848a8c" + "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/76c076483cef89860d32a3fd25312f5a42848a8c", - "reference": "76c076483cef89860d32a3fd25312f5a42848a8c", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d", + "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d", "shasum": "" }, "require": { @@ -185,7 +185,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -199,16 +199,16 @@ ], "authors": [ { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "http://www.colinodell.com", - "role": "Lead Developer" - }, - { "name": "Nick Cernis", "email": "nick@cern.is", "homepage": "http://modernnerd.net", "role": "Original Author" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" } ], "description": "An HTML-to-markdown conversion helper for PHP", @@ -217,7 +217,7 @@ "html", "markdown" ], - "time": "2018-05-19T23:47:12+00:00" + "time": "2018-09-18T12:18:08+00:00" }, { "name": "lukasreschke/id3parser", @@ -520,16 +520,16 @@ }, { "name": "sabre/dav", - "version": "3.2.2", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516" + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/a9780ce4f35560ecbd0af524ad32d9d2c8954b80", + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80", "shasum": "" }, "require": { @@ -599,7 +599,7 @@ "framework", "iCalendar" ], - "time": "2017-02-15T03:06:08+00:00" + "time": "2018-10-19T09:58:27+00:00" }, { "name": "sabre/event", @@ -1002,16 +1002,16 @@ }, { "name": "smarty/smarty", - "version": "v3.1.32", + "version": "v3.1.33", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "ac9d4b587e5bf53381e21881820a9830765cb459" + "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/ac9d4b587e5bf53381e21881820a9830765cb459", - "reference": "ac9d4b587e5bf53381e21881820a9830765cb459", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/dd55b23121e55a3b4f1af90a707a6c4e5969530f", + "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f", "shasum": "" }, "require": { @@ -1051,7 +1051,7 @@ "keywords": [ "templating" ], - "time": "2018-04-24T14:53:33+00:00" + "time": "2018-09-12T20:54:16+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2160,16 +2160,16 @@ }, { "name": "php-mock/php-mock-phpunit", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-phpunit.git", - "reference": "ff1cc1d4e7478ce74221e05742588619bee84f69" + "reference": "57b92e621f14c2c07a4567cd29ed4e87de0d2912" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/ff1cc1d4e7478ce74221e05742588619bee84f69", - "reference": "ff1cc1d4e7478ce74221e05742588619bee84f69", + "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/57b92e621f14c2c07a4567cd29ed4e87de0d2912", + "reference": "57b92e621f14c2c07a4567cd29ed4e87de0d2912", "shasum": "" }, "require": { @@ -2210,7 +2210,7 @@ "test", "test double" ], - "time": "2018-04-06T13:54:43+00:00" + "time": "2018-10-07T14:38:37+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2481,16 +2481,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.0.7", + "version": "6.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" + "reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", - "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4d3ae9b21a7d7e440bd0cf65565533117976859f", + "reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f", "shasum": "" }, "require": { @@ -2501,7 +2501,7 @@ "phpunit/php-text-template": "^1.2.1", "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, @@ -2514,7 +2514,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -2540,25 +2540,28 @@ "testing", "xunit" ], - "time": "2018-06-01T07:51:50+00:00" + "time": "2018-10-23T05:59:32+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { "php": "^7.1" }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, "type": "library", "extra": { "branch-alias": { @@ -2587,7 +2590,7 @@ "filesystem", "iterator" ], - "time": "2018-06-11T11:44:00+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -2681,16 +2684,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", - "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { @@ -2726,20 +2729,20 @@ "keywords": [ "tokenizer" ], - "time": "2018-02-01T13:16:43+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "7.3.2", + "version": "7.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "34705f81bddc3f505b9599a2ef96e2b4315ba9b8" + "reference": "c151651fb6ed264038d486ea262e243af72e5e64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34705f81bddc3f505b9599a2ef96e2b4315ba9b8", - "reference": "34705f81bddc3f505b9599a2ef96e2b4315ba9b8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64", + "reference": "c151651fb6ed264038d486ea262e243af72e5e64", "shasum": "" }, "require": { @@ -2760,11 +2763,11 @@ "phpunit/php-timer": "^2.0", "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { @@ -2784,7 +2787,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.3-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -2810,7 +2813,7 @@ "testing", "xunit" ], - "time": "2018-08-22T06:39:21+00:00" + "time": "2018-10-23T05:57:41+00:00" }, { "name": "psr/container", @@ -3391,25 +3394,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3429,7 +3432,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -3476,7 +3479,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -3533,16 +3536,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "31db283fc86d3143e7ff87e922177b457d909c30" + "reference": "f31333bdff54c7595f834d510a6d2325573ddb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/31db283fc86d3143e7ff87e922177b457d909c30", - "reference": "31db283fc86d3143e7ff87e922177b457d909c30", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/f31333bdff54c7595f834d510a6d2325573ddb36", + "reference": "f31333bdff54c7595f834d510a6d2325573ddb36", "shasum": "" }, "require": { @@ -3585,20 +3588,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:19:56+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/config", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "76015a3cc372b14d00040ff58e18e29f69eba717" + "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/76015a3cc372b14d00040ff58e18e29f69eba717", - "reference": "76015a3cc372b14d00040ff58e18e29f69eba717", + "url": "https://api.github.com/repos/symfony/config/zipball/b3d4d7b567d7a49e6dfafb6d4760abc921177c96", + "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96", "shasum": "" }, "require": { @@ -3648,20 +3651,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-08-08T06:37:38+00:00" + "time": "2018-09-08T13:24:10+00:00" }, { "name": "symfony/console", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f" + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f", + "url": "https://api.github.com/repos/symfony/console/zipball/dc7122fe5f6113cfaba3b3de575d31112c9aa60b", + "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b", "shasum": "" }, "require": { @@ -3716,20 +3719,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-10-03T08:15:46+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.15", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "edda5a6155000ff8c3a3f85ee5c421af93cca416" + "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/edda5a6155000ff8c3a3f85ee5c421af93cca416", - "reference": "edda5a6155000ff8c3a3f85ee5c421af93cca416", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", "shasum": "" }, "require": { @@ -3769,20 +3772,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "bae4983003c9d451e278504d7d9b9d7fc1846873" + "reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bae4983003c9d451e278504d7d9b9d7fc1846873", - "reference": "bae4983003c9d451e278504d7d9b9d7fc1846873", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6b9d893ad28aefd8942dc0469c8397e2216fe30", + "reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30", "shasum": "" }, "require": { @@ -3840,20 +3843,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-08-08T11:48:58+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "1c4519d257e652404c3aa550207ccd8ada66b38e" + "reference": "80e60271bb288de2a2259662cff125cff4f93f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/1c4519d257e652404c3aa550207ccd8ada66b38e", - "reference": "1c4519d257e652404c3aa550207ccd8ada66b38e", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", + "reference": "80e60271bb288de2a2259662cff125cff4f93f95", "shasum": "" }, "require": { @@ -3897,11 +3900,11 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:00:49+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -3964,16 +3967,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e" + "reference": "596d12b40624055c300c8b619755b748ca5cf0b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/596d12b40624055c300c8b619755b748ca5cf0b5", + "reference": "596d12b40624055c300c8b619755b748ca5cf0b5", "shasum": "" }, "require": { @@ -4010,7 +4013,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-08-18T16:52:46+00:00" + "time": "2018-10-02T12:40:59+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -4073,16 +4076,16 @@ }, { "name": "symfony/translation", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "fa2182669f7983b7aa5f1a770d053f79f0ef144f" + "reference": "9f0b61e339160a466ebcde167a6c5521c810e304" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/fa2182669f7983b7aa5f1a770d053f79f0ef144f", - "reference": "fa2182669f7983b7aa5f1a770d053f79f0ef144f", + "url": "https://api.github.com/repos/symfony/translation/zipball/9f0b61e339160a466ebcde167a6c5521c810e304", + "reference": "9f0b61e339160a466ebcde167a6c5521c810e304", "shasum": "" }, "require": { @@ -4138,20 +4141,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-08-07T12:45:11+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.4", + "version": "v4.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b832cc289608b6d305f62149df91529a2ab3c314" + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b832cc289608b6d305f62149df91529a2ab3c314", - "reference": "b832cc289608b6d305f62149df91529a2ab3c314", + "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", + "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", "shasum": "" }, "require": { @@ -4197,7 +4200,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-08-18T16:52:46+00:00" + "time": "2018-10-02T16:36:10+00:00" }, { "name": "theseer/tokenizer", diff --git a/include/markdown.php b/include/markdown.php index d2148811c..64f0a0854 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -248,20 +248,12 @@ function bb_to_markdown($Text, $options = []) { // Convert it to HTML - don't try oembed $Text = bbcode($Text, [ 'tryoembed' => false ]); - // Markdownify does not preserve previously escaped html entities such as <> and &. - //$Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text); - // Now convert HTML to Markdown - $Text = html2markdown($Text); //html2markdown adds backslashes infront of hashes after a new line. remove them $Text = str_replace("\n\#", "\n#", $Text); - // It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason. - - //$Text = str_replace(array('&\\_lt\\_;','&\\_gt\\_;','&\\_amp\\_;'),array('<','>','&'),$Text); - // If the text going into bbcode() has a plain URL in it, i.e. // with no [url] tags around it, it will come out of parseString() // looking like: <http://url.com>, which gets removed by strip_tags(). @@ -291,12 +283,24 @@ function bb_to_markdown($Text, $options = []) { * If the HTML text can not get parsed it will return an empty string. * * @param string $html The HTML code to convert + * @param array $options an array of options to pass to the environment * @return string Markdown representation of the given HTML text, empty on error */ -function html2markdown($html,$options = []) { +function html2markdown($html, $options = []) { $markdown = ''; - $internal_errors = libxml_use_internal_errors(true); + if(! $options) { + $options = [ + 'header_style' => 'setext', // Set to 'atx' to output H1 and H2 headers as # Header1 and ## Header2 + 'suppress_errors' => true, // Set to false to show warnings when loading malformed HTML + 'strip_tags' => false, // Set to true to strip tags that don't have markdown equivalents. N.B. Strips tags, not their content. Useful to clean MS Word HTML output. + 'bold_style' => '**', // DEPRECATED: Set to '__' if you prefer the underlined style + 'italic_style' => '*', // DEPRECATED: Set to '_' if you prefer the underlined style + 'remove_nodes' => '', // space-separated list of dom nodes that should be removed. example: 'meta style script' + 'hard_break' => false, // Set to true to turn <br> into `\n` instead of ` \n` + 'list_item_style' => '-', // Set the default character for each <li> in a <ul>. Can be '-', '*', or '+' + ]; + } $environment = Environment::createDefaultEnvironment($options); $environment->addConverter(new TableConverter()); @@ -308,8 +312,6 @@ function html2markdown($html,$options = []) { logger("Invalid HTML. HTMLToMarkdown library threw an exception."); } - libxml_use_internal_errors($internal_errors); - return $markdown; } diff --git a/tests/unit/includes/MarkdownTest.php b/tests/unit/includes/MarkdownTest.php index f0e253a58..61600988d 100644 --- a/tests/unit/includes/MarkdownTest.php +++ b/tests/unit/includes/MarkdownTest.php @@ -52,12 +52,12 @@ class MarkdownTest extends UnitTestCase { ' ', '' ], -/* it is not clear why this test fails + 'strong, b, em, i, bib' => [ '<strong>strong</strong> <b>bold</b> <em>em</em> <i>italic</i> <b>bo<i>italic</i>ld</b>', - '**strong** **bold** _em_ _italic_ **bo_italic_ld**' + '**strong** **bold** *em* *italic* **bo*italic*ld**' ], -*/ + 'empty tags' => [ 'text1 <b></b> text2 <i></i>', 'text1 text2' @@ -70,10 +70,6 @@ class MarkdownTest extends UnitTestCase { '& lt < gt >', '& lt < gt >' ], - 'our escaped HTML entities' => [ - '&_lt_; &_gt_; &_amp_;', - '&\_lt\_; &\_gt\_; &\_amp\_;' - ], 'linebreak' => [ "line1<br>line2\nline3", "line1 \nline2 line3" @@ -84,15 +80,15 @@ class MarkdownTest extends UnitTestCase { ], 'unordered list' => [ '<ul><li>Item 1</li><li>Item 2</li><li>Item <b>3</b></li></ul>', - "- Item 1\n- Item 2\n- Item 3" + "- Item 1\n- Item 2\n- Item **3**" ], 'ordered list' => [ '<ol><li>Item 1</li><li>Item 2</li><li>Item <b>3</b></li></ol>', - "1. Item 1\n2. Item 2\n3. Item 3" + "1. Item 1\n2. Item 2\n3. Item **3**" ], 'nested lists' => [ '<ul><li>Item 1<ol><li>Item 1a</li><li>Item <b>1b</b></ol></li><li>Item 2</li></ul>', - "- Item 1\n 1. Item 1a\n 2. Item 1b\n- Item 2" + "- Item 1\n 1. Item 1a\n 2. Item **1b**\n- Item 2" ], 'img' => [ '<img src="/path/to/img.png" alt="alt text" title="title text">', @@ -118,12 +114,10 @@ class MarkdownTest extends UnitTestCase { '<code><p>HTML text</p></code>', '`<p>HTML text</p>`' ], -/* it is not clear why this test fails 'pre' => [ - '<pre> line with spaces </pre>', - '` line with spaces `' + '<pre> one line with spaces </pre>', + "```\n one line with spaces \n```" ], -*/ 'div p' => [ '<div>div</div><div><p>p</p></div>', "<div>div</div><div>p\n\n</div>" diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 4b8316c37..065aceee8 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -300,6 +300,7 @@ return array( 'League\\HTMLToMarkdown\\ElementInterface' => $vendorDir . '/league/html-to-markdown/src/ElementInterface.php', 'League\\HTMLToMarkdown\\Environment' => $vendorDir . '/league/html-to-markdown/src/Environment.php', 'League\\HTMLToMarkdown\\HtmlConverter' => $vendorDir . '/league/html-to-markdown/src/HtmlConverter.php', + 'League\\HTMLToMarkdown\\HtmlConverterInterface' => $vendorDir . '/league/html-to-markdown/src/HtmlConverterInterface.php', 'Michelf\\Markdown' => $vendorDir . '/michelf/php-markdown/Michelf/Markdown.php', 'Michelf\\MarkdownExtra' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownExtra.php', 'Michelf\\MarkdownInterface' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownInterface.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 0202e148c..4b8c414e0 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -468,6 +468,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'League\\HTMLToMarkdown\\ElementInterface' => __DIR__ . '/..' . '/league/html-to-markdown/src/ElementInterface.php', 'League\\HTMLToMarkdown\\Environment' => __DIR__ . '/..' . '/league/html-to-markdown/src/Environment.php', 'League\\HTMLToMarkdown\\HtmlConverter' => __DIR__ . '/..' . '/league/html-to-markdown/src/HtmlConverter.php', + 'League\\HTMLToMarkdown\\HtmlConverterInterface' => __DIR__ . '/..' . '/league/html-to-markdown/src/HtmlConverterInterface.php', 'Michelf\\Markdown' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/Markdown.php', 'Michelf\\MarkdownExtra' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/MarkdownExtra.php', 'Michelf\\MarkdownInterface' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/MarkdownInterface.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index eac4cebde..b51c4160f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -156,17 +156,17 @@ }, { "name": "league/html-to-markdown", - "version": "4.7.0", - "version_normalized": "4.7.0.0", + "version": "4.8.0", + "version_normalized": "4.8.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "76c076483cef89860d32a3fd25312f5a42848a8c" + "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/76c076483cef89860d32a3fd25312f5a42848a8c", - "reference": "76c076483cef89860d32a3fd25312f5a42848a8c", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d", + "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d", "shasum": "" }, "require": { @@ -179,14 +179,14 @@ "phpunit/phpunit": "4.*", "scrutinizer/ocular": "~1.1" }, - "time": "2018-05-19T23:47:12+00:00", + "time": "2018-09-18T12:18:08+00:00", "bin": [ "bin/html-to-markdown" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8-dev" + "dev-master": "4.9-dev" } }, "installation-source": "dist", @@ -201,16 +201,16 @@ ], "authors": [ { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "http://www.colinodell.com", - "role": "Lead Developer" - }, - { "name": "Nick Cernis", "email": "nick@cern.is", "homepage": "http://modernnerd.net", "role": "Original Author" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" } ], "description": "An HTML-to-markdown conversion helper for PHP", @@ -533,17 +533,17 @@ }, { "name": "sabre/dav", - "version": "3.2.2", - "version_normalized": "3.2.2.0", + "version": "3.2.3", + "version_normalized": "3.2.3.0", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516" + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516", - "reference": "e987775e619728f12205606c9cc3ee565ffb1516", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/a9780ce4f35560ecbd0af524ad32d9d2c8954b80", + "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80", "shasum": "" }, "require": { @@ -574,7 +574,7 @@ "ext-curl": "*", "ext-pdo": "*" }, - "time": "2017-02-15T03:06:08+00:00", + "time": "2018-10-19T09:58:27+00:00", "bin": [ "bin/sabredav", "bin/naturalselection" @@ -1029,23 +1029,23 @@ }, { "name": "smarty/smarty", - "version": "v3.1.32", - "version_normalized": "3.1.32.0", + "version": "v3.1.33", + "version_normalized": "3.1.33.0", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "ac9d4b587e5bf53381e21881820a9830765cb459" + "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/ac9d4b587e5bf53381e21881820a9830765cb459", - "reference": "ac9d4b587e5bf53381e21881820a9830765cb459", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/dd55b23121e55a3b4f1af90a707a6c4e5969530f", + "reference": "dd55b23121e55a3b4f1af90a707a6c4e5969530f", "shasum": "" }, "require": { "php": ">=5.2" }, - "time": "2018-04-24T14:53:33+00:00", + "time": "2018-09-12T20:54:16+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md index 981ffd594..ab07c94f5 100644 --- a/vendor/league/html-to-markdown/CHANGELOG.md +++ b/vendor/league/html-to-markdown/CHANGELOG.md @@ -4,6 +4,24 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] +## [4.8.0] - 2018-09-18 +### Added + - Added support for email auto-linking + - Added a new interface (`HtmlConverterInterface`) for the main `HtmlConverter` class + - Added additional test cases (#14) + +### Changed + - The `italic_style` option now defaults to `'*'` so that in-word emphasis is handled properly (#75) + +### Fixed + - Fixed several issues of `<code>` and `<pre>` tags not converting to blocks or inlines properly (#26, #70, #102, #140, #161, #162) + - Fixed in-word emphasis using underscores as delimiter (#75) + - Fixed character escaping inside of `<div>` elements + - Fixed header edge cases + +### Deprecated + - The `bold_style` and `italic_style` options have been deprecated (#75) + ## [4.7.0] - 2018-05-19 ### Added - Added `setOptions()` function for chainable calling (#149) @@ -217,7 +235,8 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce ### Added - Initial release -[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.7.0...master +[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.8.0...master +[4.8.0]: https://github.com/thephpleague/html-to-markdown/compare/4.7.0...4.8.0 [4.7.0]: https://github.com/thephpleague/html-to-markdown/compare/4.6.2...4.7.0 [4.6.2]: https://github.com/thephpleague/html-to-markdown/compare/4.6.1...4.6.2 [4.6.1]: https://github.com/thephpleague/html-to-markdown/compare/4.6.0...4.6.1 diff --git a/vendor/league/html-to-markdown/composer.json b/vendor/league/html-to-markdown/composer.json index c79230562..53403916e 100644 --- a/vendor/league/html-to-markdown/composer.json +++ b/vendor/league/html-to-markdown/composer.json @@ -9,7 +9,7 @@ { "name": "Colin O'Dell", "email": "colinodell@gmail.com", - "homepage": "http://www.colinodell.com", + "homepage": "https://www.colinodell.com", "role": "Lead Developer" }, { @@ -42,7 +42,7 @@ "bin": ["bin/html-to-markdown"], "extra": { "branch-alias": { - "dev-master": "4.8-dev" + "dev-master": "4.9-dev" } } } diff --git a/vendor/league/html-to-markdown/src/Configuration.php b/vendor/league/html-to-markdown/src/Configuration.php index 2943383aa..5bc8d5503 100644 --- a/vendor/league/html-to-markdown/src/Configuration.php +++ b/vendor/league/html-to-markdown/src/Configuration.php @@ -12,6 +12,8 @@ class Configuration public function __construct(array $config = array()) { $this->config = $config; + + $this->checkForDeprecatedOptions($config); } /** @@ -19,6 +21,7 @@ class Configuration */ public function merge(array $config = array()) { + $this->checkForDeprecatedOptions($config); $this->config = array_replace_recursive($this->config, $config); } @@ -27,6 +30,7 @@ class Configuration */ public function replace(array $config = array()) { + $this->checkForDeprecatedOptions($config); $this->config = $config; } @@ -36,6 +40,7 @@ class Configuration */ public function setOption($key, $value) { + $this->checkForDeprecatedOptions(array($key => $value)); $this->config[$key] = $value; } @@ -57,4 +62,15 @@ class Configuration return $this->config[$key]; } + + private function checkForDeprecatedOptions(array $config) + { + foreach ($config as $key => $value) { + if ($key === 'bold_style' && $value !== '**') { + @trigger_error('Customizing the bold_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); + } elseif ($key === 'italic_style' && $value !== '*') { + @trigger_error('Customizing the italic_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); + } + } + } } diff --git a/vendor/league/html-to-markdown/src/Converter/CodeConverter.php b/vendor/league/html-to-markdown/src/Converter/CodeConverter.php index e536362ee..39e6a7bc4 100644 --- a/vendor/league/html-to-markdown/src/Converter/CodeConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/CodeConverter.php @@ -13,7 +13,7 @@ class CodeConverter implements ConverterInterface */ public function convert(ElementInterface $element) { - $language = null; + $language = ''; // Checking for language class on the code block $classes = $element->getAttribute('class'); @@ -24,8 +24,7 @@ class CodeConverter implements ConverterInterface foreach ($classes as $class) { if (strpos($class, 'language-') !== false) { // Found one, save it as the selected language and stop looping over the classes. - // The space after the language avoids gluing the actual code with the language tag - $language = str_replace('language-', '', $class) . ' '; + $language = str_replace('language-', '', $class); break; } } @@ -39,14 +38,13 @@ class CodeConverter implements ConverterInterface $code = preg_replace('/<code\b[^>]*>/', '', $code); $code = str_replace('</code>', '', $code); - // Checking if the code has multiple lines - $lines = preg_split('/\r\n|\r|\n/', $code); - if (count($lines) > 1) { - // Multiple lines detected, adding three backticks and newlines - $markdown .= '```' . $language . "\n" . $code . "\n" . '```' . "\n\n"; + // Checking if it's a code block or span + if ($this->shouldBeBlock($element, $code)) { + // Code block detected, newlines will be added in parent + $markdown .= '```' . $language . "\n" . $code . "\n" . '```'; } else { - // One line of code, wrapping it on one backtick. - $markdown .= '`' . $language . $code . '`'; + // One line of code, wrapping it on one backtick, removing new lines + $markdown .= '`' . preg_replace('/\r\n|\r|\n/', '', $code) . '`'; } return $markdown; @@ -59,4 +57,23 @@ class CodeConverter implements ConverterInterface { return array('code'); } + + /** + * @param ElementInterface $element + * @param string $code + * + * @return bool + */ + private function shouldBeBlock(ElementInterface $element, $code) + { + if ($element->getParent()->getTagName() == 'pre') { + return true; + } + + if (preg_match('/[^\s]` `/', $code)) { + return true; + } + + return false; + } } diff --git a/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php b/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php index d117e7d36..05d4fe81e 100644 --- a/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/HeaderConverter.php @@ -34,6 +34,10 @@ class HeaderConverter implements ConverterInterface, ConfigurationAwareInterface $level = (int) substr($element->getTagName(), 1, 1); $style = $this->config->getOption('header_style', self::STYLE_SETEXT); + if (strlen($element->getValue()) === 0) { + return ''; + } + if (($level === 1 || $level === 2) && !$element->isDescendantOf('blockquote') && $style === self::STYLE_SETEXT) { return $this->createSetextHeader($level, $element->getValue()); } diff --git a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php index 74b49a778..c82b70e97 100644 --- a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php @@ -21,6 +21,8 @@ class LinkConverter implements ConverterInterface $markdown = '[' . $text . '](' . $href . ' "' . $title . '")'; } elseif ($href === $text && $this->isValidAutolink($href)) { $markdown = '<' . $href . '>'; + } elseif ($href === 'mailto:' . $text && $this->isValidEmail($text)) { + $markdown = '<' . $text . '>'; } else { $markdown = '[' . $text . '](' . $href . ')'; } @@ -49,4 +51,15 @@ class LinkConverter implements ConverterInterface { return preg_match('/^[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*/i', $href) === 1; } + + /** + * @param string $email + * + * @return bool + */ + private function isValidEmail($email) + { + // Email validation is messy business, but this should cover most cases + return filter_var($email, FILTER_VALIDATE_EMAIL); + } } diff --git a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php index 3b77ba10b..321c898b1 100644 --- a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php @@ -13,8 +13,6 @@ class PreformattedConverter implements ConverterInterface */ public function convert(ElementInterface $element) { - $markdown = ''; - $pre_content = html_entity_decode($element->getChildrenAsString()); $pre_content = str_replace(array('<pre>', '</pre>'), '', $pre_content); @@ -28,28 +26,22 @@ class PreformattedConverter implements ConverterInterface $firstBacktick = strpos(trim($pre_content), '`'); $lastBacktick = strrpos(trim($pre_content), '`'); if ($firstBacktick === 0 && $lastBacktick === strlen(trim($pre_content)) - 1) { - return $pre_content; + return $pre_content . "\n\n"; } // If the execution reaches this point it means it's just a pre tag, with no code tag nested // Empty lines are a special case if ($pre_content === '') { - return "```\n```\n"; + return "```\n```\n\n"; } // Normalizing new lines - $pre_content = preg_replace('/\r\n|\r|\n/', PHP_EOL, $pre_content); - - // Is it a single line? - if (strpos($pre_content, PHP_EOL) === false) { - // One line of code, wrapping it on one backtick. - return '`' . $pre_content . '`'; - } + $pre_content = preg_replace('/\r\n|\r|\n/', "\n", $pre_content); // Ensure there's a newline at the end - if (strrpos($pre_content, PHP_EOL) !== strlen($pre_content) - 1) { - $pre_content .= PHP_EOL; + if (strrpos($pre_content, "\n") !== strlen($pre_content) - strlen("\n")) { + $pre_content .= "\n"; } // Use three backticks diff --git a/vendor/league/html-to-markdown/src/Converter/TextConverter.php b/vendor/league/html-to-markdown/src/Converter/TextConverter.php index d6d91e16f..fcd466094 100644 --- a/vendor/league/html-to-markdown/src/Converter/TextConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/TextConverter.php @@ -22,7 +22,9 @@ class TextConverter implements ConverterInterface $markdown = preg_replace('~\s+~u', ' ', $markdown); // Escape the following characters: '*', '_', '[', ']' and '\' - $markdown = preg_replace('~([*_\\[\\]\\\\])~u', '\\\\$1', $markdown); + if ($element->getParent() && $element->getParent()->getTagName() !== 'div') { + $markdown = preg_replace('~([*_\\[\\]\\\\])~u', '\\\\$1', $markdown); + } $markdown = preg_replace('~^#~u', '\\\\#', $markdown); diff --git a/vendor/league/html-to-markdown/src/HtmlConverter.php b/vendor/league/html-to-markdown/src/HtmlConverter.php index 155369f56..3381e1e1e 100644 --- a/vendor/league/html-to-markdown/src/HtmlConverter.php +++ b/vendor/league/html-to-markdown/src/HtmlConverter.php @@ -14,7 +14,7 @@ namespace League\HTMLToMarkdown; * * @license http://www.opensource.org/licenses/mit-license.php MIT */ -class HtmlConverter +class HtmlConverter implements HtmlConverterInterface { /** * @var Environment @@ -35,8 +35,8 @@ class HtmlConverter 'header_style' => 'setext', // Set to 'atx' to output H1 and H2 headers as # Header1 and ## Header2 'suppress_errors' => true, // Set to false to show warnings when loading malformed HTML 'strip_tags' => false, // Set to true to strip tags that don't have markdown equivalents. N.B. Strips tags, not their content. Useful to clean MS Word HTML output. - 'bold_style' => '**', // Set to '__' if you prefer the underlined style - 'italic_style' => '_', // Set to '*' if you prefer the asterisk style + 'bold_style' => '**', // DEPRECATED: Set to '__' if you prefer the underlined style + 'italic_style' => '*', // DEPRECATED: Set to '_' if you prefer the underlined style 'remove_nodes' => '', // space-separated list of dom nodes that should be removed. example: 'meta style script' 'hard_break' => false, // Set to true to turn <br> into `\n` instead of ` \n` 'list_item_style' => '-', // Set the default character for each <li> in a <ul>. Can be '-', '*', or '+' diff --git a/vendor/league/html-to-markdown/src/HtmlConverterInterface.php b/vendor/league/html-to-markdown/src/HtmlConverterInterface.php new file mode 100644 index 000000000..7d43cf87e --- /dev/null +++ b/vendor/league/html-to-markdown/src/HtmlConverterInterface.php @@ -0,0 +1,26 @@ +<?php + +namespace League\HTMLToMarkdown; + +/** + * Interface for an HTML-to-Markdown converter. + * + * @author Colin O'Dell <colinodell@gmail.com> + * + * @link https://github.com/thephpleague/html-to-markdown/ Latest version on GitHub. + * + * @license http://www.opensource.org/licenses/mit-license.php MIT + */ +interface HtmlConverterInterface +{ + /** + * Convert the given $html to Markdown + * + * @param string $html + * + * @throws \InvalidArgumentException + * + * @return string The Markdown version of the html + */ + public function convert($html); +} diff --git a/vendor/sabre/dav/CHANGELOG.md b/vendor/sabre/dav/CHANGELOG.md index 0bccc995c..cda2564e1 100644 --- a/vendor/sabre/dav/CHANGELOG.md +++ b/vendor/sabre/dav/CHANGELOG.md @@ -1,6 +1,12 @@ ChangeLog ========= +3.2.3 (2018-10-19) +------------------ + +* #982: Make sure that files that are siblings of directories, are reported + as files (@nickvergessen) + 3.2.2 (2017-02-14) ------------------ diff --git a/vendor/sabre/dav/bin/build.php b/vendor/sabre/dav/bin/build.php index c4ba20941..c4ba20941 100755..100644 --- a/vendor/sabre/dav/bin/build.php +++ b/vendor/sabre/dav/bin/build.php diff --git a/vendor/sabre/dav/bin/googlecode_upload.py b/vendor/sabre/dav/bin/googlecode_upload.py index caafd5ded..caafd5ded 100755..100644 --- a/vendor/sabre/dav/bin/googlecode_upload.py +++ b/vendor/sabre/dav/bin/googlecode_upload.py diff --git a/vendor/sabre/dav/bin/migrateto20.php b/vendor/sabre/dav/bin/migrateto20.php index 77236804f..77236804f 100755..100644 --- a/vendor/sabre/dav/bin/migrateto20.php +++ b/vendor/sabre/dav/bin/migrateto20.php diff --git a/vendor/sabre/dav/bin/migrateto21.php b/vendor/sabre/dav/bin/migrateto21.php index c81ee5cca..c81ee5cca 100755..100644 --- a/vendor/sabre/dav/bin/migrateto21.php +++ b/vendor/sabre/dav/bin/migrateto21.php diff --git a/vendor/sabre/dav/bin/migrateto30.php b/vendor/sabre/dav/bin/migrateto30.php index 9ca77c13c..9ca77c13c 100755..100644 --- a/vendor/sabre/dav/bin/migrateto30.php +++ b/vendor/sabre/dav/bin/migrateto30.php diff --git a/vendor/sabre/dav/bin/migrateto32.php b/vendor/sabre/dav/bin/migrateto32.php index 7567aeb60..7567aeb60 100755..100644 --- a/vendor/sabre/dav/bin/migrateto32.php +++ b/vendor/sabre/dav/bin/migrateto32.php diff --git a/vendor/sabre/dav/bin/sabredav.php b/vendor/sabre/dav/bin/sabredav.php index 950075d1a..950075d1a 100755..100644 --- a/vendor/sabre/dav/bin/sabredav.php +++ b/vendor/sabre/dav/bin/sabredav.php diff --git a/vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php b/vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php index a130cd61d..5b7b2ee17 100644 --- a/vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php +++ b/vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php @@ -52,12 +52,15 @@ class AddressData implements XmlDeserializable { ]; $elems = (array)$reader->parseInnerTree(); + $elems = array_filter($elems, function($element) { + return $element['name'] === '{urn:ietf:params:xml:ns:carddav}prop' && + isset($element['attributes']['name']); + }); $result['addressDataProperties'] = array_map(function($element) { return $element['attributes']['name']; }, $elems); return $result; - } } diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php index 6805ec0b0..f7fcf3057 100644 --- a/vendor/sabre/dav/lib/DAV/Server.php +++ b/vendor/sabre/dav/lib/DAV/Server.php @@ -893,15 +893,16 @@ class Server extends EventEmitter implements LoggerAwareInterface { $newDepth--; } + $propertyNames = $propFind->getRequestedProperties(); + $propFindType = !empty($propertyNames) ? PropFind::NORMAL : PropFind::ALLPROPS; + foreach ($this->tree->getChildren($path) as $childNode) { - $subPropFind = clone $propFind; - $subPropFind->setDepth($newDepth); if ($path !== '') { $subPath = $path . '/' . $childNode->getName(); } else { $subPath = $childNode->getName(); } - $subPropFind->setPath($subPath); + $subPropFind = new PropFind($subPath, $propertyNames, $newDepth, $propFindType); yield [ $subPropFind, diff --git a/vendor/sabre/dav/lib/DAV/Tree.php b/vendor/sabre/dav/lib/DAV/Tree.php index 5d2792503..7c04f0915 100644 --- a/vendor/sabre/dav/lib/DAV/Tree.php +++ b/vendor/sabre/dav/lib/DAV/Tree.php @@ -298,7 +298,9 @@ class Tree { */ protected function copyNode(INode $source, ICollection $destinationParent, $destinationName = null) { - if (!$destinationName) $destinationName = $source->getName(); + if ((string)$destinationName === '') { + $destinationName = $source->getName(); + } if ($source instanceof IFile) { diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php index 455403aff..917f5ec3f 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php @@ -60,7 +60,7 @@ class AbstractBasicTest extends \PHPUnit_Framework_TestCase { $backend->setRealm('writing unittests on a saturday night'); $backend->challenge($request, $response); - $this->assertEquals( + $this->assertContains( 'Basic realm="writing unittests on a saturday night"', $response->getHeader('WWW-Authenticate') ); diff --git a/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php b/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php index e719e38d5..c70d17a22 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/TreeTest.php @@ -24,6 +24,22 @@ class TreeTest extends \PHPUnit_Framework_TestCase { } + function testCopyFile() { + + $tree = new TreeMock(); + $tree->copy('hi/file', 'hi/newfile'); + + $this->assertArrayHasKey('newfile', $tree->getNodeForPath('hi')->newFiles); + } + + function testCopyFile0() { + + $tree = new TreeMock(); + $tree->copy('hi/file', 'hi/0'); + + $this->assertArrayHasKey('0', $tree->getNodeForPath('hi')->newFiles); + } + function testMove() { $tree = new TreeMock(); diff --git a/vendor/smarty/smarty/NEW_FEATURES.txt b/vendor/smarty/smarty/NEW_FEATURES.txt index 7632b07ea..b3289dfc1 100644 --- a/vendor/smarty/smarty/NEW_FEATURES.txt +++ b/vendor/smarty/smarty/NEW_FEATURES.txt @@ -2,7 +2,14 @@ This file contains a brief description of new features which have been added to Smarty 3.1 -Smarty 3.1.32 New tags for inheritance parent and child +Smarty 3.1.33-dev + Variable capture name in Smarty special variable + ================================================ + {$smarty.capture.$foo} can now be used to access the content of a named + capture block + +Smarty 3.1.32 + New tags for inheritance parent and child ========================================= {parent} == {$smarty.block.parent} {child} == {$smarty.block.child} diff --git a/vendor/smarty/smarty/change_log.txt b/vendor/smarty/smarty/change_log.txt index 5765a1718..70762eda5 100644 --- a/vendor/smarty/smarty/change_log.txt +++ b/vendor/smarty/smarty/change_log.txt @@ -1,4 +1,46 @@ -===== 3.1.32 ===== (24.04.2018) +===== 3.1.33 release ===== 12.09.2018 +===== 3.1.33-dev-12 ===== +03.09.2018 + - bugfix {foreach} using new style property access like {$item@property} on + Smarty 2 style named foreach loop could produce errors https://github.com/smarty-php/smarty/issues/484 + +31.08.2018 + - bugfix some custom left and right delimiters like '{^' '^}' did not work + https://github.com/smarty-php/smarty/issues/450 https://github.com/smarty-php/smarty/pull/482 + + - reformating for PSR-2 coding standards https://github.com/smarty-php/smarty/pull/483 + + - bugfix on Windows absolute filepathes did fail if the drive letter was followed by a linux DIRECTORY_SEPARATOR + like C:/ at Smarty > 3.1.33-dev-5 https://github.com/smarty-php/smarty/issues/451 + + - PSR-2 code style fixes for config and template file Lexer/Parser generated with + the Smarty Lexer/Parser generator from https://github.com/smarty-php/smarty-lexer + https://github.com/smarty-php/smarty/pull/483 + +26.08.2018 + - bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable + like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481 + +===== 3.1.33-dev-6 ===== +19.08.2018 + - fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452 + https://github.com/smarty-php/smarty/pull/475 + https://github.com/smarty-php/smarty/pull/473 + - bugfix PHP5.2 compatibility https://github.com/smarty-php/smarty/pull/472 + +===== 3.1.33-dev-4 ===== +17.05.2018 + - bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436 + - bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437 + https://github.com/smarty-php/smarty/pull/438 + - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443 + - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 + +26.04.2018 + - bugfix regarding Security Vulnerability did not solve the problem under Linux. + Security issue CVE-2018-16831 + +===== 3.1.32 ===== (24.04.2018) 24.04.2018 - bugfix possible Security Vulnerability in Smarty_Security class. diff --git a/vendor/smarty/smarty/composer.json b/vendor/smarty/smarty/composer.json index 5064c8ce3..5007517bc 100644 --- a/vendor/smarty/smarty/composer.json +++ b/vendor/smarty/smarty/composer.json @@ -2,7 +2,9 @@ "name": "smarty/smarty", "type": "library", "description": "Smarty - the compiling PHP template engine", - "keywords": ["templating"], + "keywords": [ + "templating" + ], "homepage": "http://www.smarty.net", "license": "LGPL-3.0", "authors": [ @@ -28,12 +30,13 @@ "php": ">=5.2" }, "autoload": { - "files": ["libs/bootstrap.php"] + "files": [ + "libs/bootstrap.php" + ] }, "extra": { "branch-alias": { "dev-master": "3.1.x-dev" } } - -} +}
\ No newline at end of file diff --git a/vendor/smarty/smarty/demo/index.php b/vendor/smarty/smarty/demo/index.php index b67c217be..3aed37168 100644 --- a/vendor/smarty/smarty/demo/index.php +++ b/vendor/smarty/smarty/demo/index.php @@ -4,27 +4,32 @@ * * @package Example-application */ - require '../libs/Smarty.class.php'; - $smarty = new Smarty; - //$smarty->force_compile = true; $smarty->debugging = true; $smarty->caching = true; $smarty->cache_lifetime = 120; - $smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true); $smarty->assign("FirstName", array("John", "Mary", "James", "Henry")); $smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case")); -$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), array("I", "J", "K", "L"), - array("M", "N", "O", "P"))); - -$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), - array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); - +$smarty->assign( + "Class", + array( + array("A", "B", "C", "D"), + array("E", "F", "G", "H"), + array("I", "J", "K", "L"), + array("M", "N", "O", "P") + ) +); +$smarty->assign( + "contacts", + array( + array("phone" => "1", "fax" => "2", "cell" => "3"), + array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234") + ) +); $smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX")); $smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas")); $smarty->assign("option_selected", "NE"); - $smarty->display('index.tpl'); diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php b/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php index ed55ec846..7867cc598 100644 --- a/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php @@ -11,6 +11,11 @@ */ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { + /** + * Smarty_CacheResource_Apc constructor. + * + * @throws \Exception + */ public function __construct() { // test if APC is present @@ -22,7 +27,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch + * @param array $keys list of keys to fetch * * @return array list of values with the given keys used as indexes * @return boolean true on success, false on failure @@ -34,15 +39,14 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore foreach ($res as $k => $v) { $_res[ $k ] = $v; } - return $_res; } /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * * @return boolean true on success, false on failure */ @@ -51,14 +55,13 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore foreach ($keys as $k => $v) { apc_store($k, $v, $expire); } - return true; } /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * * @return boolean true on success, false on failure */ @@ -67,7 +70,6 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore foreach ($keys as $k) { apc_delete($k); } - return true; } diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php b/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php index 945beb349..9c8855c31 100644 --- a/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php @@ -19,6 +19,9 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore */ protected $memcache = null; + /** + * Smarty_CacheResource_Memcache constructor. + */ public function __construct() { if (class_exists('Memcached')) { @@ -32,7 +35,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch + * @param array $keys list of keys to fetch * * @return array list of values with the given keys used as indexes * @return boolean true on success, false on failure @@ -50,15 +53,14 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore foreach ($res as $k => $v) { $_res[ $lookup[ $k ] ] = $v; } - return $_res; } /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * * @return boolean true on success, false on failure */ @@ -68,14 +70,13 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore $k = sha1($k); $this->memcache->set($k, $v, 0, $expire); } - return true; } /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * * @return boolean true on success, false on failure */ @@ -85,7 +86,6 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore $k = sha1($k); $this->memcache->delete($k); } - return true; } @@ -96,6 +96,6 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore */ protected function purge() { - $this->memcache->flush(); + return $this->memcache->flush(); } } diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php b/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php index 027b93766..c5037eb13 100644 --- a/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php @@ -24,38 +24,55 @@ */ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { - // PDO instance + /** + * @var \PDO + */ protected $db; + /** + * @var \PDOStatement + */ protected $fetch; + /** + * @var \PDOStatement + */ protected $fetchTimestamp; + /** + * @var \PDOStatement + */ protected $save; + /** + * Smarty_CacheResource_Mysql constructor. + * + * @throws \SmartyException + */ public function __construct() { try { $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); - } - catch (PDOException $e) { + } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } $this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id'); $this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id'); - $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content) - VALUES (:id, :name, :cache_id, :compile_id, :content)'); + $this->save = $this->db->prepare( + 'REPLACE INTO output_cache (id, name, cache_id, compile_id, content) + VALUES (:id, :name, :cache_id, :compile_id, :content)' + ); } /** * fetch cached content and its modification time from data source * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) * * @return void */ @@ -76,12 +93,13 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom /** * Fetch cached content's modification timestamp from data source * - * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content. + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than + * loading the complete cached content. * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id * * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ @@ -90,37 +108,40 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom $this->fetchTimestamp->execute(array('id' => $id)); $mtime = strtotime($this->fetchTimestamp->fetchColumn()); $this->fetchTimestamp->closeCursor(); - return $mtime; } /** * Save content to cache * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null - * @param string $content content to cache + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache * * @return boolean success */ protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) { - $this->save->execute(array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id, - 'content' => $content,)); - + $this->save->execute( + array('id' => $id, + 'name' => $name, + 'cache_id' => $cache_id, + 'compile_id' => $compile_id, + 'content' => $content,) + ); return !!$this->save->rowCount(); } /** * Delete content from cache * - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration or null + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null * * @return integer number of deleted caches */ @@ -130,8 +151,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { // returning the number of deleted caches would require a second query to count them $query = $this->db->query('TRUNCATE TABLE output_cache'); - - return - 1; + return -1; } // build the filter $where = array(); @@ -149,12 +169,15 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom } // equal test cache_id and match sub-groups if ($cache_id !== null) { - $where[] = '(cache_id = ' . $this->db->quote($cache_id) . ' OR cache_id LIKE ' . - $this->db->quote($cache_id . '|%') . ')'; + $where[] = + '(cache_id = ' . + $this->db->quote($cache_id) . + ' OR cache_id LIKE ' . + $this->db->quote($cache_id . '|%') . + ')'; } // run delete query $query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); - return $query->rowCount(); } } diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php index 24a94c1a0..a80cd698e 100644 --- a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php @@ -29,28 +29,27 @@ */ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom { - - protected $fetchStatements = Array('default' => 'SELECT %2$s + /** + * @var string[] + */ + protected $fetchStatements = array('default' => 'SELECT %2$s FROM %1$s WHERE 1 AND id = :id AND cache_id IS NULL AND compile_id IS NULL', - 'withCacheId' => 'SELECT %2$s FROM %1$s WHERE 1 AND id = :id AND cache_id = :cache_id AND compile_id IS NULL', - 'withCompileId' => 'SELECT %2$s FROM %1$s WHERE 1 AND id = :id AND compile_id = :compile_id AND cache_id IS NULL', - 'withCacheIdAndCompileId' => 'SELECT %2$s FROM %1$s WHERE 1 @@ -58,6 +57,9 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom AND cache_id = :cache_id AND compile_id = :compile_id'); + /** + * @var string + */ protected $insertStatement = 'INSERT INTO %s SET id = :id, @@ -76,113 +78,130 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), content = :content'; + /** + * @var string + */ protected $deleteStatement = 'DELETE FROM %1$s WHERE %2$s'; + /** + * @var string + */ protected $truncateStatement = 'TRUNCATE TABLE %s'; + /** + * @var string + */ protected $fetchColumns = 'modified, content'; + /** + * @var string + */ protected $fetchTimestampColumns = 'modified'; - protected $pdo, $table, $database; + /** + * @var \PDO + */ + protected $pdo; + + /** + * @var + */ + protected $table; - /* - * Constructor - * - * @param PDO $pdo PDO : active connection - * @param string $table : table (or view) name - * @param string $database : optional - if table is located in another db + /** + * @var null + */ + protected $database; + + /** + * Constructor + * + * @param PDO $pdo PDO : active connection + * @param string $table : table (or view) name + * @param string $database : optional - if table is located in another db + * + * @throws \SmartyException */ public function __construct(PDO $pdo, $table, $database = null) { - if (is_null($table)) { throw new SmartyException("Table name for caching can't be null"); } - $this->pdo = $pdo; $this->table = $table; $this->database = $database; - $this->fillStatementsWithTableName(); } - /* - * Fills the table name into the statements. - * - * @return Current Instance - * @access protected + /** + * Fills the table name into the statements. + * + * @return $this Current Instance + * @access protected */ protected function fillStatementsWithTableName() { - - foreach ($this->fetchStatements AS &$statement) { + foreach ($this->fetchStatements as &$statement) { $statement = sprintf($statement, $this->getTableName(), '%s'); } - $this->insertStatement = sprintf($this->insertStatement, $this->getTableName()); $this->deleteStatement = sprintf($this->deleteStatement, $this->getTableName(), '%s'); $this->truncateStatement = sprintf($this->truncateStatement, $this->getTableName()); - return $this; } - /* - * Gets the fetch statement, depending on what you specify - * - * @param string $columns : the column(s) name(s) you want to retrieve from the database - * @param string $id unique cache content identifier - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @access protected + /** + * Gets the fetch statement, depending on what you specify + * + * @param string $columns : the column(s) name(s) you want to retrieve from the database + * @param string $id unique cache content identifier + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * + * @access protected + * @return \PDOStatement */ protected function getFetchStatement($columns, $id, $cache_id = null, $compile_id = null) { - + $args = array(); if (!is_null($cache_id) && !is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCacheIdAndCompileId' ] AND - $args = Array('id' => $id, 'cache_id' => $cache_id, 'compile_id' => $compile_id); + $query = $this->fetchStatements[ 'withCacheIdAndCompileId' ] and + $args = array('id' => $id, 'cache_id' => $cache_id, 'compile_id' => $compile_id); } elseif (is_null($cache_id) && !is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCompileId' ] AND - $args = Array('id' => $id, 'compile_id' => $compile_id); + $query = $this->fetchStatements[ 'withCompileId' ] and + $args = array('id' => $id, 'compile_id' => $compile_id); } elseif (!is_null($cache_id) && is_null($compile_id)) { - $query = $this->fetchStatements[ 'withCacheId' ] AND $args = Array('id' => $id, 'cache_id' => $cache_id); + $query = $this->fetchStatements[ 'withCacheId' ] and $args = array('id' => $id, 'cache_id' => $cache_id); } else { - $query = $this->fetchStatements[ 'default' ] AND $args = Array('id' => $id); + $query = $this->fetchStatements[ 'default' ] and $args = array('id' => $id); } - $query = sprintf($query, $columns); - $stmt = $this->pdo->prepare($query); - - foreach ($args AS $key => $value) { + foreach ($args as $key => $value) { $stmt->bindValue($key, $value); } - return $stmt; } /** * fetch cached content and its modification time from data source * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) * * @return void * @access protected */ protected function fetch($id, $name, $cache_id = null, $compile_id = null, &$content, &$mtime) { - $stmt = $this->getFetchStatement($this->fetchColumns, $id, $cache_id, $compile_id); $stmt->execute(); $row = $stmt->fetch(); $stmt->closeCursor(); - if ($row) { $content = $this->outputContent($row[ 'content' ]); $mtime = strtotime($row[ 'modified' ]); @@ -197,10 +216,10 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom * {@internal implementing this method is optional. * Only implement it if modification times can be accessed faster than loading the complete cached content.}} * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id * * @return integer|boolean timestamp (epoch) the template was modified, or false if not found * @access protected @@ -212,7 +231,6 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom // $stmt -> closeCursor(); // return $mtime; // } - /** * Save content to cache * @@ -228,38 +246,37 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom */ protected function save($id, $name, $cache_id = null, $compile_id = null, $exp_time, $content) { - $stmt = $this->pdo->prepare($this->insertStatement); - $stmt->bindValue('id', $id); $stmt->bindValue('name', $name); $stmt->bindValue('cache_id', $cache_id, (is_null($cache_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); $stmt->bindValue('compile_id', $compile_id, (is_null($compile_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); - $stmt->bindValue('expire', (int) $exp_time, PDO::PARAM_INT); + $stmt->bindValue('expire', (int)$exp_time, PDO::PARAM_INT); $stmt->bindValue('content', $this->inputContent($content)); $stmt->execute(); - return !!$stmt->rowCount(); } - /* - * Encodes the content before saving to database - * - * @param string $content - * @return string $content - * @access protected + /** + * Encodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected */ protected function inputContent($content) { return $content; } - /* - * Decodes the content before saving to database - * - * @param string $content - * @return string $content - * @access protected + /** + * Decodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected */ protected function outputContent($content) { @@ -272,43 +289,46 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom * @param string|null $name template name * @param string|null $cache_id cache id * @param string|null $compile_id compile id - * @param integer|null|-1 $exp_time seconds till expiration or null + * @param integer|null|-1 $exp_time seconds till expiration or null * * @return integer number of deleted caches - * @access protected + * @access protected */ protected function delete($name = null, $cache_id = null, $compile_id = null, $exp_time = null) { - - // delete the whole cache + // delete the whole cache if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { - // returning the number of deleted caches would require a second query to count them + // returning the number of deleted caches would require a second query to count them $this->pdo->query($this->truncateStatement); - return - 1; + return -1; } - // build the filter + // build the filter $where = array(); - // equal test name + // equal test name if ($name !== null) { $where[] = 'name = ' . $this->pdo->quote($name); } - // equal test cache_id and match sub-groups + // equal test cache_id and match sub-groups if ($cache_id !== null) { - $where[] = '(cache_id = ' . $this->pdo->quote($cache_id) . ' OR cache_id LIKE ' . - $this->pdo->quote($cache_id . '|%') . ')'; + $where[] = + '(cache_id = ' . + $this->pdo->quote($cache_id) . + ' OR cache_id LIKE ' . + $this->pdo->quote($cache_id . '|%') . + ')'; } - // equal test compile_id + // equal test compile_id if ($compile_id !== null) { $where[] = 'compile_id = ' . $this->pdo->quote($compile_id); } - // for clearing expired caches + // for clearing expired caches if ($exp_time === Smarty::CLEAR_EXPIRED) { $where[] = 'expire < CURRENT_TIMESTAMP'; } // range test expiration time elseif ($exp_time !== null) { $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; } - // run delete query + // run delete query $query = $this->pdo->query(sprintf($this->deleteStatement, join(' AND ', $where))); return $query->rowCount(); } @@ -324,4 +344,3 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom return (is_null($this->database)) ? "`{$this->table}`" : "`{$this->database}`.`{$this->table}`"; } } -
\ No newline at end of file diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php index 8a9e0a5dd..5560b9e39 100644 --- a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php @@ -1,4 +1,5 @@ <?php +require_once 'cacheresource.pdo.php'; /** * PDO Cache Handler with GZIP support @@ -11,33 +12,31 @@ * @require Smarty_CacheResource_Pdo class * @author Beno!t POLASZEK - 2014 */ -require_once 'cacheresource.pdo.php'; - class Smarty_CacheResource_Pdo_Gzip extends Smarty_CacheResource_Pdo { - - /* - * Encodes the content before saving to database - * - * @param string $content - * @return string $content - * @access protected + /** + * Encodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected */ protected function inputContent($content) { return gzdeflate($content); } - /* - * Decodes the content before saving to database - * - * @param string $content - * @return string $content - * @access protected + /** + * Decodes the content before saving to database + * + * @param string $content + * + * @return string $content + * @access protected */ protected function outputContent($content) { return gzinflate($content); } -} -
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/demo/plugins/resource.extendsall.php b/vendor/smarty/smarty/demo/plugins/resource.extendsall.php index a5ee432dd..a547d41db 100644 --- a/vendor/smarty/smarty/demo/plugins/resource.extendsall.php +++ b/vendor/smarty/smarty/demo/plugins/resource.extendsall.php @@ -13,8 +13,8 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -32,15 +32,13 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends $sources[ $s->uid ] = $s; $uid .= $s->filepath; $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp; - } - catch (SmartyException $e) { + } catch (SmartyException $e) { } } if (!$sources) { $source->exists = false; return; } - $sources = array_reverse($sources, true); reset($sources); $s = current($sources); @@ -51,15 +49,14 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends $source->timestamp = $timestamp; } - /* + /** * Disable timestamp checks for extendsall resource. * The individual source components will be checked. * - * @return bool + * @return bool false */ public function checkTimestamps() { return false; } - } diff --git a/vendor/smarty/smarty/demo/plugins/resource.mysql.php b/vendor/smarty/smarty/demo/plugins/resource.mysql.php index 619707e78..95a3c2baf 100644 --- a/vendor/smarty/smarty/demo/plugins/resource.mysql.php +++ b/vendor/smarty/smarty/demo/plugins/resource.mysql.php @@ -12,28 +12,46 @@ * PRIMARY KEY (`name`) * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre> * Demo data: - * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre> + * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello + * world"}{$x}');</pre> + * * * @package Resource-examples * @author Rodney Rehm */ class Smarty_Resource_Mysql extends Smarty_Resource_Custom { - // PDO instance + /** + * PDO instance + * + * @var \PDO + */ protected $db; - // prepared fetch() statement + /** + * prepared fetch() statement + * + * @var \PDOStatement + */ protected $fetch; - // prepared fetchTimestamp() statement + /** + * prepared fetchTimestamp() statement + * + * @var \PDOStatement + */ protected $mtime; + /** + * Smarty_Resource_Mysql constructor. + * + * @throws \SmartyException + */ public function __construct() { try { $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); - } - catch (PDOException $e) { + } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); @@ -43,9 +61,9 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom /** * Fetch a template and its modification time from database * - * @param string $name template name - * @param string $source template source - * @param integer $mtime template modification timestamp (epoch) + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) * * @return void */ @@ -66,9 +84,10 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom /** * Fetch a template's modification time from database * - * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source. + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than + * loading the comple template source. * - * @param string $name template name + * @param string $name template name * * @return integer timestamp (epoch) the template was modified */ @@ -77,7 +96,6 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom $this->mtime->execute(array('name' => $name)); $mtime = $this->mtime->fetchColumn(); $this->mtime->closeCursor(); - return strtotime($mtime); } } diff --git a/vendor/smarty/smarty/demo/plugins/resource.mysqls.php b/vendor/smarty/smarty/demo/plugins/resource.mysqls.php index d85aecf31..148a8dd61 100644 --- a/vendor/smarty/smarty/demo/plugins/resource.mysqls.php +++ b/vendor/smarty/smarty/demo/plugins/resource.mysqls.php @@ -14,25 +14,39 @@ * PRIMARY KEY (`name`) * ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre> * Demo data: - * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre> + * <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello + * world"}{$x}');</pre> + * * * @package Resource-examples * @author Rodney Rehm */ class Smarty_Resource_Mysqls extends Smarty_Resource_Custom { - // PDO instance + /** + * PDO instance + * + * @var \PDO + */ protected $db; - // prepared fetch() statement + /** + * prepared fetch() statement + * + * @var \PDOStatement + */ protected $fetch; + /** + * Smarty_Resource_Mysqls constructor. + * + * @throws \SmartyException + */ public function __construct() { try { $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); - } - catch (PDOException $e) { + } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); @@ -41,9 +55,9 @@ class Smarty_Resource_Mysqls extends Smarty_Resource_Custom /** * Fetch a template and its modification time from database * - * @param string $name template name - * @param string $source template source - * @param integer $mtime template modification timestamp (epoch) + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) * * @return void */ diff --git a/vendor/smarty/smarty/libs/Autoloader.php b/vendor/smarty/smarty/libs/Autoloader.php index 3a0da8faf..e4dc450f0 100644 --- a/vendor/smarty/smarty/libs/Autoloader.php +++ b/vendor/smarty/smarty/libs/Autoloader.php @@ -2,14 +2,14 @@ /** * Smarty Autoloader * - * @package Smarty + * @package Smarty */ /** * Smarty Autoloader * - * @package Smarty - * @author Uwe Tews + * @package Smarty + * @author Uwe Tews * Usage: * require_once '...path/Autoloader.php'; * Smarty_Autoloader::register(); @@ -20,7 +20,7 @@ */ class Smarty_Autoloader { - /** + /** * Filepath to Smarty root * * @var string @@ -54,8 +54,8 @@ class Smarty_Autoloader if (!defined('SMARTY_SPL_AUTOLOAD')) { define('SMARTY_SPL_AUTOLOAD', 0); } - if (SMARTY_SPL_AUTOLOAD && - set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false + if (SMARTY_SPL_AUTOLOAD + && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false ) { $registeredAutoLoadFunctions = spl_autoload_functions(); if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) { diff --git a/vendor/smarty/smarty/libs/Smarty.class.php b/vendor/smarty/smarty/libs/Smarty.class.php index 597fbbf0c..a8969926b 100644 --- a/vendor/smarty/smarty/libs/Smarty.class.php +++ b/vendor/smarty/smarty/libs/Smarty.class.php @@ -27,7 +27,7 @@ * @author Uwe Tews <uwe dot tews at gmail dot com> * @author Rodney Rehm * @package Smarty - * @version 3.1.32 + * @version 3.1.33 */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32'; + const SMARTY_VERSION = '3.1.33'; /** * define variable scopes */ @@ -166,133 +166,157 @@ class Smarty extends Smarty_Internal_TemplateBase const PLUGIN_COMPILER = 'compiler'; const PLUGIN_MODIFIER = 'modifier'; const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + /** * assigned global tpl vars */ public static $global_tpl_vars = array(); + /** * Flag denoting if Multibyte String functions are available */ public static $_MBSTRING = SMARTY_MBSTRING; + /** * The character set to adhere to (e.g. "UTF-8") */ public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + /** * The date format to be used internally * (accepts date() and strftime()) */ public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT; + /** * Flag denoting if PCRE should run in UTF-8 mode */ public static $_UTF8_MODIFIER = 'u'; + /** * Flag denoting if operating system is windows */ public static $_IS_WINDOWS = false; + /** * auto literal on delimiters with whitespace * * @var boolean */ public $auto_literal = true; + /** * display error on not assigned variables * * @var boolean */ public $error_unassigned = false; + /** * look up relative file path in include_path * * @var boolean */ public $use_include_path = false; + /** * flag if template_dir is normalized * * @var bool */ public $_templateDirNormalized = false; + /** * joined template directory string used in cache keys * * @var string */ public $_joined_template_dir = null; + /** * flag if config_dir is normalized * * @var bool */ public $_configDirNormalized = false; + /** * joined config directory string used in cache keys * * @var string */ public $_joined_config_dir = null; + /** * default template handler * * @var callable */ public $default_template_handler_func = null; + /** * default config handler * * @var callable */ public $default_config_handler_func = null; + /** * default plugin handler * * @var callable */ public $default_plugin_handler_func = null; + /** * flag if template_dir is normalized * * @var bool */ public $_compileDirNormalized = false; + /** * flag if plugins_dir is normalized * * @var bool */ public $_pluginsDirNormalized = false; + /** * flag if template_dir is normalized * * @var bool */ public $_cacheDirNormalized = false; + /** * force template compiling? * * @var boolean */ public $force_compile = false; - /** + + /** * use sub dirs for compiled/cached files? * * @var boolean */ public $use_sub_dirs = false; + /** * allow ambiguous resources (that are made unique by the resource handler) * * @var boolean */ public $allow_ambiguous_resources = false; + /** * merge compiled includes * * @var boolean */ public $merge_compiled_includes = false; + /* * flag for behaviour when extends: resource and {extends} tag are used simultaneous * if false disable execution of {extends} in templates called by extends resource. @@ -301,30 +325,35 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $extends_recursion = true; + /** * force cache file creation * * @var boolean */ public $force_cache = false; + /** * template left-delimiter * * @var string */ public $left_delimiter = "{"; + /** * template right-delimiter * * @var string */ public $right_delimiter = "}"; + /** * array of strings which shall be treated as literal by compiler * * @var array string */ public $literals = array(); + /** * class name * This should be instance of Smarty_Security. @@ -333,24 +362,28 @@ class Smarty extends Smarty_Internal_TemplateBase * @see Smarty_Security */ public $security_class = 'Smarty_Security'; + /** * implementation of security class * * @var Smarty_Security */ public $security_policy = null; + /** * controls handling of PHP-blocks * * @var integer */ public $php_handling = self::PHP_PASSTHRU; + /** * controls if the php template file resource is allowed * * @var bool */ public $allow_php_templates = false; + /** * debug mode * Setting this to true enables the debug-console. @@ -358,6 +391,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @var boolean */ public $debugging = false; + /** * This determines if debugging is enable-able from the browser. * <ul> @@ -368,6 +402,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @var string */ public $debugging_ctrl = 'NONE'; + /** * Name of debugging URL-param. * Only used when $debugging_ctrl is set to 'URL'. @@ -376,54 +411,63 @@ class Smarty extends Smarty_Internal_TemplateBase * @var string */ public $smarty_debug_id = 'SMARTY_DEBUG'; + /** * Path of debug template. * * @var string */ public $debug_tpl = null; + /** * When set, smarty uses this value as error_reporting-level. * * @var int */ public $error_reporting = null; + /** * Controls whether variables with the same name overwrite each other. * * @var boolean */ public $config_overwrite = true; + /** * Controls whether config values of on/true/yes and off/false/no get converted to boolean. * * @var boolean */ public $config_booleanize = true; + /** * Controls whether hidden config sections/vars are read from the file. * * @var boolean */ public $config_read_hidden = false; + /** * locking concurrent compiles * * @var boolean */ public $compile_locking = true; + /** * Controls whether cache resources should use locking mechanism * * @var boolean */ public $cache_locking = false; + /** * seconds to wait for acquiring a lock before ignoring the write lock * * @var float */ public $locking_timeout = 10; + /** * resource type used if none given * Must be an valid key of $registered_resources. @@ -431,6 +475,7 @@ class Smarty extends Smarty_Internal_TemplateBase * @var string */ public $default_resource_type = 'file'; + /** * caching type * Must be an element of $cache_resource_types. @@ -438,160 +483,189 @@ class Smarty extends Smarty_Internal_TemplateBase * @var string */ public $caching_type = 'file'; + /** * config type * * @var string */ public $default_config_type = 'file'; + /** * check If-Modified-Since headers * * @var boolean */ public $cache_modified_check = false; + /** * registered plugins * * @var array */ public $registered_plugins = array(); + /** * registered objects * * @var array */ public $registered_objects = array(); + /** * registered classes * * @var array */ public $registered_classes = array(); + /** * registered filters * * @var array */ public $registered_filters = array(); + /** * registered resources * * @var array */ public $registered_resources = array(); + /** * registered cache resources * * @var array */ public $registered_cache_resources = array(); + /** * autoload filter * * @var array */ public $autoload_filters = array(); + /** * default modifier * * @var array */ public $default_modifiers = array(); + /** * autoescape variable output * * @var boolean */ public $escape_html = false; + /** * start time for execution time calculation * * @var int */ public $start_time = 0; + /** * required by the compiler for BC * * @var string */ public $_current_file = null; + /** * internal flag to enable parser debugging * * @var bool */ public $_parserdebug = false; + /** * This object type (Smarty = 1, template = 2, data = 4) * * @var int */ public $_objType = 1; + /** * Debug object * * @var Smarty_Internal_Debug */ public $_debug = null; + /** * template directory * * @var array */ protected $template_dir = array('./templates/'); + /** * flags for normalized template directory entries * * @var array */ protected $_processedTemplateDir = array(); + /** * config directory * * @var array */ protected $config_dir = array('./configs/'); + /** * flags for normalized template directory entries * * @var array */ protected $_processedConfigDir = array(); + /** * compile directory * * @var string */ protected $compile_dir = './templates_c/'; + /** * plugins directory * * @var array */ protected $plugins_dir = array(); + /** * cache directory * * @var string */ protected $cache_dir = './cache/'; + /** * removed properties * * @var string[] */ - protected $obsoleteProperties = array('resource_caching', 'template_resource_caching', 'direct_access_security', - '_dir_perms', '_file_perms', 'plugin_search_order', - 'inheritance_merge_compiled_includes', 'resource_cache_mode',); + protected $obsoleteProperties = array( + 'resource_caching', 'template_resource_caching', 'direct_access_security', + '_dir_perms', '_file_perms', 'plugin_search_order', + 'inheritance_merge_compiled_includes', 'resource_cache_mode', + ); + /** * List of private properties which will call getter/setter on a direct access * * @var string[] */ - protected $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', - 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', - 'cache_dir' => 'CacheDir',); + protected $accessMap = array( + 'template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', + 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', + 'cache_dir' => 'CacheDir', + ); /** * Initialize new Smarty object @@ -618,7 +692,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Enable error handler to mute expected messages * - * @return boolean + * @return boolean * @deprecated */ public static function muteExpectedErrors() @@ -639,7 +713,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Check if a template resource exists * - * @param string $resource_name template name + * @param string $resource_name template name * * @return bool status * @throws \SmartyException @@ -654,10 +728,10 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Loads security class and enables security * - * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * @param string|Smarty_Security $security_class if a string is used, it must be class-name * * @return Smarty current Smarty instance for chaining - * @throws SmartyException when an invalid class name is provided + * @throws \SmartyException */ public function enableSecurity($security_class = null) { @@ -679,9 +753,9 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Add template directory(s) * - * @param string|array $template_dir directory(s) of template sources - * @param string $key of the array element to assign the template dir to - * @param bool $isConfig true for config_dir + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * @param bool $isConfig true for config_dir * * @return Smarty current Smarty instance for chaining */ @@ -747,8 +821,8 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Set template directory * - * @param string|array $template_dir directory(s) of template sources - * @param bool $isConfig true for config_dir + * @param string|array $template_dir directory(s) of template sources + * @param bool $isConfig true for config_dir * * @return \Smarty current Smarty instance for chaining */ @@ -835,7 +909,7 @@ class Smarty extends Smarty_Internal_TemplateBase $this->plugins_dir = (array)$this->plugins_dir; } foreach ($this->plugins_dir as $k => $v) { - $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, "/\\") . DIRECTORY_SEPARATOR, true); + $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, '/\\') . DIRECTORY_SEPARATOR, true); } $this->_cache[ 'plugin_files' ] = array(); $this->_pluginsDirNormalized = true; @@ -846,7 +920,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Set plugins directory * - * @param string|array $plugins_dir directory(s) of plugins + * @param string|array $plugins_dir directory(s) of plugins * * @return Smarty current Smarty instance for chaining */ @@ -901,7 +975,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Set cache directory * - * @param string $cache_dir directory to store cached templates in + * @param string $cache_dir directory to store cached templates in * * @return Smarty current Smarty instance for chaining */ @@ -915,11 +989,11 @@ class Smarty extends Smarty_Internal_TemplateBase /** * creates a template object * - * @param string $template the resource handle of the template file - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param boolean $do_clone flag is Smarty object shall be cloned + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned * * @return \Smarty_Internal_Template template object * @throws \SmartyException @@ -946,7 +1020,7 @@ class Smarty extends Smarty_Internal_TemplateBase Smarty_Internal_Template::$isCacheTplObj[ $_templateId ]; $tpl->inheritance = null; $tpl->tpl_vars = $tpl->config_vars = array(); - } else if (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) { + } elseif (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) { $tpl = clone Smarty_Internal_Template::$tplObjCache[ $_templateId ]; $tpl->inheritance = null; $tpl->tpl_vars = $tpl->config_vars = array(); @@ -981,11 +1055,11 @@ class Smarty extends Smarty_Internal_TemplateBase * class name format: Smarty_PluginType_PluginName * plugin filename format: plugintype.pluginname.php * - * @param string $plugin_name class plugin name to load - * @param bool $check check if already loaded + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded * - * @throws SmartyException * @return string |boolean filepath of loaded file or false + * @throws \SmartyException */ public function loadPlugin($plugin_name, $check = true) { @@ -1004,12 +1078,13 @@ class Smarty extends Smarty_Internal_TemplateBase * @return string * @throws \SmartyException */ - public function _getTemplateId($template_name, - $cache_id = null, - $compile_id = null, - $caching = null, - Smarty_Internal_Template $template = null) - { + public function _getTemplateId( + $template_name, + $cache_id = null, + $compile_id = null, + $caching = null, + Smarty_Internal_Template $template = null + ) { $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" : $template_name; $cache_id = $cache_id === null ? $this->cache_id : $cache_id; @@ -1033,33 +1108,22 @@ class Smarty extends Smarty_Internal_TemplateBase * - remove /./ and /../ * - make it absolute if required * - * @param string $path file path - * @param bool $realpath if true - convert to absolute - * false - convert to relative - * null - keep as it is but remove /./ /../ + * @param string $path file path + * @param bool $realpath if true - convert to absolute + * false - convert to relative + * null - keep as it is but + * remove /./ /../ * * @return string */ public function _realpath($path, $realpath = null) { - static $nds = null; - static $sepDotsep = null; - static $sepDot = null; - static $sepSep =null; - if (!isset($nds)) { - $nds = array('/' => '\\', '\\' => '/'); - $sepDotsep = DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR; - $sepDot = DIRECTORY_SEPARATOR . '.'; - $sepSep = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR; - } - // normalize DIRECTORY_SEPARATOR - $path = str_replace(array($nds[DIRECTORY_SEPARATOR], $sepDotsep), DIRECTORY_SEPARATOR, $path); - if (strpos($path,$sepDot) === false && (($realpath === false && $path[0] === '.') || $realpath === null) && $path[0] !== '\\') { - return $path; - } - preg_match('%^(?<root>(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?<path>(.*))$%u', - $path, - $parts); + $nds = array('/' => '\\', '\\' => '/'); + preg_match( + '%^(?<root>(?:[[:alpha:]]:[\\\\/]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?<path>(.*))$%u', + $path, + $parts + ); $path = $parts[ 'path' ]; if ($parts[ 'root' ] === '\\') { $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ]; @@ -1068,24 +1132,18 @@ class Smarty extends Smarty_Internal_TemplateBase $path = getcwd() . DIRECTORY_SEPARATOR . $path; } } - // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns - $path = str_replace(array($sepDotsep,$sepSep), DIRECTORY_SEPARATOR, $path); - // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first - if (strpos($path, '..' . DIRECTORY_SEPARATOR) !== false && - preg_match_all('#[\\\\/]([.][.][\\\\/])+#u', $path, $match) - ) { - $counts = array(); - foreach ($match[ 0 ] as $m) { - $counts[] = (int)((strlen($m) - 1) / 3); - } - sort($counts); - foreach ($counts as $count) { - $path = preg_replace('#([\\\\/]+[^\\\\/]+){' . $count . - '}[\\\\/]+([.][.][\\\\/]+){' . $count . '}#u', - DIRECTORY_SEPARATOR, - $path); - } - } + // normalize DIRECTORY_SEPARATOR + $path = str_replace($nds[ DIRECTORY_SEPARATOR ], DIRECTORY_SEPARATOR, $path); + $parts[ 'root' ] = str_replace($nds[ DIRECTORY_SEPARATOR ], DIRECTORY_SEPARATOR, $parts[ 'root' ]); + do { + $path = preg_replace( + array('#[\\\\/]{2}#', '#[\\\\/][.][\\\\/]#', '#[\\\\/]([^\\\\/.]+)[\\\\/][.][.][\\\\/]#'), + DIRECTORY_SEPARATOR, + $path, + -1, + $count + ); + } while ($count > 0); return $realpath !== false ? $parts[ 'root' ] . $path : str_ireplace(getcwd(), '.', $parts[ 'root' ] . $path); } @@ -1279,19 +1337,18 @@ class Smarty extends Smarty_Internal_TemplateBase * Calls the appropriate getter function. * Issues an E_USER_NOTICE if no valid getter is found. * - * @param string $name property name + * @param string $name property name * * @return mixed - * @throws \SmartyException */ public function __get($name) { if (isset($this->accessMap[ $name ])) { $method = 'get' . $this->accessMap[ $name ]; return $this->{$method}(); - } else if (isset($this->_cache[ $name ])) { + } elseif (isset($this->_cache[ $name ])) { return $this->_cache[ $name ]; - } else if (in_array($name, $this->obsoleteProperties)) { + } elseif (in_array($name, $this->obsoleteProperties)) { return null; } else { trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); @@ -1307,21 +1364,18 @@ class Smarty extends Smarty_Internal_TemplateBase * @param string $name property name * @param mixed $value parameter passed to setter * - * @throws \SmartyException */ public function __set($name, $value) { if (isset($this->accessMap[ $name ])) { $method = 'set' . $this->accessMap[ $name ]; $this->{$method}($value); - } else if (in_array($name, $this->obsoleteProperties)) { + } elseif (in_array($name, $this->obsoleteProperties)) { return; + } elseif (is_object($value) && method_exists($value, $name)) { + $this->$name = $value; } else { - if (is_object($value) && method_exists($value, $name)) { - $this->$name = $value; - } else { - trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); - } + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } } @@ -1345,7 +1399,6 @@ class Smarty extends Smarty_Internal_TemplateBase * Normalize template_dir or config_dir * * @param bool $isConfig true for config_dir - * */ private function _normalizeTemplateConfig($isConfig) { diff --git a/vendor/smarty/smarty/libs/SmartyBC.class.php b/vendor/smarty/smarty/libs/SmartyBC.class.php index f2230fc9c..836f98153 100644 --- a/vendor/smarty/smarty/libs/SmartyBC.class.php +++ b/vendor/smarty/smarty/libs/SmartyBC.class.php @@ -28,7 +28,7 @@ /** * @ignore */ -require_once(dirname(__FILE__) . '/Smarty.class.php'); +require_once dirname(__FILE__) . '/Smarty.class.php'; /** * Smarty Backward Compatibility Wrapper Class @@ -53,7 +53,6 @@ class SmartyBC extends Smarty /** * Initialize new SmartyBC object - * */ public function __construct() { @@ -127,12 +126,16 @@ class SmartyBC extends Smarty * @param boolean $smarty_args smarty argument format, else traditional * @param array $block_methods list of methods that are block format * - * @throws SmartyException + * @throws SmartyException * @internal param array $block_functs list of methods that are block format */ - public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, - $block_methods = array()) - { + public function register_object( + $object, + $object_impl, + $allowed = array(), + $smarty_args = true, + $block_methods = array() + ) { settype($allowed, 'array'); settype($smarty_args, 'boolean'); $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods); @@ -326,10 +329,10 @@ class SmartyBC extends Smarty /** * clear cached content for the given template and cache id * - * @param string $tpl_file name of template file - * @param string $cache_id name of cache_id - * @param string $compile_id name of compile_id - * @param string $exp_time expiration time + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time * * @return boolean */ @@ -341,7 +344,7 @@ class SmartyBC extends Smarty /** * clear the entire contents of cache (all templates) * - * @param string $exp_time expire time + * @param string $exp_time expire time * * @return boolean */ @@ -353,9 +356,9 @@ class SmartyBC extends Smarty /** * test to see if valid cache exists for this template * - * @param string $tpl_file name of template file - * @param string $cache_id - * @param string $compile_id + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id * * @return bool * @throws \Exception @@ -379,9 +382,9 @@ class SmartyBC extends Smarty * or all compiled template files if one is not specified. * This function is for advanced use only, not normally needed. * - * @param string $tpl_file - * @param string $compile_id - * @param string $exp_time + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time * * @return boolean results of {@link smarty_core_rm_auto()} */ @@ -393,7 +396,7 @@ class SmartyBC extends Smarty /** * Checks whether requested template exists. * - * @param string $tpl_file + * @param string $tpl_file * * @return bool * @throws \SmartyException @@ -406,7 +409,7 @@ class SmartyBC extends Smarty /** * Returns an array containing template variables * - * @param string $name + * @param string $name * * @return array */ @@ -418,7 +421,7 @@ class SmartyBC extends Smarty /** * Returns an array containing config variables * - * @param string $name + * @param string $name * * @return array */ @@ -442,7 +445,7 @@ class SmartyBC extends Smarty /** * return a reference to a registered object * - * @param string $name + * @param string $name * * @return object */ diff --git a/vendor/smarty/smarty/libs/bootstrap.php b/vendor/smarty/smarty/libs/bootstrap.php index dad72fcb1..2c830468e 100644 --- a/vendor/smarty/smarty/libs/bootstrap.php +++ b/vendor/smarty/smarty/libs/bootstrap.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of the Smarty package. * * (c) Sebastian Bergmann <sebastian@phpunit.de> @@ -7,11 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - -/* +/** * Load and register Smarty Autoloader */ if (!class_exists('Smarty_Autoloader')) { - require dirname(__FILE__) . '/Autoloader.php'; + include dirname(__FILE__) . '/Autoloader.php'; } Smarty_Autoloader::register(true); diff --git a/vendor/smarty/smarty/libs/debug.tpl b/vendor/smarty/smarty/libs/debug.tpl index 5526cbca8..edc7bef98 100644 --- a/vendor/smarty/smarty/libs/debug.tpl +++ b/vendor/smarty/smarty/libs/debug.tpl @@ -113,10 +113,10 @@ <div> {foreach $template_data as $template} <font color=brown>{$template.name}</font> - <br> <span class="exectime"> + <br /> <span class="exectime"> (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) </span> - <br> + <br /> {/foreach} </div> {/if} @@ -127,7 +127,7 @@ {foreach $assigned_vars as $vars} <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> <td><h3><font color=blue>${$vars@key}</font></h3> - {if isset($vars['nocache'])}<b>Nocache</b></br>{/if} + {if isset($vars['nocache'])}<b>Nocache</b><br />{/if} {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if} </td> <td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td> diff --git a/vendor/smarty/smarty/libs/plugins/block.textformat.php b/vendor/smarty/smarty/libs/plugins/block.textformat.php index 310a420ee..5e494637e 100644 --- a/vendor/smarty/smarty/libs/plugins/block.textformat.php +++ b/vendor/smarty/smarty/libs/plugins/block.textformat.php @@ -20,7 +20,6 @@ * - indent_char - string (" ") * - wrap_boundary - boolean (true) * - * * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} * (Smarty online manual) * @@ -39,10 +38,15 @@ function smarty_block_textformat($params, $content, Smarty_Internal_Template $te return; } if (Smarty::$_MBSTRING) { - $template->_checkPlugins(array(array('function' => 'smarty_modifier_mb_wordwrap', - 'file' => SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php'))); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_modifier_mb_wordwrap', + 'file' => SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php' + ) + ) + ); } - $style = null; $indent = 0; $indent_first = 0; @@ -51,47 +55,48 @@ function smarty_block_textformat($params, $content, Smarty_Internal_Template $te $wrap_char = "\n"; $wrap_cut = false; $assign = null; - foreach ($params as $_key => $_val) { switch ($_key) { case 'style': case 'indent_char': case 'wrap_char': case 'assign': - $$_key = (string) $_val; + $$_key = (string)$_val; break; - case 'indent': case 'indent_first': case 'wrap': - $$_key = (int) $_val; + $$_key = (int)$_val; break; - case 'wrap_cut': - $$_key = (bool) $_val; + $$_key = (bool)$_val; break; - default: trigger_error("textformat: unknown attribute '{$_key}'"); } } - if ($style === 'email') { $wrap = 72; } // split into paragraphs $_paragraphs = preg_split('![\r\n]{2}!', $content); - foreach ($_paragraphs as &$_paragraph) { if (!$_paragraph) { continue; } // convert mult. spaces & special chars to single space $_paragraph = - preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, - '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), - array(' ', - ''), $_paragraph); + preg_replace( + array( + '!\s+!' . Smarty::$_UTF8_MODIFIER, + '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER + ), + array( + ' ', + '' + ), + $_paragraph + ); // indent first line if ($indent_first > 0) { $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; @@ -108,7 +113,6 @@ function smarty_block_textformat($params, $content, Smarty_Internal_Template $te } } $_output = implode($wrap_char . $wrap_char, $_paragraphs); - if ($assign) { $template->assign($assign, $_output); } else { diff --git a/vendor/smarty/smarty/libs/plugins/function.counter.php b/vendor/smarty/smarty/libs/plugins/function.counter.php index 9610362d9..a4129e77c 100644 --- a/vendor/smarty/smarty/libs/plugins/function.counter.php +++ b/vendor/smarty/smarty/libs/plugins/function.counter.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {counter} function plugin * Type: function @@ -24,50 +23,40 @@ function smarty_function_counter($params, $template) { static $counters = array(); - $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default'; if (!isset($counters[ $name ])) { $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1); } $counter =& $counters[ $name ]; - if (isset($params[ 'start' ])) { - $counter[ 'start' ] = $counter[ 'count' ] = (int) $params[ 'start' ]; + $counter[ 'start' ] = $counter[ 'count' ] = (int)$params[ 'start' ]; } - if (!empty($params[ 'assign' ])) { $counter[ 'assign' ] = $params[ 'assign' ]; } - if (isset($counter[ 'assign' ])) { $template->assign($counter[ 'assign' ], $counter[ 'count' ]); } - if (isset($params[ 'print' ])) { - $print = (bool) $params[ 'print' ]; + $print = (bool)$params[ 'print' ]; } else { $print = empty($counter[ 'assign' ]); } - if ($print) { $retval = $counter[ 'count' ]; } else { $retval = null; } - if (isset($params[ 'skip' ])) { $counter[ 'skip' ] = $params[ 'skip' ]; } - if (isset($params[ 'direction' ])) { $counter[ 'direction' ] = $params[ 'direction' ]; } - if ($counter[ 'direction' ] === 'down') { $counter[ 'count' ] -= $counter[ 'skip' ]; } else { $counter[ 'count' ] += $counter[ 'skip' ]; } - return $retval; } diff --git a/vendor/smarty/smarty/libs/plugins/function.cycle.php b/vendor/smarty/smarty/libs/plugins/function.cycle.php index b871524fc..07ffcc5e2 100644 --- a/vendor/smarty/smarty/libs/plugins/function.cycle.php +++ b/vendor/smarty/smarty/libs/plugins/function.cycle.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {cycle} function plugin * Type: function @@ -29,34 +28,29 @@ * {cycle name=row values="one,two,three" reset=true} * {cycle name=row} * - * - * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} + * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} * (Smarty online manual) - * @author Monte Ohrt <monte at ohrt dot com> - * @author credit to Mark Priatel <mpriatel@rogers.com> - * @author credit to Gerard <gerard@interfold.com> - * @author credit to Jason Sweat <jsweat_php@yahoo.com> - * @version 1.3 + * @author Monte Ohrt <monte at ohrt dot com> + * @author credit to Mark Priatel <mpriatel@rogers.com> + * @author credit to Gerard <gerard@interfold.com> + * @author credit to Jason Sweat <jsweat_php@yahoo.com> + * @version 1.3 * * @param array $params parameters * @param Smarty_Internal_Template $template template object * * @return string|null */ - function smarty_function_cycle($params, $template) { static $cycle_vars; - $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ]; - $print = (isset($params[ 'print' ])) ? (bool) $params[ 'print' ] : true; - $advance = (isset($params[ 'advance' ])) ? (bool) $params[ 'advance' ] : true; - $reset = (isset($params[ 'reset' ])) ? (bool) $params[ 'reset' ] : false; - + $print = (isset($params[ 'print' ])) ? (bool)$params[ 'print' ] : true; + $advance = (isset($params[ 'advance' ])) ? (bool)$params[ 'advance' ] : true; + $reset = (isset($params[ 'reset' ])) ? (bool)$params[ 'reset' ] : false; if (!isset($params[ 'values' ])) { if (!isset($cycle_vars[ $name ][ 'values' ])) { trigger_error('cycle: missing \'values\' parameter'); - return; } } else { @@ -65,41 +59,34 @@ function smarty_function_cycle($params, $template) } $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ]; } - if (isset($params[ 'delimiter' ])) { $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ]; } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) { $cycle_vars[ $name ][ 'delimiter' ] = ','; } - if (is_array($cycle_vars[ $name ][ 'values' ])) { $cycle_array = $cycle_vars[ $name ][ 'values' ]; } else { $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]); } - if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) { $cycle_vars[ $name ][ 'index' ] = 0; } - if (isset($params[ 'assign' ])) { $print = false; $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]); } - if ($print) { $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]; } else { $retval = null; } - if ($advance) { if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) { $cycle_vars[ $name ][ 'index' ] = 0; } else { - $cycle_vars[ $name ][ 'index' ] ++; + $cycle_vars[ $name ][ 'index' ]++; } } - return $retval; } diff --git a/vendor/smarty/smarty/libs/plugins/function.fetch.php b/vendor/smarty/smarty/libs/plugins/function.fetch.php index 9539e1fcc..768761b23 100644 --- a/vendor/smarty/smarty/libs/plugins/function.fetch.php +++ b/vendor/smarty/smarty/libs/plugins/function.fetch.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {fetch} plugin * Type: function @@ -26,20 +25,16 @@ function smarty_function_fetch($params, $template) { if (empty($params[ 'file' ])) { trigger_error('[plugin] fetch parameter \'file\' cannot be empty', E_USER_NOTICE); - return; } - // strip file protocol if (stripos($params[ 'file' ], 'file://') === 0) { $params[ 'file' ] = substr($params[ 'file' ], 7); } - $protocol = strpos($params[ 'file' ], '://'); if ($protocol !== false) { $protocol = strtolower(substr($params[ 'file' ], 0, $protocol)); } - if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) @@ -53,7 +48,6 @@ function smarty_function_fetch($params, $template) } } } - $content = ''; if ($protocol === 'http') { // http fetch @@ -104,7 +98,6 @@ function smarty_function_fetch($params, $template) if (!empty($param_value)) { if (!preg_match('![\w\d-]+: .+!', $param_value)) { trigger_error("[plugin] invalid header format '{$param_value}'", E_USER_NOTICE); - return; } else { $extra_headers[] = $param_value; @@ -118,10 +111,9 @@ function smarty_function_fetch($params, $template) break; case 'proxy_port': if (!preg_match('!\D!', $param_value)) { - $proxy_port = (int) $param_value; + $proxy_port = (int)$param_value; } else { trigger_error("[plugin] invalid value for attribute '{$param_key }'", E_USER_NOTICE); - return; } break; @@ -137,16 +129,14 @@ function smarty_function_fetch($params, $template) break; case 'timeout': if (!preg_match('!\D!', $param_value)) { - $timeout = (int) $param_value; + $timeout = (int)$param_value; } else { 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); - return; } } @@ -156,10 +146,8 @@ function smarty_function_fetch($params, $template) } else { $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout); } - if (!$fp) { trigger_error("[plugin] unable to fetch: $errstr ($errno)", E_USER_NOTICE); - return; } else { if ($_is_proxy) { @@ -187,23 +175,19 @@ function smarty_function_fetch($params, $template) if (!empty($user) && !empty($pass)) { fputs($fp, 'Authorization: BASIC ' . base64_encode("$user:$pass") . "\r\n"); } - fputs($fp, "\r\n"); while (!feof($fp)) { $content .= fgets($fp, 4096); } fclose($fp); $csplit = preg_split("!\r\n\r\n!", $content, 2); - $content = $csplit[ 1 ]; - if (!empty($params[ 'assign_headers' ])) { $template->assign($params[ 'assign_headers' ], preg_split("!\r\n!", $csplit[ 0 ])); } } } else { trigger_error("[plugin fetch] unable to parse URL, check syntax", E_USER_NOTICE); - return; } } else { @@ -212,7 +196,6 @@ function smarty_function_fetch($params, $template) throw new SmartyException("{fetch} cannot read resource '" . $params[ 'file' ] . "'"); } } - if (!empty($params[ 'assign' ])) { $template->assign($params[ 'assign' ], $content); } else { diff --git a/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php b/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php index d654caba6..302358edd 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php @@ -29,25 +29,29 @@ * - assign (optional) - assign the output as an array to this variable * - escape (optional) - escape the content (not value), defaults to true * - * - * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} * (Smarty online manual) - * @author Christopher Kvarme <christopher.kvarme@flashjab.com> - * @author credits to Monte Ohrt <monte at ohrt dot com> - * @version 1.0 + * @author Christopher Kvarme <christopher.kvarme@flashjab.com> + * @author credits to Monte Ohrt <monte at ohrt dot com> + * @version 1.0 * * @param array $params parameters * @param Smarty_Internal_Template $template template object * * @return string - * @uses smarty_function_escape_special_chars() + * @uses smarty_function_escape_special_chars() * @throws \SmartyException */ function smarty_function_html_checkboxes($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); - + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); $name = 'checkbox'; $values = null; $options = null; @@ -57,31 +61,25 @@ function smarty_function_html_checkboxes($params, Smarty_Internal_Template $temp $labels = true; $label_ids = false; $output = null; - $extra = ''; - foreach ($params as $_key => $_val) { switch ($_key) { case 'name': case 'separator': - $$_key = (string) $_val; + $$_key = (string)$_val; break; - case 'escape': case 'labels': case 'label_ids': - $$_key = (bool) $_val; + $$_key = (bool)$_val; break; - case 'options': - $$_key = (array) $_val; + $$_key = (array)$_val; break; - case 'values': case 'output': - $$_key = array_values((array) $_val); + $$_key = array_values((array)$_val); break; - case 'checked': case 'selected': if (is_array($_val)) { @@ -89,57 +87,61 @@ function smarty_function_html_checkboxes($params, Smarty_Internal_Template $temp foreach ($_val as $_sel) { if (is_object($_sel)) { if (method_exists($_sel, '__toString')) { - $_sel = smarty_function_escape_special_chars((string) $_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 { - $_sel = smarty_function_escape_special_chars((string) $_sel); + $_sel = smarty_function_escape_special_chars((string)$_sel); } $selected[ $_sel ] = true; } } elseif (is_object($_val)) { if (method_exists($_val, '__toString')) { - $selected = smarty_function_escape_special_chars((string) $_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); + $selected = smarty_function_escape_special_chars((string)$_val); } break; - case 'checkboxes': - trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', - E_USER_WARNING); - $options = (array) $_val; + trigger_error( + 'html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', + E_USER_WARNING + ); + $options = (array)$_val; break; - case 'assign': break; - case 'strict': break; - case 'disabled': 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", - E_USER_NOTICE); + trigger_error( + "html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute", + E_USER_NOTICE + ); } - if ($_val === true || $_val === $_key) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; } - break; } // omit break; to fall through! - + // no break default: if (!is_array($_val)) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; @@ -149,34 +151,49 @@ function smarty_function_html_checkboxes($params, Smarty_Internal_Template $temp break; } } - if (!isset($options) && !isset($values)) { return ''; } /* raise error here? */ - $_html_result = array(); - if (isset($options)) { foreach ($options as $_key => $_val) { $_html_result[] = - smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, - $label_ids, $escape); + smarty_function_html_checkboxes_output( + $name, + $_key, + $_val, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape + ); } } else { foreach ($values as $_i => $_key) { $_val = isset($output[ $_i ]) ? $output[ $_i ] : ''; $_html_result[] = - smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, - $label_ids, $escape); + smarty_function_html_checkboxes_output( + $name, + $_key, + $_val, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape + ); } } - if (!empty($params[ 'assign' ])) { $template->assign($params[ 'assign' ], $_html_result); } else { return implode("\n", $_html_result); } } + /** * @param $name * @param $value @@ -190,59 +207,69 @@ function smarty_function_html_checkboxes($params, Smarty_Internal_Template $temp * * @return string */ -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, - $label_ids, $escape = true) -{ +function smarty_function_html_checkboxes_output( + $name, + $value, + $output, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape = true +) { $_output = ''; - if (is_object($value)) { if (method_exists($value, '__toString')) { - $value = (string) $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 ''; } } else { - $value = (string) $value; + $value = (string)$value; } - if (is_object($output)) { if (method_exists($output, '__toString')) { - $output = (string) $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 ''; } } else { - $output = (string) $output; + $output = (string)$output; } - if ($labels) { if ($label_ids) { - $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', - $name . '_' . $value)); + $_id = smarty_function_escape_special_chars( + preg_replace( + '![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, + '_', + $name . '_' . $value + ) + ); $_output .= '<label for="' . $_id . '">'; } else { $_output .= '<label>'; } } - $name = smarty_function_escape_special_chars($name); $value = smarty_function_escape_special_chars($value); if ($escape) { $output = smarty_function_escape_special_chars($output); } - $_output .= '<input type="checkbox" name="' . $name . '[]" value="' . $value . '"'; - if ($labels && $label_ids) { $_output .= ' id="' . $_id . '"'; } - if (is_array($selected)) { if (isset($selected[ $value ])) { $_output .= ' checked="checked"'; @@ -250,13 +277,10 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte } elseif ($value === $selected) { $_output .= ' checked="checked"'; } - $_output .= $extra . ' />' . $output; if ($labels) { $_output .= '</label>'; } - $_output .= $separator; - return $_output; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_image.php b/vendor/smarty/smarty/libs/plugins/function.html_image.php index 4fda72eef..ad468e4f1 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_image.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_image.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_image} function plugin * Type: function @@ -22,7 +21,6 @@ * - basedir - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT * - path_prefix - prefix for path output (optional, default empty) * - * * @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image} * (Smarty online manual) * @author Monte Ohrt <monte at ohrt dot com> @@ -38,9 +36,14 @@ */ function smarty_function_html_image($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); - + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); $alt = ''; $file = ''; $height = ''; @@ -60,53 +63,50 @@ function smarty_function_html_image($params, Smarty_Internal_Template $template) case 'basedir': $$_key = $_val; break; - case 'alt': 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; - case 'link': case 'href': $prefix = '<a href="' . $_val . '">'; $suffix = '</a>'; break; - default: 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); - return; } - if ($file[ 0 ] === '/') { $_image_path = $basedir . $file; } else { $_image_path = $file; } - // strip file protocol if (stripos($params[ 'file' ], 'file://') === 0) { $params[ 'file' ] = substr($params[ 'file' ], 7); } - $protocol = strpos($params[ 'file' ], '://'); if ($protocol !== false) { $protocol = strtolower(substr($params[ 'file' ], 0, $protocol)); } - if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) @@ -120,25 +120,20 @@ function smarty_function_html_image($params, Smarty_Internal_Template $template) } } } - if (!isset($params[ 'width' ]) || !isset($params[ 'height' ])) { // 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); - return; } elseif (!is_readable($_image_path)) { 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); - return; } } - if (!isset($params[ 'width' ])) { $width = $_image_data[ 0 ]; } @@ -146,7 +141,6 @@ function smarty_function_html_image($params, Smarty_Internal_Template $template) $height = $_image_data[ 1 ]; } } - if (isset($params[ 'dpi' ])) { if (strstr($_SERVER[ 'HTTP_USER_AGENT' ], 'Mac')) { // FIXME: (rodneyrehm) wrong dpi assumption @@ -159,7 +153,6 @@ function smarty_function_html_image($params, Smarty_Internal_Template $template) $width = round($width * $_resize); $height = round($height * $_resize); } - return $prefix . '<img src="' . $path_prefix . $file . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $extra . ' />' . $suffix; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_options.php b/vendor/smarty/smarty/libs/plugins/function.html_options.php index b8b986493..6907e8ee1 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_options.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_options.php @@ -21,25 +21,29 @@ * - id (optional) - string default not set * - class (optional) - string default not set * - * - * @link http://www.smarty.net/manual/en/language.function.html.options.php {html_image} + * @link http://www.smarty.net/manual/en/language.function.html.options.php {html_image} * (Smarty online manual) - * @author Monte Ohrt <monte at ohrt dot com> - * @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de> + * @author Monte Ohrt <monte at ohrt dot com> + * @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de> * * @param array $params parameters * * @param \Smarty_Internal_Template $template * * @return string - * @uses smarty_function_escape_special_chars() + * @uses smarty_function_escape_special_chars() * @throws \SmartyException */ function smarty_function_html_options($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); - + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); $name = null; $values = null; $options = null; @@ -47,74 +51,73 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat $output = null; $id = null; $class = null; - $extra = ''; - foreach ($params as $_key => $_val) { switch ($_key) { case 'name': case 'class': case 'id': - $$_key = (string) $_val; + $$_key = (string)$_val; break; - case 'options': - $options = (array) $_val; + $options = (array)$_val; break; - case 'values': case 'output': - $$_key = array_values((array) $_val); + $$_key = array_values((array)$_val); break; - case 'selected': if (is_array($_val)) { $selected = array(); foreach ($_val as $_sel) { if (is_object($_sel)) { if (method_exists($_sel, '__toString')) { - $_sel = smarty_function_escape_special_chars((string) $_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 { - $_sel = smarty_function_escape_special_chars((string) $_sel); + $_sel = smarty_function_escape_special_chars((string)$_sel); } $selected[ $_sel ] = true; } } elseif (is_object($_val)) { if (method_exists($_val, '__toString')) { - $selected = smarty_function_escape_special_chars((string) $_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); + $selected = smarty_function_escape_special_chars((string)$_val); } break; - case 'strict': break; - case 'disabled': 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", - E_USER_NOTICE); + trigger_error( + "html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute", + E_USER_NOTICE + ); } - if ($_val === true || $_val === $_key) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; } - break; } // omit break; to fall through! - + // no break default: if (!is_array($_val)) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; @@ -124,16 +127,12 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat break; } } - if (!isset($options) && !isset($values)) { /* raise error here? */ - return ''; } - $_html_result = ''; $_idx = 0; - if (isset($options)) { foreach ($options as $_key => $_val) { $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx); @@ -144,7 +143,6 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx); } } - if (!empty($name)) { $_html_class = !empty($class) ? ' class="' . $class . '"' : ''; $_html_id = !empty($id) ? ' id="' . $id . '"' : ''; @@ -152,9 +150,9 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat '<select name="' . $name . '"' . $_html_class . $_html_id . $extra . '>' . "\n" . $_html_result . '</select>' . "\n"; } - return $_html_result; } + /** * @param $key * @param $value @@ -181,28 +179,36 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c $_html_id = !empty($id) ? ' id="' . $id . '-' . $idx . '"' : ''; if (is_object($value)) { if (method_exists($value, '__toString')) { - $value = smarty_function_escape_special_chars((string) $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 ''; } } else { - $value = smarty_function_escape_special_chars((string) $value); + $value = smarty_function_escape_special_chars((string)$value); } $_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n"; - $idx ++; + $idx++; } else { $_idx = 0; $_html_result = - smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null, - $class, $_idx); - $idx ++; + smarty_function_html_options_optgroup( + $key, + $value, + $selected, + !empty($id) ? ($id . '-' . $idx) : null, + $class, + $_idx + ); + $idx++; } - return $_html_result; } + /** * @param $key * @param $values @@ -220,6 +226,5 @@ function smarty_function_html_options_optgroup($key, $values, $selected, $id, $c $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx); } $optgroup_html .= "</optgroup>\n"; - return $optgroup_html; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_radios.php b/vendor/smarty/smarty/libs/plugins/function.html_radios.php index 37feec63e..5e834587c 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_radios.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_radios.php @@ -29,7 +29,6 @@ * {html_radios values=$ids name='box' separator='<br>' output=$names} * {html_radios values=$ids checked=$checked separator='<br>' output=$names} * - * * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios} * (Smarty online manual) * @author Christopher Kvarme <christopher.kvarme@flashjab.com> @@ -45,9 +44,14 @@ */ function smarty_function_html_radios($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); - + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); $name = 'radio'; $values = null; $options = null; @@ -58,73 +62,69 @@ function smarty_function_html_radios($params, Smarty_Internal_Template $template $label_ids = false; $output = null; $extra = ''; - foreach ($params as $_key => $_val) { switch ($_key) { case 'name': case 'separator': - $$_key = (string) $_val; + $$_key = (string)$_val; break; - case 'checked': case 'selected': 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')) { - $selected = smarty_function_escape_special_chars((string) $_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; + $selected = (string)$_val; } break; - case 'escape': case 'labels': case 'label_ids': - $$_key = (bool) $_val; + $$_key = (bool)$_val; break; - case 'options': - $$_key = (array) $_val; + $$_key = (array)$_val; break; - case 'values': case 'output': - $$_key = array_values((array) $_val); + $$_key = array_values((array)$_val); break; - case 'radios': - trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', - E_USER_WARNING); - $options = (array) $_val; + trigger_error( + 'html_radios: the use of the "radios" attribute is deprecated, use "options" instead', + E_USER_WARNING + ); + $options = (array)$_val; break; - case 'assign': break; - case 'strict': break; - case 'disabled': 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", - E_USER_NOTICE); + trigger_error( + "html_options: {$_key} attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", + E_USER_NOTICE + ); } - if ($_val === true || $_val === $_key) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; } - break; } // omit break; to fall through! - + // no break default: if (!is_array($_val)) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; @@ -134,36 +134,50 @@ function smarty_function_html_radios($params, Smarty_Internal_Template $template break; } } - if (!isset($options) && !isset($values)) { /* raise error here? */ - return ''; } - $_html_result = array(); - if (isset($options)) { foreach ($options as $_key => $_val) { $_html_result[] = - smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, - $label_ids, $escape); + smarty_function_html_radios_output( + $name, + $_key, + $_val, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape + ); } } else { foreach ($values as $_i => $_key) { $_val = isset($output[ $_i ]) ? $output[ $_i ] : ''; $_html_result[] = - smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, - $label_ids, $escape); + smarty_function_html_radios_output( + $name, + $_key, + $_val, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape + ); } } - if (!empty($params[ 'assign' ])) { $template->assign($params[ 'assign' ], $_html_result); } else { return implode("\n", $_html_result); } } + /** * @param $name * @param $value @@ -177,69 +191,76 @@ function smarty_function_html_radios($params, Smarty_Internal_Template $template * * @return string */ -function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, - $escape) -{ +function smarty_function_html_radios_output( + $name, + $value, + $output, + $selected, + $extra, + $separator, + $labels, + $label_ids, + $escape +) { $_output = ''; - if (is_object($value)) { if (method_exists($value, '__toString')) { - $value = (string) $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 ''; } } else { - $value = (string) $value; + $value = (string)$value; } - if (is_object($output)) { if (method_exists($output, '__toString')) { - $output = (string) $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 ''; } } else { - $output = (string) $output; + $output = (string)$output; } - if ($labels) { if ($label_ids) { - $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', - $name . '_' . $value)); + $_id = smarty_function_escape_special_chars( + preg_replace( + '![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, + '_', + $name . '_' . $value + ) + ); $_output .= '<label for="' . $_id . '">'; } else { $_output .= '<label>'; } } - $name = smarty_function_escape_special_chars($name); $value = smarty_function_escape_special_chars($value); if ($escape) { $output = smarty_function_escape_special_chars($output); } - $_output .= '<input type="radio" name="' . $name . '" value="' . $value . '"'; - if ($labels && $label_ids) { $_output .= ' id="' . $_id . '"'; } - if ($value === $selected) { $_output .= ' checked="checked"'; } - $_output .= $extra . ' />' . $output; if ($labels) { $_output .= '</label>'; } - $_output .= $separator; - return $_output; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_select_date.php b/vendor/smarty/smarty/libs/plugins/function.html_select_date.php index 1d63800e1..86403e3dc 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_select_date.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_select_date.php @@ -28,13 +28,12 @@ * - 2.0 complete rewrite for performance, * added attributes month_names, *_id * - * - * @link http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date} + * @link http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date} * (Smarty online manual) - * @version 2.0 - * @author Andrei Zmievski - * @author Monte Ohrt <monte at ohrt dot com> - * @author Rodney Rehm + * @version 2.0 + * @author Andrei Zmievski + * @author Monte Ohrt <monte at ohrt dot com> + * @author Rodney Rehm * * @param array $params parameters * @@ -45,19 +44,24 @@ */ function smarty_function_html_select_date($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); // generate timestamps used for month names only static $_month_timestamps = null; static $_current_year = null; if ($_month_timestamps === null) { $_current_year = date('Y'); $_month_timestamps = array(); - for ($i = 1; $i <= 12; $i ++) { + for ($i = 1; $i <= 12; $i++) { $_month_timestamps[ $i ] = mktime(0, 0, 0, $i, 1, 2000); } } - /* Default values. */ $prefix = 'Date_'; $start_year = null; @@ -106,17 +110,21 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem $day_id = null; $month_id = null; $year_id = null; - foreach ($params as $_key => $_value) { switch ($_key) { case 'time': if (!is_array($_value) && $_value !== null) { - $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp', - 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'))); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_make_timestamp', + 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php' + ) + ) + ); $time = smarty_make_timestamp($_value); } break; - case 'month_names': if (is_array($_value) && count($_value) === 12) { $$_key = $_value; @@ -124,7 +132,6 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem trigger_error('html_select_date: month_names must be an array of 12 strings', E_USER_NOTICE); } break; - case 'prefix': case 'field_array': case 'start_year': @@ -151,17 +158,15 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem case 'month_id': case 'day_id': case 'year_id': - $$_key = (string) $_value; + $$_key = (string)$_value; break; - case 'display_days': case 'display_months': case 'display_years': case 'year_as_text': case 'reverse_years': - $$_key = (bool) $_value; + $$_key = (bool)$_value; break; - default: if (!is_array($_value)) { $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"'; @@ -171,15 +176,16 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem break; } } - // Note: date() is faster than strftime() // Note: explode(date()) is faster than date() date() date() if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) { if (isset($params[ 'time' ][ $prefix . 'Year' ])) { // $_REQUEST[$field_array] given - foreach (array('Y' => 'Year', - 'm' => 'Month', - 'd' => 'Day') as $_elementKey => $_elementName) { + foreach (array( + 'Y' => 'Year', + 'm' => 'Month', + 'd' => 'Day' + ) as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] : @@ -187,9 +193,11 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem } } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Year' ])) { // $_REQUEST given - foreach (array('Y' => 'Year', - 'm' => 'Month', - 'd' => 'Day') as $_elementKey => $_elementName) { + foreach (array( + 'Y' => 'Year', + 'm' => 'Month', + 'd' => 'Day' + ) as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey); @@ -207,31 +215,30 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem } else { list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time)); } - // make syntax "+N" or "-N" work with $start_year and $end_year // Note preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match) is slower than trim+substr - foreach (array('start', - 'end') as $key) { + foreach (array( + 'start', + 'end' + ) as $key) { $key .= '_year'; $t = $$key; if ($t === null) { - $$key = (int) $_current_year; + $$key = (int)$_current_year; } elseif ($t[ 0 ] === '+') { - $$key = (int) ($_current_year + (int) trim(substr($t, 1))); + $$key = (int)($_current_year + (int)trim(substr($t, 1))); } elseif ($t[ 0 ] === '-') { - $$key = (int) ($_current_year - (int) trim(substr($t, 1))); + $$key = (int)($_current_year - (int)trim(substr($t, 1))); } else { - $$key = (int) $$key; + $$key = (int)$$key; } } - // flip for ascending or descending if (($start_year > $end_year && !$reverse_years) || ($start_year < $end_year && $reverse_years)) { $t = $end_year; $end_year = $start_year; $start_year = $t; } - // generate year <select> or <input> if ($display_years) { $_extra = ''; @@ -242,7 +249,6 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem if ($year_extra) { $_extra .= ' ' . $year_extra; } - if ($year_as_text) { $_html_years = '<input type="text" name="' . $_name . '" value="' . $_year . '" size="4" maxlength="4"' . $_extra . @@ -250,31 +256,29 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem } else { $_html_years = '<select name="' . $_name . '"'; if ($year_id !== null || $all_id !== null) { - $_html_years .= ' id="' . smarty_function_escape_special_chars($year_id !== null ? - ($year_id ? $year_id : $_name) : - ($all_id ? ($all_id . $_name) : - $_name)) . '"'; + $_html_years .= ' id="' . smarty_function_escape_special_chars( + $year_id !== null ? + ($year_id ? $year_id : $_name) : + ($all_id ? ($all_id . $_name) : + $_name) + ) . '"'; } if ($year_size) { $_html_years .= ' size="' . $year_size . '"'; } $_html_years .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($year_empty) || isset($all_empty)) { $_html_years .= '<option value="">' . (isset($year_empty) ? $year_empty : $all_empty) . '</option>' . $option_separator; } - - $op = $start_year > $end_year ? - 1 : 1; + $op = $start_year > $end_year ? -1 : 1; for ($i = $start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) { $_html_years .= '<option value="' . $i . '"' . ($_year == $i ? ' selected="selected"' : '') . '>' . $i . '</option>' . $option_separator; } - $_html_years .= '</select>'; } } - // generate month <select> or <input> if ($display_months) { $_extra = ''; @@ -285,25 +289,24 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem if ($month_extra) { $_extra .= ' ' . $month_extra; } - $_html_months = '<select name="' . $_name . '"'; if ($month_id !== null || $all_id !== null) { - $_html_months .= ' id="' . smarty_function_escape_special_chars($month_id !== null ? - ($month_id ? $month_id : $_name) : - ($all_id ? ($all_id . $_name) : - $_name)) . '"'; + $_html_months .= ' id="' . smarty_function_escape_special_chars( + $month_id !== null ? + ($month_id ? $month_id : $_name) : + ($all_id ? ($all_id . $_name) : + $_name) + ) . '"'; } if ($month_size) { $_html_months .= ' size="' . $month_size . '"'; } $_html_months .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($month_empty) || isset($all_empty)) { $_html_months .= '<option value="">' . (isset($month_empty) ? $month_empty : $all_empty) . '</option>' . $option_separator; } - - for ($i = 1; $i <= 12; $i ++) { + 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 ])); @@ -311,10 +314,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem $_html_months .= '<option value="' . $_value . '"' . ($_val == $_month ? ' selected="selected"' : '') . '>' . $_text . '</option>' . $option_separator; } - $_html_months .= '</select>'; } - // generate day <select> or <input> if ($display_days) { $_extra = ''; @@ -325,37 +326,34 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem if ($day_extra) { $_extra .= ' ' . $day_extra; } - $_html_days = '<select name="' . $_name . '"'; if ($day_id !== null || $all_id !== null) { $_html_days .= ' id="' . - smarty_function_escape_special_chars($day_id !== null ? ($day_id ? $day_id : $_name) : - ($all_id ? ($all_id . $_name) : $_name)) . '"'; + smarty_function_escape_special_chars( + $day_id !== null ? ($day_id ? $day_id : $_name) : + ($all_id ? ($all_id . $_name) : $_name) + ) . '"'; } if ($day_size) { $_html_days .= ' size="' . $day_size . '"'; } $_html_days .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($day_empty) || isset($all_empty)) { $_html_days .= '<option value="">' . (isset($day_empty) ? $day_empty : $all_empty) . '</option>' . $option_separator; } - - for ($i = 1; $i <= 31; $i ++) { + 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); $_html_days .= '<option value="' . $_value . '"' . ($_val == $_day ? ' selected="selected"' : '') . '>' . $_text . '</option>' . $option_separator; } - $_html_days .= '</select>'; } - // order the fields for output $_html = ''; - for ($i = 0; $i <= 2; $i ++) { + for ($i = 0; $i <= 2; $i++) { switch ($field_order[ $i ]) { case 'Y': case 'y': @@ -366,7 +364,6 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem $_html .= $_html_years; } break; - case 'm': case 'M': if (isset($_html_months)) { @@ -376,7 +373,6 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem $_html .= $_html_months; } break; - case 'd': case 'D': if (isset($_html_days)) { @@ -388,6 +384,5 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem break; } } - return $_html; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_select_time.php b/vendor/smarty/smarty/libs/plugins/function.html_select_time.php index f7c3816e3..cb047bc0a 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_select_time.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_select_time.php @@ -11,130 +11,124 @@ * Name: html_select_time * Purpose: Prints the dropdowns for time selection * - * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time} + * @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time} * (Smarty online manual) - * @author Roberto Berto <roberto@berto.net> - * @author Monte Ohrt <monte AT ohrt DOT com> + * @author Roberto Berto <roberto@berto.net> + * @author Monte Ohrt <monte AT ohrt DOT com> * * @param array $params parameters * * @param \Smarty_Internal_Template $template * * @return string - * @uses smarty_make_timestamp() + * @uses smarty_make_timestamp() * @throws \SmartyException */ function smarty_function_html_select_time($params, Smarty_Internal_Template $template) { - $template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars', - 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'))); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_function_escape_special_chars', + 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php' + ) + ) + ); $prefix = 'Time_'; $field_array = null; $field_separator = "\n"; $option_separator = "\n"; $time = null; - $display_hours = true; $display_minutes = true; $display_seconds = true; $display_meridian = true; - $hour_format = '%02d'; $hour_value_format = '%02d'; $minute_format = '%02d'; $minute_value_format = '%02d'; $second_format = '%02d'; $second_value_format = '%02d'; - $hour_size = null; $minute_size = null; $second_size = null; $meridian_size = null; - $all_empty = null; $hour_empty = null; $minute_empty = null; $second_empty = null; $meridian_empty = null; - $all_id = null; $hour_id = null; $minute_id = null; $second_id = null; $meridian_id = null; - $use_24_hours = true; $minute_interval = 1; $second_interval = 1; - $extra_attrs = ''; $all_extra = null; $hour_extra = null; $minute_extra = null; $second_extra = null; $meridian_extra = null; - foreach ($params as $_key => $_value) { switch ($_key) { case 'time': if (!is_array($_value) && $_value !== null) { - $template->_checkPlugins(array(array('function' => 'smarty_make_timestamp', - 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'))); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_make_timestamp', + 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php' + ) + ) + ); $time = smarty_make_timestamp($_value); } break; - case 'prefix': case 'field_array': - case 'field_separator': case 'option_separator': - case 'all_extra': case 'hour_extra': case 'minute_extra': case 'second_extra': case 'meridian_extra': - case 'all_empty': case 'hour_empty': case 'minute_empty': case 'second_empty': case 'meridian_empty': - case 'all_id': case 'hour_id': case 'minute_id': case 'second_id': case 'meridian_id': - case 'hour_format': case 'hour_value_format': case 'minute_format': case 'minute_value_format': case 'second_format': case 'second_value_format': - $$_key = (string) $_value; + $$_key = (string)$_value; break; - case 'display_hours': case 'display_minutes': case 'display_seconds': case 'display_meridian': case 'use_24_hours': - $$_key = (bool) $_value; + $$_key = (bool)$_value; break; - case 'minute_interval': case 'second_interval': - case 'hour_size': case 'minute_size': case 'second_size': case 'meridian_size': - $$_key = (int) $_value; + $$_key = (int)$_value; break; - default: if (!is_array($_value)) { $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"'; @@ -144,13 +138,14 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem break; } } - if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) { if (isset($params[ 'time' ][ $prefix . 'Hour' ])) { // $_REQUEST[$field_array] given - foreach (array('H' => 'Hour', - 'i' => 'Minute', - 's' => 'Second') as $_elementKey => $_elementName) { + foreach (array( + 'H' => 'Hour', + 'i' => 'Minute', + 's' => 'Second' + ) as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] : @@ -163,9 +158,11 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Hour' ])) { // $_REQUEST given - foreach (array('H' => 'Hour', - 'i' => 'Minute', - 's' => 'Second') as $_elementKey => $_elementName) { + foreach (array( + 'H' => 'Hour', + 'i' => 'Minute', + 's' => 'Second' + ) as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey); @@ -187,7 +184,6 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem } else { list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); } - // generate hour <select> if ($display_hours) { $_html_hours = ''; @@ -199,42 +195,37 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem if ($hour_extra) { $_extra .= ' ' . $hour_extra; } - $_html_hours = '<select name="' . $_name . '"'; if ($hour_id !== null || $all_id !== null) { $_html_hours .= ' id="' . - smarty_function_escape_special_chars($hour_id !== null ? ($hour_id ? $hour_id : $_name) : - ($all_id ? ($all_id . $_name) : $_name)) . '"'; + smarty_function_escape_special_chars( + $hour_id !== null ? ($hour_id ? $hour_id : $_name) : + ($all_id ? ($all_id . $_name) : $_name) + ) . '"'; } if ($hour_size) { $_html_hours .= ' size="' . $hour_size . '"'; } $_html_hours .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($hour_empty) || isset($all_empty)) { $_html_hours .= '<option value="">' . (isset($hour_empty) ? $hour_empty : $all_empty) . '</option>' . $option_separator; } - $start = $use_24_hours ? 0 : 1; $end = $use_24_hours ? 23 : 12; - for ($i = $start; $i <= $end; $i ++) { + 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); - if (!$use_24_hours) { $_hour12 = $_hour == 0 ? 12 : ($_hour <= 12 ? $_hour : $_hour - 12); } - $selected = $_hour !== null ? ($use_24_hours ? $_hour == $_val : $_hour12 == $_val) : null; $_html_hours .= '<option value="' . $_value . '"' . ($selected ? ' selected="selected"' : '') . '>' . $_text . '</option>' . $option_separator; } - $_html_hours .= '</select>'; } - // generate minute <select> if ($display_minutes) { $_html_minutes = ''; @@ -246,24 +237,23 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem if ($minute_extra) { $_extra .= ' ' . $minute_extra; } - $_html_minutes = '<select name="' . $_name . '"'; if ($minute_id !== null || $all_id !== null) { - $_html_minutes .= ' id="' . smarty_function_escape_special_chars($minute_id !== null ? - ($minute_id ? $minute_id : $_name) : - ($all_id ? ($all_id . $_name) : - $_name)) . '"'; + $_html_minutes .= ' id="' . smarty_function_escape_special_chars( + $minute_id !== null ? + ($minute_id ? $minute_id : $_name) : + ($all_id ? ($all_id . $_name) : + $_name) + ) . '"'; } if ($minute_size) { $_html_minutes .= ' size="' . $minute_size . '"'; } $_html_minutes .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($minute_empty) || isset($all_empty)) { $_html_minutes .= '<option value="">' . (isset($minute_empty) ? $minute_empty : $all_empty) . '</option>' . $option_separator; } - $selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null; for ($i = 0; $i <= 59; $i += $minute_interval) { $_val = sprintf('%02d', $i); @@ -272,10 +262,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem $_html_minutes .= '<option value="' . $_value . '"' . ($selected === $i ? ' selected="selected"' : '') . '>' . $_text . '</option>' . $option_separator; } - $_html_minutes .= '</select>'; } - // generate second <select> if ($display_seconds) { $_html_seconds = ''; @@ -287,24 +275,23 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem if ($second_extra) { $_extra .= ' ' . $second_extra; } - $_html_seconds = '<select name="' . $_name . '"'; if ($second_id !== null || $all_id !== null) { - $_html_seconds .= ' id="' . smarty_function_escape_special_chars($second_id !== null ? - ($second_id ? $second_id : $_name) : - ($all_id ? ($all_id . $_name) : - $_name)) . '"'; + $_html_seconds .= ' id="' . smarty_function_escape_special_chars( + $second_id !== null ? + ($second_id ? $second_id : $_name) : + ($all_id ? ($all_id . $_name) : + $_name) + ) . '"'; } if ($second_size) { $_html_seconds .= ' size="' . $second_size . '"'; } $_html_seconds .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($second_empty) || isset($all_empty)) { $_html_seconds .= '<option value="">' . (isset($second_empty) ? $second_empty : $all_empty) . '</option>' . $option_separator; } - $selected = $_second !== null ? ($_second - $_second % $second_interval) : null; for ($i = 0; $i <= 59; $i += $second_interval) { $_val = sprintf('%02d', $i); @@ -313,10 +300,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem $_html_seconds .= '<option value="' . $_value . '"' . ($selected === $i ? ' selected="selected"' : '') . '>' . $_text . '</option>' . $option_separator; } - $_html_seconds .= '</select>'; } - // generate meridian <select> if ($display_meridian && !$use_24_hours) { $_html_meridian = ''; @@ -328,36 +313,36 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem if ($meridian_extra) { $_extra .= ' ' . $meridian_extra; } - $_html_meridian = '<select name="' . $_name . '"'; if ($meridian_id !== null || $all_id !== null) { - $_html_meridian .= ' id="' . smarty_function_escape_special_chars($meridian_id !== null ? - ($meridian_id ? $meridian_id : - $_name) : - ($all_id ? ($all_id . $_name) : - $_name)) . '"'; + $_html_meridian .= ' id="' . smarty_function_escape_special_chars( + $meridian_id !== null ? + ($meridian_id ? $meridian_id : + $_name) : + ($all_id ? ($all_id . $_name) : + $_name) + ) . '"'; } if ($meridian_size) { $_html_meridian .= ' size="' . $meridian_size . '"'; } $_html_meridian .= $_extra . $extra_attrs . '>' . $option_separator; - if (isset($meridian_empty) || isset($all_empty)) { $_html_meridian .= '<option value="">' . (isset($meridian_empty) ? $meridian_empty : $all_empty) . '</option>' . $option_separator; } - $_html_meridian .= '<option value="am"' . ($_hour > 0 && $_hour < 12 ? ' selected="selected"' : '') . '>AM</option>' . $option_separator . '<option value="pm"' . ($_hour < 12 ? '' : ' selected="selected"') . '>PM</option>' . $option_separator . '</select>'; } - $_html = ''; - foreach (array('_html_hours', - '_html_minutes', - '_html_seconds', - '_html_meridian') as $k) { + foreach (array( + '_html_hours', + '_html_minutes', + '_html_seconds', + '_html_meridian' + ) as $k) { if (isset($$k)) { if ($_html) { $_html .= $field_separator; @@ -365,6 +350,5 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem $_html .= $$k; } } - return $_html; } diff --git a/vendor/smarty/smarty/libs/plugins/function.html_table.php b/vendor/smarty/smarty/libs/plugins/function.html_table.php index d9a9fd691..ae61e83dc 100644 --- a/vendor/smarty/smarty/libs/plugins/function.html_table.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_table.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {html_table} function plugin * Type: function @@ -35,12 +34,11 @@ * {table loop=$data cols=4 tr_attr='"bgcolor=red"'} * {table loop=$data cols="first,second,third" tr_attr=$colors} * - * - * @author Monte Ohrt <monte at ohrt dot com> - * @author credit to Messju Mohr <messju at lammfellpuschen dot de> - * @author credit to boots <boots dot smarty at yahoo dot com> - * @version 1.1 - * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table} + * @author Monte Ohrt <monte at ohrt dot com> + * @author credit to Messju Mohr <messju at lammfellpuschen dot de> + * @author credit to boots <boots dot smarty at yahoo dot com> + * @version 1.1 + * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table} * (Smarty online manual) * * @param array $params parameters @@ -61,19 +59,15 @@ function smarty_function_html_table($params) $inner = 'cols'; $caption = ''; $loop = null; - if (!isset($params[ 'loop' ])) { trigger_error("html_table: missing 'loop' parameter", E_USER_WARNING); - return; } - foreach ($params as $_key => $_value) { switch ($_key) { case 'loop': - $$_key = (array) $_value; + $$_key = (array)$_value; break; - case 'cols': if (is_array($_value) && !empty($_value)) { $cols = $_value; @@ -82,25 +76,22 @@ function smarty_function_html_table($params) $cols = explode(',', $_value); $cols_count = count($cols); } elseif (!empty($_value)) { - $cols_count = (int) $_value; + $cols_count = (int)$_value; } else { $cols_count = $cols; } break; - case 'rows': - $$_key = (int) $_value; + $$_key = (int)$_value; break; - case 'table_attr': case 'trailpad': case 'hdir': case 'vdir': case 'inner': case 'caption': - $$_key = (string) $_value; + $$_key = (string)$_value; break; - case 'tr_attr': case 'td_attr': case 'th_attr': @@ -108,7 +99,6 @@ function smarty_function_html_table($params) break; } } - $loop_count = count($loop); if (empty($params[ 'rows' ])) { /* no rows specified */ @@ -119,37 +109,30 @@ function smarty_function_html_table($params) $cols_count = ceil($loop_count / $rows); } } - $output = "<table $table_attr>\n"; - if (!empty($caption)) { $output .= '<caption>' . $caption . "</caption>\n"; } - if (is_array($cols)) { $cols = ($hdir === 'right') ? $cols : array_reverse($cols); $output .= "<thead><tr>\n"; - - for ($r = 0; $r < $cols_count; $r ++) { + for ($r = 0; $r < $cols_count; $r++) { $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>'; $output .= $cols[ $r ]; $output .= "</th>\n"; } $output .= "</tr></thead>\n"; } - $output .= "<tbody>\n"; - for ($r = 0; $r < $rows; $r ++) { + 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; - - for ($c = 0; $c < $cols_count; $c ++) { + for ($c = 0; $c < $cols_count; $c++) { $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; } - if ($x < $loop_count) { $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[ $x ] . "</td>\n"; } else { @@ -160,9 +143,9 @@ function smarty_function_html_table($params) } $output .= "</tbody>\n"; $output .= "</table>\n"; - return $output; } + /** * @param $name * @param $var @@ -177,6 +160,5 @@ function smarty_function_html_table_cycle($name, $var, $no) } else { $ret = $var[ $no % count($var) ]; } - return ($ret) ? ' ' . $ret : ''; } diff --git a/vendor/smarty/smarty/libs/plugins/function.mailto.php b/vendor/smarty/smarty/libs/plugins/function.mailto.php index 0d817535a..27351df82 100644 --- a/vendor/smarty/smarty/libs/plugins/function.mailto.php +++ b/vendor/smarty/smarty/libs/plugins/function.mailto.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {mailto} function plugin * Type: function @@ -37,12 +36,11 @@ * {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"} * {mailto address="me@domain.com" extra='class="mailto"'} * - * - * @link http://www.smarty.net/manual/en/language.function.mailto.php {mailto} + * @link http://www.smarty.net/manual/en/language.function.mailto.php {mailto} * (Smarty online manual) - * @version 1.2 - * @author Monte Ohrt <monte at ohrt dot com> - * @author credits to Jason Sweat (added cc, bcc and subject functionality) + * @version 1.2 + * @author Monte Ohrt <monte at ohrt dot com> + * @author credits to Jason Sweat (added cc, bcc and subject functionality) * * @param array $params parameters * @@ -53,15 +51,12 @@ function smarty_function_mailto($params) static $_allowed_encoding = array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true); $extra = ''; - if (empty($params[ 'address' ])) { trigger_error("mailto: missing 'address' parameter", E_USER_WARNING); - return; } else { $address = $params[ 'address' ]; } - $text = $address; // netscape and mozilla do not decode %40 (@) in BCC field (bug?) // so, don't encode it. @@ -77,61 +72,52 @@ function smarty_function_mailto($params) $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value)); } break; - case 'subject': case 'newsgroups': $mail_parms[] = $var . '=' . rawurlencode($value); break; - case 'extra': case 'text': $$var = $value; - + // no break default: } } - if ($mail_parms) { $address .= '?' . join('&', $mail_parms); } - $encode = (empty($params[ 'encode' ])) ? 'none' : $params[ 'encode' ]; if (!isset($_allowed_encoding[ $encode ])) { - trigger_error("mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex", - E_USER_WARNING); - + trigger_error( + "mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex", + E_USER_WARNING + ); return; } // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed! if ($encode === 'javascript') { $string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');'; - $js_encode = ''; - for ($x = 0, $_length = strlen($string); $x < $_length; $x ++) { + for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[ $x ]); } - return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>'; } elseif ($encode === 'javascript_charcode') { $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>'; - - for ($x = 0, $y = strlen($string); $x < $y; $x ++) { + for ($x = 0, $y = strlen($string); $x < $y; $x++) { $ord[] = ord($string[ $x ]); } - $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n" . "{document.write(String.fromCharCode(" . implode(',', $ord) . "))" . "}\n" . "</script>\n"; - return $_ret; } 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); - return; } $address_encode = ''; - for ($x = 0, $_length = strlen($address); $x < $_length; $x ++) { + for ($x = 0, $_length = strlen($address); $x < $_length; $x++) { if (preg_match('!\w!' . Smarty::$_UTF8_MODIFIER, $address[ $x ])) { $address_encode .= '%' . bin2hex($address[ $x ]); } else { @@ -139,12 +125,10 @@ function smarty_function_mailto($params) } } $text_encode = ''; - for ($x = 0, $_length = strlen($text); $x < $_length; $x ++) { + for ($x = 0, $_length = strlen($text); $x < $_length; $x++) { $text_encode .= '&#x' . bin2hex($text[ $x ]) . ';'; } - $mailto = "mailto:"; - return '<a href="' . $mailto . $address_encode . '" ' . $extra . '>' . $text_encode . '</a>'; } else { // no encoding diff --git a/vendor/smarty/smarty/libs/plugins/function.math.php b/vendor/smarty/smarty/libs/plugins/function.math.php index 396ad085e..7348d9649 100644 --- a/vendor/smarty/smarty/libs/plugins/function.math.php +++ b/vendor/smarty/smarty/libs/plugins/function.math.php @@ -6,16 +6,15 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {math} function plugin * Type: function * Name: math * Purpose: handle math computations in template * - * @link http://www.smarty.net/manual/en/language.function.math.php {math} + * @link http://www.smarty.net/manual/en/language.function.math.php {math} * (Smarty online manual) - * @author Monte Ohrt <monte at ohrt dot com> + * @author Monte Ohrt <monte at ohrt dot com> * * @param array $params parameters * @param Smarty_Internal_Template $template template object @@ -25,66 +24,71 @@ function smarty_function_math($params, $template) { static $_allowed_funcs = - array('int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, - 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 'rand' => true, - 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true); + array( + 'int' => true, + 'abs' => true, + 'ceil' => true, + 'cos' => true, + 'exp' => true, + 'floor' => true, + 'log' => true, + 'log10' => true, + 'max' => true, + 'min' => true, + 'pi' => true, + 'pow' => true, + 'rand' => true, + 'round' => true, + 'sin' => true, + 'sqrt' => true, + 'srand' => true, + 'tan' => true + ); // be sure equation parameter is present if (empty($params[ 'equation' ])) { trigger_error("math: missing equation parameter", E_USER_WARNING); - return; } - $equation = $params[ 'equation' ]; - // make sure parenthesis are balanced if (substr_count($equation, '(') !== substr_count($equation, ')')) { trigger_error("math: unbalanced parenthesis", E_USER_WARNING); - return; } - // disallow backticks if (strpos($equation, '`') !== false) { trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); - return; } - // also disallow dollar signs if (strpos($equation, '$') !== false) { trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); - return; } - foreach ($params as $key => $val) { if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { // make sure value is not empty if (strlen($val) === 0) { trigger_error("math: parameter '{$key}' is empty", E_USER_WARNING); - return; } if (!is_numeric($val)) { trigger_error("math: parameter '{$key}' is not numeric", E_USER_WARNING); - return; } } } - // match all vars in equation, make sure all are passed preg_match_all('!(?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)!', $equation, $match); - foreach ($match[ 1 ] as $curr_var) { if ($curr_var && !isset($params[ $curr_var ]) && !isset($_allowed_funcs[ $curr_var ])) { - trigger_error("math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'", E_USER_WARNING); - + trigger_error( + "math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'", + E_USER_WARNING + ); return; } } - foreach ($params as $key => $val) { if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); @@ -92,7 +96,6 @@ function smarty_function_math($params, $template) } $smarty_math_result = null; eval("\$smarty_math_result = " . $equation . ";"); - if (empty($params[ 'format' ])) { if (empty($params[ 'assign' ])) { return $smarty_math_result; diff --git a/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php b/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php index e354977b0..c5fc400a6 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty capitalize modifier plugin * Type: modifier @@ -29,50 +28,75 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals $upper_string = mb_convert_case($string, MB_CASE_TITLE, Smarty::$_CHARSET); } else { // uppercase word breaks - $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, - 'smarty_mod_cap_mbconvert_cb', $string); + $upper_string = preg_replace_callback( + "!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_mbconvert_cb', + $string + ); } // check uc_digits case if (!$uc_digits) { - if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, - PREG_OFFSET_CAPTURE)) { + if (preg_match_all( + "!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, + $string, + $matches, + PREG_OFFSET_CAPTURE + ) + ) { foreach ($matches[ 1 ] as $match) { $upper_string = - substr_replace($upper_string, mb_strtolower($match[ 0 ], Smarty::$_CHARSET), $match[ 1 ], - strlen($match[ 0 ])); + substr_replace( + $upper_string, + mb_strtolower($match[ 0 ], Smarty::$_CHARSET), + $match[ 1 ], + strlen($match[ 0 ]) + ); } } } $upper_string = - preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb', - $upper_string); + preg_replace_callback( + "!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_mbconvert2_cb', + $upper_string + ); return $upper_string; } - // lowercase first if ($lc_rest) { $string = strtolower($string); } // uppercase (including hyphenated words) $upper_string = - preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb', - $string); + preg_replace_callback( + "!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_ucfirst_cb', + $string + ); // check uc_digits case if (!$uc_digits) { - if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, - PREG_OFFSET_CAPTURE)) { + if (preg_match_all( + "!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, + $string, + $matches, + PREG_OFFSET_CAPTURE + ) + ) { foreach ($matches[ 1 ] as $match) { $upper_string = substr_replace($upper_string, strtolower($match[ 0 ]), $match[ 1 ], strlen($match[ 0 ])); } } } - $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb', - $upper_string); + $upper_string = preg_replace_callback( + "!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_ucfirst2_cb', + $upper_string + ); 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() @@ -89,6 +113,7 @@ function smarty_mod_cap_mbconvert_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } + /** * @param $matches * @@ -98,6 +123,7 @@ function smarty_mod_cap_mbconvert2_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } + /** * @param $matches * @@ -107,6 +133,7 @@ function smarty_mod_cap_ucfirst_cb($matches) { return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ])); } + /** * @param $matches * diff --git a/vendor/smarty/smarty/libs/plugins/modifier.date_format.php b/vendor/smarty/smarty/libs/plugins/modifier.date_format.php index b45b2d4b8..23b69430b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.date_format.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.date_format.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty date_format modifier plugin * Type: modifier @@ -38,7 +37,7 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' static $is_loaded = false; if (!$is_loaded) { if (!is_callable('smarty_make_timestamp')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'; } $is_loaded = true; } @@ -51,20 +50,24 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' } if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) { if (Smarty::$_IS_WINDOWS) { - $_win_from = array('%D', - '%h', - '%n', - '%r', - '%R', - '%t', - '%T'); - $_win_to = array('%m/%d/%y', - '%b', - "\n", - '%I:%M:%S %p', - '%H:%M', - "\t", - '%H:%M:%S'); + $_win_from = array( + '%D', + '%h', + '%n', + '%r', + '%R', + '%t', + '%T' + ); + $_win_to = array( + '%m/%d/%y', + '%b', + "\n", + '%I:%M:%S %p', + '%H:%M', + "\t", + '%H:%M:%S' + ); if (strpos($format, '%e') !== false) { $_win_from[] = '%e'; $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); @@ -75,7 +78,6 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' } $format = str_replace($_win_from, $_win_to, $format); } - return strftime($format, $timestamp); } else { return date($format, $timestamp); diff --git a/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php b/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php index 2bd112154..78397d017 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage Debug */ - /** * Smarty debug_print_var modifier plugin * Type: modifier @@ -26,7 +25,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = { $_replace = array("\n" => '\n', "\r" => '\r', "\t" => '\t'); switch (gettype($var)) { - case 'array' : + case 'array': $results = '<b>Array (' . count($var) . ')</b>'; if ($depth === $max) { break; @@ -34,12 +33,11 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = foreach ($var as $curr_key => $curr_val) { $results .= '<br>' . str_repeat(' ', $depth * 2) . '<b>' . strtr($curr_key, $_replace) . '</b> => ' . - smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects); - $depth --; + smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; } break; - - case 'object' : + case 'object': $object_vars = get_object_vars($var); $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>'; if (in_array($var, $objects)) { @@ -52,14 +50,13 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $objects[] = $var; foreach ($object_vars as $curr_key => $curr_val) { $results .= '<br>' . str_repeat(' ', $depth * 2) . '<b> ->' . strtr($curr_key, $_replace) . - '</b> = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects); - $depth --; + '</b> = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; } break; - - case 'boolean' : - case 'NULL' : - case 'resource' : + case 'boolean': + case 'NULL': + case 'resource': if (true === $var) { $results = 'true'; } elseif (false === $var) { @@ -67,17 +64,15 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = } elseif (null === $var) { $results = 'null'; } else { - $results = htmlspecialchars((string) $var); + $results = htmlspecialchars((string)$var); } $results = '<i>' . $results . '</i>'; break; - - case 'integer' : - case 'float' : - $results = htmlspecialchars((string) $var); + case 'integer': + case 'float': + $results = htmlspecialchars((string)$var); break; - - case 'string' : + case 'string': $results = strtr($var, $_replace); if (Smarty::$_MBSTRING) { if (mb_strlen($var, Smarty::$_CHARSET) > $length) { @@ -88,13 +83,11 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $results = substr($var, 0, $length - 3) . '...'; } } - $results = htmlspecialchars('"' . $results . '"', ENT_QUOTES, Smarty::$_CHARSET); break; - - case 'unknown type' : - default : - $results = strtr((string) $var, $_replace); + case 'unknown type': + default: + $results = strtr((string)$var, $_replace); if (Smarty::$_MBSTRING) { if (mb_strlen($results, Smarty::$_CHARSET) > $length) { $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...'; @@ -104,9 +97,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $results = substr($results, 0, $length - 3) . '...'; } } - $results = htmlspecialchars($results, ENT_QUOTES, Smarty::$_CHARSET); } - return $results; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.escape.php b/vendor/smarty/smarty/libs/plugins/modifier.escape.php index 1ae87a7aa..150901c7c 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.escape.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty escape modifier plugin * Type: modifier @@ -30,11 +29,9 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - if (!$char_set) { $char_set = Smarty::$_CHARSET; } - switch ($esc_type) { case 'html': if ($_double_encode) { @@ -48,14 +45,21 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // php <5.2.3 - prevent double encoding $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); - $string = str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + $string = str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - + // no break case 'htmlall': if (Smarty::$_MBSTRING) { // mb_convert_encoding ignores htmlspecialchars() @@ -71,18 +75,23 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); $string = - str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - // htmlentities() won't convert everything, so use mb_convert_encoding return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set); } - // no MBString fallback if ($_double_encode) { return htmlentities($string, ENT_QUOTES, $char_set, $double_encode); @@ -92,41 +101,43 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ } else { $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlentities($string, ENT_QUOTES, $char_set); - $string = str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + $string = str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - + // no break case 'url': return rawurlencode($string); - case 'urlpathinfo': return str_replace('%2F', '/', rawurlencode($string)); - case 'quotes': // escape unescaped single quotes return preg_replace("%(?<!\\\\)'%", "\\'", $string); - case 'hex': // escape every byte into hex // Note that the UTF-8 encoded character ä will be represented as %c3%a4 $return = ''; $_length = strlen($string); - for ($x = 0; $x < $_length; $x ++) { + for ($x = 0; $x < $_length; $x++) { $return .= '%' . bin2hex($string[ $x ]); } - return $return; - case 'hexentity': $return = ''; if (Smarty::$_MBSTRING) { if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'; } $is_loaded_1 = true; } @@ -134,23 +145,20 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { $return .= '&#x' . strtoupper(dechex($unicode)) . ';'; } - return $return; } // no MBString fallback $_length = strlen($string); - for ($x = 0; $x < $_length; $x ++) { + for ($x = 0; $x < $_length; $x++) { $return .= '&#x' . bin2hex($string[ $x ]) . ';'; } - return $return; - case 'decentity': $return = ''; if (Smarty::$_MBSTRING) { if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'; } $is_loaded_1 = true; } @@ -158,50 +166,66 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { $return .= '&#' . $unicode . ';'; } - return $return; } // no MBString fallback $_length = strlen($string); - for ($x = 0; $x < $_length; $x ++) { + for ($x = 0; $x < $_length; $x++) { $return .= '&#' . ord($string[ $x ]) . ';'; } - return $return; - case 'javascript': // escape quotes and backslashes, newlines, etc. - return strtr($string, array('\\' => '\\\\', - "'" => "\\'", - '"' => '\\"', - "\r" => '\\r', - "\n" => '\\n', - '</' => '<\/')); - + return strtr( + $string, + array( + '\\' => '\\\\', + "'" => "\\'", + '"' => '\\"', + "\r" => '\\r', + "\n" => '\\n', + '</' => '<\/' + ) + ); case 'mail': if (Smarty::$_MBSTRING) { if (!$is_loaded_2) { if (!is_callable('smarty_mb_str_replace')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'; } $is_loaded_2 = true; } - return smarty_mb_str_replace(array('@', - '.'), array(' [AT] ', - ' [DOT] '), $string); + return smarty_mb_str_replace( + array( + '@', + '.' + ), + array( + ' [AT] ', + ' [DOT] ' + ), + $string + ); } // no MBString fallback - return str_replace(array('@', - '.'), array(' [AT] ', - ' [DOT] '), $string); - + return str_replace( + array( + '@', + '.' + ), + array( + ' [AT] ', + ' [DOT] ' + ), + $string + ); case 'nonstd': // escape non-standard chars, such as ms document quotes $return = ''; if (Smarty::$_MBSTRING) { if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'; } $is_loaded_1 = true; } @@ -212,12 +236,10 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= chr($unicode); } } - return $return; } - $_length = strlen($string); - for ($_i = 0; $_i < $_length; $_i ++) { + for ($_i = 0; $_i < $_length; $_i++) { $_ord = ord(substr($string, $_i, 1)); // non-standard char, escape it if ($_ord >= 126) { @@ -226,9 +248,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= substr($string, $_i, 1); } } - return $return; - default: return $string; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php b/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php index 93c6241ec..1cd625b64 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php @@ -11,13 +11,12 @@ * Name: mb_wordwrap * Purpose: Wrap a string to a given number of characters * - * @link http://php.net/manual/en/function.wordwrap.php for similarity * - * @param string $str the string to wrap - * @param int $width the width of the output - * @param string $break the character used to break the line - * @param boolean $cut ignored parameter, just for the sake of + * @param string $str the string to wrap + * @param int $width the width of the output + * @param string $break the character used to break the line + * @param boolean $cut ignored parameter, just for the sake of * * @return string wrapped string * @author Rodney Rehm @@ -30,30 +29,28 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa $t = ''; $_previous = false; $_space = false; - foreach ($tokens as $_token) { $token_length = mb_strlen($_token, Smarty::$_CHARSET); $_tokens = array($_token); if ($token_length > $width) { if ($cut) { - $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, - $_token, - -1, - PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE); + $_tokens = preg_split( + '!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, + $_token, + -1, + PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE + ); } } - foreach ($_tokens as $token) { $_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token); $token_length = mb_strlen($token, Smarty::$_CHARSET); $length += $token_length; - if ($length > $width) { // remove space before inserted break if ($_previous) { $t = mb_substr($t, 0, -1, Smarty::$_CHARSET); } - if (!$_space) { // add the break before the token if (!empty($t)) { @@ -61,7 +58,7 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa } $length = $token_length; } - } else if ($token === "\n") { + } elseif ($token === "\n") { // hard break must reset counters $length = 0; } @@ -70,6 +67,5 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa $t .= $token; } } - return $t; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php b/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php index 479aba875..7eb550695 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty regex_replace modifier plugin * Type: modifier * Name: regex_replace * Purpose: regular expression search/replace * - * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php + * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php * regex_replace (Smarty online manual) - * @author Monte Ohrt <monte at ohrt dot com> + * @author Monte Ohrt <monte at ohrt dot com> * * @param string $string input string * @param string|array $search regular expression(s) to search for @@ -23,7 +22,7 @@ * * @return string */ -function smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1) +function smarty_modifier_regex_replace($string, $search, $replace, $limit = -1) { if (is_array($search)) { foreach ($search as $idx => $s) { @@ -32,7 +31,6 @@ function smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1) } else { $search = _smarty_regex_replace_check($search); } - return preg_replace($search, $replace, $string, $limit); } @@ -51,8 +49,7 @@ function _smarty_regex_replace_check($search) } // remove eval-modifier from $search if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[ 1 ], 'e') !== false)) { - $search = substr($search, 0, - strlen($match[ 1 ])) . preg_replace('![e\s]+!', '', $match[ 1 ]); + $search = substr($search, 0, -strlen($match[ 1 ])) . preg_replace('![e\s]+!', '', $match[ 1 ]); } - return $search; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.replace.php b/vendor/smarty/smarty/libs/plugins/modifier.replace.php index a1b043b64..a98f5a4a6 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.replace.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.replace.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty replace modifier plugin * Type: modifier @@ -28,12 +27,11 @@ function smarty_modifier_replace($string, $search, $replace) if (Smarty::$_MBSTRING) { if (!$is_loaded) { if (!is_callable('smarty_mb_str_replace')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'; } $is_loaded = true; } - return smarty_mb_str_replace($search, $replace, $string); + return smarty_mb_str_replace($search, $replace, $string); } - return str_replace($search, $replace, $string); } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.spacify.php b/vendor/smarty/smarty/libs/plugins/modifier.spacify.php index 1e29fd553..98efd4b30 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.spacify.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.spacify.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty spacify modifier plugin * Type: modifier @@ -23,5 +22,5 @@ function smarty_modifier_spacify($string, $spacify_char = ' ') { // well… what about charsets besides latin and UTF-8? - return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, - 1, PREG_SPLIT_NO_EMPTY)); + return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY)); } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.truncate.php b/vendor/smarty/smarty/libs/plugins/modifier.truncate.php index bb9df92d7..bb881bf6e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.truncate.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.truncate.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty truncate modifier plugin * Type: modifier @@ -30,25 +29,24 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if ($length === 0) { return ''; } - if (Smarty::$_MBSTRING) { if (mb_strlen($string, Smarty::$_CHARSET) > $length) { $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET)); if (!$break_words && !$middle) { - $string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', - mb_substr($string, 0, $length + 1, Smarty::$_CHARSET)); + $string = preg_replace( + '/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, + '', + mb_substr($string, 0, $length + 1, Smarty::$_CHARSET) + ); } if (!$middle) { return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc; } - return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . - mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET); + mb_substr($string, -$length / 2, $length, Smarty::$_CHARSET); } - return $string; } - // no MBString fallback if (isset($string[ $length ])) { $length -= min($length, strlen($etc)); @@ -58,9 +56,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if (!$middle) { return substr($string, 0, $length) . $etc; } - - return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); + return substr($string, 0, $length / 2) . $etc . substr($string, -$length / 2); } - return $string; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php index 919b03c39..21d0e6624 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty cat modifier plugin * Type: modifier @@ -15,9 +14,9 @@ * Input: string to catenate * Example: {$var|cat:"foo"} * - * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat + * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat * (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php index 8116aa327..6c44278af 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php @@ -5,14 +5,14 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_characters modifier plugin * Type: modifier * Name: count_characters * Purpose: count the number of characters in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online + * manual) * @author Uwe Tews * * @param array $params parameters diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php index 1917d290a..e214a56f0 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_paragraphs modifier plugin * Type: modifier * Name: count_paragraphs * Purpose: count the number of paragraphs in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php + * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php * count_paragraphs (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php index a782d8e0b..027745635 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_sentences modifier plugin * Type: modifier * Name: count_sentences * Purpose: count the number of sentences in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php + * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php * count_sentences (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php index dc8500c75..6d889da5c 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_words modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php index 9fe5d4da2..ae886c4b2 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty default modifier plugin * Type: modifier @@ -25,11 +24,9 @@ function smarty_modifiercompiler_default($params) if (!isset($params[ 1 ])) { $params[ 1 ] = "''"; } - array_shift($params); foreach ($params as $param) { $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; } - return $output; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php index 6a6e01637..e0763adce 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php @@ -14,8 +14,8 @@ * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual) * @author Rodney Rehm * - * @param array $params parameters - * @param Smarty_Internal_TemplateCompilerBase $compiler + * @param array $params parameters + * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code * @throws \SmartyException @@ -24,21 +24,24 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile { static $_double_encode = null; static $is_loaded = false; - $compiler->template->_checkPlugins(array(array('function' => 'smarty_literal_compiler_param', - 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php'))); + $compiler->template->_checkPlugins( + array( + array( + 'function' => 'smarty_literal_compiler_param', + 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php' + ) + ) + ); if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - try { $esc_type = smarty_literal_compiler_param($params, 1, 'html'); $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET); $double_encode = smarty_literal_compiler_param($params, 3, true); - if (!$char_set) { $char_set = Smarty::$_CHARSET; } - switch ($esc_type) { case 'html': if ($_double_encode) { @@ -49,7 +52,7 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile } else { // fall back to modifier.escape.php } - + // no break case 'htmlall': if (Smarty::$_MBSTRING) { if ($_double_encode) { @@ -65,7 +68,6 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile // fall back to modifier.escape.php } } - // no MBString fallback if ($_double_encode) { // php >=5.2.3 - go native @@ -77,27 +79,23 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile } else { // fall back to modifier.escape.php } - + // no break case 'url': return 'rawurlencode(' . $params[ 0 ] . ')'; - case 'urlpathinfo': return 'str_replace("%2F", "/", rawurlencode(' . $params[ 0 ] . '))'; - case 'quotes': // escape unescaped single quotes return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[ 0 ] . ')'; - case 'javascript': // escape quotes and backslashes, newlines, etc. - return 'strtr(' . $params[ 0 ] . + return 'strtr(' . + $params[ 0 ] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))'; } - } - catch (SmartyException $e) { + } catch (SmartyException $e) { // pass through to regular plugin fallback } - // could not optimize |escape call, so fallback to regular plugin if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] = @@ -110,6 +108,5 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } - return 'smarty_modifier_escape(' . join(', ', $params) . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php index b5732db42..acce7784b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty from_charset modifier plugin * Type: modifier @@ -24,10 +23,8 @@ function smarty_modifiercompiler_from_charset($params) // FIXME: (rodneyrehm) shouldn't this throw an error? return $params[ 0 ]; } - if (!isset($params[ 1 ])) { $params[ 1 ] = '"ISO-8859-1"'; } - return 'mb_convert_encoding(' . $params[ 0 ] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[ 1 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php index fede8aa74..2088ad6a8 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty indent modifier plugin * Type: modifier @@ -19,7 +18,6 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_indent($params) { if (!isset($params[ 1 ])) { @@ -28,6 +26,5 @@ function smarty_modifiercompiler_indent($params) if (!isset($params[ 2 ])) { $params[ 2 ] = "' '"; } - return 'preg_replace(\'!^!m\',str_repeat(' . $params[ 2 ] . ',' . $params[ 1 ] . '),' . $params[ 0 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php index 8c6c26a89..0d899a002 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty lower modifier plugin * Type: modifier @@ -20,7 +19,6 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_lower($params) { if (Smarty::$_MBSTRING) { diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php index 455cfe14b..1275190e0 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php @@ -5,14 +5,13 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty noprint modifier plugin * Type: modifier * Name: noprint * Purpose: return an empty string * - * @author Uwe Tews + * @author Uwe Tews * @return string with compiled code */ function smarty_modifiercompiler_noprint() diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php index 8d3bfa4e2..663094311 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty string_format modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php index 3b7ade5ed..04ea332c5 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty strip modifier plugin * Type: modifier @@ -22,12 +21,10 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_strip($params) { if (!isset($params[ 1 ])) { $params[ 1 ] = "' '"; } - return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})"; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php index 5ddca7a94..1bca1a28e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty strip_tags modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php index 889005712..d652eab1b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty to_charset modifier plugin * Type: modifier @@ -24,10 +23,8 @@ function smarty_modifiercompiler_to_charset($params) // FIXME: (rodneyrehm) shouldn't this throw an error? return $params[ 0 ]; } - if (!isset($params[ 1 ])) { $params[ 1 ] = '"ISO-8859-1"'; } - return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 1 ] . ', "' . addslashes(Smarty::$_CHARSET) . '")'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php index 5a94e0727..05beb81f5 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty unescape modifier plugin * Type: modifier @@ -28,22 +27,17 @@ function smarty_modifiercompiler_unescape($params) } else { $params[ 2 ] = "'{$params[ 2 ]}'"; } - switch (trim($params[ 1 ], '"\'')) { case 'entity': case 'htmlall': if (Smarty::$_MBSTRING) { return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 2 ] . ', \'HTML-ENTITIES\')'; } - return 'html_entity_decode(' . $params[ 0 ] . ', ENT_NOQUOTES, ' . $params[ 2 ] . ')'; - case 'html': return 'htmlspecialchars_decode(' . $params[ 0 ] . ', ENT_QUOTES)'; - case 'url': return 'rawurldecode(' . $params[ 0 ] . ')'; - default: return $params[ 0 ]; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php index d0d5cc7c3..ea4e95b7a 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty upper modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php index 94a0cf602..8565f140e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php @@ -33,7 +33,7 @@ function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompi } $function = 'wordwrap'; if (Smarty::$_MBSTRING) { - $function = $compiler->getPlugin('mb_wordwrap','modifier'); + $function = $compiler->getPlugin('mb_wordwrap', 'modifier'); } return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php b/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php index 70a66d3da..7e4503a1c 100644 --- a/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php +++ b/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php @@ -5,85 +5,85 @@ * @package Smarty * @subpackage PluginsFilter */ - /** * Smarty trimwhitespace outputfilter plugin * Trim unnecessary whitespace from HTML markup. * - * @author Rodney Rehm + * @author Rodney Rehm * * @param string $source input string * * @return string filtered output - * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail! + * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail! */ function smarty_outputfilter_trimwhitespace($source) { $store = array(); $_store = 0; $_offset = 0; - // Unify Line-Breaks to \n $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, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + if (preg_match_all( + '#<!--((\[[^\]]+\]>.*?<!\[[^\]]+\])|(\s*/?ko\s+.+))-->#is', + $source, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ]; $_length = strlen($match[ 0 ][ 0 ]); $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); - $_offset += $_length - strlen($replace); - $_store ++; + $_store++; } } - // Strip all HTML-Comments // yes, even the ones in <script> - see http://stackoverflow.com/a/808850/515124 $source = preg_replace('#<!--.*?-->#ms', '', $source); - // capture html elements not to be messed with $_offset = 0; - if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is', - $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + if (preg_match_all( + '#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is', + $source, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ]; $_length = strlen($match[ 0 ][ 0 ]); $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); - $_offset += $_length - strlen($replace); - $_store ++; + $_store++; } } - $expressions = array(// replace multiple spaces between tags by a single space // can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements - '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2', + '#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2', // remove spaces between attributes (but not in attribute values!) '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', // note: for some very weird reason trim() seems to remove spaces inside attributes. // maybe a \0 byte or something is interfering? - '#^\s+<#Ss' => '<', '#>\s+$#Ss' => '>',); - + '#^\s+<#Ss' => '<', + '#>\s+$#Ss' => '>', + ); $source = preg_replace(array_keys($expressions), array_values($expressions), $source); // note: for some very weird reason trim() seems to remove spaces inside attributes. // maybe a \0 byte or something is interfering? // $source = trim( $source ); - $_offset = 0; if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { $_length = strlen($match[ 0 ][ 0 ]); $replace = $store[ $match[ 1 ][ 0 ] ]; $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] + $_offset, $_length); - $_offset += strlen($replace) - $_length; - $_store ++; + $_store++; } } - return $source; } diff --git a/vendor/smarty/smarty/libs/plugins/shared.escape_special_chars.php b/vendor/smarty/smarty/libs/plugins/shared.escape_special_chars.php index 1d4c7284b..6b18d3eec 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.escape_special_chars.php +++ b/vendor/smarty/smarty/libs/plugins/shared.escape_special_chars.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsShared */ - /** * escape_special_chars common function * Function: smarty_function_escape_special_chars * Purpose: used by other smarty functions to escape * special chars except for already escaped ones * - * @author Monte Ohrt <monte at ohrt dot com> + * @author Monte Ohrt <monte at ohrt dot com> * - * @param string $string text that should by escaped + * @param string $string text that should by escaped * * @return string */ @@ -29,6 +28,5 @@ function smarty_function_escape_special_chars($string) $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); } } - return $string; } diff --git a/vendor/smarty/smarty/libs/plugins/shared.literal_compiler_param.php b/vendor/smarty/smarty/libs/plugins/shared.literal_compiler_param.php index 8a3711d30..65caf03c8 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.literal_compiler_param.php +++ b/vendor/smarty/smarty/libs/plugins/shared.literal_compiler_param.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsShared */ - /** * evaluate compiler parameter * @@ -25,12 +24,12 @@ function smarty_literal_compiler_param($params, $index, $default = null) } // test if param is a literal if (!preg_match('/^([\'"]?)[a-zA-Z0-9-]+(\\1)$/', $params[ $index ])) { - throw new SmartyException('$param[' . $index . - '] is not a literal and is thus not evaluatable at compile time'); + throw new SmartyException( + '$param[' . $index . + '] is not a literal and is thus not evaluatable at compile time' + ); } - $t = null; eval("\$t = " . $params[ $index ] . ";"); - return $t; } diff --git a/vendor/smarty/smarty/libs/plugins/shared.make_timestamp.php b/vendor/smarty/smarty/libs/plugins/shared.make_timestamp.php index eb064607d..9626dc68e 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.make_timestamp.php +++ b/vendor/smarty/smarty/libs/plugins/shared.make_timestamp.php @@ -5,12 +5,11 @@ * @package Smarty * @subpackage PluginsShared */ - /** * Function: smarty_make_timestamp * Purpose: used by other smarty functions to make a timestamp from a string. * - * @author Monte Ohrt <monte at ohrt dot com> + * @author Monte Ohrt <monte at ohrt dot com> * * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime() * @@ -21,25 +20,30 @@ function smarty_make_timestamp($string) if (empty($string)) { // use "now": return time(); - } elseif ($string instanceof DateTime || - (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface) + } elseif ($string instanceof DateTime + || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface) ) { - return (int) $string->format('U'); // PHP 5.2 BC + return (int)$string->format('U'); // PHP 5.2 BC } 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)); + 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) + ); } elseif (is_numeric($string)) { // it is a numeric string, we handle it as timestamp - return (int) $string; + return (int)$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(); } - return $time; } } diff --git a/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php b/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php index 300702933..206cf9ea6 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php +++ b/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php @@ -9,10 +9,10 @@ if (!function_exists('smarty_mb_str_replace')) { /** * Multibyte string replace * - * @param string|string[] $search the string to be searched - * @param string|string[] $replace the replacement string - * @param string $subject the source string - * @param int &$count number of matches found + * @param string|string[] $search the string to be searched + * @param string|string[] $replace the replacement string + * @param string $subject the source string + * @param int &$count number of matches found * * @return string replaced string * @author Rodney Rehm @@ -28,7 +28,7 @@ if (!function_exists('smarty_mb_str_replace')) { $string = smarty_mb_str_replace($search, $replace, $string, $c); $count += $c; } - } else if (is_array($search)) { + } elseif (is_array($search)) { if (!is_array($replace)) { foreach ($search as &$string) { $subject = smarty_mb_str_replace($string, $replace, $subject, $c); diff --git a/vendor/smarty/smarty/libs/plugins/shared.mb_unicode.php b/vendor/smarty/smarty/libs/plugins/shared.mb_unicode.php index 7450148a4..7d1206506 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.mb_unicode.php +++ b/vendor/smarty/smarty/libs/plugins/shared.mb_unicode.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsShared */ - /** * convert characters to their decimal unicode equivalents * @@ -24,7 +23,6 @@ function smarty_mb_to_unicode($string, $encoding = null) } else { $expanded = mb_convert_encoding($string, 'UTF-32BE'); } - return unpack('N*', $expanded); } @@ -45,10 +43,9 @@ function smarty_mb_from_unicode($unicode, $encoding = null) if (!$encoding) { $encoding = mb_internal_encoding(); } - foreach ((array) $unicode as $utf32be) { + foreach ((array)$unicode as $utf32be) { $character = pack('N*', $utf32be); $t .= mb_convert_encoding($character, $encoding, 'UTF-32BE'); } - return $t; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource.php index 2a4552cb2..91e9f3924 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource.php @@ -25,12 +25,12 @@ abstract class Smarty_CacheResource /** * populate Cached Object with meta data from Resource * - * @param Smarty_Template_Cached $cached cached object + * @param \Smarty_Template_Cached $cached cached object * @param Smarty_Internal_Template $_template template object * * @return void */ - abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template); + abstract public function populate(\Smarty_Template_Cached $cached, Smarty_Internal_Template $_template); /** * populate Cached Object with timestamp and exists from Resource @@ -50,8 +50,11 @@ abstract class Smarty_CacheResource * * @return boolean true or false if the cached content does not exist */ - abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached = null, - $update = false); + abstract public function process( + Smarty_Internal_Template $_template, + Smarty_Template_Cached $cached = null, + $update = false + ); /** * Write the rendered template output to cache @@ -66,11 +69,11 @@ abstract class Smarty_CacheResource /** * Read cached template from cache * - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template $_template template object * * @return string content */ - abstract function readCachedContent(Smarty_Internal_Template $_template); + abstract public function readCachedContent(Smarty_Internal_Template $_template); /** * Return cached content @@ -87,7 +90,6 @@ abstract class Smarty_CacheResource $unifunc($_template); return ob_get_clean(); } - return null; } @@ -133,7 +135,6 @@ abstract class Smarty_CacheResource } sleep(1); } - return $hadLock; } @@ -193,12 +194,10 @@ abstract class Smarty_CacheResource if (!isset($type)) { $type = $smarty->caching_type; } - // try smarty's cache if (isset($smarty->_cache[ 'cacheresource_handlers' ][ $type ])) { return $smarty->_cache[ 'cacheresource_handlers' ][ $type ]; } - // try registered resource if (isset($smarty->registered_cache_resources[ $type ])) { // do not cache these instances as they may vary from instance to instance diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_custom.php b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_custom.php index 7a5920f43..68ad11289 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_custom.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_custom.php @@ -18,12 +18,12 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * fetch cached content and its modification time from data source * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) * * @return void */ @@ -34,10 +34,10 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource * {@internal implementing this method is optional. * Only implement it if modification times can be accessed faster than loading the complete cached content.}} * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id * * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ @@ -49,12 +49,12 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * Save content to cache * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration or null - * @param string $content content to cache + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * @param string $content content to cache * * @return boolean success */ @@ -63,10 +63,10 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * Delete content from cache * - * @param string|null $name template name - * @param string|null $cache_id cache id - * @param string|null $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string|null $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null * * @return integer number of deleted caches */ @@ -75,8 +75,8 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * populate Cached Object with meta data from Resource * - * @param Smarty_Template_Cached $cached cached object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -106,12 +106,17 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource if ($mtime !== null) { $cached->timestamp = $mtime; $cached->exists = !!$cached->timestamp; - return; } $timestamp = null; - $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content, - $timestamp); + $this->fetch( + $cached->filepath, + $cached->source->name, + $cached->cache_id, + $cached->compile_id, + $cached->content, + $timestamp + ); $cached->timestamp = isset($timestamp) ? $timestamp : false; $cached->exists = !!$cached->timestamp; } @@ -120,50 +125,63 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource * Read the cached template and process the header * * @param \Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached $cached cached object * @param boolean $update flag if called because cache update * * @return boolean true or false if the cached content does not exist */ - public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null, - $update = false) - { + public function process( + Smarty_Internal_Template $_smarty_tpl, + Smarty_Template_Cached $cached = null, + $update = false + ) { if (!$cached) { $cached = $_smarty_tpl->cached; } $content = $cached->content ? $cached->content : null; $timestamp = $cached->timestamp ? $cached->timestamp : null; if ($content === null || !$timestamp) { - $this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id, - $_smarty_tpl->compile_id, $content, $timestamp); + $this->fetch( + $_smarty_tpl->cached->filepath, + $_smarty_tpl->source->name, + $_smarty_tpl->cache_id, + $_smarty_tpl->compile_id, + $content, + $timestamp + ); } if (isset($content)) { eval('?>' . $content); $cached->content = null; return true; } - return false; } /** * Write the rendered template output to cache * - * @param Smarty_Internal_Template $_template template object - * @param string $content content to cache + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache * * @return boolean success */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { - return $this->save($_template->cached->filepath, $_template->source->name, $_template->cache_id, - $_template->compile_id, $_template->cache_lifetime, $content); + return $this->save( + $_template->cached->filepath, + $_template->source->name, + $_template->cache_id, + $_template->compile_id, + $_template->cache_lifetime, + $content + ); } /** * Read cached template from cache * - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template $_template template object * * @return string|boolean content */ @@ -173,8 +191,14 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource $timestamp = null; if ($content === null) { $timestamp = null; - $this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, - $_template->compile_id, $content, $timestamp); + $this->fetch( + $_template->cached->filepath, + $_template->source->name, + $_template->cache_id, + $_template->compile_id, + $content, + $timestamp + ); } if (isset($content)) { return $content; @@ -185,8 +209,8 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * Empty cache * - * @param Smarty $smarty Smarty object - * @param integer $exp_time expiration time (number of seconds, not timestamp) + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time (number of seconds, not timestamp) * * @return integer number of cache files deleted */ @@ -198,11 +222,11 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource /** * Empty cache for a specific template * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time (number of seconds, not timestamp) + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) * * @return int number of cache files deleted * @throws \SmartyException @@ -210,7 +234,6 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) { $cache_name = null; - if (isset($resource_name)) { $source = Smarty_Template_Source::load(null, $smarty, $resource_name); if ($source->exists) { @@ -219,15 +242,14 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource return 0; } } - return $this->delete($cache_name, $cache_id, $compile_id, $exp_time); } /** * Check is cache is locked for this template * - * @param Smarty $smarty Smarty object - * @param Smarty_Template_Cached $cached cached object + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object * * @return boolean true or false if cache is locked */ @@ -235,7 +257,6 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { $id = $cached->lock_id; $name = $cached->source->name . '.lock'; - $mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id); if ($mtime === null) { $this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime); diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index ff065a278..59bf1d4a8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -47,8 +47,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * populate Cached Object with meta data from Resource * - * @param Smarty_Template_Cached $cached cached object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -56,26 +56,32 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { $cached->filepath = $_template->source->uid . '#' . $this->sanitize($cached->source->resource) . '#' . $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id); - $this->populateTimestamp($cached); } /** * populate Cached Object with timestamp and exists from Resource * - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached $cached cached object * * @return void */ public function populateTimestamp(Smarty_Template_Cached $cached) { - if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content, - $timestamp, $cached->source->uid) + if (!$this->fetch( + $cached->filepath, + $cached->source->name, + $cached->cache_id, + $cached->compile_id, + $content, + $timestamp, + $cached->source->uid + ) ) { return; } $cached->content = $content; - $cached->timestamp = (int) $timestamp; + $cached->timestamp = (int)$timestamp; $cached->exists = !!$cached->timestamp; } @@ -83,54 +89,60 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource * Read the cached template and process the header * * @param \Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached $cached cached object * @param boolean $update flag if called because cache update * * @return boolean true or false if the cached content does not exist */ - public function process(Smarty_Internal_Template $_smarty_tpl, Smarty_Template_Cached $cached = null, - $update = false) - { + public function process( + Smarty_Internal_Template $_smarty_tpl, + Smarty_Template_Cached $cached = null, + $update = false + ) { if (!$cached) { $cached = $_smarty_tpl->cached; } $content = $cached->content ? $cached->content : null; $timestamp = $cached->timestamp ? $cached->timestamp : null; if ($content === null || !$timestamp) { - if (!$this->fetch($_smarty_tpl->cached->filepath, $_smarty_tpl->source->name, $_smarty_tpl->cache_id, - $_smarty_tpl->compile_id, $content, $timestamp, $_smarty_tpl->source->uid) + if (!$this->fetch( + $_smarty_tpl->cached->filepath, + $_smarty_tpl->source->name, + $_smarty_tpl->cache_id, + $_smarty_tpl->compile_id, + $content, + $timestamp, + $_smarty_tpl->source->uid + ) ) { return false; } } if (isset($content)) { eval('?>' . $content); - return true; } - return false; } /** * Write the rendered template output to cache * - * @param Smarty_Internal_Template $_template template object - * @param string $content content to cache + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache * * @return boolean success */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { $this->addMetaTimestamp($content); - return $this->write(array($_template->cached->filepath => $content), $_template->cache_lifetime); } /** * Read cached template from cache * - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template $_template template object * * @return string|false content */ @@ -139,8 +151,15 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource $content = $_template->cached->content ? $_template->cached->content : null; $timestamp = null; if ($content === null) { - if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, - $_template->compile_id, $content, $timestamp, $_template->source->uid) + if (!$this->fetch( + $_template->cached->filepath, + $_template->source->name, + $_template->cache_id, + $_template->compile_id, + $content, + $timestamp, + $_template->source->uid + ) ) { return false; } @@ -155,36 +174,36 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource * Empty cache * {@internal the $exp_time argument is ignored altogether }} * - * @param Smarty $smarty Smarty object - * @param integer $exp_time expiration time [being ignored] + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time [being ignored] * * @return integer number of cache files deleted [always -1] - * @uses purge() to clear the whole store - * @uses invalidate() to mark everything outdated if purge() is inapplicable + * @uses purge() to clear the whole store + * @uses invalidate() to mark everything outdated if purge() is inapplicable */ public function clearAll(Smarty $smarty, $exp_time = null) { if (!$this->purge()) { $this->invalidate(null); } - return - 1; + return -1; } /** * Empty cache for a specific template * {@internal the $exp_time argument is ignored altogether}} * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time [being ignored] + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time [being ignored] * * @return int number of cache files deleted [always -1] * @throws \SmartyException - * @uses buildCachedFilepath() to generate the CacheID - * @uses invalidate() to mark CacheIDs parent chain as outdated - * @uses delete() to remove CacheID from cache + * @uses buildCachedFilepath() to generate the CacheID + * @uses invalidate() to mark CacheIDs parent chain as outdated + * @uses delete() to remove CacheID from cache */ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) { @@ -193,18 +212,17 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource $this->sanitize($compile_id); $this->delete(array($cid)); $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid); - return - 1; + return -1; } /** * Get template's unique ID * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name + * @param Smarty $smarty Smarty object + * @param string $resource_name template name * * @return string filepath of cache file * @throws \SmartyException - * */ protected function getTemplateUid(Smarty $smarty, $resource_name) { @@ -220,7 +238,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Sanitize CacheID components * - * @param string $string CacheID component to sanitize + * @param string $string CacheID component to sanitize * * @return string sanitized CacheID component */ @@ -236,23 +254,28 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Fetch and prepare a cache object. * - * @param string $cid CacheID to fetch - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer &$timestamp cached timestamp (epoch) - * @param string $resource_uid resource's uid + * @param string $cid CacheID to fetch + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer &$timestamp cached timestamp (epoch) + * @param string $resource_uid resource's uid * * @return boolean success */ - protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null, - &$timestamp = null, $resource_uid = null) - { + protected function fetch( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + &$content = null, + &$timestamp = null, + $resource_uid = null + ) { $t = $this->read(array($cid)); $content = !empty($t[ $cid ]) ? $t[ $cid ] : null; $timestamp = null; - if ($content && ($timestamp = $this->getMetaTimestamp($content))) { $invalidated = $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid); @@ -261,7 +284,6 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource $content = null; } } - return !!$content; } @@ -274,14 +296,14 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource protected function addMetaTimestamp(&$content) { $mt = explode(' ', microtime()); - $ts = pack('NN', $mt[ 1 ], (int) ($mt[ 0 ] * 100000000)); + $ts = pack('NN', $mt[ 1 ], (int)($mt[ 0 ] * 100000000)); $content = $ts . $content; } /** * Extract the timestamp the $content was cached * - * @param string &$content the cached content + * @param string &$content the cached content * * @return float the microtime the content was cached */ @@ -298,17 +320,21 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Invalidate CacheID * - * @param string $cid CacheID - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's uid + * @param string $cid CacheID + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's uid * * @return void */ - protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, - $resource_uid = null) - { + protected function invalidate( + $cid = null, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { $now = microtime(true); $key = null; // invalidate everything @@ -339,17 +365,21 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Determine the latest timestamp known to the invalidation chain * - * @param string $cid CacheID to determine latest invalidation timestamp of - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's filepath + * @param string $cid CacheID to determine latest invalidation timestamp of + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath * * @return float the microtime the CacheID was invalidated */ - protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null, - $resource_uid = null) - { + protected function getLatestInvalidationTimestamp( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { // abort if there is no CacheID if (false && !$cid) { return 0; @@ -358,14 +388,12 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) { return 0; } - // there are no InValidationKeys if (!($values = $this->read($_cid))) { return 0; } // make sure we're dealing with floats $values = array_map('floatval', $values); - return max($values); } @@ -373,18 +401,22 @@ 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', ... ) * - * @param string $cid CacheID to translate - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's filepath + * @param string $cid CacheID to translate + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath * * @return array list of InvalidationKeys - * @uses $invalidationKeyPrefix to prepend to each InvalidationKey + * @uses $invalidationKeyPrefix to prepend to each InvalidationKey */ - protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, - $resource_uid = null) - { + protected function listInvalidationKeys( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { $t = array('IVK#ALL'); $_name = $_compile = '#'; if ($resource_name) { @@ -416,17 +448,16 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource $t[] = 'IVK#CACHE#' . $part; $t[] = 'IVK#CID' . $_name . $part . $_compile; // skip past delimiter position - $i ++; + $i++; } - return $t; } /** * Check is cache is locked for this template * - * @param Smarty $smarty Smarty object - * @param Smarty_Template_Cached $cached cached object + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object * * @return boolean true or false if cache is locked */ @@ -434,7 +465,6 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { $key = 'LOCK#' . $cached->filepath; $data = $this->read(array($key)); - return $data && time() - $data[ $key ] < $smarty->locking_timeout; } @@ -471,7 +501,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch + * @param array $keys list of keys to fetch * * @return array list of values with the given keys used as indexes */ @@ -480,8 +510,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * * @return boolean true on success, false on failure */ @@ -490,7 +520,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * * @return boolean true on success, false on failure */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_data.php b/vendor/smarty/smarty/libs/sysplugins/smarty_data.php index 743b117bf..2545ed3a8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_data.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_data.php @@ -22,7 +22,7 @@ class Smarty_Data extends Smarty_Internal_Data * * @var int */ - static $count = 0; + public static $count = 0; /** * Data block name @@ -50,7 +50,7 @@ class Smarty_Data extends Smarty_Internal_Data public function __construct($_parent = null, $smarty = null, $name = null) { parent::__construct(); - self::$count ++; + self::$count++; $this->dataObjectName = 'Data_object ' . (isset($name) ? "'{$name}'" : self::$count); $this->smarty = $smarty; if (is_object($_parent)) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_block.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_block.php index 780319f11..9956d642b 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_block.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_block.php @@ -87,4 +87,4 @@ class Smarty_Internal_Block public function callBlock(Smarty_Internal_Template $tpl) { } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php index f6ef09306..61618449d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -7,6 +7,7 @@ * @author Uwe Tews * @author Rodney Rehm */ + /** * This class does contain all necessary methods for the HTML cache on file system * Implements the file system as resource for the HTML cache Version ussing nocache inserts. @@ -32,11 +33,17 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource $_filepath = sha1($source->uid . $smarty->_joined_template_dir); $cached->filepath = $smarty->getCacheDir(); if (isset($_template->cache_id)) { - $cached->filepath .= preg_replace(array('![^\w|]+!', - '![|]+!'), - array('_', - $_compile_dir_sep), - $_template->cache_id) . $_compile_dir_sep; + $cached->filepath .= preg_replace( + array( + '![^\w|]+!', + '![|]+!' + ), + array( + '_', + $_compile_dir_sep + ), + $_template->cache_id + ) . $_compile_dir_sep; } if (isset($_template->compile_id)) { $cached->filepath .= preg_replace('![^\w]+!', '_', $_template->compile_id) . $_compile_dir_sep; @@ -87,10 +94,11 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource * * @return boolean true or false if the cached content does not exist */ - public function process(Smarty_Internal_Template $_smarty_tpl, - Smarty_Template_Cached $cached = null, - $update = false) - { + public function process( + Smarty_Internal_Template $_smarty_tpl, + Smarty_Template_Cached $cached = null, + $update = false + ) { $_smarty_tpl->cached->valid = false; if ($update && defined('HHVM_VERSION')) { eval('?>' . file_get_contents($_smarty_tpl->cached->filepath)); @@ -111,15 +119,17 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { - if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath, - $content, - $_template->smarty) === true + if ($_template->smarty->ext->_writeFile->writeFile( + $_template->cached->filepath, + $content, + $_template->smarty + ) === true ) { - if (function_exists('opcache_invalidate') && - (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1 + if (function_exists('opcache_invalidate') + && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1 ) { opcache_invalidate($_template->cached->filepath, true); - } else if (function_exists('apc_compile_file')) { + } elseif (function_exists('apc_compile_file')) { apc_compile_file($_template->cached->filepath); } $cached = $_template->cached; @@ -135,7 +145,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource /** * Read cached template from cache * - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template $_template template object * * @return string content */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_append.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_append.php index b3689e918..1a9befbf6 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_append.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_append.php @@ -19,9 +19,9 @@ class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign /** * Compiles code for the {append} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_assign.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_assign.php index cb2ea4257..4b9984888 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_assign.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_assign.php @@ -24,21 +24,23 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase */ public $option_flags = array('nocache', 'noscope'); - /** + /** * Valid scope names * * @var array */ - public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT, - 'root' => Smarty::SCOPE_ROOT, 'global' => Smarty::SCOPE_GLOBAL, - 'tpl_root' => Smarty::SCOPE_TPL_ROOT, 'smarty' => Smarty::SCOPE_SMARTY); + public $valid_scopes = array( + 'local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT, + 'root' => Smarty::SCOPE_ROOT, 'global' => Smarty::SCOPE_GLOBAL, + 'tpl_root' => Smarty::SCOPE_TPL_ROOT, 'smarty' => Smarty::SCOPE_SMARTY + ); /** * Compiles code for the {assign} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException @@ -66,7 +68,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase } // scope setup if ($_attr[ 'noscope' ]) { - $_scope = - 1; + $_scope = -1; } else { $_scope = $compiler->convertScope($_attr, $this->valid_scopes); } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php index 88d6f37e9..8ff15d8e5 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of Smarty. * * (c) 2015 Uwe Tews @@ -22,6 +22,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $required_attributes = array('name'); + /** * Attribute definition: Overwrites base class. * @@ -29,6 +30,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $shorttag_order = array('name'); + /** * Attribute definition: Overwrites base class. * @@ -36,6 +38,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher * @see Smarty_Internal_CompileBase */ public $option_flags = array('hide', 'nocache'); + /** * Attribute definition: Overwrites base class. * @@ -47,10 +50,9 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher /** * Compiles code for the {block} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { @@ -67,16 +69,20 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher // check and get attributes $_attr = $this->getAttributes($compiler, $args); ++$compiler->_cache[ 'blockNesting' ]; - $_className = 'Block_' . preg_replace('![^\w]+!', '_', uniqid(rand(), true)); + $_className = 'Block_' . preg_replace('![^\w]+!', '_', uniqid(mt_rand(), true)); $compiler->_cache[ 'blockName' ][ $compiler->_cache[ 'blockNesting' ] ] = $_attr[ 'name' ]; $compiler->_cache[ 'blockClass' ][ $compiler->_cache[ 'blockNesting' ] ] = $_className; $compiler->_cache[ 'blockParams' ][ $compiler->_cache[ 'blockNesting' ] ] = array(); $compiler->_cache[ 'blockParams' ][ 1 ][ 'subBlocks' ][ trim($_attr[ 'name' ], '"\'') ][] = $_className; - $this->openTag($compiler, - 'block', - array($_attr, $compiler->nocache, $compiler->parser->current_buffer, - $compiler->template->compiled->has_nocache_code, - $compiler->template->caching)); + $this->openTag( + $compiler, + 'block', + array( + $_attr, $compiler->nocache, $compiler->parser->current_buffer, + $compiler->template->compiled->has_nocache_code, + $compiler->template->caching + ) + ); $compiler->saveRequiredPlugins(true); $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); @@ -84,18 +90,18 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher $compiler->suppressNocacheProcessing = true; } } + /** * Smarty Internal Plugin Compile BlockClose Class - * */ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_Inheritance { /** * Compiles code for the {/block} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return bool true */ @@ -118,13 +124,12 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $_functionCode = $compiler->parser->current_buffer; // setup buffer for template function code $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - $output = "<?php\n"; $output .= "/* {block {$_name}} */\n"; $output .= "class {$_className} extends Smarty_Internal_Block\n"; $output .= "{\n"; foreach ($_block as $property => $value) { - $output .= "public \${$property} = " . var_export($value,true) .";\n"; + $output .= "public \${$property} = " . var_export($value, true) . ";\n"; } $output .= "public function callBlock(Smarty_Internal_Template \$_smarty_tpl) {\n"; $output .= $compiler->compileRequiredPlugins(); @@ -136,9 +141,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $output .= "ob_start();\n"; } $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "<?php\n"; if (isset($_assign)) { @@ -148,9 +157,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ $output .= "}\n"; $output .= "/* {/block {$_name}} */\n\n"; $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); // restore old status diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_child.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_child.php index 1708f6482..588d18628 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_child.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_child.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of Smarty. * * (c) 2015 Uwe Tews @@ -21,4 +21,4 @@ class Smarty_Internal_Compile_Block_Child extends Smarty_Internal_Compile_Child * @var string */ public $tag = 'block_child'; -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_parent.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_parent.php index 4f094ad61..97f11ca43 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_parent.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block_parent.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of Smarty. * * (c) 2015 Uwe Tews @@ -28,4 +28,4 @@ class Smarty_Internal_Compile_Block_Parent extends Smarty_Internal_Compile_Child * @var string */ public $blockType = 'Parent'; -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_break.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_break.php index 09c25d238..1ee8d75d7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_break.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_break.php @@ -33,16 +33,16 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase public $shorttag_order = array('levels'); /** - * Tag name may be overloaded by Smarty_Internal_Compile_Continue - * - * @var string - */ + * Tag name may be overloaded by Smarty_Internal_Compile_Continue + * + * @var string + */ public $tag = 'break'; /** * Compiles code for the {break} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -67,7 +67,7 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase /** * check attributes and return array of break and foreach levels * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return array @@ -78,11 +78,9 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true); // check and get attributes $_attr = $this->getAttributes($compiler, $args); - if ($_attr[ 'nocache' ] === true) { $compiler->trigger_template_error('nocache option not allowed', null, true); } - if (isset($_attr[ 'levels' ])) { if (!is_numeric($_attr[ 'levels' ])) { $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); @@ -101,18 +99,18 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase if ($level_count === 0) { break; } - $level_count --; + $level_count--; if ($compiler->_tag_stack[ $stack_count ][ 0 ] === 'foreach') { - $foreachLevels ++; + $foreachLevels++; } } - $stack_count --; + $stack_count--; } if ($level_count !== 0) { $compiler->trigger_template_error("cannot {$this->tag} {$levels} level(s)", null, true); } if ($lastTag === 'foreach' && $this->tag === 'break' && $foreachLevels > 0) { - $foreachLevels --; + $foreachLevels--; } return array($levels, $foreachLevels); } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_call.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_call.php index eb444d357..445cabc60 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_call.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_call.php @@ -43,8 +43,8 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase /** * Compiles the calls of user defined tags defined by {function} * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * * @return string compiled code */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_capture.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_capture.php index 564b1f63e..a4ffbc9ea 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_capture.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_capture.php @@ -35,29 +35,27 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase /** * Compiles code for the {$smarty.capture.xxx} * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase$compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code - * @throws \SmartyCompilerException */ - public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null) - { - $tag = trim($parameter[ 0 ], '"\''); - $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : null; - if (!$name) { - //$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); - } - return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($name)?", '{$name}')":')'); + public static function compileSpecialVariable( + $args, + Smarty_Internal_TemplateCompilerBase $compiler, + $parameter = null + ) { + return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl' . + (isset($parameter[ 1 ]) ? ", {$parameter[ 1 ]})" : ')'); } /** * Compiles code for the {capture} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param null $parameter + * @param null $parameter * * @return string compiled code */ @@ -65,16 +63,13 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args, $parameter, 'capture'); - $buffer = isset($_attr[ 'name' ]) ? $_attr[ 'name' ] : "'default'"; $assign = isset($_attr[ 'assign' ]) ? $_attr[ 'assign' ] : 'null'; $append = isset($_attr[ 'append' ]) ? $_attr[ 'append' ] : 'null'; - $compiler->_cache[ 'capture_stack' ][] = array($compiler->nocache); // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; $_output = "<?php \$_smarty_tpl->smarty->ext->_capture->open(\$_smarty_tpl, $buffer, $assign, $append);?>"; - return $_output; } } @@ -90,9 +85,9 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase /** * Compiles code for the {/capture} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param null $parameter + * @param null $parameter * * @return string compiled code */ @@ -104,9 +99,7 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase if ($compiler->nocache) { $compiler->tag_nocache = true; } - list($compiler->nocache) = array_pop($compiler->_cache[ 'capture_stack' ]); - return "<?php \$_smarty_tpl->smarty->ext->_capture->close(\$_smarty_tpl);?>"; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_child.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_child.php index 8c7bbdf05..f728c18bf 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_child.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_child.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of Smarty. * * (c) 2015 Uwe Tews @@ -40,9 +40,9 @@ class Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase /** * Compiles code for the {child} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException @@ -51,10 +51,12 @@ class Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - $tag = isset($parameter[0]) ? "'{$parameter[0]}'" : "'{{$this->tag}}'"; + $tag = isset($parameter[ 0 ]) ? "'{$parameter[0]}'" : "'{{$this->tag}}'"; if (!isset($compiler->_cache[ 'blockNesting' ])) { - $compiler->trigger_template_error("{$tag} used outside {block} tags ", - $compiler->parser->lex->taglineno); + $compiler->trigger_template_error( + "{$tag} used outside {block} tags ", + $compiler->parser->lex->taglineno + ); } $compiler->has_code = true; $compiler->suppressNocacheProcessing = true; @@ -67,11 +69,11 @@ class Smarty_Internal_Compile_Child extends Smarty_Internal_CompileBase $output .= "ob_start();\n"; } $output .= '$_smarty_tpl->inheritance->call' . $this->blockType . '($_smarty_tpl, $this' . - ($this->blockType === 'Child' ? '' : ", {$tag}"). ");\n"; + ($this->blockType === 'Child' ? '' : ", {$tag}") . ");\n"; if (isset($_assign)) { $output .= "\$_smarty_tpl->assign({$_assign}, ob_get_clean());\n"; } - $output .="?>\n"; + $output .= "?>\n"; return $output; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_config_load.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_config_load.php index 7c6e9b59e..8fe64ee10 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_config_load.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_config_load.php @@ -53,14 +53,16 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase * * @var array */ - public $valid_scopes = array('local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT, - 'root' => Smarty::SCOPE_ROOT, 'tpl_root' => Smarty::SCOPE_TPL_ROOT, - 'smarty' => Smarty::SCOPE_SMARTY, 'global' => Smarty::SCOPE_SMARTY); + public $valid_scopes = array( + 'local' => Smarty::SCOPE_LOCAL, 'parent' => Smarty::SCOPE_PARENT, + 'root' => Smarty::SCOPE_ROOT, 'tpl_root' => Smarty::SCOPE_TPL_ROOT, + 'smarty' => Smarty::SCOPE_SMARTY, 'global' => Smarty::SCOPE_SMARTY + ); /** * Compiles code for the {config_load} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -70,11 +72,9 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - if ($_attr[ 'nocache' ] === true) { $compiler->trigger_template_error('nocache option not allowed', null, true); } - // save possible attributes $conf_file = $_attr[ 'file' ]; if (isset($_attr[ 'section' ])) { @@ -84,15 +84,13 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase } // scope setup if ($_attr[ 'noscope' ]) { - $_scope = - 1; + $_scope = -1; } else { $_scope = $compiler->convertScope($_attr, $this->valid_scopes); } - // create config object $_output = "<?php\n\$_smarty_tpl->smarty->ext->configLoad->_loadConfigFile(\$_smarty_tpl, {$conf_file}, {$section}, {$_scope});\n?>\n"; - return $_output; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_continue.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_continue.php index 19e5d4bee..e545728ee 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_continue.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_continue.php @@ -17,9 +17,9 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break { /** - * Tag name - * - * @var string - */ + * Tag name + * + * @var string + */ public $tag = 'continue'; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_debug.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_debug.php index 1668e72e8..799416689 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_debug.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_debug.php @@ -20,8 +20,8 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase /** * Compiles code for the {debug} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * * @return string compiled code */ @@ -29,10 +29,8 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - // compile always as nocache $compiler->tag_nocache = true; - // display debug template $_output = "<?php \$_smarty_debug = new Smarty_Internal_Debug;\n \$_smarty_debug->display_debug(\$_smarty_tpl);\n"; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_eval.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_eval.php index 550f194e0..8e0174e3e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_eval.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_eval.php @@ -43,8 +43,8 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase /** * Compiles code for the {eval} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * * @return string compiled code */ @@ -56,16 +56,15 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase // output will be stored in a smarty variable instead of being displayed $_assign = $_attr[ 'assign' ]; } - // 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();'; } - return "<?php $_output ?>"; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_extends.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_extends.php index 37bf8dd3f..d72d2b76f 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_extends.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_extends.php @@ -1,5 +1,4 @@ <?php - /** * Smarty Internal Plugin Compile extend * Compiles the {extends} tag @@ -74,7 +73,7 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh } else { $file = "'{$file}'"; } - $i ++; + $i++; if ($i === count($files) && isset($_attr[ 'extends_resource' ])) { $this->compileEndChild($compiler); } @@ -108,28 +107,36 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_Compile_Shared_Inh $inlineUids = $match[ 1 ]; } } - $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser, - '<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl' . - (isset($template) ? - ", {$template}{$inlineUids}" : - '') . ");\n?>"); + $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + '<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl' . + (isset($template) ? + ", {$template}{$inlineUids}" : + '') . ");\n?>" + ); } /** * Add code for including subtemplate to end of template * * @param \Smarty_Internal_TemplateCompilerBase $compiler - * @param string $template subtemplate name + * @param string $template subtemplate name * * @throws \SmartyCompilerException * @throws \SmartyException */ private function compileInclude(Smarty_Internal_TemplateCompilerBase $compiler, $template) { - $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag($compiler->parser, - $compiler->compileTag('include', - array($template, - array('scope' => 'parent')))); + $compiler->parser->template_postfix[] = new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $compiler->compileTag( + 'include', + array( + $template, + array('scope' => 'parent') + ) + ) + ); } /** diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php index 79848e521..3f113e56d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_for.php @@ -26,15 +26,15 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase * The parser is generating different sets of attribute by which this compiler can * determine which syntax is used. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ public function compile($args, $compiler, $parameter) { - $compiler->loopNesting ++; + $compiler->loopNesting++; if ($parameter === 0) { $this->required_attributes = array('start', 'to'); $this->optional_attributes = array('max', 'step'); @@ -45,7 +45,6 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase $this->mapCache = array(); // check and get attributes $_attr = $this->getAttributes($compiler, $args); - $output = "<?php\n"; if ($parameter === 1) { foreach ($_attr[ 'start' ] as $_statement) { @@ -93,7 +92,6 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase $output .= "\$_smarty_tpl->tpl_vars[$var]->last = \$_smarty_tpl->tpl_vars[$var]->iteration === \$_smarty_tpl->tpl_vars[$var]->total;"; } $output .= '?>'; - $this->openTag($compiler, 'for', array('for', $compiler->nocache)); // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; @@ -113,9 +111,9 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase /** * Compiles code for the {forelse} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ @@ -123,10 +121,8 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - list($openTag, $nocache) = $this->closeTag($compiler, array('for')); $this->openTag($compiler, 'forelse', array('forelse', $nocache)); - return "<?php }} else { ?>"; } } @@ -142,24 +138,22 @@ class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/for} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * * @return string compiled code */ public function compile($args, $compiler, $parameter) { - $compiler->loopNesting --; + $compiler->loopNesting--; // check and get attributes $_attr = $this->getAttributes($compiler, $args); // must endblock be nocache? if ($compiler->nocache) { $compiler->tag_nocache = true; } - list($openTag, $compiler->nocache) = $this->closeTag($compiler, array('for', 'forelse')); - $output = "<?php }\n"; if ($openTag !== 'forelse') { $output .= "}\n"; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_foreach.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_foreach.php index 471e92c3e..78b45ea7e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_foreach.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_foreach.php @@ -78,7 +78,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo /** * Compiles code for the {foreach} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -87,7 +87,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - $compiler->loopNesting ++; + $compiler->loopNesting++; // init $this->isNamed = false; // check and get attributes @@ -119,14 +119,16 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo if ($fromName) { foreach (array('item', 'key') as $a) { if (isset($attributes[ $a ]) && $attributes[ $a ] === $fromName) { - $compiler->trigger_template_error("'{$a}' and 'from' may not have same variable name '{$fromName}'", - null, true); + $compiler->trigger_template_error( + "'{$a}' and 'from' may not have same variable name '{$fromName}'", + null, + true + ); } } } - $itemVar = "\$_smarty_tpl->tpl_vars['{$item}']"; - $local = '$__foreach_' . $attributes[ 'item' ] . '_' . $this->counter ++ . '_'; + $local = '$__foreach_' . $attributes[ 'item' ] . '_' . $this->counter++ . '_'; // search for used tag attributes $itemAttr = array(); $namedAttr = array(); @@ -187,8 +189,11 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo } $needTotal = isset($itemAttr[ 'total' ]); // Register tag - $this->openTag($compiler, 'foreach', - array('foreach', $compiler->nocache, $local, $itemVar, empty($itemAttr) ? 1 : 2)); + $this->openTag( + $compiler, + 'foreach', + array('foreach', $compiler->nocache, $local, $itemVar, empty($itemAttr) ? 1 : 2) + ); // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; // generate output code @@ -249,7 +254,6 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_Compile_Private_Fo $output .= "{$local}saved = {$itemVar};\n"; } $output .= '?>'; - return $output; } @@ -277,7 +281,7 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase /** * Compiles code for the {foreachelse} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -286,7 +290,6 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - list($openTag, $nocache, $local, $itemVar, $restore) = $this->closeTag($compiler, array('foreach')); $this->openTag($compiler, 'foreachelse', array('foreachelse', $nocache, $local, $itemVar, 0)); $output = "<?php\n"; @@ -309,24 +312,23 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/foreach} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code * @throws \SmartyCompilerException - */ + */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - $compiler->loopNesting --; + $compiler->loopNesting--; // must endblock be nocache? if ($compiler->nocache) { $compiler->tag_nocache = true; } - - list($openTag, $compiler->nocache, $local, $itemVar, $restore) = - $this->closeTag($compiler, array('foreach', 'foreachelse')); + list( + $openTag, $compiler->nocache, $local, $itemVar, $restore + ) = $this->closeTag($compiler, array('foreach', 'foreachelse')); $output = "<?php\n"; - if ($restore === 2) { $output .= "{$itemVar} = {$local}saved;\n"; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php index 909b767c8..6e408ca72 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php @@ -16,7 +16,6 @@ */ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { - /** * Attribute definition: Overwrites base class. * @@ -44,7 +43,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase /** * Compiles code for the {function} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return bool true @@ -54,15 +53,16 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - if ($_attr[ 'nocache' ] === true) { $compiler->trigger_template_error('nocache option not allowed', null, true); } unset($_attr[ 'nocache' ]); $_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); + $save = array( + $_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code, + $compiler->template->caching + ); $this->openTag($compiler, 'function', $save); // Init temporary context $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); @@ -80,7 +80,6 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase */ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase { - /** * Compiler object * @@ -91,7 +90,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/function} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return bool true @@ -125,7 +124,6 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $_functionCode = $compiler->parser->current_buffer; // setup buffer for template function code $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - $_funcName = "smarty_template_function_{$_name}_{$compiler->template->compiled->nocache_hash}"; $_funcNameCaching = $_funcName . '_nocache'; if ($compiler->template->compiled->has_nocache_code) { @@ -143,9 +141,13 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $output .= "echo \"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php "; $output .= "\\\$_smarty_tpl->smarty->ext->_tplFunction->saveTemplateVariables(\\\$_smarty_tpl, '{$_name}');\nforeach (\$params as \\\$key => \\\$value) {\n\\\$_smarty_tpl->tpl_vars[\\\$key] = new Smarty_Variable(\\\$value, \\\$_smarty_tpl->isRenderingCache);\n}\n?>"; $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\";?>"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "<?php echo \"/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/<?php "; $output .= "\\\$_smarty_tpl->smarty->ext->_tplFunction->restoreTemplateVariables(\\\$_smarty_tpl, '{$_name}');?>\n"; @@ -154,13 +156,21 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $output .= "}\n}\n"; $output .= "/*/ {$_funcName}_nocache */\n\n"; $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); - $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser, - preg_replace_callback("/((<\?php )?echo '\/\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/([\S\s]*?)\/\*\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", - array($this, 'removeNocache'), - $_functionCode->to_smarty_php($compiler->parser))); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); + $_functionCode = new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + preg_replace_callback( + "/((<\?php )?echo '\/\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/([\S\s]*?)\/\*\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", + array($this, 'removeNocache'), + $_functionCode->to_smarty_php($compiler->parser) + ) + ); } $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name' ] = $_funcName; $output = "<?php\n"; @@ -169,20 +179,29 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $output .= "function {$_funcName}(Smarty_Internal_Template \$_smarty_tpl,\$params) {\n"; $output .= $_paramsCode; $output .= "foreach (\$params as \$key => \$value) {\n\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value, \$_smarty_tpl->isRenderingCache);\n}\n"; - $output .= $compiler->compileCheckPlugins(array_merge($compiler->required_plugins[ 'compiled' ], $compiler->required_plugins[ 'nocache' ])); + $output .= $compiler->compileCheckPlugins(array_merge($compiler->required_plugins[ 'compiled' ], + $compiler->required_plugins[ 'nocache' ])); $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "<?php\n}}\n"; $output .= "/*/ {$_funcName} */\n\n"; $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $output + ) + ); $compiler->parent_compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); - // restore old buffer + // restore old buffer $compiler->parser->current_buffer = $saved_data[ 1 ]; // restore old status $compiler->restoreRequiredPlugins(); @@ -198,11 +217,14 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase * * @return string */ - function removeNocache($match) + public function removeNocache($match) { $code = - preg_replace("/((<\?php )?echo '\/\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/)|(\/\*\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", - '', $match[ 0 ]); + preg_replace( + "/((<\?php )?echo '\/\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/)|(\/\*\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", + '', + $match[ 0 ] + ); $code = str_replace(array('\\\'', '\\\\\''), array('\'', '\\\''), $code); return $code; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_if.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_if.php index 82436c266..df3dc3fad 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_if.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_if.php @@ -33,11 +33,9 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase $this->openTag($compiler, 'if', array(1, $compiler->nocache)); // must whole block be nocache ? $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - - if (!isset($parameter['if condition'])) { + if (!isset($parameter[ 'if condition' ])) { $compiler->trigger_template_error('missing if condition', null, true); } - if (is_array($parameter[ 'if condition' ])) { if (is_array($parameter[ 'if condition' ][ 'var' ])) { $var = $parameter[ 'if condition' ][ 'var' ][ 'var' ]; @@ -55,8 +53,11 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase $assignCompiler = new Smarty_Internal_Compile_Assign(); if (is_array($parameter[ 'if condition' ][ 'var' ])) { $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ]; - $_output .= $assignCompiler->compile($assignAttr, $compiler, - array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ])); + $_output .= $assignCompiler->compile( + $assignAttr, + $compiler, + array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]) + ); } else { $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ]; $_output .= $assignCompiler->compile($assignAttr, $compiler, array()); @@ -84,12 +85,11 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code - */ + */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache)); - return '<?php } else { ?>'; } } @@ -116,13 +116,10 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); - - if (!isset($parameter['if condition'])) { + if (!isset($parameter[ 'if condition' ])) { $compiler->trigger_template_error('missing elseif condition', null, true); } - $assignCode = ''; $var = ''; if (is_array($parameter[ 'if condition' ])) { @@ -143,8 +140,11 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase $assignAttr[][ 'value' ] = $prefixVar; if (is_array($parameter[ 'if condition' ][ 'var' ])) { $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ]; - $assignCode .= $assignCompiler->compile($assignAttr, $compiler, - array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ])); + $assignCode .= $assignCompiler->compile( + $assignAttr, + $compiler, + array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ]) + ); } else { $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ]; $assignCode .= $assignCompiler->compile($assignAttr, $compiler, array()); @@ -152,7 +152,6 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase } else { $condition_by_assign = false; } - $prefixCode = $compiler->getPrefixCode(); if (empty($prefixCode)) { if ($condition_by_assign) { @@ -200,10 +199,9 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase } list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif')); $tmp = ''; - for ($i = 0; $i < $nesting; $i ++) { + for ($i = 0; $i < $nesting; $i++) { $tmp .= '}'; } - return "<?php {$tmp}?>"; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php index 70f22546c..716c91d49 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php @@ -7,6 +7,7 @@ * @subpackage Compiler * @author Uwe Tews */ + /** * Smarty Internal Plugin Compile Include Class * @@ -19,6 +20,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * caching mode to create nocache code but no cache file */ const CACHING_NOCACHE_CODE = 9999; + /** * Attribute definition: Overwrites base class. * @@ -26,6 +28,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $required_attributes = array('file'); + /** * Attribute definition: Overwrites base class. * @@ -33,6 +36,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $shorttag_order = array('file'); + /** * Attribute definition: Overwrites base class. * @@ -40,6 +44,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $option_flags = array('nocache', 'inline', 'caching'); + /** * Attribute definition: Overwrites base class. * @@ -47,20 +52,23 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $optional_attributes = array('_any'); + /** * Valid scope names * * @var array */ - public $valid_scopes = array('parent' => Smarty::SCOPE_PARENT, 'root' => Smarty::SCOPE_ROOT, - 'global' => Smarty::SCOPE_GLOBAL, 'tpl_root' => Smarty::SCOPE_TPL_ROOT, - 'smarty' => Smarty::SCOPE_SMARTY); + public $valid_scopes = array( + 'parent' => Smarty::SCOPE_PARENT, 'root' => Smarty::SCOPE_ROOT, + 'global' => Smarty::SCOPE_GLOBAL, 'tpl_root' => Smarty::SCOPE_TPL_ROOT, + 'smarty' => Smarty::SCOPE_SMARTY + ); /** * Compiles code for the {include} tag * - * @param array $args array with attributes from parser - * @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object + * @param array $args array with attributes from parser + * @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object * * @return string * @throws \Exception @@ -193,9 +201,14 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase $t_hash = sha1($c_id . ($_caching ? '--caching' : '--nocaching')); $compiler->smarty->allow_ambiguous_resources = true; /* @var Smarty_Internal_Template $tpl */ - $tpl = new $compiler->smarty->template_class (trim($fullResourceName, '"\''), $compiler->smarty, - $compiler->template, $compiler->template->cache_id, $c_id, - $_caching); + $tpl = new $compiler->smarty->template_class( + trim($fullResourceName, '"\''), + $compiler->smarty, + $compiler->template, + $compiler->template->cache_id, + $c_id, + $_caching + ); $uid = $tpl->source->type . $tpl->source->uid; if (!isset($compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ])) { $has_compiled_template = $this->compileInlineTemplate($compiler, $tpl, $t_hash); @@ -269,16 +282,17 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase * * @param \Smarty_Internal_SmartyTemplateCompiler $compiler * @param \Smarty_Internal_Template $tpl - * @param string $t_hash + * @param string $t_hash * * @return bool * @throws \Exception * @throws \SmartyException */ - public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler, - Smarty_Internal_Template $tpl, - $t_hash) - { + public function compileInlineTemplate( + Smarty_Internal_SmartyTemplateCompiler $compiler, + Smarty_Internal_Template $tpl, + $t_hash + ) { $uid = $tpl->source->type . $tpl->source->uid; if (!($tpl->source->handler->uncompiled) && $tpl->source->exists) { $compiler->parent_compiler->mergedSubTemplatesData[ $uid ][ $t_hash ][ 'uid' ] = $tpl->source->uid; @@ -317,9 +331,11 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase if ($tpl->compiled->has_nocache_code) { // replace nocache_hash $compiled_code = - str_replace("{$tpl->compiled->nocache_hash}", - $compiler->template->compiled->nocache_hash, - $compiled_code); + str_replace( + "{$tpl->compiled->nocache_hash}", + $compiler->template->compiled->nocache_hash, + $compiled_code + ); $compiler->template->compiled->has_nocache_code = true; } $compiler->parent_compiler->mergedSubTemplatesCode[ $tpl->compiled->unifunc ] = $compiled_code; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include_php.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include_php.php index e0aca93b3..1b0fdaad3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include_php.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include_php.php @@ -7,6 +7,7 @@ * @subpackage Compiler * @author Uwe Tews */ + /** * Smarty Internal Plugin Compile Insert Class * @@ -42,7 +43,7 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase /** * Compiles code for the {include_php} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string @@ -56,7 +57,10 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase } // check and get attributes $_attr = $this->getAttributes($compiler, $args); - /** @var Smarty_Internal_Template $_smarty_tpl + /** + * + * + * @var Smarty_Internal_Template $_smarty_tpl * used in evaluated code */ $_smarty_tpl = $compiler->template; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_insert.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_insert.php index e71abdce3..56fbc5615 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_insert.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_insert.php @@ -23,6 +23,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $required_attributes = array('name'); + /** * Attribute definition: Overwrites base class. * @@ -30,6 +31,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase * @see Smarty_Internal_CompileBase */ public $shorttag_order = array('name'); + /** * Attribute definition: Overwrites base class. * @@ -41,7 +43,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase /** * Compiles code for the {insert} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -104,11 +106,13 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase } // code for script file loading $_output .= "require_once '{$_filepath}' ;"; - require_once $_filepath; + include_once $_filepath; if (!is_callable($_function)) { - $compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", - null, - true); + $compiler->trigger_template_error( + " {insert} function '{$_function}' is not callable in script file '{$_script}'", + null, + true + ); } } else { $_filepath = 'null'; @@ -117,9 +121,11 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase if (!is_callable($_function)) { // try plugin if (!$_function = $compiler->getPlugin($_name, 'insert')) { - $compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", - null, - true); + $compiler->trigger_template_error( + "{insert} no function or plugin found for '{$_name}'", + null, + true + ); } } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php index c22e1a637..5493d4ecc 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_ldelim.php @@ -16,11 +16,11 @@ */ class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase { - /** + /** * Compiles code for the {ldelim} tag * This tag does output the left delimiter * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_make_nocache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_make_nocache.php index f793ecbbf..8a34ccd0a 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_make_nocache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_make_nocache.php @@ -41,11 +41,11 @@ class Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase /** * Compiles code for the {make_nocache} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code - */ + */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { // check and get attributes diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_nocache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_nocache.php index b29a993aa..12f64ed2e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_nocache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_nocache.php @@ -27,7 +27,7 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase * Compiles code for the {nocache} tag * This tag does not generate compiled output. It only sets a compiler flag. * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return bool @@ -40,7 +40,6 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase $compiler->nocache = true; // this tag does not return compiled code $compiler->has_code = false; - return true; } } @@ -57,7 +56,7 @@ class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase * Compiles code for the {/nocache} tag * This tag does not generate compiled output. It only sets a compiler flag. * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return bool @@ -69,7 +68,6 @@ class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase list($compiler->nocache) = $this->closeTag($compiler, array('nocache')); // this tag does not return compiled code $compiler->has_code = false; - return true; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_parent.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_parent.php index 052479aef..ff23edf73 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_parent.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_parent.php @@ -1,5 +1,5 @@ <?php -/* +/** * This file is part of Smarty. * * (c) 2015 Uwe Tews @@ -15,7 +15,6 @@ */ class Smarty_Internal_Compile_Parent extends Smarty_Internal_Compile_Child { - /** * Tag name * @@ -29,4 +28,4 @@ class Smarty_Internal_Compile_Parent extends Smarty_Internal_Compile_Child * @var string */ public $blockType = 'Parent'; -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 6c3f05aaa..199a296c8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -34,11 +34,11 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi /** * Compiles code for the execution of block plugin * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of block plugin - * @param string $function PHP function name + * @param array $parameter array with compilation parameter + * @param string $tag name of block plugin + * @param string $function PHP function name * * @return string compiled code * @throws \SmartyCompilerException @@ -46,15 +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 ++; + $this->nesting++; unset($_attr[ 'nocache' ]); list($callback, $_paramsArray, $callable) = $this->setup($compiler, $_attr, $tag, $function); $_params = 'array(' . implode(',', $_paramsArray) . ')'; - // compile code $output = "<?php "; if (is_array($callback)) { @@ -75,7 +74,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $compiler->tag_nocache = true; } // closing tag of block plugin, restore nocache - list($_params, $compiler->nocache, $callback) = $this->closeTag($compiler, substr($tag, 0, - 5)); + list($_params, $compiler->nocache, $callback) = $this->closeTag($compiler, substr($tag, 0, -5)); // compile code if (!isset($parameter[ 'modifier_list' ])) { $mod_pre = $mod_post = $mod_content = ''; @@ -84,11 +83,17 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $mod_content2 = "\$_block_content{$this->nesting}"; $mod_content = "\$_block_content{$this->nesting} = ob_get_clean();\n"; $mod_pre = "ob_start();\n"; - $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter[ 'modifier_list' ], - 'value' => 'ob_get_clean()')) . ";\n"; + $mod_post = 'echo ' . $compiler->compileTag( + 'private_modifier', + array(), + 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 = + "<?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; @@ -98,9 +103,9 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi * Setup callback and parameter array * * @param \Smarty_Internal_TemplateCompilerBase $compiler - * @param array $_attr attributes - * @param string $tag - * @param string $function + * @param array $_attr attributes + * @param string $tag + * @param string $function * * @return array */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php index 5161da645..d3aab24bb 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -16,28 +16,6 @@ */ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_CompileBase { - - /** - * Preg search pattern - * - * @var string - */ - private $propertyPreg = ''; - - /** - * Offsets in preg match result - * - * @var array - */ - private $resultOffsets = array(); - - /** - * Start offset - * - * @var int - */ - private $startOffset = 0; - /** * Name of this tag * @@ -72,9 +50,30 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com public $matchResults = array(); /** + * Preg search pattern + * + * @var string + */ + private $propertyPreg = ''; + + /** + * Offsets in preg match result + * + * @var array + */ + private $resultOffsets = array(); + + /** + * Start offset + * + * @var int + */ + private $startOffset = 0; + + /** * Scan sources for used tag attributes * - * @param array $attributes + * @param array $attributes * @param \Smarty_Internal_TemplateCompilerBase $compiler * * @throws \SmartyException @@ -82,10 +81,10 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler) { $this->propertyPreg = '~('; - $this->startOffset = 0; + $this->startOffset = 1; $this->resultOffsets = array(); $this->matchResults = array('named' => array(), 'item' => array()); - if ($this->isNamed) { + if (isset($attributes[ 'name' ])) { $this->buildPropertyPreg(true, $attributes); } if (isset($this->itemProperties)) { @@ -112,19 +111,19 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com public function buildPropertyPreg($named, $attributes) { if ($named) { - $this->resultOffsets[ 'named' ] = $this->startOffset + 4; - $this->propertyPreg .= "(([\$]smarty[.]{$this->tagName}[.]" . ($this->tagName === 'section' ? "|[\[]\s*" : '') - . "){$attributes['name']}[.]("; + $this->resultOffsets[ 'named' ] = $this->startOffset = $this->startOffset + 3; + $this->propertyPreg .= "(([\$]smarty[.]{$this->tagName}[.]" . + ($this->tagName === 'section' ? "|[\[]\s*" : '') . + "){$attributes['name']}[.]("; $properties = $this->nameProperties; } else { - $this->resultOffsets[ 'item' ] = $this->startOffset + 3; + $this->resultOffsets[ 'item' ] = $this->startOffset = $this->startOffset + 2; $this->propertyPreg .= "([\$]{$attributes['item']}[@]("; $properties = $this->itemProperties; } - $this->startOffset += count($properties) + 2; $propName = reset($properties); while ($propName) { - $this->propertyPreg .= "({$propName})"; + $this->propertyPreg .= "{$propName}"; $propName = next($properties); if ($propName) { $this->propertyPreg .= '|'; @@ -140,11 +139,11 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com */ public function matchProperty($source) { - preg_match_all($this->propertyPreg, $source, $match, PREG_SET_ORDER); + preg_match_all($this->propertyPreg, $source, $match); foreach ($this->resultOffsets as $key => $offset) { - foreach ($match as $m) { - if (isset($m[ $offset ]) && !empty($m[ $offset ])) { - $this->matchResults[ $key ][ strtolower($m[ $offset ]) ] = true; + foreach ($match[ $offset ] as $m) { + if (!empty($m)) { + $this->matchResults[ $key ][ strtolower($m) ] = true; } } } @@ -181,8 +180,11 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com if ((isset($nextCompiler->smarty->autoload_filters[ 'pre' ]) || isset($nextCompiler->smarty->registered_filters[ 'pre' ])) ) { - $_content = $nextCompiler->smarty->ext->_filterHandler->runFilter('pre', $_content, - $nextCompiler->template); + $_content = $nextCompiler->smarty->ext->_filterHandler->runFilter( + 'pre', + $_content, + $nextCompiler->template + ); } $this->matchProperty($_content); } @@ -202,9 +204,9 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com /** * Compiles code for the {$smarty.foreach.xxx} or {$smarty.section.xxx}tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException @@ -223,4 +225,4 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com $tagVar = "'__smarty_{$tag}_{$name}'"; return "(isset(\$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}']) ? \$_smarty_tpl->tpl_vars[{$tagVar}]->value['{$property}'] : null)"; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php index 9e9c65f59..055823423 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -35,11 +35,11 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co /** * Compiles code for the execution of function plugin * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function plugin - * @param string $function PHP function name + * @param array $parameter array with compilation parameter + * @param string $tag name of function plugin + * @param string $function PHP function name * * @return string compiled code * @throws \SmartyCompilerException @@ -49,7 +49,6 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - unset($_attr[ 'nocache' ]); // convert attributes into parameter array string $_paramsArray = array(); @@ -64,9 +63,14 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co // compile code $output = "{$function}({$_params},\$_smarty_tpl)"; if (!empty($parameter[ 'modifierlist' ])) { - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter[ 'modifierlist' ], - 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array( + 'modifierlist' => $parameter[ 'modifierlist' ], + 'value' => $output + ) + ); } $output = "<?php echo {$output};?>\n"; return $output; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php index e83b7a243..72773fff8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php @@ -1,5 +1,4 @@ <?php - /** * Smarty Internal Plugin Compile Modifier * Compiles code for modifier execution @@ -20,9 +19,9 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa /** * Compiles code for modifier execution * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException @@ -52,8 +51,12 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ])) { if (is_callable($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ])) { $output = - sprintf('call_user_func_array($_smarty_tpl->registered_plugins[ \'%s\' ][ %s ][ 0 ], array( %s ))', - Smarty::PLUGIN_MODIFIER, var_export($modifier, true), $params); + sprintf( + 'call_user_func_array($_smarty_tpl->registered_plugins[ \'%s\' ][ %s ][ 0 ], array( %s ))', + Smarty::PLUGIN_MODIFIER, + var_export($modifier, true), + $params + ); $compiler->known_modifier_type[ $modifier ] = $type; break 2; } @@ -63,8 +66,11 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa // registered modifier compiler if (isset($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ])) { $output = - call_user_func($compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ], - $single_modifier, $compiler->smarty); + call_user_func( + $compiler->smarty->registered_plugins[ Smarty::PLUGIN_MODIFIERCOMPILER ][ $modifier ][ 0 ], + $single_modifier, + $compiler->smarty + ); $compiler->known_modifier_type[ $modifier ] = $type; break 2; } @@ -73,8 +79,8 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa // modifiercompiler plugin if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) { // check if modifier allowed - if (!is_object($compiler->smarty->security_policy) || - $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + if (!is_object($compiler->smarty->security_policy) + || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) ) { $plugin = 'smarty_modifiercompiler_' . $modifier; $output = $plugin($single_modifier, $compiler); @@ -87,8 +93,8 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa // modifier plugin if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) { // check if modifier allowed - if (!is_object($compiler->smarty->security_policy) || - $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + if (!is_object($compiler->smarty->security_policy) + || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) ) { $output = "{$function}({$params})"; } @@ -100,8 +106,8 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa // PHP function if (is_callable($modifier)) { // check if modifier allowed - if (!is_object($compiler->smarty->security_policy) || - $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler) + if (!is_object($compiler->smarty->security_policy) + || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler) ) { $output = "{$modifier}({$params})"; } @@ -111,26 +117,27 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa break; case 6: // default plugin handler - if (isset($compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ]) || - (is_callable($compiler->smarty->default_plugin_handler_func) && - $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER)) + if (isset($compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ]) + || (is_callable($compiler->smarty->default_plugin_handler_func) + && $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER)) ) { $function = $compiler->default_handler_plugins[ Smarty::PLUGIN_MODIFIER ][ $modifier ][ 0 ]; // check if modifier allowed - if (!is_object($compiler->smarty->security_policy) || - $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) + if (!is_object($compiler->smarty->security_policy) + || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler) ) { if (!is_array($function)) { $output = "{$function}({$params})"; } else { if (is_object($function[ 0 ])) { - $output = $function[ 0 ] . '->'. $function[ 1 ] . '(' . $params . ')'; + $output = $function[ 0 ] . '->' . $function[ 1 ] . '(' . $params . ')'; } else { $output = $function[ 0 ] . '::' . $function[ 1 ] . '(' . $params . ')'; } } } - if (isset($compiler->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) || + if (isset($compiler->required_plugins[ 'nocache' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) + || isset($compiler->required_plugins[ 'compiled' ][ $modifier ][ Smarty::PLUGIN_MODIFIER ][ 'file' ]) ) { // was a plugin @@ -146,7 +153,6 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa $compiler->trigger_template_error("unknown modifier '{$modifier}'", null, true); } } - return $output; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php index 5c7fb6265..baac51b28 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php @@ -20,9 +20,9 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter * Setup callback and parameter array * * @param \Smarty_Internal_TemplateCompilerBase $compiler - * @param array $_attr attributes - * @param string $tag - * @param string $method + * @param array $_attr attributes + * @param string $tag + * @param string $method * * @return array */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php index 8d6c7e397..2a763c6e3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_object_function.php @@ -27,11 +27,11 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co /** * Compiles code for the execution of function plugin * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function - * @param string $method name of method to call + * @param array $parameter array with compilation parameter + * @param string $tag name of function + * @param string $method name of method to call * * @return string compiled code * @throws \SmartyCompilerException @@ -70,8 +70,11 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co $output = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}"; } if (!empty($parameter[ 'modifierlist' ])) { - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter[ 'modifierlist' ], 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array('modifierlist' => $parameter[ 'modifierlist' ], 'value' => $output) + ); } if (empty($_assign)) { return "<?php echo {$output};?>\n"; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php index 1d100f0d2..a3cf0a27b 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php @@ -16,7 +16,6 @@ */ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase { - /** * Attribute definition: Overwrites base class. * @@ -43,10 +42,16 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase 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}';?>", - true))); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $compiler->processNocacheCode( + "<?php echo '{$output}';?>", + true + ) + ) + ); return ''; } if ($_attr[ 'type' ] !== 'tag') { @@ -54,23 +59,37 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase return ''; } 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)); + 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') { $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}';?>", - true))); + $compiler->parser->current_buffer->append_subtree( + $compiler->parser, + new Smarty_Internal_ParseTree_Tag( + $compiler->parser, + $compiler->processNocacheCode( + "<?php echo '{$output}';?>", + true + ) + ) + ); return ''; } 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); + $compiler->trigger_template_error( + '$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it', + null, + true + ); } $compiler->has_code = true; return $_attr[ 'code' ]; @@ -80,8 +99,11 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase } else { $compiler->has_code = true; if (!($compiler->smarty instanceof SmartyBC)) { - $compiler->trigger_template_error('{php}{/php} tags not allowed. Use SmartyBC to enable them', null, - true); + $compiler->trigger_template_error( + '{php}{/php} tags not allowed. Use SmartyBC to enable them', + null, + true + ); } $ldel = preg_quote($compiler->smarty->left_delimiter, '#'); $rdel = preg_quote($compiler->smarty->right_delimiter, '#'); @@ -93,8 +115,11 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase $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}$#"), - array('<?php ', '?>'), $_attr[ 'code' ]); + return preg_replace( + array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#", "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"), + array('<?php ', '?>'), + $_attr[ 'code' ] + ); } } @@ -148,8 +173,10 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase 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; } @@ -161,8 +188,14 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'"); } while ($body) { - if (preg_match('~([/][*])|([/][/][^\n]*)|(\'[^\'\\\\]*(?:\\.[^\'\\\\]*)*\')|("[^"\\\\]*(?:\\.[^"\\\\]*)*")~', - $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) { + if (preg_match( + '~([/][*])|([/][/][^\n]*)|(\'[^\'\\\\]*(?:\\.[^\'\\\\]*)*\')|("[^"\\\\]*(?:\\.[^"\\\\]*)*")~', + $lex->data, + $match, + PREG_OFFSET_CAPTURE, + $start + ) + ) { $value = $match[ 0 ][ 0 ]; $from = $pos = $match[ 0 ][ 1 ]; if ($pos > $close) { @@ -178,8 +211,14 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase } } while ($close > $pos && $close < $start) { - if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, - $from)) { + if (preg_match( + '~' . preg_quote($closeTag, '~') . '~i', + $lex->data, + $match, + PREG_OFFSET_CAPTURE, + $from + ) + ) { $close = $match[ 0 ][ 1 ]; $from = $close + strlen($match[ 0 ][ 0 ]); } else { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php index 2dde69488..23cae8aef 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -49,9 +49,14 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C $output = $parameter[ 'value' ]; // tag modifier if (!empty($parameter[ 'modifierlist' ])) { - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter[ 'modifierlist' ], - 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array( + 'modifierlist' => $parameter[ 'modifierlist' ], + 'value' => $output + ) + ); } if (isset($_attr[ 'assign' ])) { // assign output to variable @@ -64,9 +69,12 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C if (empty($compiler->default_modifier_list)) { $modifierlist = array(); foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) { - preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', - $single_default_modifier, $mod_array); - for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i ++) { + preg_match_all( + '/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', + $single_default_modifier, + $mod_array + ); + for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i++) { if ($mod_array[ 0 ][ $i ] !== ':') { $modifierlist[ $key ][] = $mod_array[ 0 ][ $i ]; } @@ -74,9 +82,14 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } $compiler->default_modifier_list = $modifierlist; } - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $compiler->default_modifier_list, - 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array( + 'modifierlist' => $compiler->default_modifier_list, + 'value' => $output + ) + ); } // autoescape html if ($compiler->template->smarty->escape_html) { @@ -85,7 +98,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C // loop over registered filters if (!empty($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ])) { foreach ($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ] as $key => - $function) { + $function) { if (!is_array($function)) { $output = "{$function}({$output},\$_smarty_tpl)"; } elseif (is_object($function[ 0 ])) { @@ -98,8 +111,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } // auto loaded filters if (isset($compiler->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ])) { - foreach ((array) $compiler->template->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ] as $name) - { + foreach ((array)$compiler->template->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ] as $name) { $result = $this->compile_variable_filter($compiler, $name, $output); if ($result !== false) { $output = $result; @@ -110,19 +122,21 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } } foreach ($compiler->variable_filters as $filter) { - if (count($filter) === 1 && - ($result = $this->compile_variable_filter($compiler, $filter[ 0 ], $output)) !== false + if (count($filter) === 1 + && ($result = $this->compile_variable_filter($compiler, $filter[ 0 ], $output)) !== false ) { $output = $result; } else { - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => array($filter), 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array('modifierlist' => array($filter), 'value' => $output) + ); } } } $output = "<?php echo {$output};?>\n"; } - return $output; } @@ -136,12 +150,12 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C */ private function compile_variable_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output) { - $function= $compiler->getPlugin($name, 'variablefilter'); - if ($function) { + $function = $compiler->getPlugin($name, 'variablefilter'); + if ($function) { return "{$function}({$output},\$_smarty_tpl)"; - } else { + } else { // not found return false; - } + } } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php index bd88f1bf1..0f818d1b3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -20,9 +20,9 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C * Setup callback, parameter array and nocache mode * * @param \Smarty_Internal_TemplateCompilerBase $compiler - * @param array $_attr attributes - * @param string $tag - * @param null $function + * @param array $_attr attributes + * @param string $tag + * @param null $function * * @return array */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php index 467f9a49a..2591107d2 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_registered_function.php @@ -27,10 +27,10 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna /** * Compiles code for the execution of a registered function * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function + * @param array $parameter array with compilation parameter + * @param string $tag name of function * * @return string compiled code * @throws \SmartyCompilerException @@ -45,8 +45,8 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna $tag_info = $compiler->smarty->registered_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ]; $is_registered = true; } else { - $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ]; - $is_registered = false; + $tag_info = $compiler->default_handler_plugins[ Smarty::PLUGIN_FUNCTION ][ $tag ]; + $is_registered = false; } // not cacheable? $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[ 1 ]; @@ -76,11 +76,16 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna } } if (!empty($parameter[ 'modifierlist' ])) { - $output = $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter[ 'modifierlist' ], - 'value' => $output)); + $output = $compiler->compileTag( + 'private_modifier', + array(), + array( + 'modifierlist' => $parameter[ 'modifierlist' ], + 'value' => $output + ) + ); } $output = "<?php echo {$output};?>\n"; return $output; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 0c6be44f6..b317c9f33 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -19,9 +19,9 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C /** * Compiles code for the special $smarty variables * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param $parameter + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param $parameter * * @return string compiled code * @throws \SmartyCompilerException @@ -33,8 +33,8 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C if ($variable === false) { $compiler->trigger_template_error("special \$Smarty variable name index can not be variable", null, true); } - if (!isset($compiler->smarty->security_policy) || - $compiler->smarty->security_policy->isTrustedSpecialSmartyVar($variable, $compiler) + if (!isset($compiler->smarty->security_policy) + || $compiler->smarty->security_policy->isTrustedSpecialSmartyVar($variable, $compiler) ) { switch ($variable) { case 'foreach': @@ -43,7 +43,11 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $class = 'Smarty_Internal_Compile_' . ucfirst($variable); Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ] = new $class; } - return Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ]->compileSpecialVariable(array(), $compiler, $_index); + return Smarty_Internal_TemplateCompilerBase::$_tag_objects[ $variable ]->compileSpecialVariable( + array(), + $compiler, + $_index + ); case 'capture': if (class_exists('Smarty_Internal_Compile_Capture')) { return Smarty_Internal_Compile_Capture::compileSpecialVariable(array(), $compiler, $_index); @@ -52,8 +56,8 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C case 'now': return 'time()'; case 'cookies': - if (isset($compiler->smarty->security_policy) && - !$compiler->smarty->security_policy->allow_super_globals + if (isset($compiler->smarty->security_policy) + && !$compiler->smarty->security_policy->allow_super_globals ) { $compiler->trigger_template_error("(secure mode) super globals not permitted"); break; @@ -66,30 +70,25 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C case 'server': case 'session': case 'request': - if (isset($compiler->smarty->security_policy) && - !$compiler->smarty->security_policy->allow_super_globals + if (isset($compiler->smarty->security_policy) + && !$compiler->smarty->security_policy->allow_super_globals ) { $compiler->trigger_template_error("(secure mode) super globals not permitted"); break; } $compiled_ref = '$_' . strtoupper($variable); break; - case 'template': return 'basename($_smarty_tpl->source->filepath)'; - case 'template_object': return '$_smarty_tpl'; - case 'current_dir': return 'dirname($_smarty_tpl->source->filepath)'; - case 'version': return "Smarty::SMARTY_VERSION"; - case 'const': - if (isset($compiler->smarty->security_policy) && - !$compiler->smarty->security_policy->allow_constants + if (isset($compiler->smarty->security_policy) + && !$compiler->smarty->security_policy->allow_constants ) { $compiler->trigger_template_error("(secure mode) constants not permitted"); break; @@ -99,13 +98,14 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C } else { return "@constant({$_index[1]})"; } - + // no break case 'config': if (isset($_index[ 2 ])) { return "(is_array(\$tmp = \$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\$_smarty_tpl, $_index[1])) ? \$tmp[$_index[2]] : null)"; } else { return "\$_smarty_tpl->smarty->ext->configload->_getConfigVariable(\$_smarty_tpl, $_index[1])"; } + // no break case 'ldelim': return "\$_smarty_tpl->smarty->left_delimiter"; case 'rdelim': diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php index e3d034da1..1cc340c18 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_rdelim.php @@ -20,7 +20,7 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_Compile_Ldelim * Compiles code for the {rdelim} tag * This tag does output the right delimiter. * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -28,7 +28,7 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_Compile_Ldelim */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - parent::compile($args,$compiler); + parent::compile($args, $compiler); return $compiler->smarty->right_delimiter; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_section.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_section.php index 6e80e0fde..0dee20820 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_section.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_section.php @@ -59,8 +59,10 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo * * @var array */ - public $nameProperties = array('first', 'last', 'index', 'iteration', 'show', 'total', 'rownum', 'index_prev', - 'index_next', 'loop'); + public $nameProperties = array( + 'first', 'last', 'index', 'iteration', 'show', 'total', 'rownum', 'index_prev', + 'index_next', 'loop' + ); /** * {section} tag has no item properties @@ -79,8 +81,8 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo /** * Compiles code for the {section} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code * @throws \SmartyCompilerException @@ -88,7 +90,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - $compiler->loopNesting ++; + $compiler->loopNesting++; // check and get attributes $_attr = $this->getAttributes($compiler, $args); $attributes = array('name' => $compiler->getId($_attr[ 'name' ])); @@ -98,20 +100,19 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $compiler->trigger_template_error("'{$a}' attribute/variable has illegal value", null, true); } } - $local = "\$__section_{$attributes['name']}_" . $this->counter ++ . '_'; + $local = "\$__section_{$attributes['name']}_" . $this->counter++ . '_'; $sectionVar = "\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']"; $this->openTag($compiler, 'section', array('section', $compiler->nocache, $local, $sectionVar)); // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - $initLocal = array(); $initNamedProperty = array(); $initFor = array(); $incFor = array(); $cmpFor = array(); - $propValue = array('index' => "{$sectionVar}->value['index']", 'show' => 'true', 'step' => 1, - 'iteration' => "{$local}iteration", - + $propValue = array( + 'index' => "{$sectionVar}->value['index']", 'show' => 'true', 'step' => 1, + 'iteration' => "{$local}iteration", ); $propType = array('index' => 2, 'iteration' => 2, 'show' => 0, 'step' => 0,); // search for used tag attributes @@ -134,7 +135,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo switch ($attr_name) { case 'loop': if (is_numeric($attr_value)) { - $v = (int) $attr_value; + $v = (int)$attr_value; $t = 0; } else { $v = "(is_array(@\$_loop=$attr_value) ? count(\$_loop) : max(0, (int) \$_loop))"; @@ -156,7 +157,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo break; case 'step': if (is_numeric($attr_value)) { - $v = (int) $attr_value; + $v = (int)$attr_value; $v = ($v === 0) ? 1 : $v; $t = 0; break; @@ -165,11 +166,10 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $v = "{$local}step"; $t = 2; break; - case 'max': case 'start': if (is_numeric($attr_value)) { - $v = (int) $attr_value; + $v = (int)$attr_value; $t = 0; break; } @@ -183,7 +183,6 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propValue[ $attr_name ] = $v; $propType[ $attr_name ] = $t; } - if (isset($namedAttr[ 'step' ])) { $initNamedProperty[ 'step' ] = $propValue[ 'step' ]; } @@ -192,19 +191,17 @@ 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) { $incFor[ 'index' ] = "{$sectionVar}->value['index']++"; } elseif ($propValue[ 'step' ] > 1) { $incFor[ 'index' ] = "{$sectionVar}->value['index'] += {$propValue['step']}"; } else { - $incFor[ 'index' ] = "{$sectionVar}->value['index'] -= " . - $propValue[ 'step' ]; + $incFor[ 'index' ] = "{$sectionVar}->value['index'] -= " . -$propValue[ 'step' ]; } } else { $incFor[ 'index' ] = "{$sectionVar}->value['index'] += {$propValue['step']}"; } - if (!isset($propValue[ 'max' ])) { $propValue[ 'max' ] = $propValue[ 'loop' ]; $propType[ 'max' ] = $propType[ 'loop' ]; @@ -217,7 +214,6 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propType[ 'max' ] = $propType[ 'loop' ]; } } - if (!isset($propValue[ 'start' ])) { $start_code = array(1 => "{$propValue['step']} > 0 ? ", 2 => '0', 3 => ' : ', 4 => $propValue[ 'loop' ], 5 => ' - 1'); @@ -239,12 +235,14 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propValue[ 'start' ] = join('', $start_code); } else { $start_code = - array(1 => "{$propValue['start']} < 0 ? ", 2 => 'max(', 3 => "{$propValue['step']} > 0 ? ", 4 => '0', - 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", - 19 => ')'); + array( + 1 => "{$propValue['start']} < 0 ? ", 2 => 'max(', 3 => "{$propValue['step']} > 0 ? ", 4 => '0', + 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", + 19 => ')' + ); if ($propType[ 'step' ] === 0) { $start_code[ 3 ] = $start_code[ 5 ] = $start_code[ 15 ] = $start_code[ 17 ] = ''; if ($propValue[ 'step' ] > 0) { @@ -260,21 +258,29 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propType[ 'start' ] = $propType[ 'step' ] + $propType[ 'loop' ]; $start_code[ 1 ] = ''; if ($propValue[ 'start' ] < 0) { - for ($i = 11; $i <= 19; $i ++) { + for ($i = 11; $i <= 19; $i++) { $start_code[ $i ] = ''; } if ($propType[ 'start' ] === 0) { - $start_code = array(max($propValue[ 'step' ] > 0 ? 0 : - 1, - $propValue[ 'start' ] + $propValue[ 'loop' ])); + $start_code = array( + max( + $propValue[ 'step' ] > 0 ? 0 : -1, + $propValue[ 'start' ] + $propValue[ 'loop' ] + ) + ); } } else { - for ($i = 1; $i <= 11; $i ++) { + for ($i = 1; $i <= 11; $i++) { $start_code[ $i ] = ''; } if ($propType[ 'start' ] === 0) { $start_code = - array(min($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] : $propValue[ 'loop' ] - 1, - $propValue[ 'start' ])); + array( + min( + $propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] : $propValue[ 'loop' ] - 1, + $propValue[ 'start' ] + ) + ); } } } @@ -284,9 +290,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $initLocal[ 'start' ] = $propValue[ 'start' ]; $propValue[ 'start' ] = "{$local}start"; } - $initFor[ 'index' ] = "{$sectionVar}->value['index'] = {$propValue['start']}"; - if (!isset($_attr[ 'start' ]) && !isset($_attr[ 'step' ]) && !isset($_attr[ 'max' ])) { $propValue[ 'total' ] = $propValue[ 'loop' ]; $propType[ 'total' ] = $propType[ 'loop' ]; @@ -295,13 +299,20 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propType[ 'start' ] + $propType[ 'loop' ] + $propType[ 'step' ] + $propType[ 'max' ]; if ($propType[ 'total' ] === 0) { $propValue[ 'total' ] = - min(ceil(($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] - $propValue[ 'start' ] : - (int) $propValue[ 'start' ] + 1) / abs($propValue[ 'step' ])), $propValue[ 'max' ]); + min( + ceil( + ($propValue[ 'step' ] > 0 ? $propValue[ 'loop' ] - $propValue[ 'start' ] : + (int)$propValue[ 'start' ] + 1) / abs($propValue[ 'step' ]) + ), + $propValue[ 'max' ] + ); } else { - $total_code = array(1 => 'min(', 2 => 'ceil(', 3 => '(', 4 => "{$propValue['step']} > 0 ? ", - 5 => $propValue[ 'loop' ], 6 => ' - ', 7 => $propValue[ 'start' ], 8 => ' : ', - 9 => $propValue[ 'start' ], 10 => '+ 1', 11 => ')', 12 => '/ ', 13 => 'abs(', - 14 => $propValue[ 'step' ], 15 => ')', 16 => ')', 17 => ", {$propValue['max']})",); + $total_code = array( + 1 => 'min(', 2 => 'ceil(', 3 => '(', 4 => "{$propValue['step']} > 0 ? ", + 5 => $propValue[ 'loop' ], 6 => ' - ', 7 => $propValue[ 'start' ], 8 => ' : ', + 9 => $propValue[ 'start' ], 10 => '+ 1', 11 => ')', 12 => '/ ', 13 => 'abs(', + 14 => $propValue[ 'step' ], 15 => ')', 16 => ')', 17 => ", {$propValue['max']})", + ); if (!isset($propValue[ 'max' ])) { $total_code[ 1 ] = $total_code[ 17 ] = ''; } @@ -310,15 +321,15 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $total_code[ 6 ] = $total_code[ 7 ] = ''; } if ($propType[ 'start' ] === 0) { - $total_code[ 9 ] = (int) $propValue[ 'start' ] + 1; + $total_code[ 9 ] = (int)$propValue[ 'start' ] + 1; $total_code[ 10 ] = ''; } 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' ]; + $total_code[ 14 ] = -$propValue[ 'step' ]; } $total_code[ 4 ] = ''; if ($propValue[ 'step' ] > 0) { @@ -330,7 +341,6 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $propValue[ 'total' ] = join('', $total_code); } } - if (isset($namedAttr[ 'loop' ])) { $initNamedProperty[ 'loop' ] = "'loop' => {$propValue['loop']}"; } @@ -343,13 +353,10 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $initLocal[ 'total' ] = $propValue[ 'total' ]; $propValue[ 'total' ] = "{$local}total"; } - $cmpFor[ 'iteration' ] = "{$propValue['iteration']} <= {$propValue['total']}"; - foreach ($initLocal as $key => $code) { $output .= "{$local}{$key} = {$code};\n"; } - $_vars = 'array(' . join(', ', $initNamedProperty) . ')'; $output .= "{$sectionVar} = new Smarty_Variable({$_vars});\n"; $cond_code = "{$propValue['total']} !== 0"; @@ -388,7 +395,6 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo $output .= "{$sectionVar}->value['last'] = ({$propValue['iteration']} === {$propValue['total']});\n"; } $output .= '?>'; - return $output; } } @@ -404,7 +410,7 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase /** * Compiles code for the {sectionelse} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -413,10 +419,8 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section')); $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar)); - return "<?php }} else {\n ?>"; } } @@ -432,22 +436,20 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/section} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - $compiler->loopNesting --; + $compiler->loopNesting--; // must endblock be nocache? if ($compiler->nocache) { $compiler->tag_nocache = true; } - list($openTag, $compiler->nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section', 'sectionelse')); - $output = "<?php\n"; if ($openTag === 'sectionelse') { $output .= "}\n"; @@ -455,7 +457,6 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase $output .= "}\n}\n"; } $output .= '?>'; - return $output; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php index 1f3ba8d48..70e2e2f9f 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_setfilter.php @@ -19,9 +19,9 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase /** * Compiles code for setfilter tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code */ @@ -31,7 +31,6 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase $compiler->variable_filters = $parameter[ 'modifier_list' ]; // this tag does not return compiled code $compiler->has_code = false; - return true; } } @@ -48,7 +47,7 @@ class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase * Compiles code for the {/setfilter} tag * This tag does not generate compiled output. It resets variable filter. * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code @@ -64,7 +63,6 @@ class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase } // this tag does not return compiled code $compiler->has_code = false; - return true; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php index a32173cd6..d90262e60 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_shared_inheritance.php @@ -22,7 +22,7 @@ class Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_Compile * @param \Smarty_Internal_TemplateCompilerBase $compiler * @param bool|false $initChildSequence if true force child template */ - static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) + public static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) { $compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " . var_export($initChildSequence, true) . ");\n?>\n"; @@ -36,13 +36,14 @@ class Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_Compile */ public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) { - if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) { - $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), - array($initChildSequence), - 'inheritanceInit', - $initChildSequence); - - $compiler->_cache['inheritanceInit'] = true; + if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) { + $compiler->registerPostCompileCallback( + array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), + array($initChildSequence), + 'inheritanceInit', + $initChildSequence + ); + $compiler->_cache[ 'inheritanceInit' ] = true; } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_while.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_while.php index 328d6551d..5aa3a7330 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_while.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_while.php @@ -19,24 +19,22 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase /** * Compiles code for the {while} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $parameter array with compilation parameter * * @return string compiled code * @throws \SmartyCompilerException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { - $compiler->loopNesting ++; + $compiler->loopNesting++; // check and get attributes $_attr = $this->getAttributes($compiler, $args); $this->openTag($compiler, 'while', $compiler->nocache); - if (!array_key_exists('if condition', $parameter)) { $compiler->trigger_template_error('missing while condition', null, true); } - // maybe nocache because of nocache variables $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; if (is_array($parameter[ 'if condition' ])) { @@ -56,14 +54,16 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase if (is_array($parameter[ 'if condition' ][ 'var' ])) { $assignAttr[][ 'var' ] = $parameter[ 'if condition' ][ 'var' ][ 'var' ]; $_output = "<?php while ({$prefixVar} = {$parameter[ 'if condition' ][ 'value' ]}) {?>"; - $_output .= $assignCompiler->compile($assignAttr, $compiler, - array('smarty_internal_index' => $parameter[ 'if condition' ][ 'var' ][ 'smarty_internal_index' ])); + $_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 .= $assignCompiler->compile($assignAttr, $compiler, array()); } - return $_output; } else { return "<?php\n while ({$parameter['if condition']}) {?>"; @@ -82,14 +82,14 @@ class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/while} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string compiled code */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { - $compiler->loopNesting --; + $compiler->loopNesting--; // must endblock be nocache? if ($compiler->nocache) { $compiler->tag_nocache = true; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php index 656672b98..2a32e4373 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php @@ -65,8 +65,8 @@ abstract class Smarty_Internal_CompileBase * the corresponding list. The keyword '_any' specifies that any attribute will be accepted * as valid * - * @param object $compiler compiler object - * @param array $attributes attributes applied to the tag + * @param object $compiler compiler object + * @param array $attributes attributes applied to the tag * * @return array of mapped attributes for further processing */ @@ -103,8 +103,12 @@ abstract class Smarty_Internal_CompileBase if (isset($this->optionMap[ $v ])) { $_indexed_attr[ $k ] = $this->optionMap[ $v ]; } else { - $compiler->trigger_template_error("illegal value '" . var_export($v, true) . - "' for option flag '{$k}'", null, true); + $compiler->trigger_template_error( + "illegal value '" . var_export($v, true) . + "' for option flag '{$k}'", + null, + true + ); } } // must be named attribute @@ -124,8 +128,14 @@ abstract class Smarty_Internal_CompileBase 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, - $this->option_flags), true); + array_fill_keys( + array_merge( + $this->required_attributes, + $this->optional_attributes, + $this->option_flags + ), + true + ); } foreach ($_indexed_attr as $key => $dummy) { if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) { @@ -162,8 +172,8 @@ abstract class Smarty_Internal_CompileBase * Pop closing tag * Raise an error if this stack-top doesn't match with expected opening tags * - * @param object $compiler compiler object - * @param array|string $expectedTag the expected opening tag names + * @param object $compiler compiler object + * @param array|string $expectedTag the expected opening tag names * * @return mixed any type the opening tag's name or saved data */ @@ -173,7 +183,7 @@ abstract class Smarty_Internal_CompileBase // get stacked info list($_openTag, $_data) = array_pop($compiler->_tag_stack); // open tag must match with the expected ones - if (in_array($_openTag, (array) $expectedTag)) { + if (in_array($_openTag, (array)$expectedTag)) { if (is_null($_data)) { // return opening tag return $_openTag; @@ -184,12 +194,10 @@ abstract class Smarty_Internal_CompileBase } // wrong nesting of tags $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); - return; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php index ada38869d..a842fa8f3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -103,9 +103,11 @@ class Smarty_Internal_Config_File_Compiler { $this->template = $template; $this->template->compiled->file_dependency[ $this->template->source->uid ] = - array($this->template->source->filepath, - $this->template->source->getTimeStamp(), - $this->template->source->type); + array( + $this->template->source->filepath, + $this->template->source->getTimeStamp(), + $this->template->source->type + ); if ($this->smarty->debugging) { if (!isset($this->smarty->_debug)) { $this->smarty->_debug = new Smarty_Internal_Debug(); @@ -114,15 +116,22 @@ class Smarty_Internal_Config_File_Compiler } // init the lexer/parser to compile the config file /* @var Smarty_Internal_ConfigFileLexer $this ->lex */ - $this->lex = new $this->lexer_class(str_replace(array("\r\n", - "\r"), "\n", $template->source->getContent()) . "\n", - $this); + $this->lex = new $this->lexer_class( + str_replace( + array( + "\r\n", + "\r" + ), + "\n", + $template->source->getContent() + ) . "\n", + $this + ); /* @var Smarty_Internal_ConfigFileParser $this ->parser */ $this->parser = new $this->parser_class($this->lex, $this); - if (function_exists('mb_internal_encoding') && function_exists('ini_get') - && ((int) ini_get('mbstring.func_overload')) & 2 + && ((int)ini_get('mbstring.func_overload')) & 2 ) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); @@ -141,7 +150,6 @@ class Smarty_Internal_Config_File_Compiler } // finish parsing process $this->parser->doParse(0, 0); - if ($mbEncoding) { mb_internal_encoding($mbEncoding); } @@ -153,7 +161,6 @@ class Smarty_Internal_Config_File_Compiler "<?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"; - $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' . var_export($this->config_data, true) . '); ?>'; return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code); diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfilelexer.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfilelexer.php index 454c9f828..afb3efcb0 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfilelexer.php @@ -27,73 +27,86 @@ class Smarty_Internal_Configfilelexer const COMMENT = 4; const SECTION = 5; const TRIPPLE = 6; + /** * Source * * @var string */ public $data; + /** * Source length * * @var int */ public $dataLength = null; + /** * byte counter * * @var int */ public $counter; + /** * token number * * @var int */ public $token; + /** * token value * * @var string */ public $value; + /** * current line * * @var int */ public $line; + /** * state number * * @var int */ public $state = 1; + /** * Smarty object * * @var Smarty */ public $smarty = null; + /** * trace file * * @var resource */ public $yyTraceFILE; + /** * trace prompt * * @var string */ public $yyTracePrompt; + /** * state names * * @var array */ - public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', - 6 => 'TRIPPLE'); + public $state_name = array( + 1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE' + ); + /** * token names * @@ -101,30 +114,40 @@ class Smarty_Internal_Configfilelexer */ public $smarty_token_names = array( // Text for parser error messages ); + /** * compiler object * * @var Smarty_Internal_Config_File_Compiler */ private $compiler = null; + /** * copy of config_booleanize * * @var bool */ private $configBooleanize = false; + /** * storage for assembled token patterns * * @var string */ private $yy_global_pattern1 = null; + private $yy_global_pattern2 = null; + private $yy_global_pattern3 = null; + private $yy_global_pattern4 = null; + private $yy_global_pattern5 = null; + private $yy_global_pattern6 = null; + private $_yy_state = 1; + private $_yy_stack = array(); /** @@ -133,7 +156,7 @@ class Smarty_Internal_Configfilelexer * @param string $data template source * @param Smarty_Internal_Config_File_Compiler $compiler */ - function __construct($data, Smarty_Internal_Config_File_Compiler $compiler) + public function __construct($data, Smarty_Internal_Config_File_Compiler $compiler) { $this->data = $data . "\n"; //now all lines are \n-terminated $this->dataLength = strlen($data); @@ -166,39 +189,43 @@ class Smarty_Internal_Configfilelexer public function yypushstate($state) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState push %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf( + $this->yyTraceFILE, + "%sState push %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state + ); } array_push($this->_yy_stack, $this->_yy_state); $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%snew State %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf( + $this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state + ); } } public function yypopstate() { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState pop %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf( + $this->yyTraceFILE, + "%sState pop %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state + ); } $this->_yy_state = array_pop($this->_yy_stack); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%snew State %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf( + $this->yyTraceFILE, + "%snew State %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state + ); } } @@ -206,11 +233,12 @@ class Smarty_Internal_Configfilelexer { $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState set %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf( + $this->yyTraceFILE, + "%sState set %s\n", + $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state + ); } } @@ -235,9 +263,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state START'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state START'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -248,11 +278,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -269,45 +299,45 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r1_1() + public function yy_r1_1() { $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART; $this->yypushstate(self::COMMENT); } - function yy_r1_2() + public function yy_r1_2() { $this->token = Smarty_Internal_Configfileparser::TPC_OPENB; $this->yypushstate(self::SECTION); } - function yy_r1_3() + public function yy_r1_3() { $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB; } - function yy_r1_4() + public function yy_r1_4() { $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL; $this->yypushstate(self::VALUE); } // end function - function yy_r1_5() + public function yy_r1_5() { return false; } - function yy_r1_6() + public function yy_r1_6() { $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; } - function yy_r1_7() + public function yy_r1_7() { $this->token = Smarty_Internal_Configfileparser::TPC_ID; } - function yy_r1_8() + public function yy_r1_8() { $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; } @@ -333,9 +363,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state VALUE'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state VALUE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -346,11 +378,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -367,42 +399,42 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r2_1() + public function yy_r2_1() { return false; } - function yy_r2_2() + public function yy_r2_2() { $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT; $this->yypopstate(); } - function yy_r2_3() + public function yy_r2_3() { $this->token = Smarty_Internal_Configfileparser::TPC_INT; $this->yypopstate(); } - function yy_r2_4() + public function yy_r2_4() { $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES; $this->yypushstate(self::TRIPPLE); } - function yy_r2_5() + public function yy_r2_5() { $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING; $this->yypopstate(); } - function yy_r2_6() + public function yy_r2_6() { $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING; $this->yypopstate(); } // end function - function yy_r2_7() + public function yy_r2_7() { if (!$this->configBooleanize || !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no'))) { @@ -415,13 +447,13 @@ class Smarty_Internal_Configfilelexer } } - function yy_r2_8() + public function yy_r2_8() { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->yypopstate(); } - function yy_r2_9() + public function yy_r2_9() { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->value = ''; @@ -448,9 +480,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state NAKED_STRING_VALUE'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state NAKED_STRING_VALUE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -461,11 +495,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -482,7 +516,7 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r3_1() + public function yy_r3_1() { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->yypopstate(); @@ -508,9 +542,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state COMMENT'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state COMMENT'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -521,11 +557,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -542,17 +578,17 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r4_1() + public function yy_r4_1() { return false; } - function yy_r4_2() + public function yy_r4_2() { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; } // end function - function yy_r4_3() + public function yy_r4_3() { $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; $this->yypopstate(); @@ -578,9 +614,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state SECTION'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state SECTION'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -591,11 +629,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -612,12 +650,12 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r5_1() + public function yy_r5_1() { $this->token = Smarty_Internal_Configfileparser::TPC_DOT; } - function yy_r5_2() + public function yy_r5_2() { $this->token = Smarty_Internal_Configfileparser::TPC_SECTION; $this->yypopstate(); @@ -643,9 +681,11 @@ class Smarty_Internal_Configfilelexer } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state TRIPPLE'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state TRIPPLE'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -656,11 +696,11 @@ class Smarty_Internal_Configfilelexer $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -677,21 +717,21 @@ class Smarty_Internal_Configfilelexer } while (true); } - function yy_r6_1() + public function yy_r6_1() { $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END; $this->yypopstate(); $this->yypushstate(self::START); } - function yy_r6_2() + public function yy_r6_2() { $to = strlen($this->data); preg_match("/\"\"\"[ \t\r]*[\n#;]/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); if (isset($match[ 0 ][ 1 ])) { $to = $match[ 0 ][ 1 ]; } else { - $this->compiler->trigger_template_error('missing or misspelled literal closing tag'); + $this->compiler->trigger_config_file_error('missing or misspelled literal closing tag'); } $this->value = substr($this->data, $this->counter, $to - $this->counter); $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php index 1c76f7bc8..36fdb76ee 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php @@ -9,7 +9,7 @@ class TPC_yyStackEntry ** is the value of the token */ } -#line 12 "../smarty/lexer/smarty_internal_configfileparser.y" +// line 12 "../smarty/lexer/smarty_internal_configfileparser.y" /** * Smarty Internal Plugin Configfileparse @@ -23,7 +23,7 @@ class TPC_yyStackEntry */ class Smarty_Internal_Configfileparser { - #line 25 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 25 "../smarty/lexer/smarty_internal_configfileparser.y" const TPC_OPENB = 1; const TPC_SECTION = 2; const TPC_CLOSEB = 3; @@ -48,7 +48,7 @@ class Smarty_Internal_Configfileparser const YY_SZ_ACTTAB = 38; const YY_SHIFT_USE_DFLT = -8; const YY_SHIFT_MAX = 19; - const YY_REDUCE_USE_DFLT = -21; + const YY_REDUCE_USE_DFLT = -17; const YY_REDUCE_MAX = 10; const YYNOCODE = 29; const YYSTACKDEPTH = 100; @@ -57,27 +57,32 @@ class Smarty_Internal_Configfileparser const YYERRORSYMBOL = 19; const YYERRSYMDT = 'yy0'; const YYFALLBACK = 0; - static public $yy_action = array( - 29, 30, 34, 33, 24, 13, 19, 25, 35, 21, - 59, 8, 3, 1, 20, 12, 14, 31, 20, 12, - 15, 17, 23, 18, 27, 26, 4, 5, 6, 32, - 2, 11, 28, 22, 16, 9, 7, 10, + + public static $yy_action = array( + 32, 31, 30, 29, 35, 13, 19, 3, 24, 26, + 59, 9, 14, 1, 16, 25, 11, 28, 25, 11, + 17, 27, 34, 20, 18, 15, 23, 5, 6, 22, + 10, 8, 4, 12, 2, 33, 7, 21, ); - static public $yy_lookahead = array( - 7, 8, 9, 10, 11, 12, 5, 27, 15, 16, - 20, 21, 23, 23, 17, 18, 13, 14, 17, 18, - 15, 2, 17, 4, 25, 26, 6, 3, 3, 14, - 23, 1, 24, 17, 2, 25, 22, 25, + + public static $yy_lookahead = array( + 7, 8, 9, 10, 11, 12, 5, 23, 15, 16, + 20, 21, 2, 23, 4, 17, 18, 14, 17, 18, + 13, 14, 25, 26, 15, 2, 17, 3, 3, 17, + 25, 25, 6, 1, 23, 27, 22, 24, ); - static public $yy_shift_ofst = array( - -8, 1, 1, 1, -7, -3, -3, 30, -8, -8, - -8, 19, 5, 3, 15, 16, 24, 25, 32, 20, + + public static $yy_shift_ofst = array( + -8, 1, 1, 1, -7, -2, -2, 32, -8, -8, + -8, 9, 10, 7, 25, 24, 23, 3, 12, 26, ); - static public $yy_reduce_ofst = array( - -10, -1, -1, -1, -20, 10, 12, 8, 14, 7, - -11, + + public static $yy_reduce_ofst = array( + -10, -3, -3, -3, 8, 6, 5, 13, 11, 14, + -16, ); - static public $yyExpectedTokens = array( + + public static $yyExpectedTokens = array( array(), array(5, 17, 18,), array(5, 17, 18,), @@ -89,14 +94,14 @@ class Smarty_Internal_Configfileparser array(), array(), array(), - array(2, 4,), array(15, 17,), + array(2, 4,), array(13, 14,), - array(14,), - array(17,), array(3,), array(3,), array(2,), + array(14,), + array(17,), array(6,), array(), array(), @@ -115,13 +120,16 @@ class Smarty_Internal_Configfileparser array(), array(), ); - static public $yy_default = array( - 44, 37, 41, 40, 58, 58, 58, 36, 39, 44, + + public static $yy_default = array( + 44, 37, 41, 40, 58, 58, 58, 36, 44, 39, 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 55, 54, 57, 56, 50, 45, 43, 42, 38, 46, - 47, 52, 51, 49, 48, 53, + 43, 38, 57, 56, 53, 55, 54, 52, 51, 49, + 48, 47, 46, 45, 42, 50, ); + public static $yyFallback = array(); + public static $yyRuleName = array( 'start ::= global_vars sections', 'global_vars ::= var_list', @@ -146,6 +154,7 @@ class Smarty_Internal_Configfileparser 'newline ::= COMMENTSTART NEWLINE', 'newline ::= COMMENTSTART NAKED_STRING NEWLINE', ); + public static $yyRuleInfo = array( array(0 => 20, 1 => 2), array(0 => 21, 1 => 1), @@ -170,6 +179,7 @@ class Smarty_Internal_Configfileparser array(0 => 25, 1 => 2), array(0 => 25, 1 => 3), ); + public static $yyReduceMap = array( 0 => 0, 2 => 0, @@ -194,46 +204,60 @@ class Smarty_Internal_Configfileparser 17 => 17, 18 => 17, ); + /** * helper map * * @var array */ - private static $escapes_single = array('\\' => '\\', - '\'' => '\''); + private static $escapes_single = array( + '\\' => '\\', + '\'' => '\'' + ); + /** * result status * * @var bool */ public $successful = true; + /** * return value * * @var mixed */ public $retvalue = 0; + /** * @var */ public $yymajor; + /** * compiler object * * @var Smarty_Internal_Config_File_Compiler */ public $compiler = null; + /** * smarty object * * @var Smarty */ public $smarty = null; + public $yyTraceFILE; + public $yyTracePrompt; + public $yyidx; + public $yyerrcnt; + public $yystack = array(); + public $yyTokenName = array( '$', 'OPENB', 'SECTION', 'CLOSEB', 'DOT', 'ID', 'EQUAL', 'FLOAT', @@ -243,30 +267,35 @@ class Smarty_Internal_Configfileparser 'start', 'global_vars', 'sections', 'var_list', 'section', 'newline', 'var', 'value', ); + /** * lexer object * * @var Smarty_Internal_Configfilelexer */ private $lex; + /** * internal error flag * * @var bool */ private $internalError = false; + /** * copy of config_overwrite property * * @var bool */ private $configOverwrite = false; + /** * copy of config_read_hidden property * * @var bool */ private $configReadHidden = false; + private $_retvalue; /** @@ -275,7 +304,7 @@ class Smarty_Internal_Configfileparser * @param Smarty_Internal_Configfilelexer $lex * @param Smarty_Internal_Config_File_Compiler $compiler */ - function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler) + public function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Config_File_Compiler $compiler) { $this->lex = $lex; $this->smarty = $compiler->smarty; @@ -343,7 +372,7 @@ class Smarty_Internal_Configfileparser { if (!$TraceFILE) { $zTracePrompt = 0; - } else if (!$zTracePrompt) { + } elseif (!$zTracePrompt) { $TraceFILE = 0; } $this->yyTraceFILE = $TraceFILE; @@ -375,9 +404,11 @@ class Smarty_Internal_Configfileparser } $yytos = array_pop($this->yystack); if ($this->yyTraceFILE && $this->yyidx >= 0) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . - "\n"); + fwrite( + $this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . + "\n" + ); } $yymajor = $yytos->major; self::yy_destructor($yymajor, $yytos->minor); @@ -387,7 +418,7 @@ class Smarty_Internal_Configfileparser public function __destruct() { - while ($this->yystack !== Array()) { + while ($this->yystack !== array()) { $this->yy_pop_parser_stack(); } if (is_resource($this->yyTraceFILE)) { @@ -429,7 +460,8 @@ class Smarty_Internal_Configfileparser $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; $nextstate = $this->yy_find_reduce_action( $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); + self::$yyRuleInfo[ $yyruleno ][ 0 ] + ); if (isset(self::$yyExpectedTokens[ $nextstate ])) { $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); if (isset($res4[ $nextstate ][ $token ])) { @@ -455,14 +487,14 @@ class Smarty_Internal_Configfileparser $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; $this->yystack[ $this->yyidx ] = $x; continue 2; - } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; // the last token was just ignored, we can't accept // by ignoring input, this is in essence ignoring a // syntax error! return array_unique($expected); - } else if ($nextstate === self::YY_NO_ACTION) { + } elseif ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) @@ -515,7 +547,8 @@ class Smarty_Internal_Configfileparser $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; $nextstate = $this->yy_find_reduce_action( $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); + self::$yyRuleInfo[ $yyruleno ][ 0 ] + ); if (isset($res2[ $nextstate ][ $token ])) { if ($res2[ $nextstate ][ $token ]) { $this->yyidx = $yyidx; @@ -523,10 +556,9 @@ class Smarty_Internal_Configfileparser return true; } } else { - if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, - self::$yyExpectedTokens[ $nextstate ], - true))) { + if ($res2[ $nextstate ][ $token ] = + (isset(self::$yyExpectedTokens[ $nextstate ]) && + in_array($token, self::$yyExpectedTokens[ $nextstate ], true))) { $this->yyidx = $yyidx; $this->yystack = $stack; return true; @@ -540,7 +572,7 @@ class Smarty_Internal_Configfileparser $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; $this->yystack[ $this->yyidx ] = $x; continue 2; - } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; if (!$token) { @@ -551,7 +583,7 @@ class Smarty_Internal_Configfileparser // by ignoring input, this is in essence ignoring a // syntax error! return false; - } else if ($nextstate === self::YY_NO_ACTION) { + } elseif ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) @@ -589,10 +621,9 @@ class Smarty_Internal_Configfileparser if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) { if ($this->yyTraceFILE) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . 'FALLBACK ' . - $this->yyTokenName[ $iLookAhead ] . ' => ' . - $this->yyTokenName[ $iFallback ] . "\n"); + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'FALLBACK ' . + $this->yyTokenName[ $iLookAhead ] . ' => ' . + $this->yyTokenName[ $iFallback ] . "\n"); } return $this->yy_find_shift_action($iFallback); } @@ -635,7 +666,7 @@ class Smarty_Internal_Configfileparser while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - #line 239 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 239 "../smarty/lexer/smarty_internal_configfileparser.y" $this->internalError = true; $this->compiler->trigger_config_file_error('Stack overflow in configfile parser'); return; @@ -646,131 +677,142 @@ class Smarty_Internal_Configfileparser $yytos->minor = $yypMinor; $this->yystack[] = $yytos; if ($this->yyTraceFILE && $this->yyidx > 0) { - fprintf($this->yyTraceFILE, - "%sShift %d\n", - $this->yyTracePrompt, - $yyNewState); + fprintf( + $this->yyTraceFILE, + "%sShift %d\n", + $this->yyTracePrompt, + $yyNewState + ); fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); for ($i = 1; $i <= $this->yyidx; $i++) { - fprintf($this->yyTraceFILE, - " %s", - $this->yyTokenName[ $this->yystack[ $i ]->major ]); + fprintf( + $this->yyTraceFILE, + " %s", + $this->yyTokenName[ $this->yystack[ $i ]->major ] + ); } fwrite($this->yyTraceFILE, "\n"); } } - function yy_r0() + public function yy_r0() { $this->_retvalue = null; } - function yy_r1() + public function yy_r1() { $this->add_global_vars($this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = null; } - function yy_r4() + public function yy_r4() { $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = null; } - #line 245 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r5() + // line 245 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r5() { if ($this->configReadHidden) { - $this->add_section_vars($this->yystack[ $this->yyidx + -3 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor); + $this->add_section_vars( + $this->yystack[ $this->yyidx + -3 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor + ); } $this->_retvalue = null; } - #line 250 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r6() + // line 250 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r6() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 264 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r7() + // line 264 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r7() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -1 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 269 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r8() + // line 269 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r8() { $this->_retvalue = array(); } - #line 277 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r9() + // line 277 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r9() { - $this->_retvalue = array('key' => $this->yystack[ $this->yyidx + -2 ]->minor, - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + array( + 'key' => $this->yystack[ $this->yyidx + -2 ]->minor, + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor + ); } - #line 281 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r10() + // line 281 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r10() { $this->_retvalue = (float)$this->yystack[ $this->yyidx + 0 ]->minor; } - #line 285 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r11() + // line 285 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r11() { $this->_retvalue = (int)$this->yystack[ $this->yyidx + 0 ]->minor; } - #line 291 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r12() + // line 291 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r12() { $this->_retvalue = $this->parse_bool($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 296 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r13() + // line 296 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r13() { $this->_retvalue = self::parse_single_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 300 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r14() + // line 300 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r14() { $this->_retvalue = self::parse_double_quoted_string($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 304 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r15() + // line 304 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r15() { $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[ $this->yyidx + -1 ]->minor); } - #line 308 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r16() + // line 308 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r16() { $this->_retvalue = ''; } - #line 312 "../smarty/lexer/smarty_internal_configfileparser.y" - function yy_r17() + // line 312 "../smarty/lexer/smarty_internal_configfileparser.y" + public function yy_r17() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 316 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 316 "../smarty/lexer/smarty_internal_configfileparser.y" public function yy_reduce($yyruleno) { if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { - fprintf($this->yyTraceFILE, - "%sReduce (%d) [%s].\n", - $this->yyTracePrompt, - $yyruleno, - self::$yyRuleName[ $yyruleno ]); + fprintf( + $this->yyTraceFILE, + "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, + $yyruleno, + self::$yyRuleName[ $yyruleno ] + ); } $this->_retvalue = $yy_lefthand_side = null; if (isset(self::$yyReduceMap[ $yyruleno ])) { @@ -798,12 +840,12 @@ class Smarty_Internal_Configfileparser } else { $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); } - } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($yyact === self::YYNSTATE + self::YYNRULE + 1) { $this->yy_accept(); } } - #line 320 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 320 "../smarty/lexer/smarty_internal_configfileparser.y" public function yy_parse_failed() { if ($this->yyTraceFILE) { @@ -814,10 +856,10 @@ class Smarty_Internal_Configfileparser } } - #line 324 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 324 "../smarty/lexer/smarty_internal_configfileparser.y" public function yy_syntax_error($yymajor, $TOKEN) { - #line 232 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 232 "../smarty/lexer/smarty_internal_configfileparser.y" $this->internalError = true; $this->yymajor = $yymajor; $this->compiler->trigger_config_file_error(); @@ -831,7 +873,7 @@ class Smarty_Internal_Configfileparser while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - #line 225 "../smarty/lexer/smarty_internal_configfileparser.y" + // line 225 "../smarty/lexer/smarty_internal_configfileparser.y" $this->successful = !$this->internalError; $this->internalError = false; $this->retvalue = $this->_retvalue; @@ -851,10 +893,12 @@ class Smarty_Internal_Configfileparser } $yyendofinput = ($yymajor == 0); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sInput %s\n", - $this->yyTracePrompt, - $this->yyTokenName[ $yymajor ]); + fprintf( + $this->yyTraceFILE, + "%sInput %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ] + ); } do { $yyact = $this->yy_find_shift_action($yymajor); @@ -871,13 +915,15 @@ class Smarty_Internal_Configfileparser } else { $yymajor = self::YYNOCODE; } - } else if ($yyact < self::YYNSTATE + self::YYNRULE) { + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); - } else if ($yyact === self::YY_ERROR_ACTION) { + } elseif ($yyact === self::YY_ERROR_ACTION) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sSyntax Error!\n", - $this->yyTracePrompt); + fprintf( + $this->yyTraceFILE, + "%sSyntax Error!\n", + $this->yyTracePrompt + ); } if (self::YYERRORSYMBOL) { if ($this->yyerrcnt < 0) { @@ -886,10 +932,12 @@ class Smarty_Internal_Configfileparser $yymx = $this->yystack[ $this->yyidx ]->major; if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sDiscard input token %s\n", - $this->yyTracePrompt, - $this->yyTokenName[ $yymajor ]); + fprintf( + $this->yyTraceFILE, + "%sDiscard input token %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ] + ); } $this->yy_destructor($yymajor, $yytokenvalue); $yymajor = self::YYNOCODE; @@ -904,7 +952,7 @@ class Smarty_Internal_Configfileparser $this->yy_destructor($yymajor, $yytokenvalue); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; - } else if ($yymx !== self::YYERRORSYMBOL) { + } elseif ($yymx !== self::YYERRORSYMBOL) { $u2 = 0; $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); } @@ -996,4 +1044,3 @@ class Smarty_Internal_Configfileparser } } } - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_data.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_data.php index 37b917b14..98e3e57b3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_data.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_data.php @@ -87,9 +87,9 @@ abstract class Smarty_Internal_Data /** * assigns a Smarty variable * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to assign - * @param boolean $nocache if true any output of this variable will be not cached + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached * * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for * chaining @@ -103,7 +103,11 @@ abstract class Smarty_Internal_Data } else { if ($tpl_var !== '') { if ($this->_objType === 2) { - /** @var Smarty_Internal_Template $this */ + /** + * + * + * @var Smarty_Internal_Template $this + */ $this->_assignInScope($tpl_var, $value, $nocache); } else { $this->tpl_vars[ $tpl_var ] = new Smarty_Variable($value, $nocache); @@ -119,11 +123,11 @@ abstract class Smarty_Internal_Data * @api Smarty::append() * @link http://www.smarty.net/docs/en/api.append.tpl * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to append - * @param bool $merge flag if array elements shall be merged - * @param bool $nocache if true any output of this variable will - * be not cached + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + * @param bool $merge flag if array elements shall be merged + * @param bool $nocache if true any output of this variable will + * be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -135,9 +139,9 @@ abstract class Smarty_Internal_Data /** * assigns a global Smarty variable * - * @param string $varName the global variable name - * @param mixed $value the value to assign - * @param boolean $nocache if true any output of this variable will be not cached + * @param string $varName the global variable name + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -149,9 +153,9 @@ abstract class Smarty_Internal_Data /** * appends values to template variables by reference * - * @param string $tpl_var the template variable name - * @param mixed &$value the referenced value to append - * @param boolean $merge flag if array elements shall be merged + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param boolean $merge flag if array elements shall be merged * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -163,9 +167,9 @@ abstract class Smarty_Internal_Data /** * assigns values to template variables by reference * - * @param string $tpl_var the template variable name - * @param $value - * @param boolean $nocache if true any output of this variable will be not cached + * @param string $tpl_var the template variable name + * @param $value + * @param boolean $nocache if true any output of this variable will be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -180,9 +184,9 @@ abstract class Smarty_Internal_Data * @api Smarty::getTemplateVars() * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl * - * @param string $varName variable name or null + * @param string $varName variable name or null * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr optional pointer to data object - * @param bool $searchParents include parent templates? + * @param bool $searchParents include parent templates? * * @return mixed variable value or or array of variables */ @@ -194,17 +198,20 @@ abstract class Smarty_Internal_Data /** * gets the object of a Smarty variable * - * @param string $variable the name of the Smarty variable - * @param Smarty_Internal_Data $_ptr optional pointer to data object - * @param boolean $searchParents search also in parent data - * @param bool $error_enable + * @param string $variable the name of the Smarty variable + * @param Smarty_Internal_Data $_ptr optional pointer to data object + * @param boolean $searchParents search also in parent data + * @param bool $error_enable * - * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable + * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable * @deprecated since 3.1.28 please use Smarty_Internal_Data::getTemplateVars() instead. */ - public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true, - $error_enable = true) - { + public function getVariable( + $variable = null, + Smarty_Internal_Data $_ptr = null, + $searchParents = true, + $error_enable = true + ) { return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable); } @@ -277,7 +284,6 @@ abstract class Smarty_Internal_Data * @param array $args argument array * * @return mixed - * @throws SmartyException */ public function __call($name, $args) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php index c826a1786..24b233e26 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_debug.php @@ -53,8 +53,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data public function start_template(Smarty_Internal_Template $template, $mode = null) { if (isset($mode) && !$template->_isSubTpl()) { - $this->index ++; - $this->offset ++; + $this->index++; + $this->offset++; $this->template_data[ $this->index ] = null; } $key = $this->get_key($template); @@ -117,7 +117,6 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data if (isset($this->ignore_uid[ $template->source->uid ])) { return; } - $key = $this->get_key($template); } $this->template_data[ $this->index ][ $key ][ 'compile_time' ] += @@ -200,7 +199,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data public function display_debug($obj, $full = false) { if (!$full) { - $this->offset ++; + $this->offset++; $savedIndex = $this->index; $this->index = 9999; } @@ -211,7 +210,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data // copy the working dirs from application $debObj->setCompileDir($smarty->getCompileDir()); // init properties by hand as user may have edited the original Smarty class - $debObj->setPluginsDir(is_dir(__DIR__ . '/../plugins') ? __DIR__ . '/../plugins' : $smarty->getPluginsDir()); + $debObj->setPluginsDir(is_dir(dirname(__FILE__) . '/../plugins') ? dirname(__FILE__) . + '/../plugins' : $smarty->getPluginsDir()); $debObj->force_compile = false; $debObj->compile_check = Smarty::COMPILECHECK_ON; $debObj->left_delimiter = '{'; @@ -220,7 +220,8 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $debObj->debugging = false; $debObj->debugging_ctrl = 'NONE'; $debObj->error_reporting = E_ALL & ~E_NOTICE; - $debObj->debug_tpl = isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . __DIR__ . '/../debug.tpl'; + $debObj->debug_tpl = + isset($smarty->debug_tpl) ? $smarty->debug_tpl : 'file:' . dirname(__FILE__) . '/../debug.tpl'; $debObj->registered_plugins = array(); $debObj->registered_resources = array(); $debObj->registered_filters = array(); @@ -237,7 +238,6 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_config_vars = $ptr->config_vars; ksort($_config_vars); $debugging = $smarty->debugging; - $_template = new Smarty_Internal_Template($debObj->debug_tpl, $debObj); if ($obj->_isTplObj()) { $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name); @@ -254,7 +254,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $_template->assign('offset', $this->offset * 50); echo $_template->fetch(); if (isset($full)) { - $this->index --; + $this->index--; } if (!$full) { $this->index = $savedIndex; @@ -264,7 +264,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data /** * Recursively gets variables from all template/data scopes * - * @param Smarty_Internal_Template|Smarty_Data $obj object to debug + * @param Smarty_Internal_Template|Smarty_Data $obj object to debug * * @return StdClass */ @@ -306,7 +306,6 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $tpl_vars[ $key ][ 'scope' ] = 'Smarty object'; } } - if (isset($obj->parent)) { $parent = $this->get_debug_vars($obj->parent); foreach ($parent->tpl_vars as $name => $pvar) { @@ -315,7 +314,6 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data } } $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars); - foreach ($parent->config_vars as $name => $pvar) { if (isset($config_vars[ $name ]) && $config_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) { $config_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ]; @@ -344,8 +342,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data } } } - - return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); + return (object)array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); } /** @@ -376,7 +373,6 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data $this->template_data[ $this->index ][ $key ][ 'render_time' ] = 0; $this->template_data[ $this->index ][ $key ][ 'cache_time' ] = 0; $this->template_data[ $this->index ][ $key ][ 'total_time' ] = 0; - return $key; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php index 831421833..0ba00659d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php @@ -3,7 +3,6 @@ /** * Smarty error handler * - * * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews @@ -17,6 +16,7 @@ class Smarty_Internal_ErrorHandler * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors() */ public static $mutedDirectories = array(); + /** * error handler returned by set_error_handler() in self::muteExpectedErrors() */ @@ -25,7 +25,6 @@ class Smarty_Internal_ErrorHandler /** * Enable error handler to mute expected messages * - * @return boolean */ public static function muteExpectedErrors() { @@ -58,11 +57,11 @@ class Smarty_Internal_ErrorHandler * * @link http://php.net/set_error_handler * - * @param integer $errno Error level - * @param $errstr - * @param $errfile - * @param $errline - * @param $errcontext + * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext * * @return bool */ @@ -98,15 +97,17 @@ class Smarty_Internal_ErrorHandler // or the error was within smarty but masked to be ignored if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { if (self::$previousErrorHandler) { - return call_user_func(self::$previousErrorHandler, - $errno, - $errstr, - $errfile, - $errline, - $errcontext); + return call_user_func( + self::$previousErrorHandler, + $errno, + $errstr, + $errfile, + $errline, + $errcontext + ); } else { return false; } } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php index 90d3b81ea..b07615526 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php @@ -5,41 +5,39 @@ * * Load extensions dynamically * - * * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews * * Runtime extensions - * @property Smarty_Internal_Runtime_CacheModify $_cacheModify - * @property Smarty_Internal_Runtime_CacheResourceFile $_cacheResourceFile - * @property Smarty_Internal_Runtime_Capture $_capture - * @property Smarty_Internal_Runtime_CodeFrame $_codeFrame - * @property Smarty_Internal_Runtime_FilterHandler $_filterHandler - * @property Smarty_Internal_Runtime_Foreach $_foreach - * @property Smarty_Internal_Runtime_GetIncludePath $_getIncludePath - * @property Smarty_Internal_Runtime_Make_Nocache $_make_nocache - * @property Smarty_Internal_Runtime_UpdateCache $_updateCache - * @property Smarty_Internal_Runtime_UpdateScope $_updateScope - * @property Smarty_Internal_Runtime_TplFunction $_tplFunction - * @property Smarty_Internal_Runtime_WriteFile $_writeFile + * @property Smarty_Internal_Runtime_CacheModify $_cacheModify + * @property Smarty_Internal_Runtime_CacheResourceFile $_cacheResourceFile + * @property Smarty_Internal_Runtime_Capture $_capture + * @property Smarty_Internal_Runtime_CodeFrame $_codeFrame + * @property Smarty_Internal_Runtime_FilterHandler $_filterHandler + * @property Smarty_Internal_Runtime_Foreach $_foreach + * @property Smarty_Internal_Runtime_GetIncludePath $_getIncludePath + * @property Smarty_Internal_Runtime_Make_Nocache $_make_nocache + * @property Smarty_Internal_Runtime_UpdateCache $_updateCache + * @property Smarty_Internal_Runtime_UpdateScope $_updateScope + * @property Smarty_Internal_Runtime_TplFunction $_tplFunction + * @property Smarty_Internal_Runtime_WriteFile $_writeFile * * Method extensions - * @property Smarty_Internal_Method_GetTemplateVars $getTemplateVars - * @property Smarty_Internal_Method_Append $append - * @property Smarty_Internal_Method_AppendByRef $appendByRef - * @property Smarty_Internal_Method_AssignGlobal $assignGlobal - * @property Smarty_Internal_Method_AssignByRef $assignByRef - * @property Smarty_Internal_Method_LoadFilter $loadFilter - * @property Smarty_Internal_Method_LoadPlugin $loadPlugin - * @property Smarty_Internal_Method_RegisterFilter $registerFilter - * @property Smarty_Internal_Method_RegisterObject $registerObject - * @property Smarty_Internal_Method_RegisterPlugin $registerPlugin - * @property mixed|\Smarty_Template_Cached configLoad + * @property Smarty_Internal_Method_GetTemplateVars $getTemplateVars + * @property Smarty_Internal_Method_Append $append + * @property Smarty_Internal_Method_AppendByRef $appendByRef + * @property Smarty_Internal_Method_AssignGlobal $assignGlobal + * @property Smarty_Internal_Method_AssignByRef $assignByRef + * @property Smarty_Internal_Method_LoadFilter $loadFilter + * @property Smarty_Internal_Method_LoadPlugin $loadPlugin + * @property Smarty_Internal_Method_RegisterFilter $registerFilter + * @property Smarty_Internal_Method_RegisterObject $registerObject + * @property Smarty_Internal_Method_RegisterPlugin $registerPlugin + * @property mixed|\Smarty_Template_Cached configLoad */ class Smarty_Internal_Extension_Handler { - public $objType = null; /** @@ -48,9 +46,11 @@ class Smarty_Internal_Extension_Handler * * @var array */ - private $_property_info = array('AutoloadFilters' => 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0, - 'DebugTemplate' => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0, - 'TemplateVars' => 0, 'Literals' => 'Literals',);# + private $_property_info = array( + 'AutoloadFilters' => 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0, + 'DebugTemplate' => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0, + 'TemplateVars' => 0, 'Literals' => 'Literals', + );// private $resolvedProperties = array(); @@ -62,7 +62,6 @@ class Smarty_Internal_Extension_Handler * @param array $args argument array * * @return mixed - * @throws SmartyException */ public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args) { @@ -70,9 +69,10 @@ class Smarty_Internal_Extension_Handler $smarty = isset($data->smarty) ? $data->smarty : $data; if (!isset($smarty->ext->$name)) { if (preg_match('/^((set|get)|(.*?))([A-Z].*)$/', $name, $match)) { - $basename = $this->upperCase($match[4]); - if (!isset($smarty->ext->$basename) && isset($this->_property_info[ $basename ]) && - is_string($this->_property_info[ $basename ])) { + $basename = $this->upperCase($match[ 4 ]); + if (!isset($smarty->ext->$basename) && isset($this->_property_info[ $basename ]) + && is_string($this->_property_info[ $basename ]) + ) { $class = 'Smarty_Internal_Method_' . $this->_property_info[ $basename ]; if (class_exists($class)) { $classObj = new $class(); @@ -82,40 +82,45 @@ class Smarty_Internal_Extension_Handler } } } - if (!empty($match[2]) && !isset($smarty->ext->$name)) { + if (!empty($match[ 2 ]) && !isset($smarty->ext->$name)) { $class = 'Smarty_Internal_Method_' . $this->upperCase($name); if (!class_exists($class)) { $objType = $data->_objType; $propertyType = false; - if (!isset($this->resolvedProperties[ $match[0] ][ $objType ])) { - $property = isset($this->resolvedProperties['property'][ $basename ]) ? - $this->resolvedProperties['property'][ $basename ] : - $property = $this->resolvedProperties['property'][ $basename ] = strtolower(join('_', - preg_split('/([A-Z][^A-Z]*)/', - $basename, - -1, - PREG_SPLIT_NO_EMPTY | - PREG_SPLIT_DELIM_CAPTURE))); - + if (!isset($this->resolvedProperties[ $match[ 0 ] ][ $objType ])) { + $property = isset($this->resolvedProperties[ 'property' ][ $basename ]) ? + $this->resolvedProperties[ 'property' ][ $basename ] : + $property = $this->resolvedProperties[ 'property' ][ $basename ] = strtolower( + join( + '_', + preg_split( + '/([A-Z][^A-Z]*)/', + $basename, + -1, + PREG_SPLIT_NO_EMPTY | + PREG_SPLIT_DELIM_CAPTURE + ) + ) + ); if ($property !== false) { if (property_exists($data, $property)) { - $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 1; - } else if (property_exists($smarty, $property)) { - $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ] = 2; + $propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 1; + } elseif (property_exists($smarty, $property)) { + $propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ] = 2; } else { - $this->resolvedProperties['property'][ $basename ] = $property = false; + $this->resolvedProperties[ 'property' ][ $basename ] = $property = false; } } } else { - $propertyType = $this->resolvedProperties[ $match[0] ][ $objType ]; - $property = $this->resolvedProperties['property'][ $basename ]; + $propertyType = $this->resolvedProperties[ $match[ 0 ] ][ $objType ]; + $property = $this->resolvedProperties[ 'property' ][ $basename ]; } if ($propertyType) { $obj = $propertyType === 1 ? $data : $smarty; - if ($match[2] === 'get') { + if ($match[ 2 ] === 'get') { return $obj->$property; - } else if ($match[2] === 'set') { - return $obj->$property = $args[0]; + } elseif ($match[ 2 ] === 'set') { + return $obj->$property = $args[ 0 ]; } } } @@ -124,7 +129,7 @@ class Smarty_Internal_Extension_Handler } $callback = array($smarty->ext->$name, $name); array_unshift($args, $data); - if (isset($callback) && $callback[0]->objMap | $data->_objType) { + if (isset($callback) && $callback[ 0 ]->objMap | $data->_objType) { return call_user_func_array($callback, $args); } return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); @@ -150,12 +155,11 @@ class Smarty_Internal_Extension_Handler * @param string $property_name property name * * @return mixed|Smarty_Template_Cached - * @throws SmartyException */ 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); @@ -172,7 +176,6 @@ class Smarty_Internal_Extension_Handler * @param string $property_name property name * @param mixed $value value * - * @throws SmartyException */ public function __set($property_name, $value) { @@ -186,11 +189,9 @@ class Smarty_Internal_Extension_Handler * @param array $args argument array * * @return mixed - * @throws SmartyException */ public function __call($name, $args) { return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), array($this)); } - -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_addautoloadfilters.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_addautoloadfilters.php index 7bd75bfb5..a05f55a82 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_addautoloadfilters.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_addautoloadfilters.php @@ -17,11 +17,12 @@ class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_S * @api Smarty::setAutoloadFilters() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the - * filter type to set. Defaults to - * none treating $filters' keys as - * the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify + * the filter type to set. + * Defaults to none treating + * $filters' keys as the + * appropriate types * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -32,21 +33,21 @@ class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_S if ($type !== null) { $this->_checkFilterType($type); if (!empty($smarty->autoload_filters[ $type ])) { - $smarty->autoload_filters[ $type ] = array_merge($smarty->autoload_filters[ $type ], (array) $filters); + $smarty->autoload_filters[ $type ] = array_merge($smarty->autoload_filters[ $type ], (array)$filters); } else { - $smarty->autoload_filters[ $type ] = (array) $filters; + $smarty->autoload_filters[ $type ] = (array)$filters; } } else { - foreach ((array) $filters as $type => $value) { + foreach ((array)$filters as $type => $value) { $this->_checkFilterType($type); if (!empty($smarty->autoload_filters[ $type ])) { $smarty->autoload_filters[ $type ] = - array_merge($smarty->autoload_filters[ $type ], (array) $value); + array_merge($smarty->autoload_filters[ $type ], (array)$value); } else { - $smarty->autoload_filters[ $type ] = (array) $value; + $smarty->autoload_filters[ $type ] = (array)$value; } } } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php index afb0b68d5..c3feb3d8b 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_adddefaultmodifiers.php @@ -24,7 +24,7 @@ class Smarty_Internal_Method_AddDefaultModifiers * @api Smarty::addDefaultModifiers() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array|string $modifiers modifier or list of modifiers + * @param array|string $modifiers modifier or list of modifiers * to add * * @return \Smarty|\Smarty_Internal_Template @@ -39,4 +39,4 @@ class Smarty_Internal_Method_AddDefaultModifiers } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_append.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_append.php index a1422cf5a..881375efe 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_append.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_append.php @@ -25,10 +25,10 @@ class Smarty_Internal_Method_Append * @link http://www.smarty.net/docs/en/api.append.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to append - * @param bool $merge flag if array elements shall be merged - * @param bool $nocache if true any output of this variable will + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + * @param bool $merge flag if array elements shall be merged + * @param bool $nocache if true any output of this variable will * be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty @@ -52,8 +52,8 @@ class Smarty_Internal_Method_Append $data->tpl_vars[ $tpl_var ] = clone $tpl_var_inst; } } - if (!(is_array($data->tpl_vars[ $tpl_var ]->value) || - $data->tpl_vars[ $tpl_var ]->value instanceof ArrayAccess) + if (!(is_array($data->tpl_vars[ $tpl_var ]->value) + || $data->tpl_vars[ $tpl_var ]->value instanceof ArrayAccess) ) { settype($data->tpl_vars[ $tpl_var ]->value, 'array'); } @@ -71,4 +71,4 @@ class Smarty_Internal_Method_Append } return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_appendbyref.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_appendbyref.php index 9185a8e83..c95904460 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_appendbyref.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_appendbyref.php @@ -11,7 +11,6 @@ */ class Smarty_Internal_Method_AppendByRef { - /** * appends values to template variables by reference * @@ -19,9 +18,9 @@ class Smarty_Internal_Method_AppendByRef * @link http://www.smarty.net/docs/en/api.append.by.ref.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $tpl_var the template variable name - * @param mixed &$value the referenced value to append - * @param bool $merge flag if array elements shall be merged + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param bool $merge flag if array elements shall be merged * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -47,4 +46,4 @@ class Smarty_Internal_Method_AppendByRef } return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php index 1c513ce99..fa705bb80 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php @@ -11,14 +11,14 @@ */ class Smarty_Internal_Method_AssignByRef { - /** * assigns values to template variables by reference * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string $tpl_var the template variable name * @param $value - * @param boolean $nocache if true any output of this variable will be not cached + * @param boolean $nocache if true any output of this variable will + * be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -33,4 +33,4 @@ class Smarty_Internal_Method_AssignByRef } return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignglobal.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignglobal.php index 0e1690418..08cfa4693 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignglobal.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignglobal.php @@ -22,9 +22,10 @@ class Smarty_Internal_Method_AssignGlobal * assigns a global Smarty variable * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $varName the global variable name - * @param mixed $value the value to assign - * @param boolean $nocache if true any output of this variable will be not cached + * @param string $varName the global variable name + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will + * be not cached * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -40,4 +41,4 @@ class Smarty_Internal_Method_AssignGlobal } return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallassign.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallassign.php index 1e5fec4bd..29ff2ffb0 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallassign.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallassign.php @@ -31,7 +31,6 @@ class Smarty_Internal_Method_ClearAllAssign public function clearAllAssign(Smarty_Internal_Data $data) { $data->tpl_vars = array(); - return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallcache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallcache.php index 9641e2baa..30d55f7d2 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallcache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearallcache.php @@ -24,9 +24,9 @@ class Smarty_Internal_Method_ClearAllCache * @api Smarty::clearAllCache() * @link http://www.smarty.net/docs/en/api.clear.all.cache.tpl * - * @param \Smarty $smarty - * @param integer $exp_time expiration time - * @param string $type resource type + * @param \Smarty $smarty + * @param integer $exp_time expiration time + * @param string $type resource type * * @return int number of cache files deleted * @throws \SmartyException @@ -38,4 +38,4 @@ class Smarty_Internal_Method_ClearAllCache $_cache_resource = Smarty_CacheResource::load($smarty, $type); return $_cache_resource->clearAll($smarty, $exp_time); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearassign.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearassign.php index 060a2ac49..22bfa2d31 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearassign.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearassign.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_ClearAssign * @link http://www.smarty.net/docs/en/api.clear.assign.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string|array $tpl_var the template variable(s) to clear + * @param string|array $tpl_var the template variable(s) to clear * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -38,7 +38,6 @@ class Smarty_Internal_Method_ClearAssign } else { unset($data->tpl_vars[ $tpl_var ]); } - return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcache.php index 6d56c13d5..a5dd4e26e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcache.php @@ -24,22 +24,27 @@ class Smarty_Internal_Method_ClearCache * @api Smarty::clearCache() * @link http://www.smarty.net/docs/en/api.clear.cache.tpl * - * @param \Smarty $smarty - * @param string $template_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * @param string $type resource type + * @param \Smarty $smarty + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type * * @return int number of cache files deleted * @throws \SmartyException */ - public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null, - $type = null) - { + public function clearCache( + Smarty $smarty, + $template_name, + $cache_id = null, + $compile_id = null, + $exp_time = null, + $type = null + ) { $smarty->_clearTemplateCache(); // load cache resource and call clear $_cache_resource = Smarty_CacheResource::load($smarty, $type); return $_cache_resource->clear($smarty, $template_name, $cache_id, $compile_id, $exp_time); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php index c019c59db..bf4929807 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -24,10 +24,10 @@ class Smarty_Internal_Method_ClearCompiledTemplate * @api Smarty::clearCompiledTemplate() * @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl * - * @param \Smarty $smarty - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time + * @param \Smarty $smarty + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time * * @return int number of template files deleted * @throws \SmartyException @@ -69,8 +69,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate try { $_compileDirs = new RecursiveDirectoryIterator($_dir); // NOTE: UnexpectedValueException thrown for PHP >= 5.3 - } - catch (Exception $e) { + } catch (Exception $e) { return 0; } $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); @@ -90,18 +89,22 @@ class Smarty_Internal_Method_ClearCompiledTemplate continue; } $unlink = false; - if ((!isset($_compile_id) || (isset($_filepath[ $_compile_id_part_length ]) && $a = - !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) && - (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) && - substr_compare($_filepath, - $_resource_part_1, - -$_resource_part_1_length, - $_resource_part_1_length) === - 0) || (isset($_filepath[ $_resource_part_2_length ]) && - substr_compare($_filepath, - $_resource_part_2, - -$_resource_part_2_length, - $_resource_part_2_length) === 0)) + if ((!isset($_compile_id) || + (isset($_filepath[ $_compile_id_part_length ]) && + $a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) + && (!isset($resource_name) || (isset($_filepath[ $_resource_part_1_length ]) + && substr_compare( + $_filepath, + $_resource_part_1, + -$_resource_part_1_length, + $_resource_part_1_length + ) === 0) || (isset($_filepath[ $_resource_part_2_length ]) + && substr_compare( + $_filepath, + $_resource_part_2, + -$_resource_part_2_length, + $_resource_part_2_length + ) === 0)) ) { if (isset($exp_time)) { if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) { @@ -117,7 +120,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1) ) { opcache_invalidate($_filepath, true); - } else if (function_exists('apc_delete_file')) { + } elseif (function_exists('apc_delete_file')) { apc_delete_file($_filepath); } } @@ -125,4 +128,4 @@ class Smarty_Internal_Method_ClearCompiledTemplate } return $_count; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearconfig.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearconfig.php index 371247807..15bf492a1 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearconfig.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_clearconfig.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_ClearConfig * @link http://www.smarty.net/docs/en/api.clear.config.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string|null $name variable name or null + * @param string|null $name variable name or null * * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty */ @@ -38,4 +38,4 @@ class Smarty_Internal_Method_ClearConfig } return $data; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compileallconfig.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compileallconfig.php index 767031bd9..3934ca042 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compileallconfig.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compileallconfig.php @@ -11,23 +11,26 @@ */ class Smarty_Internal_Method_CompileAllConfig extends Smarty_Internal_Method_CompileAllTemplates { - /** * Compile all config files * - * @api Smarty::compileAllConfig() + * @api Smarty::compileAllConfig() * * @param \Smarty $smarty passed smarty object - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors * * @return int number of template files recompiled */ - public function compileAllConfig(Smarty $smarty, $extension = '.conf', $force_compile = false, $time_limit = 0, - $max_errors = null) - { + public function compileAllConfig( + Smarty $smarty, + $extension = '.conf', + $force_compile = false, + $time_limit = 0, + $max_errors = null + ) { return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors, true); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php index 64912599f..5c046da40 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php @@ -1,4 +1,5 @@ <?php + /** * Smarty Method CompileAllTemplates * @@ -20,22 +21,23 @@ class Smarty_Internal_Method_CompileAllTemplates /** * Compile all template files * - * @api Smarty::compileAllTemplates() + * @api Smarty::compileAllTemplates() * * @param \Smarty $smarty passed smarty object - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors * * @return integer number of template files recompiled */ - public function compileAllTemplates(Smarty $smarty, - $extension = '.tpl', - $force_compile = false, - $time_limit = 0, - $max_errors = null) - { + public function compileAllTemplates( + Smarty $smarty, + $extension = '.tpl', + $force_compile = false, + $time_limit = 0, + $max_errors = null + ) { return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors); } @@ -43,21 +45,22 @@ class Smarty_Internal_Method_CompileAllTemplates * Compile all template or config files * * @param \Smarty $smarty - * @param string $extension template file name extension - * @param bool $force_compile force all to recompile - * @param int $time_limit set maximum execution time - * @param int $max_errors set maximum allowed errors + * @param string $extension template file name extension + * @param bool $force_compile force all to recompile + * @param int $time_limit set maximum execution time + * @param int $max_errors set maximum allowed errors * @param bool $isConfig flag true if called for config files * * @return int number of template files compiled */ - protected function compileAll(Smarty $smarty, - $extension, - $force_compile, - $time_limit, - $max_errors, - $isConfig = false) - { + protected function compileAll( + Smarty $smarty, + $extension, + $force_compile, + $time_limit, + $max_errors, + $isConfig = false + ) { // switch off time limit if (function_exists('set_time_limit')) { @set_time_limit($time_limit); @@ -67,15 +70,18 @@ class Smarty_Internal_Method_CompileAllTemplates $sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir(); // loop over array of source directories foreach ($sourceDir as $_dir) { - $_dir_1 = new RecursiveDirectoryIterator($_dir, defined('FilesystemIterator::FOLLOW_SYMLINKS') ? - FilesystemIterator::FOLLOW_SYMLINKS : 0); + $_dir_1 = new RecursiveDirectoryIterator( + $_dir, + defined('FilesystemIterator::FOLLOW_SYMLINKS') ? + FilesystemIterator::FOLLOW_SYMLINKS : 0 + ); $_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) { 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)) { @@ -105,8 +111,7 @@ class Smarty_Internal_Method_CompileAllTemplates echo ' is up to date'; flush(); } - } - catch (Exception $e) { + } catch (Exception $e) { echo "\n<br> ------>Error: ", $e->getMessage(), "<br><br>\n"; $_error_count++; } @@ -122,4 +127,4 @@ class Smarty_Internal_Method_CompileAllTemplates echo "\n<br>"; return $_count; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_configload.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_configload.php index eb8672fe9..2e6254880 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_configload.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_configload.php @@ -25,8 +25,8 @@ class Smarty_Internal_Method_ConfigLoad * @link http://www.smarty.net/docs/en/api.config.load.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $config_file filename - * @param mixed $sections array of section names, single + * @param string $config_file filename + * @param mixed $sections array of section names, single * section or null * * @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template @@ -45,13 +45,12 @@ class Smarty_Internal_Method_ConfigLoad * @link http://www.smarty.net/docs/en/api.config.load.tpl * * @param \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template $data - * @param string $config_file filename - * @param mixed $sections array of section names, single + * @param string $config_file filename + * @param mixed $sections array of section names, single * section or null * @param int $scope scope into which config variables * shall be loaded * - * @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template * @throws \Exception */ public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0) @@ -75,8 +74,7 @@ class Smarty_Internal_Method_ConfigLoad * load config variables into template object * * @param \Smarty_Internal_Template $tpl - * @param array $new_config_vars - * + * @param array $new_config_vars */ public function _loadConfigVars(Smarty_Internal_Template $tpl, $new_config_vars) { @@ -111,7 +109,7 @@ class Smarty_Internal_Method_ConfigLoad * * @param array $config_vars config variables in scope * @param \Smarty_Internal_Template $tpl - * @param array $new_config_vars loaded config variables + * @param array $new_config_vars loaded config variables */ public function _assignConfigVars(&$config_vars, Smarty_Internal_Template $tpl, $new_config_vars) { @@ -120,19 +118,19 @@ class Smarty_Internal_Method_ConfigLoad if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) { $config_vars[ $variable ] = $value; } else { - $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value); + $config_vars[ $variable ] = array_merge((array)$config_vars[ $variable ], (array)$value); } } // scan sections $sections = $tpl->source->config_sections; if (!empty($sections)) { - foreach ((array) $sections as $tpl_section) { + foreach ((array)$sections as $tpl_section) { if (isset($new_config_vars[ 'sections' ][ $tpl_section ])) { foreach ($new_config_vars[ 'sections' ][ $tpl_section ][ 'vars' ] as $variable => $value) { if ($tpl->smarty->config_overwrite || !isset($config_vars[ $variable ])) { $config_vars[ $variable ] = $value; } else { - $config_vars[ $variable ] = array_merge((array) $config_vars[ $variable ], (array) $value); + $config_vars[ $variable ] = array_merge((array)$config_vars[ $variable ], (array)$value); } } } @@ -151,7 +149,7 @@ class Smarty_Internal_Method_ConfigLoad $i = 0; while (isset($tpl->_cache[ 'varStack' ][ $i ])) { $this->_assignConfigVars($tpl->_cache[ 'varStack' ][ $i ][ 'config' ], $tpl, $config_vars); - $i ++; + $i++; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_createdata.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_createdata.php index 43ce89432..f95097519 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_createdata.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_createdata.php @@ -29,7 +29,7 @@ class Smarty_Internal_Method_CreateData * variables * @param string $name optional data block name * - * @returns Smarty_Data data object + * @return \Smarty_Data data object */ public function createData(Smarty_Internal_TemplateBase $obj, Smarty_Internal_Data $parent = null, $name = null) { @@ -41,4 +41,4 @@ class Smarty_Internal_Method_CreateData } return $dataObj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getautoloadfilters.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getautoloadfilters.php index b957b60d2..4145db10b 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getautoloadfilters.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getautoloadfilters.php @@ -17,7 +17,7 @@ class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_S * @api Smarty::getAutoloadFilters() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type type of filter to get auto loads + * @param string $type type of filter to get auto loads * for. Defaults to all autoload * filters * @@ -34,4 +34,4 @@ class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_S } return $smarty->autoload_filters; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvariable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvariable.php index 4dd398208..b54815123 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvariable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvariable.php @@ -31,4 +31,4 @@ class Smarty_Internal_Method_GetConfigVariable { return $data->ext->configLoad->_getConfigVariable($data, $varName, $errorEnable); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvars.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvars.php index b75cf8179..1d11e44c1 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvars.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getconfigvars.php @@ -25,8 +25,8 @@ class Smarty_Internal_Method_GetConfigVars * @link http://www.smarty.net/docs/en/api.get.config.vars.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $varname variable name or null - * @param bool $search_parents include parent templates? + * @param string $varname variable name or null + * @param bool $search_parents include parent templates? * * @return mixed variable value or or array of variables */ @@ -55,4 +55,4 @@ class Smarty_Internal_Method_GetConfigVars return $var_array; } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdebugtemplate.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdebugtemplate.php index 52073c14e..77d908c15 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdebugtemplate.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdebugtemplate.php @@ -32,4 +32,4 @@ class Smarty_Internal_Method_GetDebugTemplate $smarty = $obj->_getSmartyObj(); return $smarty->debug_tpl; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php index f65ab7914..57da85c49 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getdefaultmodifiers.php @@ -32,4 +32,4 @@ class Smarty_Internal_Method_GetDefaultModifiers $smarty = $obj->_getSmartyObj(); return $smarty->default_modifiers; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getglobal.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getglobal.php index 0f00da53c..2be11d7e8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getglobal.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getglobal.php @@ -21,10 +21,10 @@ class Smarty_Internal_Method_GetGlobal /** * Returns a single or all global variables * - * @api Smarty::getGlobal() + * @api Smarty::getGlobal() * * @param \Smarty_Internal_Data $data - * @param string $varName variable name or null + * @param string $varName variable name or null * * @return string|array variable value or or array of variables */ @@ -38,10 +38,10 @@ class Smarty_Internal_Method_GetGlobal } } else { $_result = array(); - foreach (Smarty::$global_tpl_vars AS $key => $var) { + foreach (Smarty::$global_tpl_vars as $key => $var) { $_result[ $key ] = $var->value; } return $_result; } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getregisteredobject.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getregisteredobject.php index c5c064665..df6ede130 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getregisteredobject.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getregisteredobject.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_GetRegisteredObject * @link http://www.smarty.net/docs/en/api.get.registered.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $object_name object name + * @param string $object_name object name * * @return object * @throws \SmartyException if no such object is found @@ -41,4 +41,4 @@ class Smarty_Internal_Method_GetRegisteredObject } return $smarty->registered_objects[ $object_name ][ 0 ]; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getstreamvariable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getstreamvariable.php index b922fd088..8db39c525 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getstreamvariable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_getstreamvariable.php @@ -24,7 +24,7 @@ class Smarty_Internal_Method_GetStreamVariable * @api Smarty::getStreamVariable() * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $variable the stream of the variable + * @param string $variable the stream of the variable * * @return mixed * @throws \SmartyException @@ -38,7 +38,6 @@ class Smarty_Internal_Method_GetStreamVariable $_result .= $current_line; } fclose($fp); - return $_result; } $smarty = isset($data->smarty) ? $data->smarty : $data; @@ -48,4 +47,4 @@ class Smarty_Internal_Method_GetStreamVariable return null; } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettags.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettags.php index afaa4b913..c07ae07ec 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettags.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettags.php @@ -60,4 +60,4 @@ class Smarty_Internal_Method_GetTags } throw new SmartyException('Missing template specification'); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettemplatevars.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettemplatevars.php index 510bab0fc..9ef7d46bb 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettemplatevars.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_gettemplatevars.php @@ -25,15 +25,18 @@ class Smarty_Internal_Method_GetTemplateVars * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data - * @param string $varName variable name or null + * @param string $varName variable name or null * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr optional pointer to data object - * @param bool $searchParents include parent templates? + * @param bool $searchParents include parent templates? * * @return mixed variable value or or array of variables */ - public function getTemplateVars(Smarty_Internal_Data $data, $varName = null, Smarty_Internal_Data $_ptr = null, - $searchParents = true) - { + public function getTemplateVars( + Smarty_Internal_Data $data, + $varName = null, + Smarty_Internal_Data $_ptr = null, + $searchParents = true + ) { if (isset($varName)) { $_var = $this->_getVariable($data, $varName, $_ptr, $searchParents, false); if (is_object($_var)) { @@ -47,7 +50,7 @@ class Smarty_Internal_Method_GetTemplateVars $_ptr = $data; } while ($_ptr !== null) { - foreach ($_ptr->tpl_vars AS $key => $var) { + foreach ($_ptr->tpl_vars as $key => $var) { if (!array_key_exists($key, $_result)) { $_result[ $key ] = $var->value; } @@ -60,7 +63,7 @@ class Smarty_Internal_Method_GetTemplateVars } } if ($searchParents && isset(Smarty::$global_tpl_vars)) { - foreach (Smarty::$global_tpl_vars AS $key => $var) { + foreach (Smarty::$global_tpl_vars as $key => $var) { if (!array_key_exists($key, $_result)) { $_result[ $key ] = $var->value; } @@ -81,9 +84,13 @@ class Smarty_Internal_Method_GetTemplateVars * * @return \Smarty_Variable */ - public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Internal_Data $_ptr = null, - $searchParents = true, $errorEnable = true) - { + public function _getVariable( + Smarty_Internal_Data $data, + $varName, + Smarty_Internal_Data $_ptr = null, + $searchParents = true, + $errorEnable = true + ) { if ($_ptr === null) { $_ptr = $data; } @@ -107,7 +114,6 @@ class Smarty_Internal_Method_GetTemplateVars // force a notice $x = $$varName; } - return new Smarty_Undefined_Variable; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_literals.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_literals.php index 08e1a473b..bfa3f58ec 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_literals.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_literals.php @@ -39,8 +39,8 @@ class Smarty_Internal_Method_Literals * @api Smarty::addLiterals() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array|string $literals literal or list of literals - * to add + * @param array|string $literals literal or list of literals + * to addto add * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -59,8 +59,8 @@ class Smarty_Internal_Method_Literals * @api Smarty::setLiterals() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array|string $literals literal or list of literals - * to set + * @param array|string $literals literal or list of literals + * to setto set * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -80,7 +80,7 @@ class Smarty_Internal_Method_Literals * Smarty::$literals array gets filled with identical key values * * @param \Smarty $smarty - * @param array $literals + * @param array $literals * * @throws \SmartyException */ @@ -90,9 +90,11 @@ class Smarty_Internal_Method_Literals $error = isset($literals[ $smarty->left_delimiter ]) ? array($smarty->left_delimiter) : array(); $error = isset($literals[ $smarty->right_delimiter ]) ? $error[] = $smarty->right_delimiter : $error; if (!empty($error)) { - throw new SmartyException('User defined literal(s) "' . $error . - '" may not be identical with left or right delimiter'); + throw new SmartyException( + 'User defined literal(s) "' . $error . + '" may not be identical with left or right delimiter' + ); } $smarty->literals = array_merge((array)$smarty->literals, (array)$literals); } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadfilter.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadfilter.php index 239fd6dd3..66d80d474 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadfilter.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadfilter.php @@ -33,8 +33,8 @@ class Smarty_Internal_Method_LoadFilter * @link http://www.smarty.net/docs/en/api.load.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type filter type - * @param string $name filter name + * @param string $type filter type + * @param string $name filter name * * @return bool * @throws SmartyException if filter could not be loaded @@ -74,4 +74,4 @@ class Smarty_Internal_Method_LoadFilter throw new SmartyException("Illegal filter type '{$type}'"); } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadplugin.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadplugin.php index 2454d9c9c..3bd659cb8 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadplugin.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadplugin.php @@ -24,8 +24,8 @@ class Smarty_Internal_Method_LoadPlugin * plugin filename format: plugintype.pluginname.php * * @param \Smarty $smarty - * @param string $plugin_name class plugin name to load - * @param bool $check check if already loaded + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded * * @return bool|string * @throws \SmartyException @@ -50,7 +50,7 @@ class Smarty_Internal_Method_LoadPlugin } else { if (is_file($file)) { $this->plugin_files[ $file ] = $file; - require_once($file); + include_once $file; return $file; } else { $this->plugin_files[ $file ] = false; @@ -87,7 +87,7 @@ class Smarty_Internal_Method_LoadPlugin $file = $_plugin_dir . $name; if (is_file($file)) { $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = $file; - require_once($file); + include_once $file; return $file; } $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = false; @@ -100,7 +100,7 @@ class Smarty_Internal_Method_LoadPlugin $file = $smarty->ext->_getIncludePath->getIncludePath($_p_dirs, $_file_name, $smarty); $this->plugin_files[ 'include_path' ][ $_lower_filename ] = $file; if ($file !== false) { - require_once($file); + include_once $file; return $file; } } @@ -108,4 +108,4 @@ class Smarty_Internal_Method_LoadPlugin // no plugin loaded return false; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_mustcompile.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_mustcompile.php index 62c16f626..39318838e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_mustcompile.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_mustcompile.php @@ -45,7 +45,6 @@ class Smarty_Internal_Method_MustCompile $_template->compiled->getTimeStamp() < $_template->source->getTimeStamp()))); } - return $_template->mustCompile; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registercacheresource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registercacheresource.php index ae3872722..648365619 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registercacheresource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registercacheresource.php @@ -25,16 +25,18 @@ class Smarty_Internal_Method_RegisterCacheResource * @link http://www.smarty.net/docs/en/api.register.cacheresource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $name name of resource type + * @param string $name name of resource type * @param \Smarty_CacheResource $resource_handler * * @return \Smarty|\Smarty_Internal_Template */ - public function registerCacheResource(Smarty_Internal_TemplateBase $obj, $name, - Smarty_CacheResource $resource_handler) - { + public function registerCacheResource( + Smarty_Internal_TemplateBase $obj, + $name, + Smarty_CacheResource $resource_handler + ) { $smarty = $obj->_getSmartyObj(); $smarty->registered_cache_resources[ $name ] = $resource_handler; return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerclass.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerclass.php index 5469b98aa..8d18547e2 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerclass.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerclass.php @@ -25,8 +25,8 @@ class Smarty_Internal_Method_RegisterClass * @link http://www.smarty.net/docs/en/api.register.class.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $class_name - * @param string $class_impl the referenced PHP class to + * @param string $class_name + * @param string $class_impl the referenced PHP class to * register * * @return \Smarty|\Smarty_Internal_Template @@ -43,4 +43,4 @@ class Smarty_Internal_Method_RegisterClass $smarty->registered_classes[ $class_name ] = $class_impl; return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php index c8c5ae73f..b340f178d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultconfighandler.php @@ -21,10 +21,10 @@ class Smarty_Internal_Method_RegisterDefaultConfigHandler /** * Register config default handler * - * @api Smarty::registerDefaultConfigHandler() + * @api Smarty::registerDefaultConfigHandler() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param callable $callback class/method name + * @param callable $callback class/method name * * @return \Smarty|\Smarty_Internal_Template * @throws SmartyException if $callback is not callable @@ -39,4 +39,4 @@ class Smarty_Internal_Method_RegisterDefaultConfigHandler } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php index d9aecb4a9..a9fb78dc6 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_RegisterDefaultPluginHandler * @link http://www.smarty.net/docs/en/api.register.default.plugin.handler.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param callable $callback class/method name + * @param callable $callback class/method name * * @return \Smarty|\Smarty_Internal_Template * @throws SmartyException if $callback is not callable @@ -40,4 +40,4 @@ class Smarty_Internal_Method_RegisterDefaultPluginHandler } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php index 4c5d396ed..cbc133ccd 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php @@ -21,10 +21,10 @@ class Smarty_Internal_Method_RegisterDefaultTemplateHandler /** * Register template default handler * - * @api Smarty::registerDefaultTemplateHandler() + * @api Smarty::registerDefaultTemplateHandler() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param callable $callback class/method name + * @param callable $callback class/method name * * @return \Smarty|\Smarty_Internal_Template * @throws SmartyException if $callback is not callable @@ -55,16 +55,20 @@ class Smarty_Internal_Method_RegisterDefaultTemplateHandler $default_handler = $source->smarty->default_template_handler_func; } $_content = $_timestamp = null; - $_return = call_user_func_array($default_handler, - array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty)); + $_return = call_user_func_array( + $default_handler, + array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty) + ); if (is_string($_return)) { $source->exists = is_file($_return); if ($source->exists) { $source->timestamp = filemtime($_return); } else { - throw new SmartyException('Default handler: Unable to load ' . - ($source->isConfig ? 'config' : 'template') . - " default file '{$_return}' for '{$source->type}:{$source->name}'"); + throw new SmartyException( + 'Default handler: Unable to load ' . + ($source->isConfig ? 'config' : 'template') . + " default file '{$_return}' for '{$source->type}:{$source->name}'" + ); } $source->name = $source->filepath = $_return; $source->uid = sha1($source->filepath); @@ -75,8 +79,10 @@ class Smarty_Internal_Method_RegisterDefaultTemplateHandler $source->handler = Smarty_Resource::load($source->smarty, 'eval'); } else { $source->exists = false; - throw new SmartyException('Default handler: No ' . ($source->isConfig ? 'config' : 'template') . - " default content for '{$source->type}:{$source->name}'"); + throw new SmartyException( + 'Default handler: No ' . ($source->isConfig ? 'config' : 'template') . + " default content for '{$source->type}:{$source->name}'" + ); } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerfilter.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerfilter.php index 77e41f37c..c0f9fff10 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerfilter.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerfilter.php @@ -33,9 +33,9 @@ class Smarty_Internal_Method_RegisterFilter * @link http://www.smarty.net/docs/en/api.register.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type filter type - * @param callback $callback - * @param string|null $name optional filter name + * @param string $type filter type + * @param callback $callback + * @param string|null $name optional filter name * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -55,7 +55,7 @@ class Smarty_Internal_Method_RegisterFilter /** * Return internal filter name * - * @param callback $function_name + * @param callback $function_name * * @return string internal filter name */ @@ -63,7 +63,6 @@ class Smarty_Internal_Method_RegisterFilter { if (is_array($function_name)) { $_class_name = (is_object($function_name[ 0 ]) ? get_class($function_name[ 0 ]) : $function_name[ 0 ]); - return $_class_name . '_' . $function_name[ 1 ]; } elseif (is_string($function_name)) { return $function_name; @@ -85,4 +84,4 @@ class Smarty_Internal_Method_RegisterFilter throw new SmartyException("Illegal filter type '{$type}'"); } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerobject.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerobject.php index ba699b219..4646e4f22 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerobject.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerobject.php @@ -25,32 +25,44 @@ class Smarty_Internal_Method_RegisterObject * @link http://www.smarty.net/docs/en/api.register.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $object_name - * @param object $object the + * @param string $object_name + * @param object $object the * referenced - * PHP object to + * PHP + * object + * to * register - * @param array $allowed_methods_properties list of + * + * @param array $allowed_methods_properties list of * allowed * methods - * (empty = all) - * @param bool $format smarty + * (empty + * = all) + * + * @param bool $format smarty * argument - * format, else + * format, + * else * traditional - * @param array $block_methods list of + * + * @param array $block_methods list of * block-methods * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException */ - public function registerObject(Smarty_Internal_TemplateBase $obj, $object_name, $object, - $allowed_methods_properties = array(), $format = true, $block_methods = array()) - { + public function registerObject( + Smarty_Internal_TemplateBase $obj, + $object_name, + $object, + $allowed_methods_properties = array(), + $format = true, + $block_methods = array() + ) { $smarty = $obj->_getSmartyObj(); // test if allowed methods callable if (!empty($allowed_methods_properties)) { - foreach ((array) $allowed_methods_properties as $method) { + foreach ((array)$allowed_methods_properties as $method) { if (!is_callable(array($object, $method)) && !property_exists($object, $method)) { throw new SmartyException("Undefined method or property '$method' in registered object"); } @@ -58,7 +70,7 @@ class Smarty_Internal_Method_RegisterObject } // test if block methods callable if (!empty($block_methods)) { - foreach ((array) $block_methods as $method) { + foreach ((array)$block_methods as $method) { if (!is_callable(array($object, $method))) { throw new SmartyException("Undefined method '$method' in registered object"); } @@ -66,7 +78,7 @@ class Smarty_Internal_Method_RegisterObject } // register the object $smarty->registered_objects[ $object_name ] = - array($object, (array) $allowed_methods_properties, (boolean) $format, (array) $block_methods); + array($object, (array)$allowed_methods_properties, (boolean)$format, (array)$block_methods); return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerplugin.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerplugin.php index 64bf0ef15..f987f6da5 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerplugin.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerplugin.php @@ -25,27 +25,32 @@ class Smarty_Internal_Method_RegisterPlugin * @link http://www.smarty.net/docs/en/api.register.plugin.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type plugin type - * @param string $name name of template tag - * @param callback $callback PHP callback to register - * @param bool $cacheable if true (default) this + * @param string $type plugin type + * @param string $name name of template tag + * @param callback $callback PHP callback to register + * @param bool $cacheable if true (default) this * function is cache able - * @param mixed $cache_attr caching attributes if any + * @param mixed $cache_attr caching attributes if any * * @return \Smarty|\Smarty_Internal_Template * @throws SmartyException when the plugin tag is invalid */ - public function registerPlugin(Smarty_Internal_TemplateBase $obj, $type, $name, $callback, $cacheable = true, - $cache_attr = null) - { + public function registerPlugin( + Smarty_Internal_TemplateBase $obj, + $type, + $name, + $callback, + $cacheable = true, + $cache_attr = null + ) { $smarty = $obj->_getSmartyObj(); if (isset($smarty->registered_plugins[ $type ][ $name ])) { throw new SmartyException("Plugin tag '{$name}' already registered"); } elseif (!is_callable($callback)) { throw new SmartyException("Plugin '{$name}' not callable"); } else { - $smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool) $cacheable, (array) $cache_attr); + $smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool)$cacheable, (array)$cache_attr); } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerresource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerresource.php index 44534b738..7c7d0f78a 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerresource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_registerresource.php @@ -25,11 +25,13 @@ class Smarty_Internal_Method_RegisterResource * @link http://www.smarty.net/docs/en/api.register.resource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $name name of resource type - * @param Smarty_Resource|array $resource_handler or instance of - * Smarty_Resource, or - * array of callbacks to - * handle resource + * @param string $name name of resource type + * @param Smarty_Resource|array $resource_handler or instance of + * Smarty_Resource, + * or array of + * callbacks to + * handle + * resource * (deprecated) * * @return \Smarty|\Smarty_Internal_Template @@ -41,4 +43,4 @@ class Smarty_Internal_Method_RegisterResource $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false); return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setautoloadfilters.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setautoloadfilters.php index 29653b08e..2972f3ce1 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setautoloadfilters.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setautoloadfilters.php @@ -31,11 +31,12 @@ class Smarty_Internal_Method_SetAutoloadFilters * @api Smarty::setAutoloadFilters() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the - * filter type to set. Defaults to - * none treating $filters' keys as - * the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify + * the filter type to set. + * Defaults to none treating + * $filters' keys as the + * appropriate types * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -45,12 +46,12 @@ class Smarty_Internal_Method_SetAutoloadFilters $smarty = $obj->_getSmartyObj(); if ($type !== null) { $this->_checkFilterType($type); - $smarty->autoload_filters[ $type ] = (array) $filters; + $smarty->autoload_filters[ $type ] = (array)$filters; } else { - foreach ((array) $filters as $type => $value) { + foreach ((array)$filters as $type => $value) { $this->_checkFilterType($type); } - $smarty->autoload_filters = (array) $filters; + $smarty->autoload_filters = (array)$filters; } return $obj; } @@ -68,4 +69,4 @@ class Smarty_Internal_Method_SetAutoloadFilters throw new SmartyException("Illegal filter type '{$type}'"); } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdebugtemplate.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdebugtemplate.php index 76c87deb6..cc9d23e2a 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdebugtemplate.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdebugtemplate.php @@ -24,7 +24,7 @@ class Smarty_Internal_Method_SetDebugTemplate * @api Smarty::setDebugTemplate() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $tpl_name + * @param string $tpl_name * * @return \Smarty|\Smarty_Internal_Template * @throws SmartyException if file is not readable @@ -38,4 +38,4 @@ class Smarty_Internal_Method_SetDebugTemplate $smarty->debug_tpl = $tpl_name; return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php index 81434b968..eadc2de1b 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_setdefaultmodifiers.php @@ -24,7 +24,7 @@ class Smarty_Internal_Method_SetDefaultModifiers * @api Smarty::setDefaultModifiers() * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param array|string $modifiers modifier or list of modifiers + * @param array|string $modifiers modifier or list of modifiers * to set * * @return \Smarty|\Smarty_Internal_Template @@ -32,7 +32,7 @@ class Smarty_Internal_Method_SetDefaultModifiers public function setDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers) { $smarty = $obj->_getSmartyObj(); - $smarty->default_modifiers = (array) $modifiers; + $smarty->default_modifiers = (array)$modifiers; return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unloadfilter.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unloadfilter.php index 1a5fdf19b..55e1596be 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unloadfilter.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unloadfilter.php @@ -19,8 +19,8 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil * @link http://www.smarty.net/docs/en/api.unload.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type filter type - * @param string $name filter name + * @param string $type filter type + * @param string $name filter name * * @return Smarty_Internal_TemplateBase * @throws \SmartyException @@ -32,7 +32,7 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil if (isset($smarty->registered_filters[ $type ])) { $_filter_name = "smarty_{$type}filter_{$name}"; if (isset($smarty->registered_filters[ $type ][ $_filter_name ])) { - unset ($smarty->registered_filters[ $type ][ $_filter_name ]); + unset($smarty->registered_filters[ $type ][ $_filter_name ]); if (empty($smarty->registered_filters[ $type ])) { unset($smarty->registered_filters[ $type ]); } @@ -40,4 +40,4 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregistercacheresource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregistercacheresource.php index 1a157ffb6..b99903867 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregistercacheresource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregistercacheresource.php @@ -21,8 +21,8 @@ class Smarty_Internal_Method_UnregisterCacheResource /** * Registers a resource to fetch a template * - * @api Smarty::unregisterCacheResource() - * @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl + * @api Smarty::unregisterCacheResource() + * @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param $name @@ -37,4 +37,4 @@ class Smarty_Internal_Method_UnregisterCacheResource } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterfilter.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterfilter.php index fcc4e5d89..9cb494a52 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterfilter.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterfilter.php @@ -19,8 +19,8 @@ class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_Reg * @link http://www.smarty.net/docs/en/api.unregister.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type filter type - * @param callback|string $callback + * @param string $type filter type + * @param callback|string $callback * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -40,4 +40,4 @@ class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_Reg } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterobject.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterobject.php index 76d48661e..1e592b339 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterobject.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterobject.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_UnregisterObject * @link http://www.smarty.net/docs/en/api.unregister.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $object_name name of object + * @param string $object_name name of object * * @return \Smarty|\Smarty_Internal_Template */ @@ -37,4 +37,4 @@ class Smarty_Internal_Method_UnregisterObject } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterplugin.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterplugin.php index b5f0d505b..f39e31678 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterplugin.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterplugin.php @@ -25,8 +25,8 @@ class Smarty_Internal_Method_UnregisterPlugin * @link http://www.smarty.net/docs/en/api.unregister.plugin.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type plugin type - * @param string $name name of template tag + * @param string $type plugin type + * @param string $name name of template tag * * @return \Smarty|\Smarty_Internal_Template */ @@ -38,4 +38,4 @@ class Smarty_Internal_Method_UnregisterPlugin } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterresource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterresource.php index ed4801d48..a79db4299 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterresource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_unregisterresource.php @@ -25,7 +25,7 @@ class Smarty_Internal_Method_UnregisterResource * @link http://www.smarty.net/docs/en/api.unregister.resource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj - * @param string $type name of resource type + * @param string $type name of resource type * * @return \Smarty|\Smarty_Internal_Template */ @@ -37,4 +37,4 @@ class Smarty_Internal_Method_UnregisterResource } return $obj; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_nocache_insert.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_nocache_insert.php index 2629d51f7..88694dcfd 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_nocache_insert.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_nocache_insert.php @@ -19,11 +19,11 @@ class Smarty_Internal_Nocache_Insert /** * Compiles code for the {insert} tag into cache file * - * @param string $_function insert function name - * @param array $_attr array with parameter - * @param Smarty_Internal_Template $_template template object - * @param string $_script script name to load or 'null' - * @param string $_assign optional variable name + * @param string $_function insert function name + * @param array $_attr array with parameter + * @param Smarty_Internal_Template $_template template object + * @param string $_script script name to load or 'null' + * @param string $_assign optional variable name * * @return string compiled code */ @@ -46,7 +46,6 @@ class Smarty_Internal_Nocache_Insert while ($_tpl->_isSubTpl()) { $_tpl = $_tpl->parent; } - return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/"; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree.php index b3e202efb..9f7678526 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree.php @@ -16,7 +16,6 @@ */ abstract class Smarty_Internal_ParseTree { - /** * Buffer content * @@ -48,7 +47,4 @@ abstract class Smarty_Internal_ParseTree $this->data = null; $this->subtrees = null; } - } - - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_dq.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_dq.php index a57e629c6..8655f5869 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_dq.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_dq.php @@ -1,5 +1,4 @@ <?php - /** * Double quoted string inside a tag. * @@ -40,17 +39,21 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree public function append_subtree(Smarty_Internal_Templateparser $parser, Smarty_Internal_ParseTree $subtree) { $last_subtree = count($this->subtrees) - 1; - if ($last_subtree >= 0 && $this->subtrees[ $last_subtree ] instanceof Smarty_Internal_ParseTree_Tag && - $this->subtrees[ $last_subtree ]->saved_block_nesting < $parser->block_nesting_level + if ($last_subtree >= 0 && $this->subtrees[ $last_subtree ] instanceof Smarty_Internal_ParseTree_Tag + && $this->subtrees[ $last_subtree ]->saved_block_nesting < $parser->block_nesting_level ) { if ($subtree instanceof Smarty_Internal_ParseTree_Code) { $this->subtrees[ $last_subtree ]->data = - $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data, - '<?php echo ' . $subtree->data . ';?>'); + $parser->compiler->appendCode( + $this->subtrees[ $last_subtree ]->data, + '<?php echo ' . $subtree->data . ';?>' + ); } elseif ($subtree instanceof Smarty_Internal_ParseTree_DqContent) { $this->subtrees[ $last_subtree ]->data = - $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data, - '<?php echo "' . $subtree->data . '";?>'); + $parser->compiler->appendCode( + $this->subtrees[ $last_subtree ]->data, + '<?php echo "' . $subtree->data . '";?>' + ); } else { $this->subtrees[ $last_subtree ]->data = $parser->compiler->appendCode($this->subtrees[ $last_subtree ]->data, $subtree->data); @@ -82,14 +85,11 @@ class Smarty_Internal_ParseTree_Dq extends Smarty_Internal_ParseTree } else { $more_php = $subtree->to_smarty_php($parser); } - $code .= $more_php; - if (!$subtree instanceof Smarty_Internal_ParseTree_DqContent) { $parser->compiler->has_variable_string = true; } } - return $code; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_tag.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_tag.php index 8e19ec294..e6c755604 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_tag.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_tag.php @@ -18,7 +18,6 @@ */ class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree { - /** * Saved block nesting level * @@ -63,7 +62,6 @@ class Smarty_Internal_ParseTree_Tag extends Smarty_Internal_ParseTree $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); - return $var; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php index 26612d4c7..8e716bd5d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php @@ -18,17 +18,15 @@ */ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree { - /** * Array of template elements * * @var array */ - public $subtrees = Array(); + public $subtrees = array(); /** * Create root of parse tree for template elements - * */ public function __construct() { @@ -60,7 +58,7 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree public function append_array(Smarty_Internal_Templateparser $parser, $array = array()) { if (!empty($array)) { - $this->subtrees = array_merge($this->subtrees, (array) $array); + $this->subtrees = array_merge($this->subtrees, (array)$array); } } @@ -73,7 +71,7 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree public function prepend_array(Smarty_Internal_Templateparser $parser, $array = array()) { if (!empty($array)) { - $this->subtrees = array_merge((array) $array, $this->subtrees); + $this->subtrees = array_merge((array)$array, $this->subtrees); } } @@ -87,12 +85,12 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree public function to_smarty_php(Smarty_Internal_Templateparser $parser) { $code = ''; - for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key ++) { + for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) { 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 === '')) { - $key ++; + $key++; if ($this->subtrees[ $key ]->data === '') { continue; } @@ -101,15 +99,18 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree if ($subtree === '') { continue; } - $code .= preg_replace('/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', "<?php echo '\$1'; ?>\n", - $subtree); + $code .= preg_replace( + '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', + "<?php echo '\$1'; ?>\n", + $subtree + ); continue; } 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 === '')) { - $key ++; + $key++; if ($this->subtrees[ $key ]->data === '') { continue; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_eval.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_eval.php index d3088bdd9..3b552a589 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_eval.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_eval.php @@ -21,8 +21,8 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -37,7 +37,7 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled * * @uses decode() to decode base64 and urlencoded template_resources * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source */ @@ -49,7 +49,7 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled /** * decode base64 and urlencode * - * @param string $string template_resource to decode + * @param string $string template_resource to decode * * @return string decoded template_resource */ @@ -63,16 +63,15 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled return urldecode(substr($string, 10)); } } - return $string; } /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @param boolean $isConfig flag for config resource + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource * * @return string unique resource name */ @@ -84,7 +83,7 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string resource's basename */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_extends.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_extends.php index 23a624729..80946932e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_extends.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_extends.php @@ -88,9 +88,7 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource if (!$source->exists) { throw new SmartyException("Unable to load template '{$source->type}:{$source->name}'"); } - $_components = array_reverse($source->components); - $_content = ''; /* @var \Smarty_Template_Source $_s */ foreach ($_components as $_s) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_file.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_file.php index 9dcda7fcb..ae2060673 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_file.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_file.php @@ -18,10 +18,82 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + * + * @throws \SmartyException + */ + public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) + { + $source->filepath = $this->buildFilepath($source, $_template); + if ($source->filepath !== false) { + if (isset($source->smarty->security_policy) && is_object($source->smarty->security_policy)) { + $source->smarty->security_policy->isTrustedResourceDir($source->filepath, $source->isConfig); + } + $source->exists = true; + $source->uid = sha1( + $source->filepath . ($source->isConfig ? $source->smarty->_joined_config_dir : + $source->smarty->_joined_template_dir) + ); + $source->timestamp = filemtime($source->filepath); + } else { + $source->timestamp = $source->exists = false; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + if (!$source->exists) { + $source->timestamp = $source->exists = is_file($source->filepath); + } + if ($source->exists) { + $source->timestamp = filemtime($source->filepath); + } + } + + /** + * Load template's source from file into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + if ($source->exists) { + return file_get_contents($source->filepath); + } + throw new SmartyException( + 'Unable to read ' . ($source->isConfig ? 'config' : 'template') . + " {$source->type} '{$source->name}'" + ); + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return basename($source->filepath); + } + + /** * build template filepath by traversing the template_dir array * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return string fully qualified filepath * @throws SmartyException @@ -35,16 +107,17 @@ class Smarty_Internal_Resource_File extends Smarty_Resource return is_file($file) ? $file : false; } // go relative to a given template? - if ($file[ 0 ] === '.' && $_template && $_template->_isSubTpl() && - preg_match('#^[.]{1,2}[\\\/]#', $file) + if ($file[ 0 ] === '.' && $_template && $_template->_isSubTpl() + && preg_match('#^[.]{1,2}[\\\/]#', $file) ) { - if ($_template->parent->source->type !== 'file' && $_template->parent->source->type !== 'extends' && - !isset($_template->parent->_cache[ 'allow_relative_path' ]) + if ($_template->parent->source->type !== 'file' && $_template->parent->source->type !== 'extends' + && !isset($_template->parent->_cache[ 'allow_relative_path' ]) ) { throw new SmartyException("Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'"); } // normalize path - $path = $source->smarty->_realpath(dirname($_template->parent->source->filepath) . DIRECTORY_SEPARATOR . $file); + $path = + $source->smarty->_realpath(dirname($_template->parent->source->filepath) . DIRECTORY_SEPARATOR . $file); // files relative to a template only get one shot return is_file($path) ? $path : false; } @@ -52,7 +125,6 @@ class Smarty_Internal_Resource_File extends Smarty_Resource if (strpos($file, DIRECTORY_SEPARATOR === '/' ? '\\' : '/') !== false) { $file = str_replace(DIRECTORY_SEPARATOR === '/' ? '\\' : '/', DIRECTORY_SEPARATOR, $file); } - $_directories = $source->smarty->getTemplateDir(null, $source->isConfig); // template_dir index? if ($file[ 0 ] === '[' && preg_match('#^\[([^\]]+)\](.+)$#', $file, $fileMatch)) { @@ -66,7 +138,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource $_index_dirs[] = $_directories[ $index ]; } elseif (is_numeric($index)) { // try numeric index - $index = (int) $index; + $index = (int)$index; if (isset($_directories[ $index ])) { $_index_dirs[] = $_directories[ $index ]; } else { @@ -85,7 +157,6 @@ class Smarty_Internal_Resource_File extends Smarty_Resource $_directories = $_index_dirs; } } - // relative file name? foreach ($_directories as $_directory) { $path = $_directory . $file; @@ -106,73 +177,4 @@ class Smarty_Internal_Resource_File extends Smarty_Resource } return false; } - - /** - * populate Source Object with meta data from Resource - * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * - * @throws \SmartyException - */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) - { - $source->filepath = $this->buildFilepath($source, $_template); - - if ($source->filepath !== false) { - if (isset($source->smarty->security_policy) && is_object($source->smarty->security_policy)) { - $source->smarty->security_policy->isTrustedResourceDir($source->filepath, $source->isConfig); - } - $source->exists = true; - $source->uid = sha1($source->filepath . ($source->isConfig ? $source->smarty->_joined_config_dir : - $source->smarty->_joined_template_dir)); - $source->timestamp = filemtime($source->filepath); - } else { - $source->timestamp = $source->exists = false; - } - } - - /** - * populate Source Object with timestamp and exists from Resource - * - * @param Smarty_Template_Source $source source object - */ - public function populateTimestamp(Smarty_Template_Source $source) - { - if (!$source->exists) { - $source->timestamp = $source->exists = is_file($source->filepath); - } - if ($source->exists) { - $source->timestamp = filemtime($source->filepath); - } - } - - /** - * Load template's source from file into current template object - * - * @param Smarty_Template_Source $source source object - * - * @return string template source - * @throws SmartyException if source cannot be loaded - */ - public function getContent(Smarty_Template_Source $source) - { - if ($source->exists) { - return file_get_contents($source->filepath); - } - throw new SmartyException('Unable to read ' . ($source->isConfig ? 'config' : 'template') . - " {$source->type} '{$source->name}'"); - } - - /** - * Determine basename for compiled filename - * - * @param Smarty_Template_Source $source source object - * - * @return string resource's basename - */ - public function getBasename(Smarty_Template_Source $source) - { - return basename($source->filepath); - } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_php.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_php.php index 6f685abe4..9d98ae181 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_php.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_php.php @@ -43,7 +43,7 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File /** * Load template's source from file into current template object * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source * @throws SmartyException if source cannot be loaded @@ -68,16 +68,18 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File $compiled->timestamp = $_template->source->timestamp; $compiled->exists = $_template->source->exists; $compiled->file_dependency[ $_template->source->uid ] = - array($compiled->filepath, - $compiled->timestamp, - $_template->source->type,); + array( + $compiled->filepath, + $compiled->timestamp, + $_template->source->type, + ); } /** * Render and output the template (without using the compiler) * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return void * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled @@ -88,22 +90,25 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File throw new SmartyException('PHP templates are disabled'); } if (!$source->exists) { - throw new SmartyException("Unable to load template '{$source->type}:{$source->name}'" . - ($_template->_isSubTpl() ? " in '{$_template->parent->template_resource}'" : '')); + throw new SmartyException( + "Unable to load template '{$source->type}:{$source->name}'" . + ($_template->_isSubTpl() ? " in '{$_template->parent->template_resource}'" : '') + ); } - // prepare variables extract($_template->getTemplateVars()); - // include PHP template with short open tags enabled if (function_exists('ini_set')) { ini_set('short_open_tag', '1'); } - /** @var Smarty_Internal_Template $_smarty_template + /** + * + * + * @var Smarty_Internal_Template $_smarty_template * used in included file */ $_smarty_template = $_template; - include($source->filepath); + include $source->filepath; if (function_exists('ini_set')) { ini_set('short_open_tag', $this->short_open_tag); } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php index 8535257ab..df526101f 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php @@ -21,8 +21,8 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -37,7 +37,7 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource /** * populate Source Object with timestamp and exists from Resource * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return void */ @@ -50,7 +50,7 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource /** * Get timestamp (epoch) the template source was modified * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp */ @@ -58,16 +58,17 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { // return timestamp $time_stamp = false; - call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 1 ], - array($source->name, &$time_stamp, $source->smarty)); - - return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp; + call_user_func_array( + $source->smarty->registered_resources[ $source->type ][ 0 ][ 1 ], + array($source->name, &$time_stamp, $source->smarty) + ); + return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp; } /** * Load template's source by invoking the registered callback into current template object * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source * @throws SmartyException if source cannot be loaded @@ -76,19 +77,20 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { // return template string $content = null; - $t = call_user_func_array($source->smarty->registered_resources[ $source->type ][ 0 ][ 0 ], - array($source->name, &$content, $source->smarty)); + $t = call_user_func_array( + $source->smarty->registered_resources[ $source->type ][ 0 ][ 0 ], + array($source->name, &$content, $source->smarty) + ); if (is_bool($t) && !$t) { throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); } - return $content; } /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string resource's basename */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_stream.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_stream.php index f358db01d..9956bd073 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_stream.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_stream.php @@ -26,7 +26,6 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled * @param Smarty_Internal_Template $_template template object * * @return void - * @throws \SmartyException */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) { @@ -46,7 +45,6 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled * @param Smarty_Template_Source $source source object * * @return string template source - * @throws SmartyException if source cannot be loaded */ public function getContent(Smarty_Template_Source $source) { @@ -58,7 +56,6 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled $t .= $current_line; } fclose($fp); - return $t; } else { return false; @@ -68,9 +65,9 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @param boolean $isConfig flag for config resource + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource * * @return string unique resource name */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_string.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_string.php index 0175d5182..3fecbb7ef 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_string.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_string.php @@ -21,8 +21,8 @@ class Smarty_Internal_Resource_String extends Smarty_Resource /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * * @return void */ @@ -37,7 +37,7 @@ class Smarty_Internal_Resource_String extends Smarty_Resource * * @uses decode() to decode base64 and urlencoded template_resources * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source */ @@ -49,7 +49,7 @@ class Smarty_Internal_Resource_String extends Smarty_Resource /** * decode base64 and urlencode * - * @param string $string template_resource to decode + * @param string $string template_resource to decode * * @return string decoded template_resource */ @@ -63,16 +63,15 @@ class Smarty_Internal_Resource_String extends Smarty_Resource return urldecode(substr($string, 10)); } } - return $string; } /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @param boolean $isConfig flag for config resource + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource * * @return string unique resource name */ @@ -85,7 +84,7 @@ class Smarty_Internal_Resource_String extends Smarty_Resource * Determine basename for compiled filename * Always returns an empty string. * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string resource's basename */ @@ -107,4 +106,3 @@ class Smarty_Internal_Resource_String extends Smarty_Resource return false; } } - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cachemodify.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cachemodify.php index dfbf7115b..6e12d2ae1 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cachemodify.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cachemodify.php @@ -6,7 +6,6 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * **/ class Smarty_Internal_Runtime_CacheModify { @@ -15,7 +14,7 @@ class Smarty_Internal_Runtime_CacheModify * * @param \Smarty_Template_Cached $cached * @param \Smarty_Internal_Template $_template - * @param string $content + * @param string $content * * @throws \Exception * @throws \SmartyException @@ -32,17 +31,15 @@ class Smarty_Internal_Runtime_CacheModify case 'fpm-fcgi': // php-fpm >= 5.3.3 header('Status: 304 Not Modified'); break; - case 'cli': - if ( /* ^phpunit */ + if (/* ^phpunit */ !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */ ) { $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified'; } break; - default: - if ( /* ^phpunit */ + if (/* ^phpunit */ !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */ ) { $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = '304 Not Modified'; @@ -54,7 +51,7 @@ class Smarty_Internal_Runtime_CacheModify } else { switch (PHP_SAPI) { case 'cli': - if ( /* ^phpunit */ + if (/* ^phpunit */ !empty($_SERVER[ 'SMARTY_PHPUNIT_DISABLE_HEADERS' ]) /* phpunit$ */ ) { $_SERVER[ 'SMARTY_PHPUNIT_HEADERS' ][] = diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php index a9ff5789a..287096438 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_cacheresourcefile.php @@ -6,6 +6,7 @@ * @subpackage PluginsInternal * @author Uwe Tews */ + /** * Smarty Internal Runtime Cache Resource File Class * @@ -41,7 +42,7 @@ class Smarty_Internal_Runtime_CacheResourceFile $_cache_id_parts_count = count($_cache_id_parts); if ($smarty->use_sub_dirs) { foreach ($_cache_id_parts as $id_part) { - $_dir .= $id_part . DIRECTORY_SEPARATOR; + $_dir .= $id_part . '/'; } } } @@ -88,8 +89,8 @@ class Smarty_Internal_Runtime_CacheResourceFile } } // check compile id - if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) || - $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id) + if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) + || $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id) ) { continue; } @@ -126,7 +127,7 @@ class Smarty_Internal_Runtime_CacheResourceFile && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) ) { opcache_invalidate($_filepath, true); - } else if (function_exists('apc_delete_file')) { + } elseif (function_exists('apc_delete_file')) { apc_delete_file($_filepath); } } @@ -135,4 +136,4 @@ class Smarty_Internal_Runtime_CacheResourceFile } return $_count; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php index 80ffa35b2..c9dca83d9 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_capture.php @@ -64,10 +64,12 @@ class Smarty_Internal_Runtime_Capture if (!$this->isRegistered) { $this->register($_template); } - $this->captureStack[] = array($buffer, - $assign, - $append); - $this->captureCount ++; + $this->captureStack[] = array( + $buffer, + $assign, + $append + ); + $this->captureCount++; ob_start(); } @@ -78,10 +80,14 @@ class Smarty_Internal_Runtime_Capture */ private function register(Smarty_Internal_Template $_template) { - $_template->startRenderCallbacks[] = array($this, - 'startRender'); - $_template->endRenderCallbacks[] = array($this, - 'endRender'); + $_template->startRenderCallbacks[] = array( + $this, + 'startRender' + ); + $_template->endRenderCallbacks[] = array( + $this, + 'endRender' + ); $this->startRender($_template); $this->isRegistered = true; } @@ -108,7 +114,7 @@ class Smarty_Internal_Runtime_Capture { if ($this->captureCount) { list($buffer, $assign, $append) = array_pop($this->captureStack); - $this->captureCount --; + $this->captureCount--; if (isset($assign)) { $_template->assign($assign, ob_get_contents()); } @@ -137,7 +143,7 @@ class Smarty_Internal_Runtime_Capture * Return content of named capture buffer by key or as array * * @param \Smarty_Internal_Template $_template - * @param string|null $name + * @param string|null $name * * @return string|string[]|null */ @@ -165,5 +171,4 @@ class Smarty_Internal_Runtime_Capture $this->captureCount = array_pop($this->countStack); } } - -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php index f792496f9..983ca6180 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -25,9 +25,13 @@ class Smarty_Internal_Runtime_CodeFrame * * @return string */ - public function create(Smarty_Internal_Template $_template, $content = '', $functions = '', $cache = false, - Smarty_Internal_TemplateCompilerBase $compiler = null) - { + public function create( + Smarty_Internal_Template $_template, + $content = '', + $functions = '', + $cache = false, + Smarty_Internal_TemplateCompilerBase $compiler = null + ) { // build property code $properties[ 'version' ] = Smarty::SMARTY_VERSION; $properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true)); @@ -35,14 +39,14 @@ class Smarty_Internal_Runtime_CodeFrame $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code; $properties[ 'file_dependency' ] = $_template->compiled->file_dependency; $properties[ 'includes' ] = $_template->compiled->includes; - } else { + } else { $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code; $properties[ 'file_dependency' ] = $_template->cached->file_dependency; $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; } $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') . ')'; @@ -56,11 +60,6 @@ class Smarty_Internal_Runtime_CodeFrame if ($cache && isset($_template->smarty->ext->_tplFunction)) { $output .= "\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " . var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . ");\n"; - - } - // include code for required plugins - if (!$cache && isset($compiler)) { - $output .= $compiler->compileRequiredPlugins(); } $output .= "?>"; $output .= $content; @@ -69,11 +68,15 @@ class Smarty_Internal_Runtime_CodeFrame $output .= "<?php }\n"; // remove unneeded PHP tags if (preg_match('/\s*\?>[\n]?<\?php\s*/', $output)) { - $curr_split = preg_split('/\s*\?>[\n]?<\?php\s*/', - $output); - preg_match_all('/\s*\?>[\n]?<\?php\s*/', - $output, - $curr_parts); + $curr_split = preg_split( + '/\s*\?>[\n]?<\?php\s*/', + $output + ); + preg_match_all( + '/\s*\?>[\n]?<\?php\s*/', + $output, + $curr_parts + ); $output = ''; foreach ($curr_split as $idx => $curr_output) { $output .= $curr_output; @@ -83,8 +86,10 @@ class Smarty_Internal_Runtime_CodeFrame } } if (preg_match('/\?>\s*$/', $output)) { - $curr_split = preg_split('/\?>\s*$/', - $output); + $curr_split = preg_split( + '/\?>\s*$/', + $output + ); $output = ''; foreach ($curr_split as $idx => $curr_output) { $output .= $curr_output; @@ -92,4 +97,4 @@ class Smarty_Internal_Runtime_CodeFrame } return $output; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php index 9d7d2db2e..9f868e1a4 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_filterhandler.php @@ -23,9 +23,9 @@ class Smarty_Internal_Runtime_FilterHandler * plugin filename format: filtertype.filtername.php * Smarty2 filter plugins could be used * - * @param string $type the type of filter ('pre','post','output') which shall run - * @param string $content the content which shall be processed by the filters - * @param Smarty_Internal_Template $template template object + * @param string $type the type of filter ('pre','post','output') which shall run + * @param string $content the content which shall be processed by the filters + * @param Smarty_Internal_Template $template template object * * @throws SmartyException * @return string the filtered content @@ -34,7 +34,7 @@ class Smarty_Internal_Runtime_FilterHandler { // loop over autoload filters of specified type if (!empty($template->smarty->autoload_filters[ $type ])) { - foreach ((array) $template->smarty->autoload_filters[ $type ] as $name) { + foreach ((array)$template->smarty->autoload_filters[ $type ] as $name) { $plugin_name = "Smarty_{$type}filter_{$name}"; if (function_exists($plugin_name)) { $callback = $plugin_name; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php index 8b60768bc..badead165 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_foreach.php @@ -6,11 +6,9 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * */ class Smarty_Internal_Runtime_Foreach { - /** * Stack of saved variables * @@ -34,24 +32,35 @@ class Smarty_Internal_Runtime_Foreach * * @return mixed $from */ - public function init(Smarty_Internal_Template $tpl, $from, $item, $needTotal = false, $key = null, $name = null, - $properties = array()) - { + public function init( + Smarty_Internal_Template $tpl, + $from, + $item, + $needTotal = false, + $key = null, + $name = null, + $properties = array() + ) { + $needTotal = $needTotal || isset($properties[ 'total' ]); $saveVars = array(); $total = null; if (!is_array($from)) { if (is_object($from)) { - $total = $this->count($from); + if ($needTotal) { + $total = $this->count($from); + } } else { settype($from, 'array'); } } if (!isset($total)) { - $total = empty($from) ? 0 : (($needTotal || isset($properties[ 'total' ])) ? count($from) : 1); + $total = empty($from) ? 0 : ($needTotal ? count($from) : 1); } if (isset($tpl->tpl_vars[ $item ])) { - $saveVars[ 'item' ] = array($item, - $tpl->tpl_vars[ $item ]); + $saveVars[ 'item' ] = array( + $item, + $tpl->tpl_vars[ $item ] + ); } $tpl->tpl_vars[ $item ] = new Smarty_Variable(null, $tpl->isRenderingCache); if ($total === 0) { @@ -59,8 +68,10 @@ class Smarty_Internal_Runtime_Foreach } else { if ($key) { if (isset($tpl->tpl_vars[ $key ])) { - $saveVars[ 'key' ] = array($key, - $tpl->tpl_vars[ $key ]); + $saveVars[ 'key' ] = array( + $key, + $tpl->tpl_vars[ $key ] + ); } $tpl->tpl_vars[ $key ] = new Smarty_Variable(null, $tpl->isRenderingCache); } @@ -71,8 +82,10 @@ class Smarty_Internal_Runtime_Foreach if ($name) { $namedVar = "__smarty_foreach_{$name}"; if (isset($tpl->tpl_vars[ $namedVar ])) { - $saveVars[ 'named' ] = array($namedVar, - $tpl->tpl_vars[ $namedVar ]); + $saveVars[ 'named' ] = array( + $namedVar, + $tpl->tpl_vars[ $namedVar ] + ); } $namedProp = array(); if (isset($properties[ 'total' ])) { @@ -82,7 +95,7 @@ class Smarty_Internal_Runtime_Foreach $namedProp[ 'iteration' ] = 0; } if (isset($properties[ 'index' ])) { - $namedProp[ 'index' ] = - 1; + $namedProp[ 'index' ] = -1; } if (isset($properties[ 'show' ])) { $namedProp[ 'show' ] = ($total > 0); @@ -94,10 +107,9 @@ class Smarty_Internal_Runtime_Foreach } /** - * * [util function] counts an array, arrayAccess/traversable or PDOStatement object * - * @param mixed $value + * @param mixed $value * * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 * for empty elements @@ -117,7 +129,7 @@ class Smarty_Internal_Runtime_Foreach } elseif ($value instanceof Traversable) { return iterator_count($value); } - return count((array) $value); + return count((array)$value); } /** @@ -144,8 +156,7 @@ class Smarty_Internal_Runtime_Foreach $tpl->tpl_vars[ $saveVars[ 'named' ][ 0 ] ] = $saveVars[ 'named' ][ 1 ]; } } - $levels --; + $levels--; } } - } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_getincludepath.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_getincludepath.php index 54b1bb3d5..5ae98304e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_getincludepath.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_getincludepath.php @@ -21,42 +21,49 @@ class Smarty_Internal_Runtime_GetIncludePath * @var string */ public $_include_path = ''; + /** * include path directory cache * * @var array */ public $_include_dirs = array(); + /** * include path directory cache * * @var array */ public $_user_dirs = array(); + /** * stream cache * * @var string[][] */ public $isFile = array(); + /** * stream cache * * @var string[] */ public $isPath = array(); + /** * stream cache * * @var int[] */ public $number = array(); + /** * status cache * * @var bool */ public $_has_stream_include = null; + /** * Number for array index * @@ -104,12 +111,11 @@ class Smarty_Internal_Runtime_GetIncludePath /** * Return full file path from PHP include_path * - * @param string[] $dirs - * @param string $file - * @param \Smarty $smarty + * @param string[] $dirs + * @param string $file + * @param \Smarty $smarty * * @return bool|string full filepath or false - * */ public function getIncludePath($dirs, $file, Smarty $smarty) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php index b593b78eb..6392d4cb3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php @@ -6,11 +6,9 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * **/ class Smarty_Internal_Runtime_Inheritance { - /** * State machine * - 0 idle next extends will create a new inheritance tree @@ -42,7 +40,7 @@ class Smarty_Internal_Runtime_Inheritance * * @var int */ - public $tplIndex = - 1; + public $tplIndex = -1; /** * Array of template source objects @@ -64,7 +62,6 @@ class Smarty_Internal_Runtime_Inheritance * @param \Smarty_Internal_Template $tpl template object of caller * @param bool $initChild if true init for child template * @param array $blockNames outer level block name - * */ public function init(Smarty_Internal_Template $tpl, $initChild, $blockNames = array()) { @@ -76,7 +73,6 @@ class Smarty_Internal_Runtime_Inheritance } ++$this->tplIndex; $this->sources[ $this->tplIndex ] = $tpl->source; - // start of child sub template(s) if ($initChild) { $this->state = 1; @@ -113,18 +109,21 @@ class Smarty_Internal_Runtime_Inheritance ob_end_clean(); $this->state = 2; } - if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends') || - $tpl->smarty->extends_recursion)) { - $tpl->_subTemplateRender($template, - $tpl->cache_id, - $tpl->compile_id, - $tpl->caching ? 9999 : 0, - $tpl->cache_lifetime, - array(), - 2, - false, - $uid, - $func); + if (isset($template) && (($tpl->parent->_isTplObj() && $tpl->parent->source->type !== 'extends') + || $tpl->smarty->extends_recursion) + ) { + $tpl->_subTemplateRender( + $template, + $tpl->cache_id, + $tpl->compile_id, + $tpl->caching ? 9999 : 0, + $tpl->cache_lifetime, + array(), + 2, + false, + $uid, + $func + ); } } @@ -166,9 +165,11 @@ class Smarty_Internal_Runtime_Inheritance * * @throws \SmartyException */ - public function process(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, - Smarty_Internal_Block $parent = null) - { + public function process( + Smarty_Internal_Template $tpl, + Smarty_Internal_Block $block, + Smarty_Internal_Block $parent = null + ) { if ($block->hide && !isset($block->child)) { return; } @@ -187,8 +188,8 @@ class Smarty_Internal_Runtime_Inheritance if ($block->prepend && isset($parent)) { $this->callParent($tpl, $block, '{block prepend}'); if ($block->append) { - if ($block->callsChild || !isset($block->child) || - ($block->child->hide && !isset($block->child->child)) + if ($block->callsChild || !isset($block->child) + || ($block->child->hide && !isset($block->child->child)) ) { $this->callBlock($block, $tpl); } else { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_make_nocache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_make_nocache.php index 65382772d..53069148d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_make_nocache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_make_nocache.php @@ -6,11 +6,9 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * */ class Smarty_Internal_Runtime_Make_Nocache { - /** * Save current variable value while rendering compiled template and inject nocache code to * assign variable value in cahed template @@ -38,8 +36,8 @@ class Smarty_Internal_Runtime_Make_Nocache * Store variable value saved while rendering compiled template in cached template context * * @param \Smarty_Internal_Template $tpl - * @param string $var variable name - * @param array $properties + * @param string $var variable name + * @param array $properties */ public function store(Smarty_Internal_Template $tpl, $var, $properties) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php index b86563cb3..e5f8e48f7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php @@ -6,7 +6,6 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * **/ class Smarty_Internal_Runtime_TplFunction { @@ -36,14 +35,14 @@ class Smarty_Internal_Runtime_TplFunction } if (function_exists($function)) { $this->saveTemplateVariables($tpl, $name); - $function ($tpl, $params); + $function($tpl, $params); $this->restoreTemplateVariables($tpl, $name); return; } // try to load template function dynamically if ($this->addTplFuncToCache($tpl, $name, $function)) { $this->saveTemplateVariables($tpl, $name); - $function ($tpl, $params); + $function($tpl, $params); $this->restoreTemplateVariables($tpl, $name); return; } @@ -55,8 +54,11 @@ class Smarty_Internal_Runtime_TplFunction * Register template functions defined by template * * @param \Smarty|\Smarty_Internal_Template|\Smarty_Internal_TemplateBase $obj - * @param array $tplFunctions source information array of template functions defined in template - * @param bool $override if true replace existing functions with same name + * @param array $tplFunctions source information array of + * template functions defined + * in template + * @param bool $override if true replace existing + * functions with same name */ public function registerTplFunctions(Smarty_Internal_TemplateBase $obj, $tplFunctions, $override = true) { @@ -90,7 +92,6 @@ class Smarty_Internal_Runtime_TplFunction } /** - * * Add template function to cache file for nocache calls * * @param Smarty_Internal_Template $tpl @@ -126,11 +127,18 @@ class Smarty_Internal_Runtime_TplFunction if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) { $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content); } - $tplPtr->smarty->ext->_updateCache->write($tplPtr, - preg_replace('/\s*\?>\s*$/', "\n", $content) . - "\n" . preg_replace(array('/^\s*<\?php\s+/', - '/\s*\?>\s*$/',), "\n", - $match[ 0 ])); + $tplPtr->smarty->ext->_updateCache->write( + $tplPtr, + preg_replace('/\s*\?>\s*$/', "\n", $content) . + "\n" . preg_replace( + array( + '/^\s*<\?php\s+/', + '/\s*\?>\s*$/', + ), + "\n", + $match[ 0 ] + ) + ); } } return true; @@ -144,7 +152,7 @@ class Smarty_Internal_Runtime_TplFunction * Save current template variables on stack * * @param \Smarty_Internal_Template $tpl - * @param string $name stack name + * @param string $name stack name */ public function saveTemplateVariables(Smarty_Internal_Template $tpl, $name) { @@ -156,7 +164,7 @@ class Smarty_Internal_Runtime_TplFunction * Restore saved variables into template objects * * @param \Smarty_Internal_Template $tpl - * @param string $name stack name + * @param string $name stack name */ public function restoreTemplateVariables(Smarty_Internal_Template $tpl, $name) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php index bb3e4e138..c1abbb321 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatecache.php @@ -6,7 +6,6 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * **/ class Smarty_Internal_Runtime_UpdateCache { @@ -15,7 +14,7 @@ class Smarty_Internal_Runtime_UpdateCache * * @param \Smarty_Template_Cached $cached * @param Smarty_Internal_Template $_template - * @param string $content + * @param string $content */ public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content) { @@ -65,35 +64,44 @@ class Smarty_Internal_Runtime_UpdateCache * * @throws \SmartyException */ - public function removeNoCacheHash(Smarty_Template_Cached $cached, - Smarty_Internal_Template $_template, - $no_output_filter) - { + public function removeNoCacheHash( + Smarty_Template_Cached $cached, + Smarty_Internal_Template $_template, + $no_output_filter + ) { $php_pattern = '/(<%|%>|<\?php|<\?|\?>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>)/'; $content = ob_get_clean(); $hash_array = $cached->hashes; - $hash_array[$_template->compiled->nocache_hash] = true; + $hash_array[ $_template->compiled->nocache_hash ] = true; $hash_array = array_keys($hash_array); $nocache_hash = '(' . implode('|', $hash_array) . ')'; $_template->cached->has_nocache_code = false; // get text between non-cached items $cache_split = - preg_split("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", - $content); + preg_split( + "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content + ); // get non-cached items - preg_match_all("!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", - $content, - $cache_parts); + preg_match_all( + "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content, + $cache_parts + ); $content = ''; // loop over items, stitch back together foreach ($cache_split as $curr_idx => $curr_split) { if (preg_match($php_pattern, $curr_split)) { // escape PHP tags in template content - $php_split = preg_split($php_pattern, - $curr_split); - preg_match_all($php_pattern, - $curr_split, - $php_parts); + $php_split = preg_split( + $php_pattern, + $curr_split + ); + preg_match_all( + $php_pattern, + $curr_split, + $php_parts + ); foreach ($php_split as $idx_php => $curr_php) { $content .= $curr_php; if (isset($php_parts[ 0 ][ $idx_php ])) { @@ -108,9 +116,9 @@ class Smarty_Internal_Runtime_UpdateCache $content .= $cache_parts[ 2 ][ $curr_idx ]; } } - if (!$no_output_filter && !$_template->cached->has_nocache_code && - (isset($_template->smarty->autoload_filters[ 'output' ]) || - isset($_template->smarty->registered_filters[ 'output' ])) + if (!$no_output_filter && !$_template->cached->has_nocache_code + && (isset($_template->smarty->autoload_filters[ 'output' ]) + || isset($_template->smarty->registered_filters[ 'output' ])) ) { $content = $_template->smarty->ext->_filterHandler->runFilter('output', $content, $_template); } @@ -162,7 +170,6 @@ class Smarty_Internal_Runtime_UpdateCache if ($_template->smarty->cache_locking) { $cached->handler->releaseLock($_template->smarty, $cached); } - return true; } $cached->content = null; @@ -171,7 +178,6 @@ class Smarty_Internal_Runtime_UpdateCache $cached->valid = false; $cached->processed = false; } - return false; } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php index 2d62c60bb..2240f97ca 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php @@ -6,25 +6,24 @@ * @package Smarty * @subpackage PluginsInternal * @author Uwe Tews - * **/ class Smarty_Internal_Runtime_UpdateScope { - /** * Update new assigned template or config variable in other effected scopes * - * @param Smarty_Internal_Template $tpl data object - * @param string|null $varName variable name - * @param int $tagScope tag scope to which bubble up variable value - * + * @param Smarty_Internal_Template $tpl data object + * @param string|null $varName variable name + * @param int $tagScope tag scope to which bubble up variable value */ public function _updateScope(Smarty_Internal_Template $tpl, $varName, $tagScope = 0) { if ($tagScope) { $this->_updateVarStack($tpl, $varName); $tagScope = $tagScope & ~Smarty::SCOPE_LOCAL; - if (!$tpl->scope && !$tagScope) return; + if (!$tpl->scope && !$tagScope) { + return; + } } $mergedScope = $tagScope | $tpl->scope; if ($mergedScope) { @@ -34,8 +33,9 @@ class Smarty_Internal_Runtime_UpdateScope // update scopes foreach ($this->_getAffectedScopes($tpl, $mergedScope) as $ptr) { $this->_updateVariableInOtherScope($ptr->tpl_vars, $tpl, $varName); - if($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) { - $this->_updateVarStack($ptr, $varName); } + if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) { + $this->_updateVarStack($ptr, $varName); + } } } } @@ -62,8 +62,8 @@ class Smarty_Internal_Runtime_UpdateScope $ptr = $ptr->parent; } while (isset($ptr) && $ptr->_isTplObj()) { - $_stack[] = $ptr; - $ptr = $ptr->parent; + $_stack[] = $ptr; + $ptr = $ptr->parent; } if ($mergedScope & Smarty::SCOPE_SMARTY) { if (isset($tpl->smarty)) { @@ -84,9 +84,9 @@ class Smarty_Internal_Runtime_UpdateScope /** * Update variable in other scope * - * @param array $tpl_vars template variable array + * @param array $tpl_vars template variable array * @param \Smarty_Internal_Template $from - * @param string $varName variable name + * @param string $varName variable name */ public function _updateVariableInOtherScope(&$tpl_vars, Smarty_Internal_Template $from, $varName) { @@ -109,7 +109,7 @@ class Smarty_Internal_Runtime_UpdateScope $i = 0; while (isset($tpl->_cache[ 'varStack' ][ $i ])) { $this->_updateVariableInOtherScope($tpl->_cache[ 'varStack' ][ $i ][ 'tpl' ], $tpl, $varName); - $i ++; + $i++; } } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php index dc9019f49..4383e6f38 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php @@ -6,6 +6,7 @@ * @subpackage PluginsInternal * @author Monte Ohrt */ + /** * Smarty Internal Write File Class * @@ -17,9 +18,9 @@ class Smarty_Internal_Runtime_WriteFile /** * Writes file in a safe way to disk * - * @param string $_filepath complete filepath - * @param string $_contents file content - * @param Smarty $smarty smarty instance + * @param string $_filepath complete filepath + * @param string $_contents file content + * @param Smarty $smarty smarty instance * * @throws SmartyException * @return boolean true diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index bdf74065d..21f4e3fdd 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -76,8 +76,8 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom /** * method to compile a Smarty template * - * @param mixed $_content template source - * @param bool $isTemplateSource + * @param mixed $_content template source + * @param bool $isTemplateSource * * @return bool true if compiling succeeded, false if it failed * @throws \SmartyCompilerException @@ -89,22 +89,32 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom then written to compiled files. */ // init the lexer/parser to compile the template $this->parser = - new $this->parser_class(new $this->lexer_class(str_replace(array("\r\n", - "\r"), "\n", $_content), $this), - $this); + new $this->parser_class( + new $this->lexer_class( + str_replace( + array( + "\r\n", + "\r" + ), + "\n", + $_content + ), + $this + ), + $this + ); if ($isTemplateSource && $this->template->caching) { $this->parser->insertPhpCode("<?php\n\$_smarty_tpl->compiled->nocache_hash = '{$this->nocache_hash}';\n?>\n"); } if (function_exists('mb_internal_encoding') && function_exists('ini_get') - && ((int) ini_get('mbstring.func_overload')) & 2 + && ((int)ini_get('mbstring.func_overload')) & 2 ) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } else { $mbEncoding = null; } - if ($this->smarty->_parserdebug) { $this->parser->PrintTrace(); $this->parser->lex->PrintTrace(); @@ -117,7 +127,6 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom } $this->parser->doParse($this->parser->lex->token, $this->parser->lex->value); } - // finish parsing process $this->parser->doParse(0, 0); if ($mbEncoding) { @@ -127,8 +136,10 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom if (count($this->_tag_stack) > 0) { // get stacked info list($openTag, $_data) = array_pop($this->_tag_stack); - $this->trigger_template_error("unclosed {$this->smarty->left_delimiter}" . $openTag . - "{$this->smarty->right_delimiter} tag"); + $this->trigger_template_error( + "unclosed {$this->smarty->left_delimiter}" . $openTag . + "{$this->smarty->right_delimiter} tag" + ); } // call post compile callbacks foreach ($this->postCompileCallbacks as $cb) { @@ -148,7 +159,6 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom * @param array $parameter optional parameter array * @param string $key optional key for callback * @param bool $replace if true replace existing keyed callback - * */ public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php index 21f60f991..bae22a7d5 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php @@ -27,6 +27,29 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { /** + * Template object cache + * + * @var Smarty_Internal_Template[] + */ + public static $tplObjCache = array(); + + /** + * Template object cache for Smarty::isCached() === true + * + * @var Smarty_Internal_Template[] + */ + public static $isCacheTplObj = array(); + + /** + * Sub template Info Cache + * - index name + * - value use count + * + * @var int[] + */ + public static $subTplInfo = array(); + + /** * This object type (Smarty = 1, template = 2, data = 4) * * @var int @@ -104,49 +127,34 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase public $endRenderCallbacks = array(); /** - * Template object cache - * - * @var Smarty_Internal_Template[] - */ - public static $tplObjCache = array(); - - /** - * Template object cache for Smarty::isCached() === true - * - * @var Smarty_Internal_Template[] - */ - public static $isCacheTplObj = array(); - - /** - * Sub template Info Cache - * - index name - * - value use count - * - * @var int[] - */ - public static $subTplInfo = array(); - - /** * Create template data object * Some of the global Smarty settings copied to template scope * It load the required template resources and caching plugins * * @param string $template_resource template resource string * @param Smarty $smarty Smarty instance - * @param null|\Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data $_parent back pointer to parent object - * with variables or null + * @param null|\Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data $_parent back pointer to parent + * object with variables or + * null * @param mixed $_cache_id cache id or null * @param mixed $_compile_id compile id or null * @param bool|int|null $_caching use caching? - * @param int|null $_cache_lifetime cache life-time in seconds + * @param int|null $_cache_lifetime cache life-time in + * seconds * @param bool $_isConfig * * @throws \SmartyException */ - public function __construct($template_resource, Smarty $smarty, Smarty_Internal_Data $_parent = null, - $_cache_id = null, $_compile_id = null, $_caching = null, $_cache_lifetime = null, - $_isConfig = false) - { + public function __construct( + $template_resource, + Smarty $smarty, + Smarty_Internal_Data $_parent = null, + $_cache_id = null, + $_compile_id = null, + $_caching = null, + $_cache_lifetime = null, + $_isConfig = false + ) { $this->smarty = $smarty; // Smarty parameter $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id; @@ -167,8 +175,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * render template * - * @param bool $no_output_filter if true do not run output filter - * @param null|bool $display true: display, false: fetch null: sub-template + * @param bool $no_output_filter if true do not run output filter + * @param null|bool $display true: display, false: fetch null: sub-template * * @return string * @throws \Exception @@ -184,8 +192,10 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } // checks if template exists if (!$this->source->exists) { - throw new SmartyException("Unable to load template '{$this->source->type}:{$this->source->name}'" . - ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : '')); + throw new SmartyException( + "Unable to load template '{$this->source->type}:{$this->source->name}'" . + ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : '') + ); } // disable caching for evaluated code if ($this->source->handler->recompiled) { @@ -193,8 +203,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } // read from cache or render 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 + if (!isset($this->cached) || $this->cached->cache_id !== $this->cache_id + || $this->cached->compile_id !== $this->compile_id ) { $this->loadCached(true); } @@ -205,16 +215,18 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } $this->compiled->render($this); } - // display or fetch if ($display) { if ($this->caching && $this->smarty->cache_modified_check) { - $this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this, - isset($content) ? $content : ob_get_clean()); + $this->smarty->ext->_cacheModify->cacheModifiedCheck( + $this->cached, + $this, + isset($content) ? $content : ob_get_clean() + ); } else { - if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && - !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ]) || - isset($this->smarty->registered_filters[ 'output' ])) + if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) + && !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ]) + || isset($this->smarty->registered_filters[ 'output' ])) ) { echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); } else { @@ -234,10 +246,10 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $this->smarty->_debug->display_debug($this, true); } } - if (!$no_output_filter && - (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && - (isset($this->smarty->autoload_filters[ 'output' ]) || - isset($this->smarty->registered_filters[ 'output' ])) + if (!$no_output_filter + && (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) + && (isset($this->smarty->autoload_filters[ 'output' ]) + || isset($this->smarty->registered_filters[ 'output' ])) ) { return $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); } @@ -263,9 +275,18 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase * @throws \Exception * @throws \SmartyException */ - public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope, - $forceTplCache, $uid = null, $content_func = null) - { + public function _subTemplateRender( + $template, + $cache_id, + $compile_id, + $caching, + $cache_lifetime, + $data, + $scope, + $forceTplCache, + $uid = null, + $content_func = null + ) { $tpl = clone $this; $tpl->parent = $this; $smarty = &$this->smarty; @@ -322,14 +343,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $tpl->scope = $scope; if (!isset(self::$tplObjCache[ $tpl->templateId ]) && !$tpl->source->handler->recompiled) { // check if template object should be cached - if ($forceTplCache || (isset(self::$subTplInfo[ $tpl->template_resource ]) && - self::$subTplInfo[ $tpl->template_resource ] > 1) || - ($tpl->_isSubTpl() && isset(self::$tplObjCache[ $tpl->parent->templateId ])) + if ($forceTplCache || (isset(self::$subTplInfo[ $tpl->template_resource ]) + && self::$subTplInfo[ $tpl->template_resource ] > 1) + || ($tpl->_isSubTpl() && isset(self::$tplObjCache[ $tpl->parent->templateId ])) ) { self::$tplObjCache[ $tpl->templateId ] = $tpl; } } - if (!empty($data)) { // set up variable values foreach ($data as $_key => $_val) { @@ -369,7 +389,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * Get called sub-templates and save call count - * */ public function _subTemplateRegister() { @@ -399,7 +418,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase * @param mixed $value value * @param bool $nocache nocache flag * @param int $scope scope into which variable shall be assigned - * */ public function _assignInScope($varName, $value, $nocache = false, $scope = 0) { @@ -426,15 +444,16 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase * * @throws \SmartyException */ - public function _checkPlugins($plugins) { + public function _checkPlugins($plugins) + { static $checked = array(); - foreach($plugins as $plugin) { + foreach ($plugins as $plugin) { $name = join('::', (array)$plugin[ 'function' ]); - if (!isset($checked[$name])) { - if (!is_callable($plugin['function'])) { - if (is_file($plugin['file'])) { - require_once $plugin['file']; - if (is_callable($plugin['function'])) { + if (!isset($checked[ $name ])) { + if (!is_callable($plugin[ 'function' ])) { + if (is_file($plugin[ 'file' ])) { + include_once $plugin[ 'file' ]; + if (is_callable($plugin[ 'function' ])) { $checked[ $name ] = true; } } @@ -458,8 +477,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase * - Check if compiled or cache file is valid * * @param \Smarty_Internal_Template $tpl - * @param array $properties special template properties - * @param bool $cache flag if called from cache file + * @param array $properties special template properties + * @param bool $cache flag if called from cache file * * @return bool flag if compiled or cache file is valid * @throws \SmartyException @@ -476,8 +495,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase return false; } $is_valid = true; - if (!empty($properties[ 'file_dependency' ]) && - ((!$cache && $tpl->compile_check) || $tpl->compile_check === Smarty::COMPILECHECK_ON) + if (!empty($properties[ 'file_dependency' ]) + && ((!$cache && $tpl->compile_check) || $tpl->compile_check === Smarty::COMPILECHECK_ON) ) { // check file dependencies at compiled code foreach ($properties[ 'file_dependency' ] as $_file_to_check) { @@ -507,8 +526,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } if ($cache) { // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc - if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties[ 'cache_lifetime' ] >= 0 && - (time() > ($tpl->cached->timestamp + $properties[ 'cache_lifetime' ])) + if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties[ 'cache_lifetime' ] >= 0 + && (time() > ($tpl->cached->timestamp + $properties[ 'cache_lifetime' ])) ) { $is_valid = false; } @@ -532,6 +551,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * Compiles the template * If the template is not evaluated the compiled template is saved on disk + * + * @throws \Exception */ public function compileTemplateSource() { @@ -564,6 +585,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * runtime error not matching capture tags + * + * @throws \SmartyException */ public function capture_error() { @@ -596,7 +619,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * Load inheritance object - * */ public function _loadInheritance() { @@ -607,7 +629,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * Unload inheritance object - * */ public function _cleanUp() { @@ -627,8 +648,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $this->smarty->loadPlugin($this->source->compiler_class); } $this->compiler = - new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, - $this->smarty); + new $this->source->compiler_class( + $this->source->template_lexer_class, + $this->source->template_parser_class, + $this->smarty + ); } /** @@ -638,7 +662,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase * @param array $args argument array * * @return mixed - * @throws SmartyException */ public function __call($name, $args) { @@ -651,60 +674,58 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } /** - * set Smarty property in template context + * get Smarty property in template context * * @param string $property_name property name - * @param mixed $value value * + * @return mixed|Smarty_Template_Cached * @throws SmartyException */ - public function __set($property_name, $value) + public function __get($property_name) { switch ($property_name) { case 'compiled': + $this->loadCompiled(); + return $this->compiled; case 'cached': + $this->loadCached(); + return $this->cached; case 'compiler': - $this->$property_name = $value; - return; + $this->loadCompiler(); + return $this->compiler; default: // Smarty property ? if (property_exists($this->smarty, $property_name)) { - $this->smarty->$property_name = $value; - return; + return $this->smarty->$property_name; } } - throw new SmartyException("invalid template property '$property_name'."); + throw new SmartyException("template property '$property_name' does not exist."); } /** - * get Smarty property in template context + * set Smarty property in template context * * @param string $property_name property name + * @param mixed $value value * - * @return mixed|Smarty_Template_Cached * @throws SmartyException */ - public function __get($property_name) + public function __set($property_name, $value) { switch ($property_name) { case 'compiled': - $this->loadCompiled(); - return $this->compiled; - case 'cached': - $this->loadCached(); - return $this->cached; - case 'compiler': - $this->loadCompiler(); - return $this->compiler; + $this->$property_name = $value; + return; default: // Smarty property ? if (property_exists($this->smarty, $property_name)) { - return $this->smarty->$property_name; + $this->smarty->$property_name = $value; + return; } } - throw new SmartyException("template property '$property_name' does not exist."); + throw new SmartyException("invalid template property '$property_name'."); } /** diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php index 6b959404c..4476f120f 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php @@ -11,8 +11,8 @@ /** * Class with shared smarty/template methods * - * @package Smarty - * @subpackage Template + * @package Smarty + * @subpackage Template * * @property int $_objType * @@ -20,7 +20,7 @@ * They are located in a corresponding Smarty_Internal_Method_xxxx class * * @method Smarty_Internal_TemplateBase addAutoloadFilters(mixed $filters, string $type = null) - * @method Smarty_Internal_TemplateBase addDefaultModifier(mixed $modifiers) + * @method Smarty_Internal_TemplateBase addDefaultModifiers(mixed $modifiers) * @method Smarty_Internal_TemplateBase addLiterals(mixed $literals) * @method Smarty_Internal_TemplateBase createData(Smarty_Internal_Data $parent = null, string $name = null) * @method array getAutoloadFilters(string $type = null) @@ -102,10 +102,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data /** * fetches a rendered Smarty template * - * @param string $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables * * @throws Exception * @throws SmartyException @@ -140,10 +140,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data * @api Smarty::isCached() * @link http://www.smarty.net/docs/en/api.is.cached.tpl * - * @param null|string|\Smarty_Internal_Template $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables + * @param null|string|\Smarty_Internal_Template $template the resource handle of the template file or template + * object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables * * @return bool cache status * @throws \Exception @@ -157,11 +158,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data /** * fetches a rendered Smarty template * - * @param string $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param string $function function type 0 = fetch, 1 = display, 2 = isCache + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param string $function function type 0 = fetch, 1 = display, 2 = isCache * * @return mixed * @throws \Exception @@ -185,7 +186,6 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data } else { // get template object $saveVars = false; - $template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false); if ($this->_objType === 1) { // set caching in template object @@ -246,8 +246,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data error_reporting($_smarty_old_error_level); } return $result; - } - catch (Exception $e) { + } catch (Exception $e) { while (ob_get_level() > $level) { ob_end_clean(); } @@ -264,14 +263,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data * @api Smarty::registerPlugin() * @link http://www.smarty.net/docs/en/api.register.plugin.tpl * - * @param string $type plugin type - * @param string $name name of template tag - * @param callback $callback PHP callback to register - * @param bool $cacheable if true (default) this function is cache able - * @param mixed $cache_attr caching attributes if any + * @param string $type plugin type + * @param string $name name of template tag + * @param callback $callback PHP callback to register + * @param bool $cacheable if true (default) this function is cache able + * @param mixed $cache_attr caching attributes if any * * @return \Smarty|\Smarty_Internal_Template - * @throws SmartyException when the plugin tag is invalid + * @throws \SmartyException */ public function registerPlugin($type, $name, $callback, $cacheable = true, $cache_attr = null) { @@ -284,11 +283,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data * @api Smarty::loadFilter() * @link http://www.smarty.net/docs/en/api.load.filter.tpl * - * @param string $type filter type - * @param string $name filter name + * @param string $type filter type + * @param string $name filter name * * @return bool - * @throws SmartyException if filter could not be loaded + * @throws \SmartyException */ public function loadFilter($type, $name) { @@ -301,9 +300,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data * @api Smarty::registerFilter() * @link http://www.smarty.net/docs/en/api.register.filter.tpl * - * @param string $type filter type - * @param callback $callback - * @param string|null $name optional filter name + * @param string $type filter type + * @param callback $callback + * @param string|null $name optional filter name * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException @@ -319,20 +318,30 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data * @api Smarty::registerObject() * @link http://www.smarty.net/docs/en/api.register.object.tpl * - * @param string $object_name - * @param object $object the referenced PHP object to register - * @param array $allowed_methods_properties list of allowed methods (empty = all) - * @param bool $format smarty argument format, else traditional - * @param array $block_methods list of block-methods + * @param string $object_name + * @param object $object the referenced PHP object to register + * @param array $allowed_methods_properties list of allowed methods (empty = all) + * @param bool $format smarty argument format, else traditional + * @param array $block_methods list of block-methods * * @return \Smarty|\Smarty_Internal_Template * @throws \SmartyException */ - public function registerObject($object_name, $object, $allowed_methods_properties = array(), $format = true, - $block_methods = array()) - { - return $this->ext->registerObject->registerObject($this, $object_name, $object, $allowed_methods_properties, - $format, $block_methods); + public function registerObject( + $object_name, + $object, + $allowed_methods_properties = array(), + $format = true, + $block_methods = array() + ) { + return $this->ext->registerObject->registerObject( + $this, + $object_name, + $object, + $allowed_methods_properties, + $format, + $block_methods + ); } /** @@ -374,6 +383,4 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { $this->cache_id = $cache_id; } - } - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php index 0d7284a0a..a72f3a4ab 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -16,8 +16,8 @@ * * @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode = '' * @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = '' - * @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false) - * @method unregisterPostCompileCallback($key) + * @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false) + * @method unregisterPostCompileCallback($key) */ abstract class Smarty_Internal_TemplateCompilerBase { @@ -26,31 +26,36 @@ abstract class Smarty_Internal_TemplateCompilerBase * * @var array */ - static $_tag_objects = array(); + public static $_tag_objects = array(); + /** * counter for prefix variable number * * @var int */ public static $prefixVariableNumber = 0; + /** * Smarty object * * @var Smarty */ public $smarty = null; + /** * Parser object * * @var Smarty_Internal_Templateparser */ public $parser = null; + /** * hash for nocache sections * * @var mixed */ public $nocache_hash = null; + /** * suppress generation of nocache code * @@ -71,174 +76,203 @@ abstract class Smarty_Internal_TemplateCompilerBase * @var array */ public $_tag_stack = array(); + /** * tag stack count * * @var array */ public $_tag_stack_count = array(); + /** * Plugins used by template * * @var array */ public $required_plugins = array('compiled' => array(), 'nocache' => array()); + /** * Required plugins stack * * @var array */ public $required_plugins_stack = array(); + /** * current template * * @var Smarty_Internal_Template */ public $template = null; + /** * merged included sub template data * * @var array */ public $mergedSubTemplatesData = array(); + /** * merged sub template code * * @var array */ public $mergedSubTemplatesCode = array(); + /** * collected template properties during compilation * * @var array */ public $templateProperties = array(); + /** * source line offset for error messages * * @var int */ public $trace_line_offset = 0; + /** * trace uid * * @var string */ public $trace_uid = ''; + /** * trace file path * * @var string */ public $trace_filepath = ''; + /** * stack for tracing file and line of nested {block} tags * * @var array */ public $trace_stack = array(); + /** * plugins loaded by default plugin handler * * @var array */ public $default_handler_plugins = array(); + /** * saved preprocessed modifier list * * @var mixed */ public $default_modifier_list = null; + /** * force compilation of complete template as nocache * * @var boolean */ public $forceNocache = false; + /** * flag if compiled template file shall we written * * @var bool */ public $write_compiled_code = true; + /** * Template functions * * @var array */ public $tpl_function = array(); + /** * called sub functions from template function * * @var array */ public $called_functions = array(); + /** * compiled template or block function code * * @var string */ public $blockOrFunctionCode = ''; + /** * php_handling setting either from Smarty or security * * @var int */ public $php_handling = 0; + /** * flags for used modifier plugins * * @var array */ public $modifier_plugins = array(); + /** * type of already compiled modifier * * @var array */ public $known_modifier_type = array(); + /** * parent compiler object for merged subtemplates and template functions * * @var Smarty_Internal_TemplateCompilerBase */ public $parent_compiler = null; + /** * Flag true when compiling nocache section * * @var bool */ public $nocache = false; + /** * Flag true when tag is compiled as nocache * * @var bool */ public $tag_nocache = false; + /** * Compiled tag prefix code * * @var array */ public $prefix_code = array(); + /** * used prefix variables by current compiled tag * * @var array */ public $usedPrefixVariables = array(); + /** * Prefix code stack * * @var array */ public $prefixCodeStack = array(); + /** * Tag has compiled code * * @var bool */ public $has_code = false; + /** * A variable string was compiled * @@ -252,63 +286,75 @@ abstract class Smarty_Internal_TemplateCompilerBase * @var array */ public $variable_filter_stack = array(); + /** * variable filters for {setfilter} {/setfilter} * * @var array */ public $variable_filters = array(); + /** * Nesting count of looping tags like {foreach}, {for}, {section}, {while} * * @var int */ public $loopNesting = 0; + /** * Strip preg pattern * * @var string */ public $stripRegEx = '![\t ]*[\r\n]+[\t ]*!'; + /** * plugin search order * * @var array */ - public $plugin_search_order = array('function', - 'block', - 'compiler', - 'class'); + public $plugin_search_order = array( + 'function', + 'block', + 'compiler', + 'class' + ); + /** * General storage area for tag compiler plugins * * @var array */ public $_cache = array(); + /** * Lexer preg pattern for left delimiter * * @var string */ private $ldelPreg = '[{]'; + /** * Lexer preg pattern for right delimiter * * @var string */ private $rdelPreg = '[}]'; + /** * Length of right delimiter * * @var int */ private $rdelLength = 0; + /** * Length of left delimiter * * @var int */ private $ldelLength = 0; + /** * Lexer preg pattern for user literals * @@ -324,35 +370,44 @@ abstract class Smarty_Internal_TemplateCompilerBase public function __construct(Smarty $smarty) { $this->smarty = $smarty; - $this->nocache_hash = str_replace(array('.', - ','), - '_', - uniqid(rand(), true)); + $this->nocache_hash = str_replace( + array( + '.', + ',' + ), + '_', + uniqid(mt_rand(), true) + ); } /** * Method to compile a Smarty template * - * @param Smarty_Internal_Template $template template object to compile - * @param bool $nocache true is shall be compiled in nocache mode + * @param Smarty_Internal_Template $template template object to compile + * @param bool $nocache true is shall be compiled in nocache mode * @param null|Smarty_Internal_TemplateCompilerBase $parent_compiler * * @return bool true if compiling succeeded, false if it failed * @throws \Exception */ - public function compileTemplate(Smarty_Internal_Template $template, - $nocache = null, - Smarty_Internal_TemplateCompilerBase $parent_compiler = null) - { + public function compileTemplate( + Smarty_Internal_Template $template, + $nocache = null, + Smarty_Internal_TemplateCompilerBase $parent_compiler = null + ) { // get code frame of compiled template - $_compiled_code = $template->smarty->ext->_codeFrame->create($template, - $this->compileTemplateSource($template, - $nocache, - $parent_compiler), - $this->postFilter($this->blockOrFunctionCode) . - join('', $this->mergedSubTemplatesCode), - false, - $this); + $_compiled_code = $template->smarty->ext->_codeFrame->create( + $template, + $this->compileTemplateSource( + $template, + $nocache, + $parent_compiler + ), + $this->postFilter($this->blockOrFunctionCode) . + join('', $this->mergedSubTemplatesCode), + false, + $this + ); return $_compiled_code; } @@ -366,10 +421,11 @@ abstract class Smarty_Internal_TemplateCompilerBase * @return string * @throws \Exception */ - public function compileTemplateSource(Smarty_Internal_Template $template, - $nocache = null, - Smarty_Internal_TemplateCompilerBase $parent_compiler = null) - { + public function compileTemplateSource( + Smarty_Internal_Template $template, + $nocache = null, + Smarty_Internal_TemplateCompilerBase $parent_compiler = null + ) { try { // save template object in compiler class $this->template = $template; @@ -405,9 +461,11 @@ abstract class Smarty_Internal_TemplateCompilerBase // add file dependency if ($this->smarty->merge_compiled_includes || $this->template->source->handler->checkTimestamps()) { $this->parent_compiler->template->compiled->file_dependency[ $this->template->source->uid ] = - array($this->template->source->filepath, - $this->template->source->getTimeStamp(), - $this->template->source->type,); + array( + $this->template->source->filepath, + $this->template->source->getTimeStamp(), + $this->template->source->type, + ); } $this->smarty->_current_file = $this->template->source->filepath; // get template source @@ -421,8 +479,10 @@ abstract class Smarty_Internal_TemplateCompilerBase $_content = $this->template->source->getContent(); } $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true)); - } - catch (Exception $e) { + if (!empty($this->required_plugins[ 'compiled' ]) || !empty($this->required_plugins[ 'nocache' ])) { + $_compiled_code = '<?php ' . $this->compileRequiredPlugins() . "?>\n" . $_compiled_code; + } + } catch (Exception $e) { if ($this->smarty->debugging) { $this->smarty->_debug->end_compile($this->template); } @@ -452,8 +512,8 @@ abstract class Smarty_Internal_TemplateCompilerBase public function postFilter($code) { // run post filter if on code - if (!empty($code) && - (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ])) + if (!empty($code) + && (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ])) ) { return $this->smarty->ext->_filterHandler->runFilter('post', $code, $this->template); } else { @@ -472,8 +532,8 @@ abstract class Smarty_Internal_TemplateCompilerBase public function preFilter($_content) { // run pre filter if required - if ($_content !== '' && - ((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ]))) + if ($_content !== '' + && ((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ]))) ) { return $this->smarty->ext->_filterHandler->runFilter('pre', $_content, $this->template); } else { @@ -490,9 +550,9 @@ abstract class Smarty_Internal_TemplateCompilerBase * Merge tag prefix code with saved one * (required nested tags in attributes) * - * @param string $tag tag name - * @param array $args array with tag attributes - * @param array $parameter array with compilation parameter + * @param string $tag tag name + * @param array $args array with tag attributes + * @param array $parameter array with compilation parameter * * @throws SmartyCompilerException * @throws SmartyException @@ -520,11 +580,13 @@ abstract class Smarty_Internal_TemplateCompilerBase // not a variable variable $var = trim($variable, '\''); $this->tag_nocache = $this->tag_nocache | - $this->template->ext->getTemplateVars->_getVariable($this->template, - $var, - null, - true, - false)->nocache; + $this->template->ext->getTemplateVars->_getVariable( + $this->template, + $var, + null, + true, + false + )->nocache; // todo $this->template->compiled->properties['variables'][$var] = $this->tag_nocache | $this->nocache; } return '$_smarty_tpl->tpl_vars[' . $variable . ']->value'; @@ -546,8 +608,8 @@ abstract class Smarty_Internal_TemplateCompilerBase /** * compile PHP function call * - * @param string $name - * @param array $parameter + * @param string $name + * @param array $parameter * * @return string * @throws \SmartyCompilerException @@ -555,8 +617,8 @@ abstract class Smarty_Internal_TemplateCompilerBase public function compilePHPFunctionCall($name, $parameter) { if (!$this->smarty->security_policy || $this->smarty->security_policy->isTrustedPhpFunction($name, $this)) { - if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0 || - strcasecmp($name, 'array') === 0 || is_callable($name) + if (strcasecmp($name, 'isset') === 0 || strcasecmp($name, 'empty') === 0 + || strcasecmp($name, 'array') === 0 || is_callable($name) ) { $func_name = strtolower($name); $par = implode(',', $parameter); @@ -575,13 +637,18 @@ abstract class Smarty_Internal_TemplateCompilerBase $isset_par = str_replace("')->value", "',null,true,false)->value", $par); } return $name . '(' . $isset_par . ')'; - } else if (in_array($func_name, - array('empty', - 'reset', - 'current', - 'end', - 'prev', - 'next'))) { + } elseif (in_array( + $func_name, + array( + 'empty', + 'reset', + 'current', + 'end', + 'prev', + 'next' + ) + ) + ) { if (count($parameter) !== 1) { $this->trigger_template_error("Illegal number of parameter in '{$func_name()}'"); } @@ -615,24 +682,27 @@ abstract class Smarty_Internal_TemplateCompilerBase */ public function processText($text) { - if ((string)$text !== '') { + if ((string)$text != '') { $store = array(); $_store = 0; if ($this->parser->strip) { if (strpos($text, '<') !== false) { // capture html elements not to be messed with $_offset = 0; - if (preg_match_all('#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is', - $text, - $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + if (preg_match_all( + '#(<script[^>]*>.*?</script[^>]*>)|(<textarea[^>]*>.*?</textarea[^>]*>)|(<pre[^>]*>.*?</pre[^>]*>)#is', + $text, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ]; $_length = strlen($match[ 0 ][ 0 ]); $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); $_offset += $_length - strlen($replace); - ++$_store; + $_store++; } } $expressions = array(// replace multiple spaces between tags by a single space @@ -643,19 +713,23 @@ abstract class Smarty_Internal_TemplateCompilerBase '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', '#>[\040\011]+$#Ss' => '> ', '#>[\040\011]*[\n]\s*$#Ss' => '>', - $this->stripRegEx => '',); + $this->stripRegEx => '', + ); $text = preg_replace(array_keys($expressions), array_values($expressions), $text); $_offset = 0; - if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', - $text, - $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + if (preg_match_all( + '#@!@SMARTY:([0-9]+):SMARTY@!@#is', + $text, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { foreach ($matches as $match) { $_length = strlen($match[ 0 ][ 0 ]); $replace = $store[ $match[ 1 ][ 0 ] ]; $text = substr_replace($text, $replace, $match[ 0 ][ 1 ] + $_offset, $_length); $_offset += strlen($replace) - $_length; - ++$_store; + $_store++; } } } else { @@ -673,11 +747,11 @@ abstract class Smarty_Internal_TemplateCompilerBase * class name format: Smarty_Internal_Compile_TagName * plugin filename format: Smarty_Internal_TagName.php * - * @param string $tag tag name - * @param array $args list of tag attributes - * @param mixed $param1 optional parameter - * @param mixed $param2 optional parameter - * @param mixed $param3 optional parameter + * @param string $tag tag name + * @param array $args list of tag attributes + * @param mixed $param1 optional parameter + * @param mixed $param2 optional parameter + * @param mixed $param3 optional parameter * * @return bool|string compiled code or false * @throws \SmartyCompilerException @@ -696,10 +770,9 @@ abstract class Smarty_Internal_TemplateCompilerBase * class name format: Smarty_Internal_Compile_TagName * plugin filename format: Smarty_Internal_TagName.php * - * @param string $tag tag name + * @param string $tag tag name * * @return bool|\Smarty_Internal_CompileBase tag compiler object or false if not found - * @throws \SmartyCompilerException */ public function getTagCompiler($tag) { @@ -709,8 +782,8 @@ abstract class Smarty_Internal_TemplateCompilerBase $_tag = explode('_', $tag); $_tag = array_map('ucfirst', $_tag); $class_name = 'Smarty_Internal_Compile_' . implode('_', $_tag); - if (class_exists($class_name) && - (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) + if (class_exists($class_name) + && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) ) { self::$_tag_objects[ $tag ] = new $class_name; } else { @@ -723,8 +796,8 @@ abstract class Smarty_Internal_TemplateCompilerBase /** * Check for plugins and return function name * - * @param $plugin_name - * @param string $plugin_type type of plugin + * @param $plugin_name + * @param string $plugin_type type of plugin * * @return string call name of function * @throws \SmartyException @@ -736,7 +809,7 @@ abstract class Smarty_Internal_TemplateCompilerBase if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { $function = $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ][ 'function' ]; - } else if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { + } elseif (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ] = $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ]; $function = @@ -746,7 +819,7 @@ abstract class Smarty_Internal_TemplateCompilerBase if (isset($this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ])) { $function = $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ][ 'function' ]; - } else if (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { + } elseif (isset($this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ])) { $this->required_plugins[ 'compiled' ][ $plugin_name ][ $plugin_type ] = $this->required_plugins[ 'nocache' ][ $plugin_name ][ $plugin_type ]; $function = @@ -789,8 +862,8 @@ abstract class Smarty_Internal_TemplateCompilerBase /** * Check for plugins by default plugin handler * - * @param string $tag name of tag - * @param string $plugin_type type of plugin + * @param string $tag name of tag + * @param string $plugin_type type of plugin * * @return bool true if found * @throws \SmartyCompilerException @@ -800,13 +873,17 @@ abstract class Smarty_Internal_TemplateCompilerBase $callback = null; $script = null; $cacheable = true; - $result = call_user_func_array($this->smarty->default_plugin_handler_func, - array($tag, - $plugin_type, - $this->template, - &$callback, - &$script, - &$cacheable,)); + $result = call_user_func_array( + $this->smarty->default_plugin_handler_func, + array( + $tag, + $plugin_type, + $this->template, + &$callback, + &$script, + &$cacheable, + ) + ); if ($result) { $this->tag_nocache = $this->tag_nocache || !$cacheable; if ($script !== null) { @@ -822,15 +899,17 @@ abstract class Smarty_Internal_TemplateCompilerBase $this->required_plugins[ 'compiled' ][ $tag ][ $plugin_type ][ 'function' ] = $callback; } - require_once $script; + include_once $script; } else { $this->trigger_template_error("Default plugin handler: Returned script file '{$script}' for '{$tag}' not found"); } } if (is_callable($callback)) { - $this->default_handler_plugins[ $plugin_type ][ $tag ] = array($callback, - true, - array()); + $this->default_handler_plugins[ $plugin_type ][ $tag ] = array( + $callback, + true, + array() + ); return true; } else { $this->trigger_template_error("Default plugin handler: Returned callback for '{$tag}' not callable"); @@ -864,8 +943,8 @@ abstract class Smarty_Internal_TemplateCompilerBase * If the content is compiled code and it should be not cached the code is injected * into the rendered output. * - * @param string $content content of template element - * @param boolean $is_code true if content is compiled code + * @param string $content content of template element + * @param boolean $is_code true if content is compiled code * * @return string content */ @@ -874,13 +953,14 @@ abstract class Smarty_Internal_TemplateCompilerBase // If the template is not evaluated and we have a nocache section and or a nocache tag if ($is_code && !empty($content)) { // generate replacement code - if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching && - !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache) + if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching + && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache) ) { $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 = + "<?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->required_plugins[ 'compiled' ][ $plugin_name ][ 'modifier' ])) { @@ -962,7 +1042,7 @@ abstract class Smarty_Internal_TemplateCompilerBase $_scopeName = trim($_attr[ 'scope' ], '\'"'); if (is_numeric($_scopeName) && in_array($_scopeName, $validScopes)) { $_scope = $_scopeName; - } else if (is_string($_scopeName)) { + } elseif (is_string($_scopeName)) { $_scopeName = trim($_scopeName, '\'"'); $_scope = isset($validScopes[ $_scopeName ]) ? $validScopes[ $_scopeName ] : false; } else { @@ -996,8 +1076,8 @@ abstract class Smarty_Internal_TemplateCompilerBase * In this case the parser is called to obtain information about expected tokens. * If parameter $args contains a string this is used as error message * - * @param string $args individual error message or null - * @param string $line line-number + * @param string $args individual error message or null + * @param string $line line-number * @param null|bool $tagline if true the line number of last tag * * @throws \SmartyCompilerException when an unexpected token is found @@ -1008,20 +1088,29 @@ abstract class Smarty_Internal_TemplateCompilerBase if ($tagline === true) { // get line number of Tag $line = $lex->taglineno; - } else if (!isset($line)) { + } elseif (!isset($line)) { // get template source line which has error $line = $lex->line; } else { $line = (int)$line; } - if (in_array($this->template->source->type, - array('eval', - 'string'))) { - $templateName = $this->template->source->type . ':' . trim(preg_replace('![\t\r\n]+!', - ' ', - strlen($lex->data) > 40 ? - substr($lex->data, 0, 40) . - '...' : $lex->data)); + if (in_array( + $this->template->source->type, + array( + 'eval', + 'string' + ) + ) + ) { + $templateName = $this->template->source->type . ':' . trim( + preg_replace( + '![\t\r\n]+!', + ' ', + strlen($lex->data) > 40 ? + substr($lex->data, 0, 40) . + '...' : $lex->data + ) + ); } else { $templateName = $this->template->source->type . ':' . $this->template->source->filepath; } @@ -1068,7 +1157,7 @@ abstract class Smarty_Internal_TemplateCompilerBase /** * Return var_export() value with all white spaces removed * - * @param mixed $value + * @param mixed $value * * @return string */ @@ -1103,11 +1192,15 @@ abstract class Smarty_Internal_TemplateCompilerBase */ public function replaceDelimiter($lexerPreg) { - return str_replace(array('SMARTYldel', 'SMARTYliteral', 'SMARTYrdel', 'SMARTYautoliteral', 'SMARTYal'), - array($this->ldelPreg, $this->literalPreg, $this->rdelPreg, - $this->smarty->getAutoLiteral() ? '{1,}' : '{9}', - $this->smarty->getAutoLiteral() ? '' : '\\s*'), - $lexerPreg); + return str_replace( + array('SMARTYldel', 'SMARTYliteral', 'SMARTYrdel', 'SMARTYautoliteral', 'SMARTYal'), + array( + $this->ldelPreg, $this->literalPreg, $this->rdelPreg, + $this->smarty->getAutoLiteral() ? '{1,}' : '{9}', + $this->smarty->getAutoLiteral() ? '' : '\\s*' + ), + $lexerPreg + ); } /** @@ -1119,20 +1212,20 @@ abstract class Smarty_Internal_TemplateCompilerBase $this->ldelLength = strlen($ldel); $this->ldelPreg = ''; foreach (str_split($ldel, 1) as $chr) { - $this->ldelPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']'; + $this->ldelPreg .= '[' . preg_quote($chr,'/') . ']'; } $rdel = $this->smarty->getRightDelimiter(); $this->rdelLength = strlen($rdel); $this->rdelPreg = ''; foreach (str_split($rdel, 1) as $chr) { - $this->rdelPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']'; + $this->rdelPreg .= '[' . preg_quote($chr,'/') . ']'; } $literals = $this->smarty->getLiterals(); if (!empty($literals)) { foreach ($literals as $key => $literal) { $literalPreg = ''; foreach (str_split($literal, 1) as $chr) { - $literalPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']'; + $literalPreg .= '[' . preg_quote($chr,'/') . ']'; } $literals[ $key ] = $literalPreg; } @@ -1152,9 +1245,11 @@ 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", - null, - true); + $this->trigger_template_error( + "unclosed '{{$tag}}' in doubled quoted string", + null, + true + ); } } @@ -1292,7 +1387,7 @@ abstract class Smarty_Internal_TemplateCompilerBase * * @param bool $init if true init required plugins */ - public function saveRequiredPlugins($init=false) + public function saveRequiredPlugins($init = false) { $this->required_plugins_stack[] = $this->required_plugins; if ($init) { @@ -1359,9 +1454,9 @@ abstract class Smarty_Internal_TemplateCompilerBase /** * Compile Tag * - * @param string $tag tag name - * @param array $args array with tag attributes - * @param array $parameter array with compilation parameter + * @param string $tag tag name + * @param array $args array with tag attributes + * @param array $parameter array with compilation parameter * * @throws SmartyCompilerException * @throws SmartyException @@ -1375,8 +1470,10 @@ abstract class Smarty_Internal_TemplateCompilerBase $this->has_code = true; // log tag/attributes if (isset($this->smarty->_cache[ 'get_used_tags' ])) { - $this->template->_cache[ 'used_tags' ][] = array($tag, - $args); + $this->template->_cache[ 'used_tags' ][] = array( + $tag, + $args + ); } // check nocache option flag foreach ($args as $arg) { @@ -1394,9 +1491,9 @@ abstract class Smarty_Internal_TemplateCompilerBase } // compile the smarty tag (required compile classes to compile the tag are auto loaded) if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) { - if (isset($this->parent_compiler->tpl_function[ $tag ]) || - (isset ($this->template->smarty->ext->_tplFunction) && - $this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false) + if (isset($this->parent_compiler->tpl_function[ $tag ]) + || (isset($this->template->smarty->ext->_tplFunction) + && $this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false) ) { // template defined by {template} tag $args[ '_attr' ][ 'name' ] = "'{$tag}'"; @@ -1427,29 +1524,35 @@ abstract class Smarty_Internal_TemplateCompilerBase // check if tag is a registered object if (isset($this->smarty->registered_objects[ $tag ]) && isset($parameter[ 'object_method' ])) { $method = $parameter[ 'object_method' ]; - if (!in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ]) && - (empty($this->smarty->registered_objects[ $tag ][ 1 ]) || - in_array($method, $this->smarty->registered_objects[ $tag ][ 1 ])) + if (!in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ]) + && (empty($this->smarty->registered_objects[ $tag ][ 1 ]) + || in_array($method, $this->smarty->registered_objects[ $tag ][ 1 ])) ) { return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $method); - } else if (in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ])) { - return $this->callTagCompiler('private_object_block_function', - $args, - $parameter, - $tag, - $method); + } elseif (in_array($method, $this->smarty->registered_objects[ $tag ][ 3 ])) { + return $this->callTagCompiler( + 'private_object_block_function', + $args, + $parameter, + $tag, + $method + ); } else { // throw exception - $this->trigger_template_error('not allowed method "' . $method . '" in registered object "' . - $tag . '"', - null, - true); + $this->trigger_template_error( + 'not allowed method "' . $method . '" in registered object "' . + $tag . '"', + null, + true + ); } } // check if tag is registered - foreach (array(Smarty::PLUGIN_COMPILER, - Smarty::PLUGIN_FUNCTION, - Smarty::PLUGIN_BLOCK,) as $plugin_type) { + foreach (array( + Smarty::PLUGIN_COMPILER, + Smarty::PLUGIN_FUNCTION, + Smarty::PLUGIN_BLOCK, + ) as $plugin_type) { if (isset($this->smarty->registered_plugins[ $plugin_type ][ $tag ])) { // if compiler function plugin call it now if ($plugin_type === Smarty::PLUGIN_COMPILER) { @@ -1464,25 +1567,31 @@ abstract class Smarty_Internal_TemplateCompilerBase if (!$this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 1 ]) { $this->tag_nocache = true; } - return call_user_func_array($this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ], - array($new_args, - $this)); + return call_user_func_array( + $this->smarty->registered_plugins[ $plugin_type ][ $tag ][ 0 ], + array( + $new_args, + $this + ) + ); } // compile registered function or block function if ($plugin_type === Smarty::PLUGIN_FUNCTION || $plugin_type === Smarty::PLUGIN_BLOCK) { - return $this->callTagCompiler('private_registered_' . $plugin_type, - $args, - $parameter, - $tag); + return $this->callTagCompiler( + 'private_registered_' . $plugin_type, + $args, + $parameter, + $tag + ); } } } // check plugins from plugins folder foreach ($this->plugin_search_order as $plugin_type) { - if ($plugin_type === Smarty::PLUGIN_COMPILER && - $this->smarty->loadPlugin('smarty_compiler_' . $tag) && - (!isset($this->smarty->security_policy) || - $this->smarty->security_policy->isTrustedTag($tag, $this)) + if ($plugin_type === Smarty::PLUGIN_COMPILER + && $this->smarty->loadPlugin('smarty_compiler_' . $tag) + && (!isset($this->smarty->security_policy) + || $this->smarty->security_policy->isTrustedTag($tag, $this)) ) { $plugin = 'smarty_compiler_' . $tag; if (is_callable($plugin)) { @@ -1506,14 +1615,16 @@ abstract class Smarty_Internal_TemplateCompilerBase throw new SmartyException("Plugin '{$tag}' not callable"); } else { if ($function = $this->getPlugin($tag, $plugin_type)) { - if (!isset($this->smarty->security_policy) || - $this->smarty->security_policy->isTrustedTag($tag, $this) + if (!isset($this->smarty->security_policy) + || $this->smarty->security_policy->isTrustedTag($tag, $this) ) { - return $this->callTagCompiler('private_' . $plugin_type . '_plugin', - $args, - $parameter, - $tag, - $function); + return $this->callTagCompiler( + 'private_' . $plugin_type . '_plugin', + $args, + $parameter, + $tag, + $function + ); } } } @@ -1547,14 +1658,20 @@ abstract class Smarty_Internal_TemplateCompilerBase $new_args[ $key ] = $mixed; } } - return call_user_func_array($this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ], - array($new_args, - $this)); + return call_user_func_array( + $this->default_handler_plugins[ $plugin_type ][ $tag ][ 0 ], + array( + $new_args, + $this + ) + ); } else { - return $this->callTagCompiler('private_registered_' . $plugin_type, - $args, - $parameter, - $tag); + return $this->callTagCompiler( + 'private_registered_' . $plugin_type, + $args, + $parameter, + $tag + ); } } } @@ -1565,22 +1682,26 @@ abstract class Smarty_Internal_TemplateCompilerBase if (isset($this->smarty->registered_objects[ $base_tag ]) && isset($parameter[ 'object_method' ])) { $method = $parameter[ 'object_method' ]; if (in_array($method, $this->smarty->registered_objects[ $base_tag ][ 3 ])) { - return $this->callTagCompiler('private_object_block_function', - $args, - $parameter, - $tag, - $method); + return $this->callTagCompiler( + 'private_object_block_function', + $args, + $parameter, + $tag, + $method + ); } else { // throw exception - $this->trigger_template_error('not allowed closing tag method "' . $method . - '" in registered object "' . $base_tag . '"', - null, - true); + $this->trigger_template_error( + 'not allowed closing tag method "' . $method . + '" in registered object "' . $base_tag . '"', + null, + true + ); } } // registered block tag ? - if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) || - isset($this->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) + if (isset($this->smarty->registered_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) + || isset($this->default_handler_plugins[ Smarty::PLUGIN_BLOCK ][ $base_tag ]) ) { return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag); } @@ -1594,8 +1715,8 @@ abstract class Smarty_Internal_TemplateCompilerBase } // function plugin? if ($function = $this->getPlugin($tag, Smarty::PLUGIN_FUNCTION)) { - if (!isset($this->smarty->security_policy) || - $this->smarty->security_policy->isTrustedTag($tag, $this) + if (!isset($this->smarty->security_policy) + || $this->smarty->security_policy->isTrustedTag($tag, $this) ) { return $this->callTagCompiler('private_function_plugin', $args, $parameter, $tag, $function); } @@ -1607,9 +1728,13 @@ abstract class Smarty_Internal_TemplateCompilerBase if (!$this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 1 ]) { $this->tag_nocache = true; } - return call_user_func_array($this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ], - array($args, - $this)); + return call_user_func_array( + $this->smarty->registered_plugins[ Smarty::PLUGIN_COMPILER ][ $tag ][ 0 ], + array( + $args, + $this + ) + ); } if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) { $plugin = 'smarty_compiler_' . $tag; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php index 3045a7b0c..c6c49ef59 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php @@ -18,101 +18,117 @@ */ class Smarty_Internal_Templatelexer { - const TEXT = 1; - const TAG = 2; - const TAGBODY = 3; - const LITERAL = 4; + const TEXT = 1; + const TAG = 2; + const TAGBODY = 3; + const LITERAL = 4; const DOUBLEQUOTEDSTRING = 5; + /** * Source * * @var string */ public $data; + /** * Source length * * @var int */ public $dataLength = null; + /** * byte counter * * @var int */ public $counter; + /** * token number * * @var int */ public $token; + /** * token value * * @var string */ public $value; + /** * current line * * @var int */ public $line; + /** * tag start line * * @var */ public $taglineno; + /** * php code type * * @var string */ public $phpType = ''; + /** * state number * * @var int */ public $state = 1; + /** * Smarty object * * @var Smarty */ public $smarty = null; + /** * compiler object * * @var Smarty_Internal_TemplateCompilerBase */ public $compiler = null; + /** * trace file * * @var resource */ public $yyTraceFILE; + /** * trace prompt * * @var string */ public $yyTracePrompt; + /** * XML flag true while processing xml * * @var bool */ public $is_xml = false; + /** * state names * * @var array */ public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',); + /** * token names * @@ -156,44 +172,52 @@ class Smarty_Internal_Templatelexer 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', 'SCOND' => '"is even" ... if condition', ); + /** * literal tag nesting level * * @var int */ private $literal_cnt = 0; + /** * preg token pattern for state TEXT * * @var string */ private $yy_global_pattern1 = null; + /** * preg token pattern for state TAG * * @var string */ private $yy_global_pattern2 = null; + /** * preg token pattern for state TAGBODY * * @var string */ private $yy_global_pattern3 = null; + /** * preg token pattern for state LITERAL * * @var string */ private $yy_global_pattern4 = null; + /** * preg token pattern for state DOUBLEQUOTEDSTRING * * @var null */ private $yy_global_pattern5 = null; - private $_yy_state = 1; - private $_yy_stack = array(); + + private $_yy_state = 1; + + private $_yy_stack = array(); /** * constructor @@ -201,7 +225,7 @@ class Smarty_Internal_Templatelexer * @param string $source template source * @param Smarty_Internal_TemplateCompilerBase $compiler */ - function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler) + public function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler) { $this->data = $source; $this->dataLength = strlen($this->data); @@ -239,7 +263,7 @@ class Smarty_Internal_Templatelexer return $this->compiler->replaceDelimiter($preg); } - /** + /** * check if current value is an autoliteral left delimiter * * @return bool @@ -258,39 +282,27 @@ class Smarty_Internal_Templatelexer public function yypushstate($state) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState push %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); } array_push($this->_yy_stack, $this->_yy_state); $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%snew State %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); } } public function yypopstate() { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState pop %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); } $this->_yy_state = array_pop($this->_yy_stack); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%snew State %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); } } @@ -298,15 +310,12 @@ class Smarty_Internal_Templatelexer { $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sState set %s\n", - $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : - $this->_yy_state); + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, + isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); } } -public function yylex1() + public function yylex1() { if (!isset($this->yy_global_pattern1)) { $this->yy_global_pattern1 = @@ -327,9 +336,11 @@ public function yylex1() } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state TEXT'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state TEXT'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -340,11 +351,11 @@ public function yylex1() $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -361,18 +372,15 @@ public function yylex1() } while (true); } - function yy_r1_1() + public function yy_r1_1() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r1_2() + public function yy_r1_2() { - preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/", - $this->data, - $match, - PREG_OFFSET_CAPTURE, - $this->counter); + preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/", $this->data, $match, PREG_OFFSET_CAPTURE, + $this->counter); if (isset($match[ 0 ][ 1 ])) { $to = $match[ 0 ][ 1 ] + strlen($match[ 0 ][ 0 ]); } else { @@ -382,45 +390,45 @@ public function yylex1() return false; } - function yy_r1_4() + public function yy_r1_4() { $this->compiler->getTagCompiler('private_php')->parsePhp($this); } - function yy_r1_8() + public function yy_r1_8() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r1_10() + public function yy_r1_10() { $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; $this->yypushstate(self::LITERAL); } - function yy_r1_12() + public function yy_r1_12() { $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; $this->yypushstate(self::LITERAL); } // end function - function yy_r1_14() + public function yy_r1_14() { $this->yypushstate(self::TAG); return true; } - function yy_r1_16() + public function yy_r1_16() { $this->compiler->getTagCompiler('private_php')->parsePhp($this); } - function yy_r1_19() + public function yy_r1_19() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } -public function yylex2() + public function yylex2() { if (!isset($this->yy_global_pattern2)) { $this->yy_global_pattern2 = @@ -441,9 +449,11 @@ public function yylex2() } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state TAG'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state TAG'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -454,11 +464,11 @@ public function yylex2() $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -475,63 +485,63 @@ public function yylex2() } while (true); } - function yy_r2_1() + public function yy_r2_1() { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_4() + public function yy_r2_4() { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_6() + public function yy_r2_6() { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_8() + public function yy_r2_8() { $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_10() + public function yy_r2_10() { $this->token = Smarty_Internal_Templateparser::TP_LDELMAKENOCACHE; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_12() + public function yy_r2_12() { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG; $this->taglineno = $this->line; } - function yy_r2_15() + public function yy_r2_15() { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; $this->taglineno = $this->line; } - function yy_r2_18() + public function yy_r2_18() { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG; $this->taglineno = $this->line; } - function yy_r2_20() + public function yy_r2_20() { if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] === self::TEXT) { $this->yypopstate(); @@ -545,21 +555,21 @@ public function yylex2() } } // end function - function yy_r2_23() + public function yy_r2_23() { $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - function yy_r2_25() + public function yy_r2_25() { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } -public function yylex3() + public function yylex3() { if (!isset($this->yy_global_pattern3)) { $this->yy_global_pattern3 = @@ -580,9 +590,11 @@ public function yylex3() } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state TAGBODY'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state TAGBODY'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -593,11 +605,11 @@ public function yylex3() $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -614,156 +626,156 @@ public function yylex3() } while (true); } - function yy_r3_1() + public function yy_r3_1() { $this->token = Smarty_Internal_Templateparser::TP_RDEL; $this->yypopstate(); } - function yy_r3_2() + public function yy_r3_2() { $this->yypushstate(self::TAG); return true; } - function yy_r3_4() + public function yy_r3_4() { $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypushstate(self::DOUBLEQUOTEDSTRING); $this->compiler->enterDoubleQuote(); } - function yy_r3_5() + public function yy_r3_5() { $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; } - function yy_r3_6() + public function yy_r3_6() { $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; } - function yy_r3_7() + public function yy_r3_7() { $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; } - function yy_r3_8() + public function yy_r3_8() { $this->token = Smarty_Internal_Templateparser::TP_ISIN; } - function yy_r3_9() + public function yy_r3_9() { $this->token = Smarty_Internal_Templateparser::TP_AS; } - function yy_r3_10() + public function yy_r3_10() { $this->token = Smarty_Internal_Templateparser::TP_TO; } - function yy_r3_11() + public function yy_r3_11() { $this->token = Smarty_Internal_Templateparser::TP_STEP; } - function yy_r3_12() + public function yy_r3_12() { $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; } - function yy_r3_13() + public function yy_r3_13() { $this->token = Smarty_Internal_Templateparser::TP_LOGOP; } - function yy_r3_15() + public function yy_r3_15() { $this->token = Smarty_Internal_Templateparser::TP_SLOGOP; } - function yy_r3_17() + public function yy_r3_17() { $this->token = Smarty_Internal_Templateparser::TP_TLOGOP; } - function yy_r3_20() + public function yy_r3_20() { $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND; } - function yy_r3_23() + public function yy_r3_23() { $this->token = Smarty_Internal_Templateparser::TP_NOT; } - function yy_r3_24() + public function yy_r3_24() { $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; } - function yy_r3_28() + public function yy_r3_28() { $this->token = Smarty_Internal_Templateparser::TP_OPENP; } - function yy_r3_29() + public function yy_r3_29() { $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; } - function yy_r3_30() + public function yy_r3_30() { $this->token = Smarty_Internal_Templateparser::TP_OPENB; } - function yy_r3_31() + public function yy_r3_31() { $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; } - function yy_r3_32() + public function yy_r3_32() { $this->token = Smarty_Internal_Templateparser::TP_PTR; } - function yy_r3_33() + public function yy_r3_33() { $this->token = Smarty_Internal_Templateparser::TP_APTR; } - function yy_r3_34() + public function yy_r3_34() { $this->token = Smarty_Internal_Templateparser::TP_EQUAL; } - function yy_r3_35() + public function yy_r3_35() { $this->token = Smarty_Internal_Templateparser::TP_INCDEC; } - function yy_r3_37() + public function yy_r3_37() { $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; } - function yy_r3_39() + public function yy_r3_39() { $this->token = Smarty_Internal_Templateparser::TP_MATH; } - function yy_r3_41() + public function yy_r3_41() { $this->token = Smarty_Internal_Templateparser::TP_AT; } - function yy_r3_42() + public function yy_r3_42() { $this->token = Smarty_Internal_Templateparser::TP_HATCH; } - function yy_r3_43() + public function yy_r3_43() { // resolve conflicts with shorttag and right_delimiter starting with '=' if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === @@ -776,78 +788,78 @@ public function yylex3() } } - function yy_r3_44() + public function yy_r3_44() { $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE; } - function yy_r3_47() + public function yy_r3_47() { $this->token = Smarty_Internal_Templateparser::TP_ID; } - function yy_r3_48() + public function yy_r3_48() { $this->token = Smarty_Internal_Templateparser::TP_INTEGER; } - function yy_r3_49() + public function yy_r3_49() { $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; $this->yypopstate(); } - function yy_r3_50() + public function yy_r3_50() { $this->token = Smarty_Internal_Templateparser::TP_VERT; } - function yy_r3_51() + public function yy_r3_51() { $this->token = Smarty_Internal_Templateparser::TP_DOT; } - function yy_r3_52() + public function yy_r3_52() { $this->token = Smarty_Internal_Templateparser::TP_COMMA; } - function yy_r3_53() + public function yy_r3_53() { $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; } - function yy_r3_54() + public function yy_r3_54() { $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; } - function yy_r3_55() + public function yy_r3_55() { $this->token = Smarty_Internal_Templateparser::TP_COLON; } - function yy_r3_56() + public function yy_r3_56() { $this->token = Smarty_Internal_Templateparser::TP_QMARK; } - function yy_r3_57() + public function yy_r3_57() { $this->token = Smarty_Internal_Templateparser::TP_HEX; } - function yy_r3_58() + public function yy_r3_58() { $this->token = Smarty_Internal_Templateparser::TP_SPACE; } // end function - function yy_r3_59() + public function yy_r3_59() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } -public function yylex4() + public function yylex4() { if (!isset($this->yy_global_pattern4)) { $this->yy_global_pattern4 = @@ -868,9 +880,11 @@ public function yylex4() } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state LITERAL'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state LITERAL'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -881,11 +895,11 @@ public function yylex4() $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -902,13 +916,13 @@ public function yylex4() } while (true); } - function yy_r4_1() + public function yy_r4_1() { $this->literal_cnt++; $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } - function yy_r4_3() + public function yy_r4_3() { if ($this->literal_cnt) { $this->literal_cnt--; @@ -919,12 +933,12 @@ public function yylex4() } } - function yy_r4_5() + public function yy_r4_5() { $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } // end function -public function yylex5() + public function yylex5() { if (!isset($this->yy_global_pattern5)) { $this->yy_global_pattern5 = @@ -945,9 +959,11 @@ public function yylex5() } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, - 5) . '... state DOUBLEQUOTEDSTRING'); + ' an empty string. Input "' . substr( + $this->data, + $this->counter, + 5 + ) . '... state DOUBLEQUOTEDSTRING'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -958,11 +974,11 @@ public function yylex5() $this->line += substr_count($this->value, "\n"); // accept this token return true; - } else if ($r === true) { + } elseif ($r === true) { // we have changed state // process this token in the new state return $this->yylex(); - } else if ($r === false) { + } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); if ($this->counter >= $this->dataLength) { @@ -979,47 +995,47 @@ public function yylex5() } while (true); } - function yy_r5_1() + public function yy_r5_1() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r5_3() + public function yy_r5_3() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r5_5() + public function yy_r5_5() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r5_7() + public function yy_r5_7() { $this->yypushstate(self::TAG); return true; } - function yy_r5_9() + public function yy_r5_9() { $this->yypushstate(self::TAG); return true; } - function yy_r5_11() + public function yy_r5_11() { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->taglineno = $this->line; $this->yypushstate(self::TAGBODY); } - function yy_r5_13() + public function yy_r5_13() { $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypopstate(); } - function yy_r5_14() + public function yy_r5_14() { $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; $this->value = substr($this->value, 0, -1); @@ -1027,20 +1043,18 @@ public function yylex5() $this->taglineno = $this->line; } - function yy_r5_15() + public function yy_r5_15() { $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; } - function yy_r5_16() + public function yy_r5_16() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r5_17() + public function yy_r5_17() { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } } - -
\ No newline at end of file diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php index d8219daed..b008715f7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php @@ -4,13 +4,14 @@ class TP_yyStackEntry { public $stateno; /* The state-number */ public $major; /* The major token value. This is the code - ** number for the token at this stack level */ - public $minor; /* The user-supplied minor token value. This - ** is the value of the token */ + * number for the token at this stack level + */ + public $minor; /* The user-supplied minor token value. This + * is the value of the token + */ } -; -#line 11 "../smarty/lexer/smarty_internal_templateparser.y" +// line 11 "../smarty/lexer/smarty_internal_templateparser.y" /** * Smarty Template Parser Class @@ -22,10 +23,10 @@ class TP_yyStackEntry */ class Smarty_Internal_Templateparser { - #line 23 "../smarty/lexer/smarty_internal_templateparser.y" - const Err1 = 'Security error: Call to private object member not allowed'; - const Err2 = 'Security error: Call to dynamic object member not allowed'; - const Err3 = 'PHP in template not allowed. Use SmartyBC to enable it'; + // line 23 "../smarty/lexer/smarty_internal_templateparser.y" + const ERR1 = 'Security error: Call to private object member not allowed'; + const ERR2 = 'Security error: Call to dynamic object member not allowed'; + const ERR3 = 'PHP in template not allowed. Use SmartyBC to enable it'; const TP_VERT = 1; const TP_COLON = 2; const TP_UNIMATH = 3; @@ -89,339 +90,231 @@ class Smarty_Internal_Templateparser const YY_NO_ACTION = 511; const YY_ACCEPT_ACTION = 510; const YY_ERROR_ACTION = 509; - const YY_SZ_ACTTAB = 2178; - const YY_SHIFT_USE_DFLT = -23; - const YY_SHIFT_MAX = 227; - const YY_REDUCE_USE_DFLT = -68; - const YY_REDUCE_MAX = 176; - const YYNOCODE = 108; - const YYSTACKDEPTH = 500; - const YYNSTATE = 323; - const YYNRULE = 186; - const YYERRORSYMBOL = 61; - const YYERRSYMDT = 'yy0'; - const YYFALLBACK = 0; - /** - * result status - * - * @var bool - */ - public $successful = true; - /** - * return value - * - * @var mixed - */ - public $retvalue = 0; - /** - * @var - */ - public $yymajor; - /** - * last index of array variable - * - * @var mixed - */ - public $last_index; - /** - * last variable name - * - * @var string - */ - public $last_variable; - /** - * root parse tree buffer - * - * @var Smarty_Internal_ParseTree - */ - public $root_buffer; - /** - * current parse tree object - * - * @var Smarty_Internal_ParseTree - */ - public $current_buffer; - /** - * lexer object - * - * @var Smarty_Internal_Templatelexer - */ - public $lex; - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; - /** - * {strip} status - * - * @var bool - */ - public $strip = false; - /** - * compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - /** - * smarty object - * - * @var Smarty - */ - public $smarty = null; - /** - * template object - * - * @var Smarty_Internal_Template - */ - public $template = null; - /** - * block nesting level - * - * @var int - */ - public $block_nesting_level = 0; - /** - * security object - * - * @var Smarty_Security - */ - public $security = null; - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_prefix = array(); - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_postfix = array(); - static public $yy_action = array( - 43, 266, 267, 379, 115, 203, 33, 201, 274, 275, - 281, 1, 13, 124, 93, 183, 379, 217, 6, 79, - 253, 89, 379, 16, 102, 425, 304, 252, 218, 249, - 211, 129, 190, 302, 26, 213, 425, 33, 11, 39, - 42, 283, 209, 13, 223, 385, 195, 233, 77, 3, - 236, 290, 43, 385, 170, 385, 75, 17, 385, 94, - 274, 275, 281, 1, 385, 128, 385, 196, 385, 217, - 6, 79, 80, 298, 158, 210, 102, 156, 174, 133, - 218, 249, 211, 85, 208, 290, 28, 264, 101, 264, - 199, 39, 42, 283, 209, 31, 312, 182, 195, 259, - 77, 3, 43, 290, 23, 172, 239, 174, 75, 288, - 274, 275, 281, 1, 167, 127, 256, 196, 248, 217, - 6, 79, 345, 40, 20, 305, 102, 248, 345, 157, - 218, 249, 211, 83, 208, 290, 26, 8, 174, 264, - 74, 39, 42, 283, 209, 131, 312, 292, 195, 74, - 77, 3, 43, 290, 295, 99, 243, 174, 75, 345, - 274, 275, 281, 1, 15, 126, 86, 196, 248, 217, - 6, 79, 345, 322, 161, 289, 102, 87, 345, 165, - 218, 249, 211, 290, 208, 115, 26, 128, 255, 221, - 74, 39, 42, 283, 209, 93, 312, 210, 195, 162, - 77, 3, 43, 290, 254, 235, 247, 304, 75, 27, - 274, 275, 281, 1, 172, 127, 425, 177, 248, 217, - 6, 79, 77, 174, 250, 290, 102, 425, 198, 14, - 218, 249, 211, 248, 208, 34, 26, 222, 206, 139, - 74, 39, 42, 283, 209, 198, 312, 23, 195, 291, - 77, 3, 43, 290, 300, 74, 198, 438, 75, 346, - 274, 275, 281, 1, 438, 127, 176, 196, 267, 217, - 6, 79, 346, 161, 289, 290, 102, 23, 346, 238, - 218, 249, 211, 33, 178, 263, 26, 160, 289, 13, - 37, 39, 42, 283, 209, 198, 312, 212, 195, 250, - 77, 3, 43, 290, 216, 189, 155, 97, 75, 381, - 274, 275, 281, 1, 149, 127, 264, 179, 18, 217, - 6, 79, 381, 94, 97, 237, 102, 140, 381, 251, - 218, 249, 211, 4, 194, 94, 26, 264, 198, 37, - 30, 39, 42, 283, 209, 198, 312, 212, 195, 129, - 77, 3, 43, 290, 219, 172, 11, 97, 75, 378, - 274, 275, 281, 1, 101, 127, 438, 186, 210, 217, - 6, 79, 378, 438, 12, 163, 102, 220, 378, 425, - 218, 249, 211, 302, 208, 213, 26, 225, 215, 187, - 425, 39, 42, 283, 209, 234, 312, 7, 195, 212, - 77, 3, 43, 290, 134, 9, 240, 425, 75, 97, - 274, 275, 281, 1, 264, 91, 109, 76, 425, 217, - 6, 79, 253, 293, 426, 16, 102, 251, 198, 252, - 218, 249, 211, 198, 208, 426, 26, 148, 198, 135, - 132, 39, 42, 283, 209, 143, 312, 264, 195, 264, - 77, 3, 43, 290, 138, 264, 205, 24, 75, 166, - 274, 275, 281, 1, 264, 125, 276, 196, 19, 217, - 6, 79, 454, 153, 13, 454, 102, 168, 290, 454, - 218, 249, 211, 174, 208, 314, 5, 136, 210, 251, - 152, 39, 42, 283, 209, 268, 312, 213, 195, 308, - 77, 3, 43, 290, 94, 169, 111, 144, 75, 251, - 274, 275, 281, 1, 229, 128, 7, 196, 313, 217, - 6, 79, 510, 90, 175, 111, 102, 164, 289, 174, - 218, 249, 211, 101, 208, 265, 28, 32, 128, 150, - 261, 39, 42, 283, 209, 10, 312, 317, 195, 224, - 77, 21, 269, 290, 232, 230, 282, 114, 75, 307, - 214, 213, 279, 22, 84, 103, 246, 181, 92, 64, - 260, 262, 454, 77, 93, 454, 290, 257, 316, 454, - 438, 228, 311, 197, 309, 78, 304, 271, 272, 273, - 270, 121, 258, 310, 274, 275, 281, 1, 17, 280, - 110, 284, 81, 217, 6, 79, 438, 146, 94, 438, - 102, 454, 151, 438, 218, 249, 211, 307, 214, 213, - 279, 278, 84, 103, 104, 180, 92, 56, 263, 159, - 130, 152, 93, 295, 137, 257, 316, 295, 251, 88, - 311, 197, 309, 82, 304, 307, 295, 213, 303, 295, - 100, 295, 295, 193, 105, 59, 295, 295, 295, 295, - 93, 295, 295, 257, 316, 295, 295, 295, 311, 197, - 309, 307, 304, 213, 277, 295, 100, 103, 295, 181, - 92, 64, 200, 297, 295, 253, 93, 295, 16, 257, - 316, 295, 252, 295, 311, 197, 309, 295, 304, 295, - 299, 295, 295, 295, 295, 295, 274, 275, 281, 2, - 295, 301, 295, 295, 295, 217, 6, 79, 253, 295, - 295, 16, 102, 299, 204, 252, 218, 249, 211, 274, - 275, 281, 2, 295, 301, 33, 295, 154, 217, 6, - 79, 13, 295, 295, 295, 102, 295, 295, 295, 218, - 249, 211, 295, 295, 286, 25, 307, 295, 213, 295, - 295, 100, 295, 295, 193, 105, 59, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 287, 25, 311, - 197, 309, 307, 304, 213, 295, 454, 100, 295, 454, - 193, 118, 67, 454, 296, 253, 295, 93, 16, 295, - 257, 316, 252, 295, 295, 311, 197, 309, 295, 304, - 295, 295, 307, 295, 213, 295, 188, 100, 295, 295, - 193, 118, 67, 295, 295, 454, 295, 93, 295, 295, - 257, 316, 295, 295, 226, 311, 197, 309, 295, 304, - 295, 295, 307, 295, 213, 295, 192, 100, 295, 295, - 193, 118, 67, 295, 295, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 295, 304, - 295, 295, 307, 295, 213, 295, 191, 98, 295, 295, - 193, 118, 46, 295, 108, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, - 213, 295, 295, 98, 295, 295, 193, 118, 47, 295, - 219, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, - 295, 295, 193, 118, 45, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, - 295, 304, 295, 295, 307, 295, 213, 295, 295, 100, - 295, 295, 193, 118, 70, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, - 307, 304, 213, 295, 295, 100, 295, 295, 193, 118, - 49, 295, 295, 295, 295, 93, 295, 295, 257, 316, - 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, - 295, 100, 295, 295, 193, 96, 66, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, - 197, 309, 295, 304, 295, 295, 307, 295, 213, 295, - 295, 100, 295, 295, 193, 118, 44, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, - 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, - 193, 118, 58, 295, 295, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, - 213, 295, 295, 100, 295, 295, 193, 118, 54, 295, - 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 295, 304, 295, 295, 307, 295, - 213, 295, 295, 100, 295, 295, 193, 118, 71, 295, - 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, - 295, 295, 193, 118, 65, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, - 307, 304, 213, 295, 295, 100, 295, 295, 193, 96, - 57, 295, 295, 295, 295, 93, 295, 295, 257, 316, - 295, 295, 295, 311, 197, 309, 295, 304, 295, 295, - 307, 295, 213, 295, 295, 100, 295, 295, 185, 106, - 53, 295, 295, 295, 295, 93, 295, 295, 257, 316, - 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, - 295, 100, 295, 295, 193, 118, 60, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, - 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, - 193, 118, 73, 295, 295, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 295, 304, - 295, 295, 307, 295, 213, 295, 295, 100, 295, 295, - 193, 118, 55, 295, 295, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, - 213, 295, 295, 100, 295, 295, 193, 95, 68, 295, - 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, - 295, 295, 193, 118, 69, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, - 295, 304, 295, 295, 307, 295, 213, 295, 295, 100, - 295, 295, 193, 118, 51, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 295, 295, 295, 311, 197, 309, - 307, 304, 213, 295, 295, 100, 295, 295, 184, 118, - 52, 295, 295, 295, 295, 93, 295, 295, 257, 316, - 295, 295, 295, 311, 197, 309, 307, 304, 213, 295, - 295, 100, 295, 295, 193, 118, 47, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, - 197, 309, 295, 304, 295, 295, 307, 295, 213, 295, - 295, 100, 295, 295, 193, 118, 50, 295, 295, 295, - 295, 93, 295, 295, 257, 316, 295, 295, 295, 311, - 197, 309, 307, 304, 213, 295, 295, 100, 295, 295, - 193, 118, 62, 295, 295, 295, 295, 93, 295, 295, - 257, 316, 295, 295, 295, 311, 197, 309, 307, 304, - 213, 295, 295, 100, 295, 295, 193, 118, 63, 295, - 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 295, 304, 295, 295, 307, 295, - 213, 295, 295, 100, 295, 295, 193, 118, 61, 295, - 295, 295, 295, 93, 295, 295, 257, 316, 295, 295, - 295, 311, 197, 309, 307, 304, 213, 295, 295, 100, - 295, 295, 193, 118, 48, 295, 295, 295, 295, 93, - 295, 295, 257, 316, 391, 391, 391, 311, 197, 309, - 307, 304, 213, 295, 295, 100, 295, 295, 193, 118, - 72, 295, 295, 295, 295, 93, 295, 295, 257, 316, - 295, 295, 295, 311, 197, 309, 295, 304, 295, 295, - 425, 295, 391, 391, 295, 295, 295, 295, 307, 295, - 213, 425, 198, 100, 38, 295, 193, 112, 391, 391, - 391, 391, 38, 93, 295, 295, 295, 306, 295, 295, - 295, 311, 197, 309, 295, 304, 295, 35, 307, 33, - 213, 295, 295, 100, 295, 13, 193, 120, 295, 295, - 41, 36, 198, 93, 38, 295, 295, 231, 41, 36, - 295, 311, 197, 309, 295, 304, 319, 318, 315, 245, - 295, 207, 295, 295, 319, 318, 315, 245, 295, 33, - 454, 295, 295, 454, 295, 13, 207, 454, 438, 295, - 41, 36, 295, 295, 295, 454, 295, 295, 454, 295, - 295, 14, 454, 438, 295, 295, 319, 318, 315, 245, - 295, 198, 295, 38, 438, 295, 295, 438, 307, 454, - 213, 438, 320, 100, 295, 241, 193, 122, 295, 438, - 295, 295, 438, 93, 454, 295, 438, 295, 198, 295, - 38, 311, 197, 309, 295, 304, 307, 295, 213, 41, - 36, 100, 295, 295, 193, 117, 295, 295, 295, 295, - 295, 93, 295, 295, 295, 319, 318, 315, 245, 311, - 197, 309, 207, 304, 295, 295, 41, 36, 295, 295, - 295, 454, 295, 295, 454, 295, 295, 4, 454, 438, - 295, 295, 319, 318, 315, 245, 295, 294, 295, 295, - 295, 307, 295, 213, 295, 295, 100, 295, 295, 193, - 123, 295, 295, 295, 295, 438, 93, 295, 438, 141, - 454, 295, 438, 167, 311, 197, 309, 295, 304, 264, - 295, 295, 40, 20, 305, 295, 295, 307, 295, 213, - 295, 198, 100, 38, 295, 193, 116, 174, 307, 295, - 213, 295, 93, 100, 295, 295, 193, 113, 295, 295, - 311, 197, 309, 93, 304, 295, 198, 295, 38, 295, - 295, 311, 197, 309, 295, 304, 307, 295, 213, 41, - 36, 100, 295, 295, 193, 119, 295, 295, 295, 295, - 295, 93, 295, 321, 145, 319, 318, 315, 245, 311, - 197, 309, 207, 304, 41, 36, 295, 295, 295, 295, - 295, 454, 295, 295, 454, 295, 295, 295, 454, 438, - 319, 318, 315, 245, 198, 295, 38, 295, 198, 295, - 38, 295, 198, 295, 38, 295, 295, 295, 242, 295, - 295, 295, 285, 295, 295, 438, 171, 295, 438, 295, - 454, 295, 438, 295, 295, 295, 295, 454, 295, 295, - 454, 295, 41, 36, 454, 438, 41, 36, 295, 295, - 41, 36, 198, 295, 38, 295, 295, 295, 319, 318, - 315, 245, 319, 318, 315, 245, 319, 318, 315, 245, - 295, 438, 295, 147, 438, 295, 454, 167, 438, 295, - 295, 295, 295, 264, 295, 295, 40, 20, 305, 227, - 41, 36, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 174, 295, 295, 295, 295, 319, 318, 315, 245, - 198, 295, 38, 295, 198, 295, 38, 142, 198, 295, - 38, 167, 295, 295, 173, 295, 295, 264, 295, 295, - 40, 20, 305, 295, 295, 295, 107, 295, 198, 29, - 38, 295, 198, 295, 38, 174, 295, 295, 41, 36, - 295, 295, 41, 36, 295, 244, 41, 36, 295, 295, - 295, 295, 295, 295, 319, 318, 315, 245, 319, 318, - 315, 245, 319, 318, 315, 245, 41, 36, 295, 295, - 41, 36, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 319, 318, 315, 245, 319, 318, 315, 245, - 198, 295, 295, 295, 295, 295, 295, 295, 295, 295, - 295, 295, 295, 295, 349, 295, 295, 295, 202, 295, - 295, 295, 295, 295, 295, 295, 295, 33, 295, 295, - 295, 295, 295, 13, 295, 295, 425, 295, 295, 295, - 295, 295, 295, 295, 295, 295, 295, 425, + const YY_SZ_ACTTAB = 2076; + const YY_SHIFT_USE_DFLT = -23; + const YY_SHIFT_MAX = 227; + const YY_REDUCE_USE_DFLT = -68; + const YY_REDUCE_MAX = 176; + const YYNOCODE = 108; + const YYSTACKDEPTH = 500; + const YYNSTATE = 323; + const YYNRULE = 186; + const YYERRORSYMBOL = 61; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + + public static $yy_action = array( + 42, 266, 267, 379, 115, 202, 27, 204, 260, 235, + 237, 1, 17, 125, 94, 182, 379, 215, 10, 79, + 317, 168, 379, 12, 107, 425, 308, 318, 224, 298, + 218, 129, 189, 292, 21, 203, 425, 27, 11, 39, + 38, 299, 219, 17, 213, 385, 191, 245, 77, 3, + 303, 315, 42, 385, 160, 385, 75, 29, 385, 95, + 260, 235, 237, 1, 385, 126, 385, 193, 385, 215, + 10, 79, 80, 290, 145, 226, 107, 148, 172, 150, + 224, 298, 218, 85, 217, 315, 21, 280, 101, 280, + 141, 39, 38, 299, 219, 20, 287, 183, 191, 232, + 77, 3, 42, 315, 16, 176, 316, 172, 75, 275, + 260, 235, 237, 1, 167, 128, 236, 193, 319, 215, + 10, 79, 345, 40, 14, 257, 107, 319, 345, 5, + 224, 298, 218, 89, 217, 315, 30, 292, 172, 203, + 74, 39, 38, 299, 219, 132, 287, 205, 191, 74, + 77, 3, 42, 315, 210, 194, 310, 99, 75, 345, + 260, 235, 237, 1, 425, 126, 87, 179, 319, 215, + 10, 79, 345, 95, 195, 425, 107, 272, 345, 176, + 224, 298, 218, 315, 199, 115, 21, 128, 278, 209, + 74, 39, 38, 299, 219, 94, 287, 226, 191, 129, + 77, 3, 42, 315, 277, 309, 11, 308, 75, 13, + 260, 235, 237, 1, 163, 127, 425, 193, 319, 215, + 10, 79, 77, 254, 19, 315, 107, 425, 137, 34, + 224, 298, 218, 196, 217, 33, 21, 220, 280, 159, + 74, 39, 38, 299, 219, 196, 287, 8, 191, 162, + 77, 3, 42, 315, 294, 222, 196, 438, 75, 378, + 260, 235, 237, 1, 438, 126, 16, 193, 271, 215, + 10, 79, 378, 172, 302, 315, 107, 175, 378, 267, + 224, 298, 218, 27, 178, 252, 21, 164, 296, 17, + 83, 39, 38, 299, 219, 196, 287, 205, 191, 170, + 77, 3, 42, 315, 270, 18, 144, 99, 75, 346, + 260, 235, 237, 1, 142, 126, 280, 177, 84, 215, + 10, 79, 346, 172, 280, 4, 107, 95, 346, 321, + 224, 298, 218, 438, 217, 131, 21, 321, 426, 24, + 438, 39, 38, 299, 219, 196, 287, 205, 191, 426, + 77, 3, 42, 315, 201, 9, 101, 99, 75, 381, + 260, 235, 237, 1, 149, 124, 102, 193, 22, 215, + 10, 79, 381, 315, 99, 231, 107, 311, 381, 425, + 224, 298, 218, 23, 217, 319, 7, 207, 196, 17, + 425, 39, 38, 299, 219, 307, 287, 36, 191, 154, + 77, 3, 42, 315, 161, 296, 227, 74, 75, 280, + 260, 235, 237, 1, 16, 91, 273, 76, 312, 215, + 10, 79, 317, 208, 190, 12, 107, 176, 196, 318, + 224, 298, 218, 135, 217, 321, 21, 196, 35, 95, + 263, 39, 38, 299, 219, 157, 287, 111, 191, 88, + 77, 3, 42, 315, 169, 280, 225, 15, 75, 285, + 260, 235, 237, 1, 155, 126, 226, 184, 101, 215, + 10, 79, 454, 172, 280, 454, 107, 246, 253, 454, + 224, 298, 218, 152, 217, 111, 21, 161, 296, 265, + 6, 39, 38, 299, 219, 269, 287, 203, 191, 119, + 77, 3, 42, 315, 158, 262, 321, 274, 75, 97, + 260, 235, 237, 1, 153, 128, 165, 193, 151, 215, + 10, 79, 317, 43, 280, 12, 107, 320, 280, 318, + 224, 298, 218, 8, 217, 171, 30, 306, 196, 36, + 172, 39, 38, 299, 219, 264, 287, 256, 191, 128, + 77, 288, 78, 315, 510, 90, 166, 296, 75, 41, + 37, 223, 104, 228, 250, 251, 255, 122, 226, 289, + 260, 235, 237, 1, 239, 233, 238, 240, 241, 215, + 10, 79, 229, 305, 77, 304, 107, 315, 281, 300, + 224, 298, 218, 261, 211, 203, 314, 28, 86, 108, + 140, 181, 96, 61, 214, 247, 317, 454, 94, 12, + 454, 297, 322, 318, 454, 29, 259, 192, 249, 248, + 308, 313, 138, 27, 302, 143, 130, 82, 95, 17, + 261, 211, 203, 314, 252, 86, 108, 286, 180, 96, + 50, 136, 139, 100, 152, 94, 454, 81, 297, 322, + 295, 321, 146, 259, 192, 249, 295, 308, 261, 295, + 203, 295, 295, 110, 295, 295, 197, 105, 64, 295, + 295, 295, 295, 94, 295, 295, 297, 322, 295, 295, + 295, 259, 192, 249, 261, 308, 203, 276, 295, 110, + 108, 295, 181, 96, 61, 187, 282, 295, 317, 94, + 295, 12, 297, 322, 295, 318, 295, 259, 192, 249, + 295, 308, 295, 291, 295, 295, 295, 295, 295, 260, + 235, 237, 2, 295, 293, 295, 295, 295, 215, 10, + 79, 295, 295, 295, 295, 107, 291, 206, 295, 224, + 298, 218, 260, 235, 237, 2, 295, 293, 295, 295, + 295, 215, 10, 79, 295, 295, 295, 295, 107, 295, + 295, 295, 224, 298, 218, 295, 295, 295, 26, 261, + 295, 203, 295, 295, 110, 295, 295, 197, 113, 60, + 295, 295, 295, 295, 94, 156, 295, 297, 322, 167, + 284, 26, 259, 192, 249, 280, 308, 295, 40, 14, + 257, 295, 261, 200, 203, 295, 295, 110, 295, 295, + 197, 105, 64, 172, 295, 295, 295, 94, 295, 295, + 297, 322, 295, 295, 295, 259, 192, 249, 295, 308, + 295, 295, 295, 295, 261, 295, 203, 295, 295, 98, + 283, 295, 197, 113, 51, 295, 201, 295, 295, 94, + 295, 295, 297, 322, 295, 295, 295, 259, 192, 249, + 261, 308, 203, 295, 295, 110, 295, 295, 197, 113, + 60, 295, 295, 295, 295, 94, 295, 295, 297, 322, + 295, 295, 295, 259, 192, 249, 295, 308, 261, 295, + 203, 295, 295, 110, 188, 295, 197, 113, 60, 196, + 31, 43, 295, 94, 295, 295, 297, 322, 295, 295, + 295, 259, 192, 249, 295, 308, 261, 295, 203, 295, + 295, 98, 198, 295, 197, 113, 45, 295, 109, 295, + 295, 94, 295, 295, 297, 322, 295, 41, 37, 259, + 192, 249, 261, 308, 203, 295, 295, 110, 295, 295, + 197, 113, 67, 233, 238, 240, 241, 94, 295, 295, + 297, 322, 295, 295, 295, 259, 192, 249, 295, 308, + 261, 295, 203, 295, 295, 110, 295, 295, 197, 113, + 57, 196, 295, 43, 295, 94, 295, 295, 297, 322, + 295, 295, 295, 259, 192, 249, 295, 308, 261, 295, + 203, 295, 295, 110, 295, 295, 197, 113, 46, 295, + 295, 295, 295, 94, 295, 295, 297, 322, 295, 41, + 37, 259, 192, 249, 261, 308, 203, 295, 295, 110, + 295, 295, 197, 113, 66, 233, 238, 240, 241, 94, + 301, 295, 297, 322, 295, 295, 295, 259, 192, 249, + 295, 308, 261, 295, 203, 295, 295, 110, 295, 295, + 197, 113, 72, 196, 295, 43, 295, 94, 295, 295, + 297, 322, 295, 295, 295, 259, 192, 249, 295, 308, + 261, 295, 203, 295, 295, 110, 295, 295, 197, 113, + 53, 295, 295, 295, 295, 94, 295, 295, 297, 322, + 230, 41, 37, 259, 192, 249, 261, 308, 203, 295, + 295, 110, 295, 295, 197, 113, 48, 233, 238, 240, + 241, 94, 295, 295, 297, 322, 295, 295, 295, 259, + 192, 249, 295, 308, 261, 295, 203, 295, 295, 110, + 295, 295, 185, 103, 49, 196, 295, 43, 295, 94, + 295, 295, 297, 322, 295, 295, 295, 259, 192, 249, + 295, 308, 261, 295, 203, 295, 295, 110, 295, 295, + 197, 113, 55, 134, 295, 295, 295, 94, 295, 295, + 297, 322, 295, 41, 37, 259, 192, 249, 261, 308, + 203, 295, 295, 110, 295, 295, 197, 113, 71, 233, + 238, 240, 241, 94, 295, 295, 297, 322, 295, 295, + 295, 259, 192, 249, 295, 308, 261, 295, 203, 295, + 295, 110, 295, 295, 197, 113, 59, 196, 295, 43, + 295, 94, 295, 295, 297, 322, 295, 295, 295, 259, + 192, 249, 295, 308, 261, 295, 203, 295, 295, 110, + 295, 295, 197, 113, 63, 295, 295, 295, 295, 94, + 295, 295, 297, 322, 216, 41, 37, 259, 192, 249, + 261, 308, 203, 295, 295, 110, 295, 295, 197, 113, + 62, 233, 238, 240, 241, 94, 295, 295, 297, 322, + 295, 295, 295, 259, 192, 249, 295, 308, 261, 295, + 203, 295, 295, 110, 295, 295, 197, 92, 69, 196, + 295, 43, 295, 94, 295, 295, 297, 322, 295, 295, + 295, 259, 192, 249, 295, 308, 261, 295, 203, 295, + 295, 110, 295, 295, 197, 113, 52, 295, 295, 295, + 295, 94, 295, 295, 297, 322, 295, 41, 37, 259, + 192, 249, 261, 308, 203, 295, 295, 110, 295, 295, + 197, 113, 65, 233, 238, 240, 241, 94, 295, 295, + 297, 322, 295, 196, 295, 259, 192, 249, 295, 308, + 261, 295, 203, 295, 295, 110, 295, 349, 197, 113, + 58, 221, 295, 295, 295, 94, 295, 295, 297, 322, + 27, 295, 295, 259, 192, 249, 17, 308, 261, 425, + 203, 295, 295, 110, 295, 295, 197, 113, 56, 295, + 425, 295, 295, 94, 295, 295, 297, 322, 295, 295, + 295, 259, 192, 249, 261, 308, 203, 295, 295, 110, + 295, 295, 197, 113, 44, 295, 295, 295, 295, 94, + 295, 295, 297, 322, 295, 295, 295, 259, 192, 249, + 295, 308, 261, 295, 203, 295, 295, 110, 295, 295, + 197, 93, 70, 295, 295, 295, 295, 94, 295, 295, + 297, 322, 295, 295, 295, 259, 192, 249, 295, 308, + 261, 295, 203, 295, 295, 110, 295, 295, 186, 113, + 54, 295, 295, 295, 295, 94, 295, 295, 297, 322, + 295, 295, 295, 259, 192, 249, 261, 308, 203, 295, + 295, 110, 295, 295, 197, 113, 73, 295, 295, 295, + 295, 94, 295, 295, 297, 322, 295, 295, 295, 259, + 192, 249, 295, 308, 261, 295, 203, 295, 295, 110, + 295, 295, 197, 113, 68, 295, 295, 295, 295, 94, + 295, 295, 297, 322, 295, 295, 295, 259, 192, 249, + 295, 308, 261, 295, 203, 295, 295, 110, 295, 295, + 197, 93, 47, 295, 295, 295, 295, 94, 295, 295, + 297, 322, 391, 391, 391, 259, 192, 249, 261, 308, + 203, 295, 295, 110, 295, 295, 197, 113, 51, 295, + 295, 295, 295, 94, 295, 295, 297, 322, 196, 295, + 43, 259, 192, 249, 295, 308, 295, 295, 425, 295, + 391, 391, 295, 295, 295, 261, 295, 203, 295, 425, + 110, 295, 295, 197, 118, 27, 391, 391, 391, 391, + 94, 17, 295, 295, 258, 295, 41, 37, 259, 192, + 249, 261, 308, 203, 295, 196, 110, 43, 295, 197, + 120, 295, 233, 238, 240, 241, 94, 295, 295, 295, + 243, 295, 295, 295, 259, 192, 249, 295, 308, 295, + 32, 295, 27, 212, 295, 295, 295, 295, 17, 295, + 295, 295, 454, 41, 37, 454, 295, 295, 295, 454, + 438, 295, 295, 295, 295, 295, 295, 295, 295, 233, + 238, 240, 241, 295, 295, 261, 295, 203, 295, 295, + 110, 295, 295, 197, 112, 295, 438, 295, 295, 438, + 94, 454, 212, 438, 268, 295, 295, 295, 259, 192, + 249, 454, 308, 212, 454, 295, 295, 34, 454, 438, + 295, 295, 454, 295, 295, 454, 295, 133, 4, 454, + 438, 167, 295, 295, 295, 295, 295, 280, 295, 295, + 40, 14, 257, 295, 295, 438, 295, 295, 438, 261, + 454, 203, 438, 295, 110, 172, 438, 197, 121, 438, + 261, 454, 203, 438, 94, 110, 295, 295, 197, 117, + 295, 295, 259, 192, 249, 94, 308, 295, 295, 295, + 295, 295, 295, 259, 192, 249, 261, 308, 203, 295, + 295, 110, 295, 295, 197, 116, 295, 261, 295, 203, + 295, 94, 110, 295, 295, 197, 114, 295, 295, 259, + 192, 249, 94, 308, 196, 295, 43, 295, 295, 295, + 259, 192, 249, 261, 308, 203, 295, 196, 110, 43, + 295, 197, 123, 295, 295, 295, 106, 295, 94, 295, + 196, 174, 43, 295, 295, 295, 259, 192, 249, 196, + 308, 43, 41, 37, 244, 295, 295, 295, 295, 295, + 295, 295, 295, 234, 295, 41, 37, 295, 233, 238, + 240, 241, 295, 295, 295, 295, 295, 295, 41, 37, + 295, 233, 238, 240, 241, 295, 295, 41, 37, 295, + 295, 295, 295, 295, 233, 238, 240, 241, 25, 196, + 295, 43, 295, 233, 238, 240, 241, 454, 295, 295, + 454, 295, 295, 279, 454, 438, 212, 295, 295, 295, + 295, 295, 295, 295, 295, 454, 295, 295, 454, 295, + 295, 295, 454, 438, 196, 295, 43, 41, 37, 295, + 295, 438, 295, 196, 438, 43, 454, 295, 438, 295, + 295, 295, 295, 233, 238, 240, 241, 173, 295, 438, + 295, 295, 438, 295, 454, 295, 438, 454, 295, 295, + 454, 295, 41, 37, 454, 438, 295, 295, 295, 295, + 295, 41, 37, 295, 295, 295, 242, 295, 233, 238, + 240, 241, 295, 295, 295, 295, 295, 233, 238, 240, + 241, 438, 295, 295, 438, 295, 454, 147, 438, 295, + 295, 167, 295, 295, 295, 295, 295, 280, 295, 295, + 40, 14, 257, 295, 295, 295, 295, 295, 295, 295, + 295, 295, 295, 295, 295, 172, ); - static public $yy_lookahead = array( + + public static $yy_lookahead = array( 3, 9, 10, 15, 71, 17, 28, 74, 11, 12, 13, 14, 34, 16, 81, 18, 28, 20, 21, 22, 11, 82, 34, 14, 27, 37, 93, 18, 31, 32, @@ -431,262 +324,255 @@ class Smarty_Internal_Templateparser 11, 12, 13, 14, 34, 16, 36, 18, 38, 20, 21, 22, 105, 106, 94, 45, 27, 73, 101, 73, 31, 32, 33, 77, 35, 54, 37, 83, 48, 83, - 65, 42, 43, 44, 45, 14, 47, 16, 49, 18, + 94, 42, 43, 44, 45, 14, 47, 16, 49, 18, 51, 52, 3, 54, 36, 101, 38, 101, 59, 15, 11, 12, 13, 14, 77, 16, 35, 18, 24, 20, - 21, 22, 28, 86, 87, 88, 27, 24, 34, 73, - 31, 32, 33, 77, 35, 54, 37, 36, 101, 83, - 46, 42, 43, 44, 45, 16, 47, 70, 49, 46, - 51, 52, 3, 54, 53, 81, 53, 101, 59, 15, - 11, 12, 13, 14, 23, 16, 37, 18, 24, 20, - 21, 22, 28, 99, 97, 98, 27, 36, 34, 82, + 21, 22, 28, 86, 87, 88, 27, 24, 34, 37, + 31, 32, 33, 82, 35, 54, 37, 66, 101, 68, + 46, 42, 43, 44, 45, 16, 47, 71, 49, 46, + 51, 52, 3, 54, 78, 79, 53, 81, 59, 15, + 11, 12, 13, 14, 37, 16, 37, 18, 24, 20, + 21, 22, 28, 19, 65, 48, 27, 106, 34, 101, 31, 32, 33, 54, 35, 71, 37, 16, 74, 18, - 46, 42, 43, 44, 45, 81, 47, 45, 49, 77, - 51, 52, 3, 54, 90, 53, 18, 93, 59, 30, - 11, 12, 13, 14, 101, 16, 37, 18, 24, 20, - 21, 22, 51, 101, 102, 54, 27, 48, 1, 17, - 31, 32, 33, 24, 35, 14, 37, 16, 50, 18, - 46, 42, 43, 44, 45, 1, 47, 36, 49, 38, - 51, 52, 3, 54, 60, 46, 1, 45, 59, 15, - 11, 12, 13, 14, 52, 16, 8, 18, 10, 20, - 21, 22, 28, 97, 98, 54, 27, 36, 34, 38, + 46, 42, 43, 44, 45, 81, 47, 45, 49, 45, + 51, 52, 3, 54, 90, 53, 52, 93, 59, 30, + 11, 12, 13, 14, 82, 16, 37, 18, 24, 20, + 21, 22, 51, 18, 14, 54, 27, 48, 73, 17, + 31, 32, 33, 1, 35, 14, 37, 16, 83, 18, + 46, 42, 43, 44, 45, 1, 47, 37, 49, 77, + 51, 52, 3, 54, 60, 50, 1, 45, 59, 15, + 11, 12, 13, 14, 52, 16, 36, 18, 38, 20, + 21, 22, 28, 101, 102, 54, 27, 8, 34, 10, 31, 32, 33, 28, 35, 95, 37, 97, 98, 34, - 2, 42, 43, 44, 45, 1, 47, 71, 49, 102, - 51, 52, 3, 54, 78, 79, 73, 81, 59, 15, - 11, 12, 13, 14, 71, 16, 83, 18, 17, 20, - 21, 22, 28, 19, 81, 24, 27, 73, 34, 96, - 31, 32, 33, 17, 35, 19, 37, 83, 1, 2, - 17, 42, 43, 44, 45, 1, 47, 71, 49, 45, - 51, 52, 3, 54, 78, 101, 52, 81, 59, 15, - 11, 12, 13, 14, 48, 16, 45, 18, 45, 20, - 21, 22, 28, 52, 14, 16, 27, 18, 34, 37, - 31, 32, 33, 66, 35, 68, 37, 45, 64, 65, - 48, 42, 43, 44, 45, 53, 47, 37, 49, 71, - 51, 52, 3, 54, 73, 37, 78, 37, 59, 81, - 11, 12, 13, 14, 83, 16, 48, 18, 48, 20, - 21, 22, 11, 106, 37, 14, 27, 96, 1, 18, - 31, 32, 33, 1, 35, 48, 37, 73, 1, 73, - 16, 42, 43, 44, 45, 73, 47, 83, 49, 83, - 51, 52, 3, 54, 73, 83, 19, 30, 59, 77, - 11, 12, 13, 14, 83, 16, 70, 18, 28, 20, - 21, 22, 11, 94, 34, 14, 27, 82, 54, 18, - 31, 32, 33, 101, 35, 53, 37, 94, 45, 96, - 94, 42, 43, 44, 45, 66, 47, 68, 49, 92, - 51, 52, 3, 54, 19, 77, 99, 94, 59, 96, - 11, 12, 13, 14, 38, 16, 37, 18, 92, 20, - 21, 22, 62, 63, 18, 99, 27, 97, 98, 101, - 31, 32, 33, 48, 35, 16, 37, 25, 16, 51, - 18, 42, 43, 44, 45, 37, 47, 18, 49, 18, - 51, 41, 9, 54, 53, 53, 15, 18, 59, 66, - 67, 68, 69, 2, 71, 72, 18, 74, 75, 76, - 18, 49, 11, 51, 81, 14, 54, 84, 85, 18, - 19, 18, 89, 90, 91, 18, 93, 4, 5, 6, - 7, 8, 18, 35, 11, 12, 13, 14, 17, 15, - 18, 35, 81, 20, 21, 22, 45, 51, 19, 48, - 27, 50, 94, 52, 31, 32, 33, 66, 67, 68, - 69, 83, 71, 72, 80, 74, 75, 76, 95, 94, - 81, 94, 81, 107, 94, 84, 85, 107, 96, 94, - 89, 90, 91, 81, 93, 66, 107, 68, 98, 107, - 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, - 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, - 91, 66, 93, 68, 69, 107, 71, 72, 107, 74, - 75, 76, 103, 104, 107, 11, 81, 107, 14, 84, - 85, 107, 18, 107, 89, 90, 91, 107, 93, 107, - 5, 107, 107, 107, 107, 107, 11, 12, 13, 14, - 107, 16, 107, 107, 107, 20, 21, 22, 11, 107, - 107, 14, 27, 5, 50, 18, 31, 32, 33, 11, - 12, 13, 14, 107, 16, 28, 107, 30, 20, 21, - 22, 34, 107, 107, 107, 27, 107, 107, 107, 31, - 32, 33, 107, 107, 59, 60, 66, 107, 68, 107, - 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, - 107, 81, 107, 107, 84, 85, 107, 59, 60, 89, - 90, 91, 66, 93, 68, 107, 11, 71, 107, 14, - 74, 75, 76, 18, 104, 11, 107, 81, 14, 107, - 84, 85, 18, 107, 107, 89, 90, 91, 107, 93, - 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, - 74, 75, 76, 107, 107, 50, 107, 81, 107, 107, - 84, 85, 107, 107, 50, 89, 90, 91, 107, 93, - 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, - 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, - 107, 107, 66, 107, 68, 107, 100, 71, 107, 107, - 74, 75, 76, 107, 78, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 94, 42, 43, 44, 45, 1, 47, 71, 49, 77, + 51, 52, 3, 54, 78, 23, 73, 81, 59, 15, + 11, 12, 13, 14, 73, 16, 83, 18, 36, 20, + 21, 22, 28, 101, 83, 17, 27, 19, 34, 96, + 31, 32, 33, 45, 35, 16, 37, 96, 37, 41, + 52, 42, 43, 44, 45, 1, 47, 71, 49, 48, + 51, 52, 3, 54, 78, 37, 48, 81, 59, 15, + 11, 12, 13, 14, 71, 16, 48, 18, 17, 20, + 21, 22, 28, 54, 81, 24, 27, 70, 34, 37, + 31, 32, 33, 28, 35, 24, 37, 45, 1, 34, + 48, 42, 43, 44, 45, 53, 47, 2, 49, 73, + 51, 52, 3, 54, 97, 98, 19, 46, 59, 83, + 11, 12, 13, 14, 36, 16, 38, 18, 98, 20, + 21, 22, 11, 64, 65, 14, 27, 101, 1, 18, + 31, 32, 33, 94, 35, 96, 37, 1, 17, 19, + 92, 42, 43, 44, 45, 73, 47, 99, 49, 77, + 51, 52, 3, 54, 16, 83, 18, 30, 59, 70, + 11, 12, 13, 14, 73, 16, 45, 18, 48, 20, + 21, 22, 11, 101, 83, 14, 27, 35, 92, 18, + 31, 32, 33, 94, 35, 99, 37, 97, 98, 53, + 36, 42, 43, 44, 45, 66, 47, 68, 49, 18, + 51, 52, 3, 54, 94, 38, 96, 53, 59, 81, + 11, 12, 13, 14, 73, 16, 77, 18, 73, 20, + 21, 22, 11, 3, 83, 14, 27, 99, 83, 18, + 31, 32, 33, 37, 35, 18, 37, 18, 1, 2, + 101, 42, 43, 44, 45, 35, 47, 18, 49, 16, + 51, 18, 18, 54, 62, 63, 97, 98, 59, 39, + 40, 50, 18, 4, 5, 6, 7, 8, 45, 16, + 11, 12, 13, 14, 18, 55, 56, 57, 58, 20, + 21, 22, 49, 53, 51, 53, 27, 54, 18, 15, + 31, 32, 33, 66, 67, 68, 69, 25, 71, 72, + 51, 74, 75, 76, 18, 18, 11, 11, 81, 14, + 14, 84, 85, 18, 18, 17, 89, 90, 91, 9, + 93, 15, 51, 28, 102, 30, 81, 81, 19, 34, + 66, 67, 68, 69, 95, 71, 72, 83, 74, 75, + 76, 94, 94, 80, 94, 81, 50, 81, 84, 85, + 107, 96, 94, 89, 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 78, 107, 107, 81, 107, 107, 84, 85, 107, 107, - 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, - 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, - 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, - 107, 93, 107, 107, 66, 107, 68, 107, 107, 71, - 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 66, 93, 68, 69, 107, 71, + 72, 107, 74, 75, 76, 103, 104, 107, 11, 81, + 107, 14, 84, 85, 107, 18, 107, 89, 90, 91, + 107, 93, 107, 5, 107, 107, 107, 107, 107, 11, + 12, 13, 14, 107, 16, 107, 107, 107, 20, 21, + 22, 107, 107, 107, 107, 27, 5, 50, 107, 31, + 32, 33, 11, 12, 13, 14, 107, 16, 107, 107, + 107, 20, 21, 22, 107, 107, 107, 107, 27, 107, + 107, 107, 31, 32, 33, 107, 107, 59, 60, 66, + 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, + 107, 107, 107, 107, 81, 73, 107, 84, 85, 77, + 59, 60, 89, 90, 91, 83, 93, 107, 86, 87, + 88, 107, 66, 100, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 101, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, + 107, 107, 107, 107, 66, 107, 68, 107, 107, 71, + 104, 107, 74, 75, 76, 107, 78, 107, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, - 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, - 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, - 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, - 90, 91, 107, 93, 107, 107, 66, 107, 68, 107, - 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, - 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 107, 107, 107, 89, 90, 91, 107, 93, 66, 107, + 68, 107, 107, 71, 100, 107, 74, 75, 76, 1, + 2, 3, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 66, 107, 68, 107, + 107, 71, 100, 107, 74, 75, 76, 107, 78, 107, + 107, 81, 107, 107, 84, 85, 107, 39, 40, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, - 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, - 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, - 107, 89, 90, 91, 107, 93, 107, 107, 66, 107, + 74, 75, 76, 55, 56, 57, 58, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, + 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 1, 107, 3, 107, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, - 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, - 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, - 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, - 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, - 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, - 107, 107, 107, 89, 90, 91, 107, 93, 107, 107, + 107, 107, 107, 81, 107, 107, 84, 85, 107, 39, + 40, 89, 90, 91, 66, 93, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 55, 56, 57, 58, 81, + 60, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 1, 107, 3, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, - 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, - 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 38, 39, 40, 89, 90, 91, 66, 93, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 55, 56, 57, + 58, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 1, 107, 3, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 29, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 39, 40, 89, 90, 91, 66, 93, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 55, + 56, 57, 58, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 66, 107, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 1, 107, 3, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, + 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 38, 39, 40, 89, 90, 91, + 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 76, 55, 56, 57, 58, 81, 107, 107, 84, 85, + 107, 107, 107, 89, 90, 91, 107, 93, 66, 107, + 68, 107, 107, 71, 107, 107, 74, 75, 76, 1, + 107, 3, 107, 81, 107, 107, 84, 85, 107, 107, + 107, 89, 90, 91, 107, 93, 66, 107, 68, 107, + 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, + 107, 81, 107, 107, 84, 85, 107, 39, 40, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, - 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, - 107, 107, 66, 107, 68, 107, 107, 71, 107, 107, - 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 74, 75, 76, 55, 56, 57, 58, 81, 107, 107, + 84, 85, 107, 1, 107, 89, 90, 91, 107, 93, + 66, 107, 68, 107, 107, 71, 107, 15, 74, 75, + 76, 19, 107, 107, 107, 81, 107, 107, 84, 85, + 28, 107, 107, 89, 90, 91, 34, 93, 66, 37, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, + 48, 107, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, - 107, 93, 107, 107, 66, 107, 68, 107, 107, 71, - 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, - 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, - 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, + 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, + 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, + 84, 85, 107, 107, 107, 89, 90, 91, 107, 93, + 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, - 90, 91, 107, 93, 107, 107, 66, 107, 68, 107, - 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, - 107, 81, 107, 107, 84, 85, 107, 107, 107, 89, - 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, + 90, 91, 107, 93, 66, 107, 68, 107, 107, 71, + 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, + 107, 107, 84, 85, 107, 107, 107, 89, 90, 91, + 107, 93, 66, 107, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, 107, 107, - 84, 85, 107, 107, 107, 89, 90, 91, 66, 93, + 84, 85, 1, 2, 3, 89, 90, 91, 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, - 107, 89, 90, 91, 107, 93, 107, 107, 66, 107, - 68, 107, 107, 71, 107, 107, 74, 75, 76, 107, - 107, 107, 107, 81, 107, 107, 84, 85, 107, 107, - 107, 89, 90, 91, 66, 93, 68, 107, 107, 71, - 107, 107, 74, 75, 76, 107, 107, 107, 107, 81, - 107, 107, 84, 85, 1, 2, 3, 89, 90, 91, - 66, 93, 68, 107, 107, 71, 107, 107, 74, 75, - 76, 107, 107, 107, 107, 81, 107, 107, 84, 85, - 107, 107, 107, 89, 90, 91, 107, 93, 107, 107, - 37, 107, 39, 40, 107, 107, 107, 107, 66, 107, - 68, 48, 1, 71, 3, 107, 74, 75, 55, 56, - 57, 58, 3, 81, 107, 107, 107, 85, 107, 107, - 107, 89, 90, 91, 107, 93, 107, 26, 66, 28, - 68, 107, 107, 71, 107, 34, 74, 75, 107, 107, - 39, 40, 1, 81, 3, 107, 107, 85, 39, 40, - 107, 89, 90, 91, 107, 93, 55, 56, 57, 58, - 107, 2, 107, 107, 55, 56, 57, 58, 107, 28, - 11, 107, 107, 14, 107, 34, 2, 18, 19, 107, - 39, 40, 107, 107, 107, 11, 107, 107, 14, 107, - 107, 17, 18, 19, 107, 107, 55, 56, 57, 58, - 107, 1, 107, 3, 45, 107, 107, 48, 66, 50, - 68, 52, 53, 71, 107, 15, 74, 75, 107, 45, - 107, 107, 48, 81, 50, 107, 52, 107, 1, 107, - 3, 89, 90, 91, 107, 93, 66, 107, 68, 39, - 40, 71, 107, 107, 74, 75, 107, 107, 107, 107, - 107, 81, 107, 107, 107, 55, 56, 57, 58, 89, - 90, 91, 2, 93, 107, 107, 39, 40, 107, 107, - 107, 11, 107, 107, 14, 107, 107, 17, 18, 19, - 107, 107, 55, 56, 57, 58, 107, 60, 107, 107, - 107, 66, 107, 68, 107, 107, 71, 107, 107, 74, - 75, 107, 107, 107, 107, 45, 81, 107, 48, 73, - 50, 107, 52, 77, 89, 90, 91, 107, 93, 83, - 107, 107, 86, 87, 88, 107, 107, 66, 107, 68, - 107, 1, 71, 3, 107, 74, 75, 101, 66, 107, - 68, 107, 81, 71, 107, 107, 74, 75, 107, 107, - 89, 90, 91, 81, 93, 107, 1, 107, 3, 107, - 107, 89, 90, 91, 107, 93, 66, 107, 68, 39, - 40, 71, 107, 107, 74, 75, 107, 107, 107, 107, - 107, 81, 107, 53, 29, 55, 56, 57, 58, 89, - 90, 91, 2, 93, 39, 40, 107, 107, 107, 107, - 107, 11, 107, 107, 14, 107, 107, 107, 18, 19, - 55, 56, 57, 58, 1, 107, 3, 107, 1, 107, - 3, 107, 1, 107, 3, 107, 107, 107, 15, 107, - 107, 107, 15, 107, 107, 45, 15, 107, 48, 107, - 50, 107, 52, 107, 107, 107, 107, 11, 107, 107, - 14, 107, 39, 40, 18, 19, 39, 40, 107, 107, - 39, 40, 1, 107, 3, 107, 107, 107, 55, 56, - 57, 58, 55, 56, 57, 58, 55, 56, 57, 58, - 107, 45, 107, 73, 48, 107, 50, 77, 52, 107, - 107, 107, 107, 83, 107, 107, 86, 87, 88, 38, - 39, 40, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 101, 107, 107, 107, 107, 55, 56, 57, 58, - 1, 107, 3, 107, 1, 107, 3, 73, 1, 107, - 3, 77, 107, 107, 15, 107, 107, 83, 107, 107, - 86, 87, 88, 107, 107, 107, 23, 107, 1, 2, - 3, 107, 1, 107, 3, 101, 107, 107, 39, 40, - 107, 107, 39, 40, 107, 38, 39, 40, 107, 107, - 107, 107, 107, 107, 55, 56, 57, 58, 55, 56, - 57, 58, 55, 56, 57, 58, 39, 40, 107, 107, - 39, 40, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 55, 56, 57, 58, 55, 56, 57, 58, - 1, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 15, 107, 107, 107, 19, 107, - 107, 107, 107, 107, 107, 107, 107, 28, 107, 107, - 107, 107, 107, 34, 107, 107, 37, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 48, + 107, 107, 107, 81, 107, 107, 84, 85, 1, 107, + 3, 89, 90, 91, 107, 93, 107, 107, 37, 107, + 39, 40, 107, 107, 107, 66, 107, 68, 107, 48, + 71, 107, 107, 74, 75, 28, 55, 56, 57, 58, + 81, 34, 107, 107, 85, 107, 39, 40, 89, 90, + 91, 66, 93, 68, 107, 1, 71, 3, 107, 74, + 75, 107, 55, 56, 57, 58, 81, 107, 107, 107, + 85, 107, 107, 107, 89, 90, 91, 107, 93, 107, + 26, 107, 28, 2, 107, 107, 107, 107, 34, 107, + 107, 107, 11, 39, 40, 14, 107, 107, 107, 18, + 19, 107, 107, 107, 107, 107, 107, 107, 107, 55, + 56, 57, 58, 107, 107, 66, 107, 68, 107, 107, + 71, 107, 107, 74, 75, 107, 45, 107, 107, 48, + 81, 50, 2, 52, 53, 107, 107, 107, 89, 90, + 91, 11, 93, 2, 14, 107, 107, 17, 18, 19, + 107, 107, 11, 107, 107, 14, 107, 73, 17, 18, + 19, 77, 107, 107, 107, 107, 107, 83, 107, 107, + 86, 87, 88, 107, 107, 45, 107, 107, 48, 66, + 50, 68, 52, 107, 71, 101, 45, 74, 75, 48, + 66, 50, 68, 52, 81, 71, 107, 107, 74, 75, + 107, 107, 89, 90, 91, 81, 93, 107, 107, 107, + 107, 107, 107, 89, 90, 91, 66, 93, 68, 107, + 107, 71, 107, 107, 74, 75, 107, 66, 107, 68, + 107, 81, 71, 107, 107, 74, 75, 107, 107, 89, + 90, 91, 81, 93, 1, 107, 3, 107, 107, 107, + 89, 90, 91, 66, 93, 68, 107, 1, 71, 3, + 107, 74, 75, 107, 107, 107, 23, 107, 81, 107, + 1, 15, 3, 107, 107, 107, 89, 90, 91, 1, + 93, 3, 39, 40, 15, 107, 107, 107, 107, 107, + 107, 107, 107, 15, 107, 39, 40, 107, 55, 56, + 57, 58, 107, 107, 107, 107, 107, 107, 39, 40, + 107, 55, 56, 57, 58, 107, 107, 39, 40, 107, + 107, 107, 107, 107, 55, 56, 57, 58, 2, 1, + 107, 3, 107, 55, 56, 57, 58, 11, 107, 107, + 14, 107, 107, 15, 18, 19, 2, 107, 107, 107, + 107, 107, 107, 107, 107, 11, 107, 107, 14, 107, + 107, 107, 18, 19, 1, 107, 3, 39, 40, 107, + 107, 45, 107, 1, 48, 3, 50, 107, 52, 107, + 107, 107, 107, 55, 56, 57, 58, 15, 107, 45, + 107, 107, 48, 107, 50, 107, 52, 11, 107, 107, + 14, 107, 39, 40, 18, 19, 107, 107, 107, 107, + 107, 39, 40, 107, 107, 107, 53, 107, 55, 56, + 57, 58, 107, 107, 107, 107, 107, 55, 56, 57, + 58, 45, 107, 107, 48, 107, 50, 73, 52, 107, + 107, 77, 107, 107, 107, 107, 107, 83, 107, 107, + 86, 87, 88, 107, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 101, ); - static public $yy_shift_ofst = array( - -23, 399, 399, 349, 99, 449, 449, 99, 349, 99, - 99, -3, 99, 99, 249, 99, 99, 99, 99, 299, - 99, 149, 199, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 299, 99, 99, 49, 49, 499, 499, - 499, 499, 499, 499, 1621, 1661, 1661, 1981, 2067, 2039, - 2047, 2043, 1747, 1850, 1720, 1941, 1937, 1875, 1933, 2071, - 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, 2071, - 2071, 2071, 1629, 1629, 522, 695, 2129, 171, 255, 129, - 718, 707, 9, 255, 316, 255, 129, 129, 304, 337, - 583, 1780, 244, 784, 221, 344, 294, 411, 40, 411, - 485, 359, 440, -22, -22, 427, 432, 424, -22, 359, - 437, 589, 227, 227, 227, 589, 227, 227, 227, 227, - -23, -23, -23, -23, 1679, 1694, 561, 1910, 1956, 81, - 674, 212, 461, -22, -22, -22, -14, -14, -22, 360, - -22, -22, -22, -22, -14, 31, 321, -22, -22, 301, - 321, -14, -14, -14, 31, -22, -22, -22, -14, -14, - 589, 589, 227, 508, 589, 288, 227, 227, 288, 227, - 227, -23, -23, -23, -23, -23, -23, 1573, 30, -12, - 94, 144, 775, 342, 194, 103, 179, 258, 211, 141, - 152, 68, 241, 209, 323, 387, 370, 368, 188, -8, - 101, 556, 567, 563, 552, 539, 548, 574, 443, 558, - 566, 582, 581, 584, 541, 543, 512, 519, 506, 476, - 479, 488, 508, 502, 501, 531, 529, 510, + + public static $yy_shift_ofst = array( + -23, 399, 399, 449, 49, 49, 449, 349, 49, 49, + 349, -3, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 149, 199, 299, 49, 149, 49, 49, + 49, 49, 49, 49, 249, 49, 99, 99, 499, 499, + 499, 499, 499, 499, 1664, 1617, 1617, 1144, 1982, 1973, + 1938, 1226, 1853, 1062, 980, 1879, 898, 1866, 1888, 1308, + 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, 1308, + 1308, 1308, 520, 520, 533, 731, 1372, 171, 255, 129, + 708, 595, 9, 154, 129, 255, 308, 129, 255, 537, + 559, 1751, 244, 344, 511, 221, 294, 411, 40, 411, + -22, 438, 438, 436, 387, 427, 319, 355, -22, -22, + 420, 609, 232, 232, 232, 609, 232, 232, 232, 232, + -23, -23, -23, -23, 1740, 1691, 1954, 1936, 1996, 81, + 687, 461, 212, -22, 31, -14, -14, -22, 288, -14, + 288, -14, -22, 31, -22, -14, -14, -22, -22, 351, + -22, -22, -14, -22, -22, -22, -22, -22, -14, 210, + 232, 609, 232, 395, 609, 232, 609, 232, 395, 92, + 232, -23, -23, -23, -23, -23, -23, 1591, 30, -12, + 94, 144, 342, 596, 179, 103, 194, 454, 230, 152, + 269, 301, 318, 127, 282, -8, 205, 361, 378, 421, + 68, 467, 556, 606, 571, 598, 587, 586, 610, 549, + 572, 574, 570, 532, 530, 553, 298, 523, 544, 510, + 92, 534, 529, 519, 517, 496, 442, 481, ); - static public $yy_reduce_ofst = array( - 460, 493, 551, 579, 605, 832, 806, 776, 690, 746, - 716, 1134, 1216, 1242, 1160, 1298, 1022, 1052, 1078, 1104, - 1268, 1488, 1514, 1432, 1462, 1324, 1350, 1406, 1380, 1186, - 888, 996, 970, 940, 914, 858, 1552, 1582, 1745, 1690, - 1781, 1820, 1792, 1662, 1974, 1930, 1756, 37, 37, 37, + + public static $yy_reduce_ofst = array( + 492, 527, 564, 592, 618, 703, 736, 768, 794, 822, + 850, 1068, 1096, 1122, 1150, 1286, 1204, 1232, 1260, 1040, + 1314, 1532, 1478, 1506, 1342, 1450, 1424, 1396, 1368, 1178, + 1014, 986, 932, 904, 876, 958, 1595, 1569, 1771, 1659, + 1760, 1734, 1723, 1797, 712, 1694, 1974, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 114, -33, 6, -67, 56, 226, - 317, 233, 331, 254, 77, 4, 276, 328, 190, 122, - 429, 396, -23, 393, 74, -23, -23, 393, 176, 413, - 176, 407, 381, 366, 364, -23, -23, 243, 372, 426, - 428, 430, -23, -23, 382, 176, -23, -23, -23, -23, - -23, 324, -23, -23, 537, 537, 537, 537, 537, 549, - 542, 537, 537, 538, 538, 538, 533, 533, 538, 540, - 538, 538, 538, 538, 533, 521, 518, 538, 538, 544, - 535, 533, 533, 533, 562, 538, 538, 538, 533, 533, - 550, 550, 113, 545, 550, 197, 113, 113, 197, 113, - 113, 379, 395, -20, 97, -61, 25, + 37, 37, 37, 37, 114, -33, 372, -67, 6, 76, + 71, 233, 241, 190, 226, 4, 307, 276, 326, 172, + 429, 389, -23, -23, 339, 428, -23, 410, 390, 339, + 391, 386, 348, -23, 222, -23, 293, 155, 441, 445, + 390, 459, -23, -23, -23, 390, -23, -23, -23, 439, + -23, -23, 359, -23, 550, 550, 550, 550, 550, 545, + 555, 550, 550, 554, 566, 539, 539, 554, 547, 539, + 548, 539, 554, 546, 554, 539, 539, 554, 554, 563, + 554, 554, 539, 554, 554, 554, 554, 554, 539, 558, + 78, 320, 78, 522, 320, 78, 320, 78, 522, 196, + 78, 51, -61, -20, -4, 109, 132, ); - static public $yyExpectedTokens = array( + + public static $yyExpectedTokens = array( array(), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), @@ -698,8 +584,9 @@ class Smarty_Internal_Templateparser array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), - array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54, - 59,), + array( + 3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54, 59, + ), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), array(3, 11, 12, 13, 14, 16, 18, 20, 21, 22, 27, 31, 32, 33, 35, 37, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59,), @@ -735,17 +622,17 @@ class Smarty_Internal_Templateparser array(1, 3, 26, 28, 34, 39, 40, 55, 56, 57, 58,), array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,), array(1, 3, 28, 34, 39, 40, 55, 56, 57, 58,), - array(1, 3, 38, 39, 40, 55, 56, 57, 58,), - array(1, 2, 3, 39, 40, 55, 56, 57, 58,), + array(1, 3, 29, 39, 40, 55, 56, 57, 58,), + array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 3, 39, 40, 53, 55, 56, 57, 58,), array(1, 3, 15, 39, 40, 55, 56, 57, 58,), array(1, 3, 38, 39, 40, 55, 56, 57, 58,), array(1, 3, 23, 39, 40, 55, 56, 57, 58,), + array(1, 3, 38, 39, 40, 55, 56, 57, 58,), array(1, 3, 39, 40, 55, 56, 57, 58, 60,), - array(1, 3, 39, 40, 53, 55, 56, 57, 58,), - array(1, 3, 15, 39, 40, 55, 56, 57, 58,), array(1, 3, 15, 39, 40, 55, 56, 57, 58,), + array(1, 2, 3, 39, 40, 55, 56, 57, 58,), array(1, 3, 15, 39, 40, 55, 56, 57, 58,), - array(1, 3, 29, 39, 40, 55, 56, 57, 58,), array(1, 3, 15, 39, 40, 55, 56, 57, 58,), array(1, 3, 39, 40, 55, 56, 57, 58,), array(1, 3, 39, 40, 55, 56, 57, 58,), @@ -771,34 +658,34 @@ class Smarty_Internal_Templateparser array(5, 11, 12, 13, 14, 16, 20, 21, 22, 27, 31, 32, 33, 59, 60,), array(11, 14, 18, 28, 30, 34,), array(11, 14, 18, 28, 34,), + array(19, 45, 52,), + array(16, 37, 54,), array(1, 28, 34,), array(17, 19, 48,), - array(1, 28, 34,), array(16, 37, 54,), - array(16, 37, 54,), - array(19, 45, 52,), + array(1, 28, 34,), array(1, 2,), array(4, 5, 6, 7, 8, 11, 12, 13, 14, 20, 21, 22, 27, 31, 32, 33,), array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,), array(1, 15, 28, 34,), + array(1, 15, 28, 34,), array(11, 14, 18, 50,), array(14, 16, 18, 54,), array(1, 15, 28, 34,), - array(1, 15, 28, 34,), array(11, 14, 18,), array(17, 19, 48,), array(11, 14, 18,), - array(19, 48,), - array(16, 18,), - array(28, 34,), array(28, 34,), - array(28, 34,), - array(1, 30,), + array(16, 18,), + array(16, 18,), array(1, 53,), + array(1, 19,), + array(1, 30,), array(16, 54,), array(28, 34,), - array(16, 18,), - array(1, 19,), + array(28, 34,), + array(28, 34,), + array(19, 48,), array(19,), array(1,), array(1,), @@ -812,52 +699,52 @@ class Smarty_Internal_Templateparser array(), array(), array(), - array(2, 11, 14, 18, 19, 45, 48, 50, 52, 53,), array(2, 11, 14, 17, 18, 19, 45, 48, 50, 52,), + array(2, 11, 14, 18, 19, 45, 48, 50, 52, 53,), array(2, 11, 14, 18, 19, 45, 48, 50, 52,), array(2, 11, 14, 18, 19, 45, 48, 50, 52,), array(11, 14, 18, 19, 45, 48, 50, 52,), array(14, 16, 18, 35, 54,), array(11, 14, 18, 50,), - array(17, 45, 52,), array(11, 14, 18,), + array(17, 45, 52,), array(28, 34,), - array(28, 34,), - array(28, 34,), + array(16, 54,), array(45, 52,), array(45, 52,), array(28, 34,), - array(14, 37,), - array(28, 34,), - array(28, 34,), + array(45, 52,), + array(45, 52,), + array(45, 52,), + array(45, 52,), array(28, 34,), + array(16, 54,), array(28, 34,), array(45, 52,), - array(16, 54,), array(45, 52,), array(28, 34,), array(28, 34,), array(17, 24,), + array(28, 34,), + array(28, 34,), array(45, 52,), - array(45, 52,), - array(45, 52,), - array(45, 52,), - array(16, 54,), + array(28, 34,), + array(28, 34,), array(28, 34,), array(28, 34,), array(28, 34,), array(45, 52,), - array(45, 52,), - array(19,), - array(19,), + array(14, 37,), array(1,), - array(37,), array(19,), + array(1,), array(2,), + array(19,), array(1,), + array(19,), array(1,), array(2,), - array(1,), + array(37,), array(1,), array(), array(), @@ -870,52 +757,52 @@ class Smarty_Internal_Templateparser array(15, 17, 28, 34, 37, 48,), array(15, 24, 28, 34, 46,), array(15, 24, 28, 34, 46,), - array(11, 14, 18, 50,), array(37, 45, 48, 53,), - array(24, 46, 60,), - array(24, 46, 53,), + array(11, 14, 18, 50,), array(30, 37, 48,), - array(8, 10,), + array(24, 46, 53,), + array(24, 46, 60,), + array(36, 53,), array(36, 38,), - array(23, 36,), array(45, 53,), - array(36, 38,), - array(36, 38,), - array(24, 46,), - array(17, 45,), + array(8, 10,), array(37, 48,), array(37, 48,), array(37, 48,), - array(18, 50,), + array(23, 36,), array(9, 10,), - array(36, 53,), + array(18, 50,), + array(24, 46,), + array(36, 38,), + array(17, 45,), + array(36, 38,), + array(38,), + array(18,), + array(15,), array(51,), + array(17,), array(18,), array(18,), + array(9,), + array(51,), + array(25,), + array(15,), array(18,), + array(53,), + array(53,), + array(16,), + array(41,), + array(45,), array(18,), + array(35,), + array(37,), array(18,), array(18,), - array(45,), - array(35,), - array(35,), array(18,), - array(17,), - array(15,), - array(15,), - array(9,), - array(25,), - array(16,), array(18,), - array(38,), - array(37,), - array(51,), array(37,), - array(53,), - array(53,), - array(18,), + array(35,), array(18,), - array(41,), array(), array(), array(), @@ -1012,77 +899,46 @@ class Smarty_Internal_Templateparser array(), array(), ); - static public $yy_default = array( - 334, 509, 509, 494, 509, 509, 509, 473, 509, 473, - 473, 509, 509, 509, 509, 509, 509, 509, 509, 509, + + public static $yy_default = array( + 334, 509, 509, 494, 509, 473, 509, 509, 473, 473, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, - 509, 509, 509, 509, 375, 375, 354, 509, 509, 509, - 509, 509, 509, 509, 509, 509, 347, 380, 509, 497, - 386, 495, 496, 471, 347, 359, 380, 472, 377, 397, - 382, 387, 401, 402, 509, 509, 413, 509, 375, 509, - 509, 375, 375, 375, 428, 375, 509, 509, 485, 366, - 323, 427, 389, 438, 509, 389, 389, 438, 428, 438, - 428, 509, 375, 375, 375, 389, 389, 509, 356, 509, - 369, 482, 400, 406, 371, 428, 396, 405, 389, 392, - 480, 332, 404, 393, 427, 427, 427, 427, 427, 509, - 440, 454, 438, 348, 364, 344, 436, 463, 365, 438, - 352, 355, 361, 357, 464, 509, 433, 362, 358, 509, - 431, 434, 435, 466, 509, 363, 350, 351, 465, 432, - 486, 460, 367, 438, 483, 475, 372, 395, 474, 370, - 422, 438, 479, 438, 479, 479, 332, 413, 409, 413, - 403, 403, 439, 413, 403, 403, 413, 330, 509, 509, - 409, 509, 509, 403, 409, 423, 413, 509, 509, 509, - 509, 509, 509, 509, 509, 509, 509, 509, 409, 509, - 411, 509, 509, 509, 509, 509, 383, 509, 509, 509, - 484, 509, 454, 418, 509, 509, 509, 415, 376, 388, - 447, 481, 446, 454, 445, 448, 453, 360, 468, 469, - 384, 459, 444, 450, 415, 490, 476, 477, 407, 368, - 478, 456, 457, 458, 416, 417, 443, 390, 391, 442, - 441, 425, 426, 437, 374, 353, 329, 331, 333, 328, - 327, 324, 325, 326, 335, 336, 341, 343, 373, 340, - 339, 337, 338, 408, 410, 506, 498, 499, 505, 461, - 455, 470, 342, 500, 503, 491, 493, 492, 501, 508, - 502, 504, 507, 462, 430, 398, 399, 421, 420, 419, - 412, 414, 418, 424, 451, 489, 394, 429, 488, 487, - 449, 452, 467, - ); - public static $yyFallback = array(); - public $yyTraceFILE; - public $yyTracePrompt; -public $yyidx; -public $yyerrcnt; -public $yystack = array(); - public $yyTokenName = array( - '$', 'VERT', 'COLON', 'UNIMATH', - 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', - 'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT', - 'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', 'LDEL', 'RDEL', - 'DOLLARID', 'EQUAL', 'ID', 'PTR', - 'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON', - 'INCDEC', 'TO', 'STEP', 'LDELFOREACH', - 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', - 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', - 'COMMA', 'OPENP', 'CLOSEP', 'MATH', - 'ISIN', 'QMARK', 'NOT', 'TYPECAST', - 'HEX', 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', - 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', - 'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP', - 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', - 'BACKTICK', 'error', 'start', 'template', - 'literal_e2', 'literal_e1', 'smartytag', 'tagbody', - 'tag', 'outattr', 'eqoutattr', 'varindexed', - 'output', 'attributes', 'variable', 'value', - 'expr', 'modifierlist', 'statement', 'statements', - 'foraction', 'varvar', 'modparameters', 'attribute', - 'ternary', 'array', 'tlop', 'lop', - 'scond', 'function', 'ns1', 'doublequoted_with_quotes', - 'static_class_access', 'object', 'arrayindex', 'indexdef', - 'varvarele', 'objectchain', 'objectelement', 'method', - 'params', 'modifier', 'modparameter', 'arrayelements', - 'arrayelement', 'doublequoted', 'doublequotedcontent', + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 375, 354, 375, 380, 509, 509, + 347, 509, 509, 509, 509, 509, 509, 509, 509, 397, + 472, 347, 471, 387, 497, 495, 382, 386, 359, 377, + 380, 496, 402, 401, 509, 509, 413, 509, 375, 509, + 509, 375, 375, 485, 509, 375, 428, 509, 375, 366, + 323, 427, 389, 389, 438, 509, 389, 438, 428, 438, + 375, 509, 509, 389, 369, 389, 509, 375, 375, 356, + 428, 482, 405, 389, 406, 428, 396, 392, 400, 371, + 480, 404, 332, 393, 427, 427, 427, 427, 427, 509, + 440, 438, 454, 355, 509, 436, 434, 365, 433, 432, + 431, 465, 364, 509, 363, 466, 463, 362, 352, 509, + 351, 357, 435, 344, 350, 358, 361, 348, 464, 438, + 422, 460, 367, 474, 486, 372, 483, 395, 475, 438, + 370, 479, 479, 438, 438, 332, 479, 413, 409, 413, + 403, 403, 413, 439, 413, 403, 403, 509, 509, 409, + 330, 423, 509, 413, 509, 509, 509, 403, 509, 409, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 383, 509, 509, 418, 509, 509, 415, 409, 509, 509, + 454, 509, 509, 509, 509, 484, 411, 509, 324, 426, + 415, 360, 442, 487, 444, 336, 443, 337, 488, 376, + 489, 490, 452, 481, 459, 454, 410, 441, 328, 419, + 325, 326, 437, 420, 477, 327, 476, 398, 399, 414, + 335, 421, 388, 424, 412, 451, 329, 331, 449, 333, + 384, 469, 500, 468, 491, 505, 343, 416, 417, 506, + 374, 391, 492, 493, 498, 341, 373, 418, 425, 353, + 501, 508, 507, 504, 502, 499, 461, 390, 368, 408, + 338, 503, 478, 453, 447, 446, 429, 445, 430, 448, + 450, 342, 462, 339, 340, 455, 470, 458, 457, 407, + 467, 456, 394, ); - public static $yyRuleName = array( + + public static $yyFallback = array(); + + public static $yyRuleName = array( 'start ::= template', 'template ::= template PHP', 'template ::= template TEXT', @@ -1270,7 +1126,8 @@ public $yystack = array(); 'doublequotedcontent ::= smartytag', 'doublequotedcontent ::= TEXT', ); - public static $yyRuleInfo = array( + + public static $yyRuleInfo = array( array(0 => 62, 1 => 1), array(0 => 63, 1 => 2), array(0 => 63, 1 => 2), @@ -1458,7 +1315,8 @@ public $yystack = array(); array(0 => 106, 1 => 1), array(0 => 106, 1 => 1), ); - public static $yyReduceMap = array( + + public static $yyReduceMap = array( 0 => 0, 1 => 1, 2 => 2, @@ -1644,16 +1502,172 @@ public $yystack = array(); 181 => 181, 184 => 184, 185 => 185, - ); /* Index of top element in stack */ - private $_retvalue; /* Shifts left before out of the error */ + ); /** + * result status + * + * @var bool + */ + public $successful = true; + + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + + /** + * @var + */ + public $yymajor; + + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + + /** + * last variable name + * + * @var string + */ + public $last_variable; + + /** + * root parse tree buffer + * + * @var Smarty_Internal_ParseTree_Template + */ + public $root_buffer; + + /** + * current parse tree object + * + * @var Smarty_Internal_ParseTree + */ + public $current_buffer; + + /** + * lexer object + * + * @var Smarty_Internal_Templatelexer + */ + public $lex; + + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + + /** + * compiler object + * + * @var Smarty_Internal_TemplateCompilerBase + */ + public $compiler = null; + + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * template object + * + * @var Smarty_Internal_Template + */ + public $template = null; + + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + + /** + * security object + * + * @var Smarty_Security + */ + public $security = null; + + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_prefix = array(); + + /** + * template prefix array + * + * @var \Smarty_Internal_ParseTree[] + */ + public $template_postfix = array(); + + public $yyTraceFILE; + + public $yyTracePrompt; + + public $yyidx; + + public $yyerrcnt; + + public $yystack = array(); + + public $yyTokenName = array( + '$', 'VERT', 'COLON', 'UNIMATH', + 'PHP', 'TEXT', 'STRIPON', 'STRIPOFF', + 'LITERALSTART', 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT', + 'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', 'LDEL', 'RDEL', + 'DOLLARID', 'EQUAL', 'ID', 'PTR', + 'LDELMAKENOCACHE', 'LDELIF', 'LDELFOR', 'SEMICOLON', + 'INCDEC', 'TO', 'STEP', 'LDELFOREACH', + 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', + 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', + 'COMMA', 'OPENP', 'CLOSEP', 'MATH', + 'ISIN', 'QMARK', 'NOT', 'TYPECAST', + 'HEX', 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', + 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', + 'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP', + 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', + 'BACKTICK', 'error', 'start', 'template', + 'literal_e2', 'literal_e1', 'smartytag', 'tagbody', + 'tag', 'outattr', 'eqoutattr', 'varindexed', + 'output', 'attributes', 'variable', 'value', + 'expr', 'modifierlist', 'statement', 'statements', + 'foraction', 'varvar', 'modparameters', 'attribute', + 'ternary', 'array', 'tlop', 'lop', + 'scond', 'function', 'ns1', 'doublequoted_with_quotes', + 'static_class_access', 'object', 'arrayindex', 'indexdef', + 'varvarele', 'objectchain', 'objectelement', 'method', + 'params', 'modifier', 'modparameter', 'arrayelements', + 'arrayelement', 'doublequoted', 'doublequotedcontent', + ); + + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; /* Index of top element in stack */ + private $_retvalue; /* Shifts left before out of the error */ + /** * constructor * * @param Smarty_Internal_Templatelexer $lex * @param Smarty_Internal_TemplateCompilerBase $compiler */ - function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) + public function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) { $this->lex = $lex; $this->compiler = $compiler; @@ -1662,6 +1676,13 @@ public $yystack = array(); $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); } /* The parser's stack */ + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: + break; /* If no destructor action specified: do nothing */ + } + } /** * insert PHP code in current buffer @@ -1709,7 +1730,7 @@ public $yystack = array(); { if (!$TraceFILE) { $zTracePrompt = 0; - } else if (!$zTracePrompt) { + } elseif (!$zTracePrompt) { $TraceFILE = 0; } $this->yyTraceFILE = $TraceFILE; @@ -1734,14 +1755,6 @@ public $yystack = array(); } } - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } - } - public function yy_pop_parser_stack() { if (empty($this->yystack)) { @@ -1749,9 +1762,11 @@ public $yystack = array(); } $yytos = array_pop($this->yystack); if ($this->yyTraceFILE && $this->yyidx >= 0) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . - "\n"); + fwrite( + $this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . + "\n" + ); } $yymajor = $yytos->major; self::yy_destructor($yymajor, $yytos->minor); @@ -1761,7 +1776,7 @@ public $yystack = array(); public function __destruct() { - while ($this->yystack !== Array()) { + while ($this->yystack !== array()) { $this->yy_pop_parser_stack(); } if (is_resource($this->yyTraceFILE)) { @@ -1803,7 +1818,8 @@ public $yystack = array(); $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; $nextstate = $this->yy_find_reduce_action( $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); + self::$yyRuleInfo[ $yyruleno ][ 0 ] + ); if (isset(self::$yyExpectedTokens[ $nextstate ])) { $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); if (isset($res4[ $nextstate ][ $token ])) { @@ -1829,14 +1845,14 @@ public $yystack = array(); $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; $this->yystack[ $this->yyidx ] = $x; continue 2; - } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; // the last token was just ignored, we can't accept // by ignoring input, this is in essence ignoring a // syntax error! return array_unique($expected); - } else if ($nextstate === self::YY_NO_ACTION) { + } elseif ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) @@ -1889,7 +1905,8 @@ public $yystack = array(); $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; $nextstate = $this->yy_find_reduce_action( $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); + self::$yyRuleInfo[ $yyruleno ][ 0 ] + ); if (isset($res2[ $nextstate ][ $token ])) { if ($res2[ $nextstate ][ $token ]) { $this->yyidx = $yyidx; @@ -1897,10 +1914,9 @@ public $yystack = array(); return true; } } else { - if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, - self::$yyExpectedTokens[ $nextstate ], - true))) { + if ($res2[ $nextstate ][ $token ] = + (isset(self::$yyExpectedTokens[ $nextstate ]) && + in_array($token, self::$yyExpectedTokens[ $nextstate ], true))) { $this->yyidx = $yyidx; $this->yystack = $stack; return true; @@ -1914,7 +1930,7 @@ public $yystack = array(); $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; $this->yystack[ $this->yyidx ] = $x; continue 2; - } else if ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; if (!$token) { @@ -1925,7 +1941,7 @@ public $yystack = array(); // by ignoring input, this is in essence ignoring a // syntax error! return false; - } else if ($nextstate === self::YY_NO_ACTION) { + } elseif ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) @@ -1963,10 +1979,9 @@ public $yystack = array(); if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) { if ($this->yyTraceFILE) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . 'FALLBACK ' . - $this->yyTokenName[ $iLookAhead ] . ' => ' . - $this->yyTokenName[ $iFallback ] . "\n"); + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'FALLBACK ' . + $this->yyTokenName[ $iLookAhead ] . ' => ' . + $this->yyTokenName[ $iFallback ] . "\n"); } return $this->yy_find_shift_action($iFallback); } @@ -1998,8 +2013,7 @@ public $yystack = array(); } } - #line 234 "../smarty/lexer/smarty_internal_templateparser.y" - + // line 234 "../smarty/lexer/smarty_internal_templateparser.y" public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; @@ -2011,7 +2025,7 @@ public $yystack = array(); while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - #line 221 "../smarty/lexer/smarty_internal_templateparser.y" + // line 221 "../smarty/lexer/smarty_internal_templateparser.y" $this->internalError = true; $this->compiler->trigger_template_error('Stack overflow in template parser'); return; @@ -2022,37 +2036,39 @@ public $yystack = array(); $yytos->minor = $yypMinor; $this->yystack[] = $yytos; if ($this->yyTraceFILE && $this->yyidx > 0) { - fprintf($this->yyTraceFILE, - "%sShift %d\n", - $this->yyTracePrompt, - $yyNewState); + fprintf( + $this->yyTraceFILE, + "%sShift %d\n", + $this->yyTracePrompt, + $yyNewState + ); fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); for ($i = 1; $i <= $this->yyidx; $i++) { - fprintf($this->yyTraceFILE, - " %s", - $this->yyTokenName[ $this->yystack[ $i ]->major ]); + fprintf( + $this->yyTraceFILE, + " %s", + $this->yyTokenName[ $this->yystack[ $i ]->major ] + ); } fwrite($this->yyTraceFILE, "\n"); } } - #line 242 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r0() + // line 242 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r0() { $this->root_buffer->prepend_array($this, $this->template_prefix); $this->root_buffer->append_array($this, $this->template_postfix); $this->_retvalue = $this->root_buffer->to_smarty_php($this); } - #line 251 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r1() + // line 251 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r1() { - $code = $this->compiler->compileTag('private_php', - array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), - array('type' => $this->lex->phpType)), - array()); + $code = + $this->compiler->compileTag('private_php', + array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), array('type' => $this->lex->phpType)), + array()); if ($this->compiler->has_code && !empty($code)) { $tmp = ''; foreach ($this->compiler->prefix_code as $code) { @@ -2060,114 +2076,94 @@ public $yystack = array(); } $this->compiler->prefix_code = array(); $this->current_buffer->append_subtree($this, - new Smarty_Internal_ParseTree_Tag($this, - $this->compiler->processNocacheCode($tmp . - $code, - true))); + new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $code, true))); } } - #line 255 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r2() + // line 255 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r2() { $this->current_buffer->append_subtree($this, - $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor)); + $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 259 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r3() + // line 259 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r3() { $this->strip = true; } - #line 264 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r4() + // line 264 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r4() { $this->strip = false; } - #line 269 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r5() + // line 269 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r5() { $this->current_buffer->append_subtree($this, - new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + - -1 ]->minor)); + new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + -1 ]->minor)); } - #line 272 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r6() + // line 272 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r6() { $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 276 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r7() + // line 276 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r7() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 281 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r8() + // line 281 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r8() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 285 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r9() + // line 285 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r9() { $this->_retvalue = ''; } - #line 297 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r10() + // line 297 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r10() { if ($this->compiler->has_code) { $this->current_buffer->append_subtree($this, - $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor)); + $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor)); } $this->compiler->has_variable_string = false; $this->block_nesting_level = count($this->compiler->_tag_stack); } - #line 307 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r12() + // line 307 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r12() { - $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, - $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), - ' $'); + $var = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), + -$this->compiler->getRdelLength()), ' $'); if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - array('nocache'), - array('value' => $this->compiler->compileVariable('\'' . - $match[ 1 ] . - '\''))); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', array('nocache'), + array('value' => $this->compiler->compileVariable('\'' . $match[ 1 ] . '\''))); } else { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - array(), - array('value' => $this->compiler->compileVariable('\'' . - $var . - '\''))); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', array(), + array('value' => $this->compiler->compileVariable('\'' . $var . '\''))); } } - #line 328 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r13() + // line 328 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r13() { - $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, - $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength())); + $tag = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), + -$this->compiler->getRdelLength())); if ($tag == 'strip') { $this->strip = true; $this->_retvalue = null;; @@ -2188,328 +2184,283 @@ public $yystack = array(); } } - #line 339 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r14() + // line 339 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r14() { $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') { // {$smarty.block.child} $this->_retvalue = - $this->compiler->compileTag('child', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));; + $this->compiler->compileTag('child', array(), array($this->yystack[ $this->yyidx + 0 ]->minor)); } else { // {$smarty.block.parent} $this->_retvalue = - $this->compiler->compileTag('parent', array(), array($this->yystack[ $this->yyidx + 0 ]->minor));; + $this->compiler->compileTag('parent', array(), array($this->yystack[ $this->yyidx + 0 ]->minor)); } } - #line 343 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r15() + // line 343 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r15() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 347 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r16() + // line 347 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r16() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 356 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r17() + // line 356 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r17() { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ], - array('value' => $this->yystack[ $this->yyidx + - 0 ]->minor[ 0 ])); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ], + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ])); } - #line 360 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r18() + // line 360 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r18() { - $this->_retvalue = $this->compiler->compileTag('assign', - array_merge(array(array('value' => $this->yystack[ $this->yyidx + - 0 ]->minor[ 0 ]), - array('var' => '\'' . - substr($this->yystack[ $this->yyidx + - -1 ]->minor, - 1) . '\'')), - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ])); + $this->_retvalue = + $this->compiler->compileTag('assign', array_merge(array( + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ]), + array('var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') + ), $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ])); } - #line 364 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r19() + // line 364 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r19() { - $this->_retvalue = $this->compiler->compileTag('assign', - array_merge(array(array('value' => $this->yystack[ $this->yyidx + - 0 ]->minor[ 0 ]), - array('var' => $this->yystack[ $this->yyidx + - -1 ]->minor[ 'var' ])), - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]), - array('smarty_internal_index' => $this->yystack[ $this->yyidx + - -1 ]->minor[ 'smarty_internal_index' ])); + $this->_retvalue = + $this->compiler->compileTag('assign', array_merge(array( + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ]), + array('var' => $this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) + ), $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]), array( + 'smarty_internal_index' => $this->yystack[ $this->yyidx + + -1 ]->minor[ 'smarty_internal_index' ] + )); } - #line 368 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r20() + // line 368 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r20() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 383 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r21() + // line 383 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r21() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 393 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r25() + // line 393 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r25() { if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler); } - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - -1 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, + array('value' => $this->yystack[ $this->yyidx + -1 ]->minor)); } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor); } } - #line 406 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r26() + // line 406 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r26() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); } - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - array(), - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', array(), + array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); } else { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array()); } } - #line 418 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r27() + // line 418 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r27() { if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) { if ($this->security) { $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler); } - $this->_retvalue = $this->compiler->compileTag('private_print_expression', - $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - -2 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + - -1 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, + array( + 'value' => $this->yystack[ $this->yyidx + -2 ]->minor, + 'modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor + )); } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('modifierlist' => $this->yystack[ $this->yyidx + - -1 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor)); } } - #line 423 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r28() + // line 423 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r28() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('object_method' => $this->yystack[ $this->yyidx + - -1 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('object_method' => $this->yystack[ $this->yyidx + -1 ]->minor)); } - #line 428 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r29() + // line 428 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r29() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('modifierlist' => $this->yystack[ $this->yyidx + - -1 ]->minor, - 'object_method' => $this->yystack[ $this->yyidx + - -2 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, array( + 'modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor, + 'object_method' => $this->yystack[ $this->yyidx + -2 ]->minor + )); } - #line 433 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r30() + // line 433 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r30() { - $this->_retvalue = $this->compiler->compileTag('make_nocache', - array(array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 0 ]->minor, - 1) . '\''))); + $this->_retvalue = + $this->compiler->compileTag('make_nocache', + array(array('var' => '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''))); } - #line 438 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r31() + // line 438 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r31() { $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, - array(), - array('if condition' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, array(), + array('if condition' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 443 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r32() + // line 443 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r32() { $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('if condition' => $this->yystack[ $this->yyidx + - -1 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, + $this->yystack[ $this->yyidx + 0 ]->minor, + array('if condition' => $this->yystack[ $this->yyidx + -1 ]->minor)); } - #line 454 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r33() + // line 454 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r33() { $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, - array(), - array('if condition' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, array(), + array('if condition' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 458 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r35() + // line 458 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r35() { - $this->_retvalue = $this->compiler->compileTag('for', - array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - -6 ]->minor), - array('ifexp' => $this->yystack[ $this->yyidx + - -4 ]->minor), - array('var' => $this->yystack[ $this->yyidx + - -2 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - -1 ]->minor))), - 1); + $this->_retvalue = + $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( + array('start' => $this->yystack[ $this->yyidx + -6 ]->minor), + array('ifexp' => $this->yystack[ $this->yyidx + -4 ]->minor), + array('var' => $this->yystack[ $this->yyidx + -2 ]->minor), + array('step' => $this->yystack[ $this->yyidx + -1 ]->minor) + )), 1); } - #line 466 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r36() + // line 466 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r36() { $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 470 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r38() + // line 470 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r38() { - $this->_retvalue = $this->compiler->compileTag('for', - array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - -3 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - -1 ]->minor))), - 0); + $this->_retvalue = + $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( + array('start' => $this->yystack[ $this->yyidx + -3 ]->minor), + array('to' => $this->yystack[ $this->yyidx + -1 ]->minor) + )), 0); } - #line 475 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r39() + // line 475 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r39() { - $this->_retvalue = $this->compiler->compileTag('for', - array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - -5 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - -3 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - -1 ]->minor))), - 0); + $this->_retvalue = + $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( + array('start' => $this->yystack[ $this->yyidx + -5 ]->minor), + array('to' => $this->yystack[ $this->yyidx + -3 ]->minor), + array('step' => $this->yystack[ $this->yyidx + -1 ]->minor) + )), 0); } - #line 479 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r40() + // line 479 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r40() { - $this->_retvalue = $this->compiler->compileTag('foreach', - array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - -3 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - -1 ]->minor)))); + $this->_retvalue = + $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( + array('from' => $this->yystack[ $this->yyidx + -3 ]->minor), + array('item' => $this->yystack[ $this->yyidx + -1 ]->minor) + ))); } - #line 482 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r41() + // line 482 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r41() { - $this->_retvalue = $this->compiler->compileTag('foreach', - array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - -5 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - -1 ]->minor), - array('key' => $this->yystack[ $this->yyidx + - -3 ]->minor)))); + $this->_retvalue = + $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( + array('from' => $this->yystack[ $this->yyidx + -5 ]->minor), + array('item' => $this->yystack[ $this->yyidx + -1 ]->minor), + array('key' => $this->yystack[ $this->yyidx + -3 ]->minor) + ))); } - #line 487 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r42() + // line 487 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r42() { $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 491 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r43() + // line 491 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r43() { - $this->_retvalue = $this->compiler->compileTag('setfilter', - array(), - array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx + - -1 ]->minor), - $this->yystack[ $this->yyidx + - 0 ]->minor)))); - } - - #line 497 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r44() - { - $this->_retvalue = $this->compiler->compileTag('setfilter', - array(), - array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx + - -2 ]->minor), - $this->yystack[ $this->yyidx + - -1 ]->minor)), - $this->yystack[ $this->yyidx + - 0 ]->minor))); + $this->_retvalue = + $this->compiler->compileTag('setfilter', array(), array( + 'modifier_list' => array( + array_merge(array($this->yystack[ $this->yyidx + -1 ]->minor), + $this->yystack[ $this->yyidx + 0 ]->minor) + ) + )); } - #line 506 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r45() + // line 497 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r44() { - $tag = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, - $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), - ' /'); + $this->_retvalue = + $this->compiler->compileTag('setfilter', array(), array( + 'modifier_list' => array_merge(array( + array_merge(array( + $this->yystack[ $this->yyidx + + -2 ]->minor + ), $this->yystack[ $this->yyidx + -1 ]->minor) + ), $this->yystack[ $this->yyidx + 0 ]->minor) + )); + } + + // line 506 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r45() + { + $tag = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), + -$this->compiler->getRdelLength()), ' /'); if ($tag === 'strip') { $this->strip = false; $this->_retvalue = null; @@ -2518,70 +2469,59 @@ public $yystack = array(); } } - #line 510 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r46() + // line 510 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r46() { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); } - #line 515 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r47() + // line 515 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r47() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close', - array(), - array('modifier_list' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close', array(), + array('modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 519 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r48() + // line 519 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r48() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close', - array(), - array('object_method' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close', array(), + array('object_method' => $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 527 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r49() + // line 527 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r49() { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close', - array(), - array('object_method' => $this->yystack[ $this->yyidx + - -1 ]->minor, - 'modifier_list' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close', array(), array( + 'object_method' => $this->yystack[ $this->yyidx + -1 ]->minor, + 'modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor + )); } - #line 533 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r50() + // line 533 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r50() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 538 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r51() + // line 538 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r51() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 543 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r52() + // line 543 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r52() { $this->_retvalue = array(); } - #line 554 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r53() + // line 554 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r53() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { @@ -2591,196 +2531,202 @@ public $yystack = array(); array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); } else { $this->_retvalue = - array($this->yystack[ $this->yyidx + -2 ]->minor => '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . - '\''); + array( + $this->yystack[ $this->yyidx + -2 ]->minor => '\'' . + $this->yystack[ $this->yyidx + 0 ]->minor . + '\'' + ); } } - #line 562 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r54() + // line 562 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r54() { $this->_retvalue = - array(trim($this->yystack[ $this->yyidx + -1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + - 0 ]->minor); + array( + trim($this->yystack[ $this->yyidx + -1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + + 0 ]->minor + ); } - #line 574 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r56() + // line 574 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r56() { $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; } - #line 587 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r59() + // line 587 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r59() { $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 592 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r61() + // line 592 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r61() { $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor; } - #line 599 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r62() + // line 599 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r62() { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'', - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + array( + 'var' => '\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'', + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor + ); } - #line 603 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r64() + // line 603 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r64() { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -2 ]->minor, - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + array( + 'var' => $this->yystack[ $this->yyidx + -2 ]->minor, + 'value' => $this->yystack[ $this->yyidx + 0 ]->minor + ); } - #line 623 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r65() + // line 623 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r65() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 628 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r68() + // line 628 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r68() { $this->_retvalue = - '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '://' . - $this->yystack[ $this->yyidx + 0 ]->minor . '\')'; + '$_smarty_tpl->getStreamVariable(\'' . + substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . + '://' . + $this->yystack[ $this->yyidx + 0 ]->minor . + '\')'; } - #line 642 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r69() + // line 642 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r69() { $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . trim($this->yystack[ $this->yyidx + -1 ]->minor) . + $this->yystack[ $this->yyidx + -2 ]->minor . + trim($this->yystack[ $this->yyidx + -1 ]->minor) . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 648 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r72() + // line 648 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r72() { - $this->_retvalue = $this->compiler->compileTag('private_modifier', - array(), - array('value' => $this->yystack[ $this->yyidx + - -1 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + - 0 ]->minor)); + $this->_retvalue = + $this->compiler->compileTag('private_modifier', array(), array( + 'value' => $this->yystack[ $this->yyidx + -1 ]->minor, + 'modifierlist' => $this->yystack[ $this->yyidx + 0 ]->minor + )); } - #line 652 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r73() + // line 652 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r73() { $this->_retvalue = - $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . $this->yystack[ $this->yyidx + 0 ]->minor . ')'; + $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . + $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . + $this->yystack[ $this->yyidx + 0 ]->minor . + ')'; } - #line 656 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r74() + // line 656 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r74() { - $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + -1 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 660 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r75() + // line 660 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r75() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 664 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r76() + // line 664 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r76() { $this->_retvalue = - 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor . + 'in_array(' . + $this->yystack[ $this->yyidx + -2 ]->minor . + ',' . + $this->yystack[ $this->yyidx + 0 ]->minor . ')'; } - #line 672 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r77() + // line 672 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r77() { - $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + -2 ]->minor . ',(array)' . - $this->yystack[ $this->yyidx + 0 ]->minor . ')'; + $this->_retvalue = + 'in_array(' . + $this->yystack[ $this->yyidx + -2 ]->minor . + ',(array)' . + $this->yystack[ $this->yyidx + 0 ]->minor . + ')'; } - #line 676 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r78() + // line 676 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r78() { - $this->_retvalue = $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + - -2 ]->minor, - 1) . - '\'') . - ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + $this->yystack[ $this->yyidx + -5 ]->minor . + ' ? ' . + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'') . + ' : ' . + $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 686 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r79() + // line 686 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r79() { $this->_retvalue = - $this->yystack[ $this->yyidx + -5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + -2 ]->minor . ' : ' . + $this->yystack[ $this->yyidx + -5 ]->minor . + ' ? ' . + $this->yystack[ $this->yyidx + -2 ]->minor . + ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 691 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r81() + // line 691 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r81() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 712 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r82() + // line 712 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r82() { $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 716 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r87() + // line 716 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r87() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 720 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r88() + // line 720 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r88() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.'; } - #line 725 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r89() + // line 725 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r89() { $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 742 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r90() + // line 742 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r90() { if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { if ($this->security) { @@ -2792,32 +2738,30 @@ public $yystack = array(); } } - #line 746 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r92() + // line 746 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r92() { $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 764 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r93() + // line 764 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r93() { - $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + -1 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 775 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r97() + // line 775 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r97() { $prefixVar = $this->compiler->getNewPrefixVariable(); if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\'smarty\'') { $this->compiler->appendPrefixCode("<?php {$prefixVar} = " . - $this->compiler->compileTag('private_special_variable', - array(), - $this->yystack[ $this->yyidx + - -2 ]->minor[ 'smarty_internal_index' ]) . + $this->compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + + -2 ]->minor[ 'smarty_internal_index' ]) . ';?>'); } else { $this->compiler->appendPrefixCode("<?php {$prefixVar} = " . @@ -2826,13 +2770,15 @@ public $yystack = array(); $this->yystack[ $this->yyidx + -2 ]->minor[ 'smarty_internal_index' ] . ';?>'); } - $this->_retvalue = $prefixVar . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + $this->_retvalue = + $prefixVar . + '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . + $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; } - #line 792 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r98() + // line 792 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r98() { $prefixVar = $this->compiler->getNewPrefixVariable(); $tmp = $this->compiler->appendCode('<?php ob_start();?>', $this->yystack[ $this->yyidx + 0 ]->minor); @@ -2840,464 +2786,457 @@ public $yystack = array(); $this->_retvalue = $prefixVar; } - #line 811 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r101() + // line 811 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r101() { if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) && - (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - $this->compiler))) { + (!$this->security || + $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor, + $this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler))) { if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ])) { $this->_retvalue = - $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; + $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . + '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . + $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; } else { $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . + $this->yystack[ $this->yyidx + -2 ]->minor . + '::' . + $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; } } else { - $this->compiler->trigger_template_error('static class \'' . $this->yystack[ $this->yyidx + -2 ]->minor . + $this->compiler->trigger_template_error('static class \'' . + $this->yystack[ $this->yyidx + -2 ]->minor . '\' is undefined or not allowed by security setting'); } } - #line 822 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r103() + // line 822 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r103() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 825 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r104() + // line 825 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r104() { $this->_retvalue = $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); } - #line 838 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r105() + // line 838 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r105() { if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] === '\'smarty\'') { - $smarty_var = $this->compiler->compileTag('private_special_variable', - array(), - $this->yystack[ $this->yyidx + - 0 ]->minor[ 'smarty_internal_index' ]); + $smarty_var = + $this->compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]); $this->_retvalue = $smarty_var; } else { // used for array reset,next,prev,end,current $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]; $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; + $this->_retvalue = + $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . + $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; } } - #line 848 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r106() + // line 848 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r106() { - $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + -2 ]->minor . ']->' . - $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + '$_smarty_tpl->tpl_vars[' . + $this->yystack[ $this->yyidx + -2 ]->minor . + ']->' . + $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 852 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r108() + // line 852 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r108() { $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\''); } - #line 856 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r109() + // line 856 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r109() { - $this->_retvalue = '(is_array($tmp = ' . - $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -2 ]->minor . - '\'') . ') ? $tmp' . - $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)'; + $this->_retvalue = + '(is_array($tmp = ' . + $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'') . + ') ? $tmp' . + $this->yystack[ $this->yyidx + 0 ]->minor . + ' :null)'; } - #line 860 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r110() + // line 860 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r110() { $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor); } - #line 864 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r111() + // line 864 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r111() { $this->_retvalue = - '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) . - ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)'; + '(is_array($tmp = ' . + $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) . + ') ? $tmp' . + $this->yystack[ $this->yyidx + 0 ]->minor . + ' : null)'; } - #line 867 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r112() + // line 867 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r112() { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'', - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + array( + 'var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'', + 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor + ); } - #line 880 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r113() + // line 880 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r113() { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + -1 ]->minor, - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); + $this->_retvalue = + array( + 'var' => $this->yystack[ $this->yyidx + -1 ]->minor, + 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor + ); } - #line 886 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r115() + // line 886 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r115() { return; } - #line 889 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r116() + // line 889 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r116() { $this->_retvalue = - '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . + '[' . + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . ']'; } - #line 893 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r117() + // line 893 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r117() { $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; } - #line 897 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r118() + // line 897 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r118() { - $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . '->' . - $this->yystack[ $this->yyidx + 0 ]->minor . ']'; + $this->_retvalue = + '[' . + $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . + '->' . + $this->yystack[ $this->yyidx + 0 ]->minor . + ']'; } - #line 901 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r119() + // line 901 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r119() { $this->_retvalue = '[\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\']'; } - #line 906 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r120() + // line 906 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r120() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; } - #line 911 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r121() + // line 911 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r121() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; } - #line 915 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r122() + // line 915 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r122() { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', - array(), - '[\'section\'][\'' . - $this->yystack[ $this->yyidx + -1 ]->minor . - '\'][\'index\']') . ']'; + $this->_retvalue = + '[' . + $this->compiler->compileTag('private_special_variable', array(), + '[\'section\'][\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\'][\'index\']') . + ']'; } - #line 918 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r123() + // line 918 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r123() { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', - array(), - '[\'section\'][\'' . - $this->yystack[ $this->yyidx + -3 ]->minor . '\'][\'' . - $this->yystack[ $this->yyidx + -1 ]->minor . '\']') . ']'; + $this->_retvalue = + '[' . + $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . + $this->yystack[ $this->yyidx + + -3 ]->minor . + '\'][\'' . + $this->yystack[ $this->yyidx + + -1 ]->minor . + '\']') . + ']'; } - #line 924 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r124() + // line 924 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r124() { $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; } - #line 940 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r126() + // line 940 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r126() { - $this->_retvalue = '[' . $this->compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + -1 ]->minor, - 1) . '\'') . ']';; + $this->_retvalue = + '[' . + $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') . + ']'; } - #line 950 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r130() + // line 950 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r130() { $this->_retvalue = '[]'; } - #line 954 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r131() + // line 954 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r131() { $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; } - #line 959 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r132() + // line 959 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r132() { $this->_retvalue = '\'\''; } - #line 967 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r133() + // line 967 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r133() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 973 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r135() + // line 973 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r135() { - $var = trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, - $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), - ' $'); + $var = + trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), + -$this->compiler->getRdelLength()), ' $'); $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); } - #line 980 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r136() + // line 980 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r136() { $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 989 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r137() + // line 989 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r137() { if ($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ] === '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable', - array(), - $this->yystack[ $this->yyidx + - -1 ]->minor[ 'smarty_internal_index' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + $this->compiler->compileTag('private_special_variable', array(), + $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ]) . + $this->yystack[ $this->yyidx + 0 ]->minor; } else { - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ] . - $this->yystack[ $this->yyidx + 0 ]->minor; + $this->_retvalue = + $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) . + $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ] . + $this->yystack[ $this->yyidx + 0 ]->minor; } } - #line 994 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r138() + // line 994 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r138() { $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 999 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r139() + // line 999 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r139() { $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1006 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r140() + // line 1006 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r140() { if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) === '_') { - $this->compiler->trigger_template_error(self::Err1); + $this->compiler->trigger_template_error(self::ERR1); } $this->_retvalue = '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1013 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r141() + // line 1013 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r141() { if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); + $this->compiler->trigger_template_error(self::ERR2); } - $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) . - $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + $this->_retvalue = + '->{' . + $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) . + $this->yystack[ $this->yyidx + 0 ]->minor . + '}'; } - #line 1020 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r142() + // line 1020 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r142() { if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); + $this->compiler->trigger_template_error(self::ERR2); } $this->_retvalue = '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - #line 1028 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r143() + // line 1028 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r143() { if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); + $this->compiler->trigger_template_error(self::ERR2); } $this->_retvalue = - '->{\'' . $this->yystack[ $this->yyidx + -4 ]->minor . '\'.' . $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor . '}'; + '->{\'' . + $this->yystack[ $this->yyidx + -4 ]->minor . + '\'.' . + $this->yystack[ $this->yyidx + -2 ]->minor . + $this->yystack[ $this->yyidx + 0 ]->minor . + '}'; } - #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r144() + // line 1036 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r144() { $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1044 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r145() + // line 1044 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r145() { - $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor, - $this->yystack[ $this->yyidx + -1 ]->minor); + $this->_retvalue = + $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor, + $this->yystack[ $this->yyidx + -1 ]->minor); } - #line 1051 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r146() + // line 1051 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r146() { if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) === '_') { - $this->compiler->trigger_template_error(self::Err1); + $this->compiler->trigger_template_error(self::ERR1); } - $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . '(' . - implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; + $this->_retvalue = + $this->yystack[ $this->yyidx + -3 ]->minor . + '(' . + implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . + ')'; } - #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r147() + // line 1062 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r147() { if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); + $this->compiler->trigger_template_error(self::ERR2); } $prefixVar = $this->compiler->getNewPrefixVariable(); - $this->compiler->appendPrefixCode("<?php {$prefixVar} = " . $this->compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + - -3 ]->minor, - 1) . '\'') . + $this->compiler->appendPrefixCode("<?php {$prefixVar} = " . + $this->compiler->compileVariable('\'' . + substr($this->yystack[ $this->yyidx + + -3 ]->minor, 1) . + '\'') . ';?>'); $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; } - #line 1079 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r148() + // line 1079 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r148() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1083 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r151() + // line 1083 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r151() { - $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -2 ]->minor, - array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor))); + $this->_retvalue = + array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array( + array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor) + )); } - #line 1091 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r152() + // line 1091 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r152() { $this->_retvalue = array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); } - #line 1099 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r154() + // line 1099 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r154() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1118 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r155() + // line 1118 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r155() { $this->_retvalue = array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1123 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r159() + // line 1123 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r159() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); } - #line 1128 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r160() + // line 1128 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r160() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); } - #line 1133 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r161() + // line 1133 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r161() { $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); } - #line 1138 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r162() + // line 1138 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r162() { $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); } - #line 1144 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r163() + // line 1144 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r163() { - $this->_retvalue = array($this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor, - 'property'); + $this->_retvalue = + array( + $this->yystack[ $this->yyidx + -2 ]->minor, + $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor, 'property' + ); } - #line 1148 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r164() + // line 1148 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r164() { $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; } - #line 1167 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r165() + // line 1167 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r165() { static $lops = array( 'eq' => ' == ', @@ -3318,9 +3257,8 @@ public $yystack = array(); $this->_retvalue = $lops[ $op ]; } - #line 1180 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r166() + // line 1180 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r166() { static $tlops = array( 'isdivby' => array('op' => ' % ', 'pre' => '!('), @@ -3334,9 +3272,8 @@ public $yystack = array(); $this->_retvalue = $tlops[ $op ]; } - #line 1194 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r167() + // line 1194 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r167() { static $scond = array( 'iseven' => '!(1 & ', @@ -3348,91 +3285,81 @@ public $yystack = array(); $this->_retvalue = $scond[ $op ]; } - #line 1202 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r168() + // line 1202 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r168() { $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; } - #line 1210 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r170() + // line 1210 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r170() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1214 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r172() + // line 1214 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r172() { $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1230 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r173() + // line 1230 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r173() { $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; } - #line 1236 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r176() + // line 1236 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r176() { $this->compiler->leaveDoubleQuote(); $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this); } - #line 1241 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r177() + // line 1241 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r177() { $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; } - #line 1245 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r178() + // line 1245 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r178() { $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - #line 1249 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r179() + // line 1249 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r179() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor); } - #line 1253 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r180() + // line 1253 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r180() { $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'); } - #line 1265 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r181() + // line 1265 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r181() { - $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . - substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . - '\']->value'); + $this->_retvalue = + new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . + substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . + '\']->value'); } - #line 1269 "../smarty/lexer/smarty_internal_templateparser.y" - - function yy_r184() + // line 1269 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r184() { $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); } - function yy_r185() + public function yy_r185() { $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); } @@ -3441,11 +3368,13 @@ public $yystack = array(); { if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { - fprintf($this->yyTraceFILE, - "%sReduce (%d) [%s].\n", - $this->yyTracePrompt, - $yyruleno, - self::$yyRuleName[ $yyruleno ]); + fprintf( + $this->yyTraceFILE, + "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, + $yyruleno, + self::$yyRuleName[ $yyruleno ] + ); } $this->_retvalue = $yy_lefthand_side = null; if (isset(self::$yyReduceMap[ $yyruleno ])) { @@ -3473,7 +3402,7 @@ public $yystack = array(); } else { $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); } - } else if ($yyact === self::YYNSTATE + self::YYNRULE + 1) { + } elseif ($yyact === self::YYNSTATE + self::YYNRULE + 1) { $this->yy_accept(); } } @@ -3490,7 +3419,7 @@ public $yystack = array(); public function yy_syntax_error($yymajor, $TOKEN) { - #line 214 "../smarty/lexer/smarty_internal_templateparser.y" + // line 214 "../smarty/lexer/smarty_internal_templateparser.y" $this->internalError = true; $this->yymajor = $yymajor; $this->compiler->trigger_template_error(); @@ -3504,7 +3433,7 @@ public $yystack = array(); while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - #line 207 "../smarty/lexer/smarty_internal_templateparser.y" + // line 207 "../smarty/lexer/smarty_internal_templateparser.y" $this->successful = !$this->internalError; $this->internalError = false; $this->retvalue = $this->_retvalue; @@ -3524,10 +3453,12 @@ public $yystack = array(); } $yyendofinput = ($yymajor == 0); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sInput %s\n", - $this->yyTracePrompt, - $this->yyTokenName[ $yymajor ]); + fprintf( + $this->yyTraceFILE, + "%sInput %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ] + ); } do { $yyact = $this->yy_find_shift_action($yymajor); @@ -3544,13 +3475,15 @@ public $yystack = array(); } else { $yymajor = self::YYNOCODE; } - } else if ($yyact < self::YYNSTATE + self::YYNRULE) { + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); - } else if ($yyact === self::YY_ERROR_ACTION) { + } elseif ($yyact === self::YY_ERROR_ACTION) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sSyntax Error!\n", - $this->yyTracePrompt); + fprintf( + $this->yyTraceFILE, + "%sSyntax Error!\n", + $this->yyTracePrompt + ); } if (self::YYERRORSYMBOL) { if ($this->yyerrcnt < 0) { @@ -3559,10 +3492,12 @@ public $yystack = array(); $yymx = $this->yystack[ $this->yyidx ]->major; if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, - "%sDiscard input token %s\n", - $this->yyTracePrompt, - $this->yyTokenName[ $yymajor ]); + fprintf( + $this->yyTraceFILE, + "%sDiscard input token %s\n", + $this->yyTracePrompt, + $this->yyTokenName[ $yymajor ] + ); } $this->yy_destructor($yymajor, $yytokenvalue); $yymajor = self::YYNOCODE; @@ -3577,7 +3512,7 @@ public $yystack = array(); $this->yy_destructor($yymajor, $yytokenvalue); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; - } else if ($yymx !== self::YYERRORSYMBOL) { + } elseif ($yymx !== self::YYERRORSYMBOL) { $u2 = 0; $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); } @@ -3602,4 +3537,3 @@ public $yystack = array(); } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0); } } - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_testinstall.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_testinstall.php index bea8b3a80..504a4582c 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_testinstall.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_testinstall.php @@ -21,7 +21,7 @@ class Smarty_Internal_TestInstall * If $errors is secified, the diagnostic report will be appended to the array, rather than being output. * * @param \Smarty $smarty - * @param array $errors array to push results into rather than outputting them + * @param array $errors array to push results into rather than outputting them * * @return bool status, true if everything is fine, false else */ @@ -82,7 +82,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'template_dir' ] = $message; } - } else if (!is_readable($template_dir)) { + } elseif (!is_readable($template_dir)) { $status = false; $message = "FAILED: $template_dir is not readable"; if ($errors === null) { @@ -110,7 +110,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'compile_dir' ] = $message; } - } else if (!is_dir($_compile_dir)) { + } elseif (!is_dir($_compile_dir)) { $status = false; $message = "FAILED: {$_compile_dir} is not a directory"; if ($errors === null) { @@ -118,7 +118,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'compile_dir' ] = $message; } - } else if (!is_readable($_compile_dir)) { + } elseif (!is_readable($_compile_dir)) { $status = false; $message = "FAILED: {$_compile_dir} is not readable"; if ($errors === null) { @@ -126,7 +126,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'compile_dir' ] = $message; } - } else if (!is_writable($_compile_dir)) { + } elseif (!is_writable($_compile_dir)) { $status = false; $message = "FAILED: {$_compile_dir} is not writable"; if ($errors === null) { @@ -192,7 +192,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'plugins_dir' ] = $message; } - } else if (!is_readable($plugin_dir)) { + } elseif (!is_readable($plugin_dir)) { $status = false; $message = "FAILED: $plugin_dir is not readable"; if ($errors === null) { @@ -200,7 +200,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'plugins_dir' ] = $message; } - } else if ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) { + } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) { $_core_plugins_available = true; if ($errors === null) { echo "$plugin_dir is OK.\n"; @@ -216,7 +216,7 @@ class Smarty_Internal_TestInstall $message = "WARNING: Smarty's own libs/plugins is not available"; if ($errors === null) { echo $message . ".\n"; - } else if (!isset($errors[ 'plugins_dir' ])) { + } elseif (!isset($errors[ 'plugins_dir' ])) { $errors[ 'plugins_dir' ] = $message; } } @@ -234,7 +234,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'cache_dir' ] = $message; } - } else if (!is_dir($_cache_dir)) { + } elseif (!is_dir($_cache_dir)) { $status = false; $message = "FAILED: {$_cache_dir} is not a directory"; if ($errors === null) { @@ -242,7 +242,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'cache_dir' ] = $message; } - } else if (!is_readable($_cache_dir)) { + } elseif (!is_readable($_cache_dir)) { $status = false; $message = "FAILED: {$_cache_dir} is not readable"; if ($errors === null) { @@ -250,7 +250,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'cache_dir' ] = $message; } - } else if (!is_writable($_cache_dir)) { + } elseif (!is_writable($_cache_dir)) { $status = false; $message = "FAILED: {$_cache_dir} is not writable"; if ($errors === null) { @@ -312,7 +312,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'config_dir' ] = $message; } - } else if (!is_readable($config_dir)) { + } elseif (!is_readable($config_dir)) { $status = false; $message = "FAILED: $config_dir is not readable"; if ($errors === null) { @@ -332,159 +332,161 @@ class Smarty_Internal_TestInstall // test if sysplugins are available $source = SMARTY_SYSPLUGINS_DIR; if (is_dir($source)) { - $expectedSysplugins = array('smartycompilerexception.php' => true, - 'smartyexception.php' => true, - 'smarty_cacheresource.php' => true, - 'smarty_cacheresource_custom.php' => true, - 'smarty_cacheresource_keyvaluestore.php' => true, - 'smarty_data.php' => true, - 'smarty_internal_block.php' => true, - 'smarty_internal_cacheresource_file.php' => true, - 'smarty_internal_compilebase.php' => true, - 'smarty_internal_compile_append.php' => true, - 'smarty_internal_compile_assign.php' => true, - 'smarty_internal_compile_block.php' => true, - 'smarty_internal_compile_block_child.php' => true, - 'smarty_internal_compile_block_parent.php' => true, - 'smarty_internal_compile_child.php' => true, - 'smarty_internal_compile_parent.php' => true, - 'smarty_internal_compile_break.php' => true, - 'smarty_internal_compile_call.php' => true, - 'smarty_internal_compile_capture.php' => true, - 'smarty_internal_compile_config_load.php' => true, - 'smarty_internal_compile_continue.php' => true, - 'smarty_internal_compile_debug.php' => true, - 'smarty_internal_compile_eval.php' => true, - 'smarty_internal_compile_extends.php' => true, - 'smarty_internal_compile_for.php' => true, - 'smarty_internal_compile_foreach.php' => true, - 'smarty_internal_compile_function.php' => true, - 'smarty_internal_compile_if.php' => true, - 'smarty_internal_compile_include.php' => true, - 'smarty_internal_compile_include_php.php' => true, - 'smarty_internal_compile_insert.php' => true, - 'smarty_internal_compile_ldelim.php' => true, - 'smarty_internal_compile_make_nocache.php' => true, - 'smarty_internal_compile_nocache.php' => true, - 'smarty_internal_compile_private_block_plugin.php' => true, - 'smarty_internal_compile_private_foreachsection.php' => true, - 'smarty_internal_compile_private_function_plugin.php' => true, - 'smarty_internal_compile_private_modifier.php' => true, - 'smarty_internal_compile_private_object_block_function.php' => true, - 'smarty_internal_compile_private_object_function.php' => true, - 'smarty_internal_compile_private_php.php' => true, - 'smarty_internal_compile_private_print_expression.php' => true, - 'smarty_internal_compile_private_registered_block.php' => true, - 'smarty_internal_compile_private_registered_function.php' => true, - 'smarty_internal_compile_private_special_variable.php' => true, - 'smarty_internal_compile_rdelim.php' => true, - 'smarty_internal_compile_section.php' => true, - 'smarty_internal_compile_setfilter.php' => true, - 'smarty_internal_compile_shared_inheritance.php' => true, - 'smarty_internal_compile_while.php' => true, - 'smarty_internal_configfilelexer.php' => true, - 'smarty_internal_configfileparser.php' => true, - 'smarty_internal_config_file_compiler.php' => true, - 'smarty_internal_data.php' => true, - 'smarty_internal_debug.php' => true, - 'smarty_internal_errorhandler.php' => true, - 'smarty_internal_extension_handler.php' => true, - 'smarty_internal_method_addautoloadfilters.php' => true, - 'smarty_internal_method_adddefaultmodifiers.php' => true, - 'smarty_internal_method_append.php' => true, - 'smarty_internal_method_appendbyref.php' => true, - 'smarty_internal_method_assignbyref.php' => true, - 'smarty_internal_method_assignglobal.php' => true, - 'smarty_internal_method_clearallassign.php' => true, - 'smarty_internal_method_clearallcache.php' => true, - 'smarty_internal_method_clearassign.php' => true, - 'smarty_internal_method_clearcache.php' => true, - 'smarty_internal_method_clearcompiledtemplate.php' => true, - 'smarty_internal_method_clearconfig.php' => true, - 'smarty_internal_method_compileallconfig.php' => true, - 'smarty_internal_method_compilealltemplates.php' => true, - 'smarty_internal_method_configload.php' => true, - 'smarty_internal_method_createdata.php' => true, - 'smarty_internal_method_getautoloadfilters.php' => true, - 'smarty_internal_method_getconfigvariable.php' => true, - 'smarty_internal_method_getconfigvars.php' => true, - 'smarty_internal_method_getdebugtemplate.php' => true, - 'smarty_internal_method_getdefaultmodifiers.php' => true, - 'smarty_internal_method_getglobal.php' => true, - 'smarty_internal_method_getregisteredobject.php' => true, - 'smarty_internal_method_getstreamvariable.php' => true, - 'smarty_internal_method_gettags.php' => true, - 'smarty_internal_method_gettemplatevars.php' => true, - 'smarty_internal_method_literals.php' => true, - 'smarty_internal_method_loadfilter.php' => true, - 'smarty_internal_method_loadplugin.php' => true, - 'smarty_internal_method_mustcompile.php' => true, - 'smarty_internal_method_registercacheresource.php' => true, - 'smarty_internal_method_registerclass.php' => true, - 'smarty_internal_method_registerdefaultconfighandler.php' => true, - 'smarty_internal_method_registerdefaultpluginhandler.php' => true, - 'smarty_internal_method_registerdefaulttemplatehandler.php' => true, - 'smarty_internal_method_registerfilter.php' => true, - 'smarty_internal_method_registerobject.php' => true, - 'smarty_internal_method_registerplugin.php' => true, - 'smarty_internal_method_registerresource.php' => true, - 'smarty_internal_method_setautoloadfilters.php' => true, - 'smarty_internal_method_setdebugtemplate.php' => true, - 'smarty_internal_method_setdefaultmodifiers.php' => true, - 'smarty_internal_method_unloadfilter.php' => true, - 'smarty_internal_method_unregistercacheresource.php' => true, - 'smarty_internal_method_unregisterfilter.php' => true, - 'smarty_internal_method_unregisterobject.php' => true, - 'smarty_internal_method_unregisterplugin.php' => true, - 'smarty_internal_method_unregisterresource.php' => true, - 'smarty_internal_nocache_insert.php' => true, - 'smarty_internal_parsetree.php' => true, - 'smarty_internal_parsetree_code.php' => true, - 'smarty_internal_parsetree_dq.php' => true, - 'smarty_internal_parsetree_dqcontent.php' => true, - 'smarty_internal_parsetree_tag.php' => true, - 'smarty_internal_parsetree_template.php' => true, - 'smarty_internal_parsetree_text.php' => true, - 'smarty_internal_resource_eval.php' => true, - 'smarty_internal_resource_extends.php' => true, - 'smarty_internal_resource_file.php' => true, - 'smarty_internal_resource_php.php' => true, - 'smarty_internal_resource_registered.php' => true, - 'smarty_internal_resource_stream.php' => true, - 'smarty_internal_resource_string.php' => true, - 'smarty_internal_runtime_cachemodify.php' => true, - 'smarty_internal_runtime_cacheresourcefile.php' => true, - 'smarty_internal_runtime_capture.php' => true, - 'smarty_internal_runtime_codeframe.php' => true, - 'smarty_internal_runtime_filterhandler.php' => true, - 'smarty_internal_runtime_foreach.php' => true, - 'smarty_internal_runtime_getincludepath.php' => true, - 'smarty_internal_runtime_inheritance.php' => true, - 'smarty_internal_runtime_make_nocache.php' => true, - 'smarty_internal_runtime_tplfunction.php' => true, - 'smarty_internal_runtime_updatecache.php' => true, - 'smarty_internal_runtime_updatescope.php' => true, - 'smarty_internal_runtime_writefile.php' => true, - 'smarty_internal_smartytemplatecompiler.php' => true, - 'smarty_internal_template.php' => true, - 'smarty_internal_templatebase.php' => true, - 'smarty_internal_templatecompilerbase.php' => true, - 'smarty_internal_templatelexer.php' => true, - 'smarty_internal_templateparser.php' => true, - 'smarty_internal_testinstall.php' => true, - 'smarty_internal_undefined.php' => true, - 'smarty_resource.php' => true, - 'smarty_resource_custom.php' => true, - 'smarty_resource_recompiled.php' => true, - 'smarty_resource_uncompiled.php' => true, - 'smarty_security.php' => true, - 'smarty_template_cached.php' => true, - 'smarty_template_compiled.php' => true, - 'smarty_template_config.php' => true, - 'smarty_template_resource_base.php' => true, - 'smarty_template_source.php' => true, - 'smarty_undefined_variable.php' => true, - 'smarty_variable.php' => true,); + $expectedSysplugins = array( + 'smartycompilerexception.php' => true, + 'smartyexception.php' => true, + 'smarty_cacheresource.php' => true, + 'smarty_cacheresource_custom.php' => true, + 'smarty_cacheresource_keyvaluestore.php' => true, + 'smarty_data.php' => true, + 'smarty_internal_block.php' => true, + 'smarty_internal_cacheresource_file.php' => true, + 'smarty_internal_compilebase.php' => true, + 'smarty_internal_compile_append.php' => true, + 'smarty_internal_compile_assign.php' => true, + 'smarty_internal_compile_block.php' => true, + 'smarty_internal_compile_block_child.php' => true, + 'smarty_internal_compile_block_parent.php' => true, + 'smarty_internal_compile_child.php' => true, + 'smarty_internal_compile_parent.php' => true, + 'smarty_internal_compile_break.php' => true, + 'smarty_internal_compile_call.php' => true, + 'smarty_internal_compile_capture.php' => true, + 'smarty_internal_compile_config_load.php' => true, + 'smarty_internal_compile_continue.php' => true, + 'smarty_internal_compile_debug.php' => true, + 'smarty_internal_compile_eval.php' => true, + 'smarty_internal_compile_extends.php' => true, + 'smarty_internal_compile_for.php' => true, + 'smarty_internal_compile_foreach.php' => true, + 'smarty_internal_compile_function.php' => true, + 'smarty_internal_compile_if.php' => true, + 'smarty_internal_compile_include.php' => true, + 'smarty_internal_compile_include_php.php' => true, + 'smarty_internal_compile_insert.php' => true, + 'smarty_internal_compile_ldelim.php' => true, + 'smarty_internal_compile_make_nocache.php' => true, + 'smarty_internal_compile_nocache.php' => true, + 'smarty_internal_compile_private_block_plugin.php' => true, + 'smarty_internal_compile_private_foreachsection.php' => true, + 'smarty_internal_compile_private_function_plugin.php' => true, + 'smarty_internal_compile_private_modifier.php' => true, + 'smarty_internal_compile_private_object_block_function.php' => true, + 'smarty_internal_compile_private_object_function.php' => true, + 'smarty_internal_compile_private_php.php' => true, + 'smarty_internal_compile_private_print_expression.php' => true, + 'smarty_internal_compile_private_registered_block.php' => true, + 'smarty_internal_compile_private_registered_function.php' => true, + 'smarty_internal_compile_private_special_variable.php' => true, + 'smarty_internal_compile_rdelim.php' => true, + 'smarty_internal_compile_section.php' => true, + 'smarty_internal_compile_setfilter.php' => true, + 'smarty_internal_compile_shared_inheritance.php' => true, + 'smarty_internal_compile_while.php' => true, + 'smarty_internal_configfilelexer.php' => true, + 'smarty_internal_configfileparser.php' => true, + 'smarty_internal_config_file_compiler.php' => true, + 'smarty_internal_data.php' => true, + 'smarty_internal_debug.php' => true, + 'smarty_internal_errorhandler.php' => true, + 'smarty_internal_extension_handler.php' => true, + 'smarty_internal_method_addautoloadfilters.php' => true, + 'smarty_internal_method_adddefaultmodifiers.php' => true, + 'smarty_internal_method_append.php' => true, + 'smarty_internal_method_appendbyref.php' => true, + 'smarty_internal_method_assignbyref.php' => true, + 'smarty_internal_method_assignglobal.php' => true, + 'smarty_internal_method_clearallassign.php' => true, + 'smarty_internal_method_clearallcache.php' => true, + 'smarty_internal_method_clearassign.php' => true, + 'smarty_internal_method_clearcache.php' => true, + 'smarty_internal_method_clearcompiledtemplate.php' => true, + 'smarty_internal_method_clearconfig.php' => true, + 'smarty_internal_method_compileallconfig.php' => true, + 'smarty_internal_method_compilealltemplates.php' => true, + 'smarty_internal_method_configload.php' => true, + 'smarty_internal_method_createdata.php' => true, + 'smarty_internal_method_getautoloadfilters.php' => true, + 'smarty_internal_method_getconfigvariable.php' => true, + 'smarty_internal_method_getconfigvars.php' => true, + 'smarty_internal_method_getdebugtemplate.php' => true, + 'smarty_internal_method_getdefaultmodifiers.php' => true, + 'smarty_internal_method_getglobal.php' => true, + 'smarty_internal_method_getregisteredobject.php' => true, + 'smarty_internal_method_getstreamvariable.php' => true, + 'smarty_internal_method_gettags.php' => true, + 'smarty_internal_method_gettemplatevars.php' => true, + 'smarty_internal_method_literals.php' => true, + 'smarty_internal_method_loadfilter.php' => true, + 'smarty_internal_method_loadplugin.php' => true, + 'smarty_internal_method_mustcompile.php' => true, + 'smarty_internal_method_registercacheresource.php' => true, + 'smarty_internal_method_registerclass.php' => true, + 'smarty_internal_method_registerdefaultconfighandler.php' => true, + 'smarty_internal_method_registerdefaultpluginhandler.php' => true, + 'smarty_internal_method_registerdefaulttemplatehandler.php' => true, + 'smarty_internal_method_registerfilter.php' => true, + 'smarty_internal_method_registerobject.php' => true, + 'smarty_internal_method_registerplugin.php' => true, + 'smarty_internal_method_registerresource.php' => true, + 'smarty_internal_method_setautoloadfilters.php' => true, + 'smarty_internal_method_setdebugtemplate.php' => true, + 'smarty_internal_method_setdefaultmodifiers.php' => true, + 'smarty_internal_method_unloadfilter.php' => true, + 'smarty_internal_method_unregistercacheresource.php' => true, + 'smarty_internal_method_unregisterfilter.php' => true, + 'smarty_internal_method_unregisterobject.php' => true, + 'smarty_internal_method_unregisterplugin.php' => true, + 'smarty_internal_method_unregisterresource.php' => true, + 'smarty_internal_nocache_insert.php' => true, + 'smarty_internal_parsetree.php' => true, + 'smarty_internal_parsetree_code.php' => true, + 'smarty_internal_parsetree_dq.php' => true, + 'smarty_internal_parsetree_dqcontent.php' => true, + 'smarty_internal_parsetree_tag.php' => true, + 'smarty_internal_parsetree_template.php' => true, + 'smarty_internal_parsetree_text.php' => true, + 'smarty_internal_resource_eval.php' => true, + 'smarty_internal_resource_extends.php' => true, + 'smarty_internal_resource_file.php' => true, + 'smarty_internal_resource_php.php' => true, + 'smarty_internal_resource_registered.php' => true, + 'smarty_internal_resource_stream.php' => true, + 'smarty_internal_resource_string.php' => true, + 'smarty_internal_runtime_cachemodify.php' => true, + 'smarty_internal_runtime_cacheresourcefile.php' => true, + 'smarty_internal_runtime_capture.php' => true, + 'smarty_internal_runtime_codeframe.php' => true, + 'smarty_internal_runtime_filterhandler.php' => true, + 'smarty_internal_runtime_foreach.php' => true, + 'smarty_internal_runtime_getincludepath.php' => true, + 'smarty_internal_runtime_inheritance.php' => true, + 'smarty_internal_runtime_make_nocache.php' => true, + 'smarty_internal_runtime_tplfunction.php' => true, + 'smarty_internal_runtime_updatecache.php' => true, + 'smarty_internal_runtime_updatescope.php' => true, + 'smarty_internal_runtime_writefile.php' => true, + 'smarty_internal_smartytemplatecompiler.php' => true, + 'smarty_internal_template.php' => true, + 'smarty_internal_templatebase.php' => true, + 'smarty_internal_templatecompilerbase.php' => true, + 'smarty_internal_templatelexer.php' => true, + 'smarty_internal_templateparser.php' => true, + 'smarty_internal_testinstall.php' => true, + 'smarty_internal_undefined.php' => true, + 'smarty_resource.php' => true, + 'smarty_resource_custom.php' => true, + 'smarty_resource_recompiled.php' => true, + 'smarty_resource_uncompiled.php' => true, + 'smarty_security.php' => true, + 'smarty_template_cached.php' => true, + 'smarty_template_compiled.php' => true, + 'smarty_template_config.php' => true, + 'smarty_template_resource_base.php' => true, + 'smarty_template_source.php' => true, + 'smarty_undefined_variable.php' => true, + 'smarty_variable.php' => true, + ); $iterator = new DirectoryIterator($source); foreach ($iterator as $file) { if (!$file->isDot()) { @@ -502,7 +504,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'sysplugins' ] = $message; } - } else if ($errors === null) { + } elseif ($errors === null) { echo "... OK\n"; } } else { @@ -586,7 +588,7 @@ class Smarty_Internal_TestInstall } else { $errors[ 'plugins' ] = $message; } - } else if ($errors === null) { + } elseif ($errors === null) { echo "... OK\n"; } } else { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_undefined.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_undefined.php index d6f4bf62e..7df0acc2d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_undefined.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_undefined.php @@ -11,7 +11,6 @@ */ class Smarty_Internal_Undefined { - /** * Name of undefined extension class * @@ -32,9 +31,9 @@ class Smarty_Internal_Undefined /** * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled * - * @param \Smarty_Internal_Template $tpl - * @param array $properties special template properties - * @param bool $cache flag if called from cache file + * @param \Smarty_Internal_Template $tpl + * @param array $properties special template properties + * @param bool $cache flag if called from cache file * * @return bool false */ @@ -65,4 +64,4 @@ class Smarty_Internal_Undefined throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method"); } } -}
\ No newline at end of file +} diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php b/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php index b76b9c783..aae7e42f7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_resource.php @@ -25,24 +25,29 @@ abstract class Smarty_Resource * * @var array */ - public static $sysplugins = array('file' => 'smarty_internal_resource_file.php', - 'string' => 'smarty_internal_resource_string.php', - 'extends' => 'smarty_internal_resource_extends.php', - 'stream' => 'smarty_internal_resource_stream.php', - 'eval' => 'smarty_internal_resource_eval.php', - 'php' => 'smarty_internal_resource_php.php'); + public static $sysplugins = array( + 'file' => 'smarty_internal_resource_file.php', + 'string' => 'smarty_internal_resource_string.php', + 'extends' => 'smarty_internal_resource_extends.php', + 'stream' => 'smarty_internal_resource_stream.php', + 'eval' => 'smarty_internal_resource_eval.php', + 'php' => 'smarty_internal_resource_php.php' + ); + /** * Source is bypassing compiler * * @var boolean */ public $uncompiled = false; + /** * Source must be recompiled on every occasion * * @var boolean */ public $recompiled = false; + /** * Flag if resource does implement populateCompiledFilepath() method * @@ -53,8 +58,8 @@ abstract class Smarty_Resource /** * Load Resource Handler * - * @param Smarty $smarty smarty object - * @param string $type name of the resource + * @param Smarty $smarty smarty object + * @param string $type name of the resource * * @throws SmartyException * @return Smarty_Resource Resource Handler @@ -82,9 +87,13 @@ abstract class Smarty_Resource if (class_exists($_resource_class, false)) { return $smarty->_cache[ 'resource_handlers' ][ $type ] = new $_resource_class(); } else { - $smarty->registerResource($type, - array("smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp", - "smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted")); + $smarty->registerResource( + $type, + array( + "smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp", + "smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted" + ) + ); // give it another try, now that the resource is registered properly return self::load($smarty, $type); } @@ -105,10 +114,11 @@ abstract class Smarty_Resource /** * extract resource_type and resource_name from template_resource and config_resource + * * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including). * - * @param string $resource_name template_resource or config_resource to parse - * @param string $default_resource the default resource_type defined in $smarty + * @param string $resource_name template_resource or config_resource to parse + * @param string $default_resource the default resource_type defined in $smarty * * @return array with parsed resource name and type */ @@ -129,8 +139,9 @@ abstract class Smarty_Resource /** * modify template_resource according to resource handlers specifications * - * @param \Smarty_Internal_Template|\Smarty $obj Smarty instance - * @param string $template_resource template_resource to extract resource handler and name of + * @param \Smarty_Internal_Template|\Smarty $obj Smarty instance + * @param string $template_resource template_resource to extract resource handler and + * name of * * @return string unique resource name * @throws \SmartyException @@ -143,8 +154,8 @@ abstract class Smarty_Resource $resource = Smarty_Resource::load($smarty, $type); // go relative to a given template? $_file_is_dotted = $name[ 0 ] === '.' && ($name[ 1 ] === '.' || $name[ 1 ] === '/'); - if ($obj->_isTplObj() && $_file_is_dotted && - ($obj->source->type === 'file' || $obj->parent->source->type === 'extends') + if ($obj->_isTplObj() && $_file_is_dotted + && ($obj->source->type === 'file' || $obj->parent->source->type === 'extends') ) { $name = $smarty->_realpath(dirname($obj->parent->source->filepath) . DIRECTORY_SEPARATOR . $name); } @@ -156,24 +167,25 @@ abstract class Smarty_Resource * wrapper for backward compatibility to versions < 3.1.22 * Either [$_template] or [$smarty, $template_resource] must be specified * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier * * @return \Smarty_Template_Source Source Object * @throws \SmartyException */ - public static function source(Smarty_Internal_Template $_template = null, - Smarty $smarty = null, - $template_resource = null) - { + public static function source( + Smarty_Internal_Template $_template = null, + Smarty $smarty = null, + $template_resource = null + ) { return Smarty_Template_Source::load($_template, $smarty, $template_resource); } /** * Load template's source into current template object * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source * @throws SmartyException if source cannot be loaded @@ -201,9 +213,9 @@ abstract class Smarty_Resource /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @param boolean $isConfig flag for config resource + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource * * @return string unique resource name */ @@ -228,11 +240,10 @@ abstract class Smarty_Resource * * @return bool */ - /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string resource's basename */ @@ -249,4 +260,3 @@ abstract class Smarty_Resource return true; } } - diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_resource_custom.php b/vendor/smarty/smarty/libs/sysplugins/smarty_resource_custom.php index 77f619eca..8d66be3ae 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_resource_custom.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_resource_custom.php @@ -30,7 +30,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource * {@internal implementing this method is optional. * Only implement it if modification times can be accessed faster than loading the complete template source.}} * - * @param string $name template name + * @param string $name template name * * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ @@ -47,9 +47,8 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) { - $source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25); + $source->filepath = $source->type . ':' . substr(preg_replace('/[^A-Za-z0-9.]/', '', $source->name), 0, 25); $source->uid = sha1($source->type . ':' . $source->name); - $mtime = $this->fetchTimestamp($source->name); if ($mtime !== null) { $source->timestamp = $mtime; @@ -66,7 +65,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource /** * Load template's source into current template object * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string template source * @throws SmartyException if source cannot be loaded @@ -77,19 +76,18 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource if (isset($content)) { return $content; } - throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); } /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * * @return string resource's basename */ public function getBasename(Smarty_Template_Source $source) { - return basename(substr(preg_replace('/[^A-Za-z0-9.]/','',$source->name),0,25)); + return basename(substr(preg_replace('/[^A-Za-z0-9.]/', '', $source->name), 0, 25)); } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php b/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php index 322cdabfa..760c4dd33 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_resource_recompiled.php @@ -50,8 +50,7 @@ abstract class Smarty_Resource_Recompiled extends Smarty_Resource // call compiler try { eval('?>' . $_smarty_tpl->compiler->compileTemplate($_smarty_tpl)); - } - catch (Exception $e) { + } catch (Exception $e) { unset($_smarty_tpl->compiler); while (ob_get_level() > $level) { ob_end_clean(); @@ -68,8 +67,8 @@ abstract class Smarty_Resource_Recompiled extends Smarty_Resource /** * populate Compiled Object with compiled filepath * - * @param Smarty_Template_Compiled $compiled compiled object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Compiled $compiled compiled object + * @param Smarty_Internal_Template $_template template object * * @return void */ diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_security.php b/vendor/smarty/smarty/libs/sysplugins/smarty_security.php index 126f6fb46..441a7e284 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_security.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_security.php @@ -6,12 +6,12 @@ * @subpackage Security * @author Uwe Tews */ - -/* +/** * FIXME: Smarty_Security API * - getter and setter instead of public properties would allow cultivating an internal cache properly - * - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir are immutable - * the cache is killed every time either of the variables change. That means that two distinct Smarty objects with differing + * - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir + * are immutable the cache is killed every time either of the variables change. That means that two distinct + * Smarty objects with differing * $template_dir or $config_dir should NOT share the same Smarty_Security instance, * as this would lead to (severe) performance penalty! how should this be handled? */ @@ -258,63 +258,54 @@ class Smarty_Security public function __construct($smarty) { $this->smarty = $smarty; - $this->smarty->_cache[ 'template_dir_new' ] = true; - $this->smarty->_cache[ 'config_dir_new' ] = true; } /** * Check if PHP function is trusted. * - * @param string $function_name - * @param object $compiler compiler object + * @param string $function_name + * @param object $compiler compiler object * * @return boolean true if function is trusted - * @throws SmartyCompilerException if php function is not trusted */ public function isTrustedPhpFunction($function_name, $compiler) { - if (isset($this->php_functions) && - (empty($this->php_functions) || in_array($function_name, $this->php_functions)) + if (isset($this->php_functions) + && (empty($this->php_functions) || in_array($function_name, $this->php_functions)) ) { return true; } - $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting"); - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if static class is trusted. * - * @param string $class_name - * @param object $compiler compiler object + * @param string $class_name + * @param object $compiler compiler object * * @return boolean true if class is trusted - * @throws SmartyCompilerException if static class is not trusted */ public function isTrustedStaticClass($class_name, $compiler) { - if (isset($this->static_classes) && - (empty($this->static_classes) || in_array($class_name, $this->static_classes)) + if (isset($this->static_classes) + && (empty($this->static_classes) || in_array($class_name, $this->static_classes)) ) { return true; } - $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting"); - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if static class method/property is trusted. * - * @param string $class_name - * @param string $params - * @param object $compiler compiler object + * @param string $class_name + * @param string $params + * @param object $compiler compiler object * * @return boolean true if class method is trusted - * @throws SmartyCompilerException if static class method is not trusted */ public function isTrustedStaticClassAccess($class_name, $params, $compiler) { @@ -335,8 +326,8 @@ class Smarty_Security // fall back return $this->isTrustedStaticClass($class_name, $compiler); } - if (isset($allowed[ $class_name ]) && - (empty($allowed[ $class_name ]) || in_array($name, $allowed[ $class_name ])) + if (isset($allowed[ $class_name ]) + && (empty($allowed[ $class_name ]) || in_array($name, $allowed[ $class_name ])) ) { return true; } @@ -348,42 +339,43 @@ class Smarty_Security /** * Check if PHP modifier is trusted. * - * @param string $modifier_name - * @param object $compiler compiler object + * @param string $modifier_name + * @param object $compiler compiler object * * @return boolean true if modifier is trusted - * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedPhpModifier($modifier_name, $compiler) { - if (isset($this->php_modifiers) && - (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers)) + if (isset($this->php_modifiers) + && (empty($this->php_modifiers) || in_array($modifier_name, $this->php_modifiers)) ) { return true; } - $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting"); - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if tag is trusted. * - * @param string $tag_name - * @param object $compiler compiler object + * @param string $tag_name + * @param object $compiler compiler object * * @return boolean true if tag is trusted - * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedTag($tag_name, $compiler) { // check for internal always required tags - if (in_array($tag_name, - array('assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin', - 'private_object_block_function', 'private_object_function', 'private_registered_function', - 'private_registered_block', 'private_special_variable', 'private_print_expression', - 'private_modifier'))) { + if (in_array( + $tag_name, + array( + 'assign', 'call', 'private_filter', 'private_block_plugin', 'private_function_plugin', + 'private_object_block_function', 'private_object_function', 'private_registered_function', + 'private_registered_block', 'private_special_variable', 'private_print_expression', + 'private_modifier' + ) + ) + ) { return true; } // check security settings @@ -398,39 +390,38 @@ class Smarty_Security } else { $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", null, true); } - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if special $smarty variable is trusted. * - * @param string $var_name - * @param object $compiler compiler object + * @param string $var_name + * @param object $compiler compiler object * * @return boolean true if tag is trusted - * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedSpecialSmartyVar($var_name, $compiler) { if (!in_array($var_name, $this->disabled_special_smarty_vars)) { return true; } else { - $compiler->trigger_template_error("special variable '\$smarty.{$var_name}' not allowed by security setting", - null, true); + $compiler->trigger_template_error( + "special variable '\$smarty.{$var_name}' not allowed by security setting", + null, + true + ); } - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if modifier plugin is trusted. * - * @param string $modifier_name - * @param object $compiler compiler object + * @param string $modifier_name + * @param object $compiler compiler object * * @return boolean true if tag is trusted - * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedModifier($modifier_name, $compiler) { @@ -443,26 +434,31 @@ class Smarty_Security if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) { return true; } else { - $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", null, - true); + $compiler->trigger_template_error( + "modifier '{$modifier_name}' disabled by security setting", + null, + true + ); } - } elseif (in_array($modifier_name, $this->allowed_modifiers) && - !in_array($modifier_name, $this->disabled_modifiers) + } elseif (in_array($modifier_name, $this->allowed_modifiers) + && !in_array($modifier_name, $this->disabled_modifiers) ) { return true; } else { - $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", null, - true); + $compiler->trigger_template_error( + "modifier '{$modifier_name}' not allowed by security setting", + null, + true + ); } - return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if constants are enabled or trusted * - * @param string $const constant name - * @param object $compiler compiler object + * @param string $const constant name + * @param object $compiler compiler object * * @return bool */ @@ -488,7 +484,7 @@ class Smarty_Security /** * Check if stream is trusted. * - * @param string $stream_name + * @param string $stream_name * * @return boolean true if stream is trusted * @throws SmartyException if stream is not trusted @@ -498,14 +494,13 @@ class Smarty_Security if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) { return true; } - throw new SmartyException("stream '{$stream_name}' not allowed by security setting"); } /** * Check if directory of file resource is trusted. * - * @param string $filepath + * @param string $filepath * @param null|bool $isConfig * * @return bool true if directory is trusted @@ -514,38 +509,35 @@ class Smarty_Security public function isTrustedResourceDir($filepath, $isConfig = null) { if ($this->_include_path_status !== $this->smarty->use_include_path) { - $_dir = $this->smarty->use_include_path ? $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty) : array(); + $_dir = + $this->smarty->use_include_path ? $this->smarty->ext->_getIncludePath->getIncludePathDirs($this->smarty) : array(); if ($this->_include_dir !== $_dir) { $this->_updateResourceDir($this->_include_dir, $_dir); $this->_include_dir = $_dir; } $this->_include_path_status = $this->smarty->use_include_path; } - if ($isConfig !== true) { - $_dir = $this->smarty->getTemplateDir(); - if ($this->_template_dir !== $_dir) { - $this->_updateResourceDir($this->_template_dir, $_dir); - $this->_template_dir = $_dir; - } + $_dir = $this->smarty->getTemplateDir(); + if ($this->_template_dir !== $_dir) { + $this->_updateResourceDir($this->_template_dir, $_dir); + $this->_template_dir = $_dir; } - if ($isConfig !== false) { - $_dir = $this->smarty->getConfigDir(); - if ($this->_config_dir !== $_dir) { - $this->_updateResourceDir($this->_config_dir, $_dir); - $this->_config_dir = $_dir; - } + $_dir = $this->smarty->getConfigDir(); + if ($this->_config_dir !== $_dir) { + $this->_updateResourceDir($this->_config_dir, $_dir); + $this->_config_dir = $_dir; } if ($this->_secure_dir !== $this->secure_dir) { $this->secure_dir = (array)$this->secure_dir; - foreach($this->secure_dir as $k => $d) { - $this->secure_dir[$k] = $this->smarty->_realpath($d.DIRECTORY_SEPARATOR,true); + foreach ($this->secure_dir as $k => $d) { + $this->secure_dir[ $k ] = $this->smarty->_realpath($d . DIRECTORY_SEPARATOR, true); } $this->_updateResourceDir($this->_secure_dir, $this->secure_dir); $this->_secure_dir = $this->secure_dir; } - $addPath = $this->_checkDir($filepath, $this->_resource_dir); + $addPath = $this->_checkDir($filepath, $this->_resource_dir); if ($addPath !== false) { - $this->_resource_dir = array_merge($this->_resource_dir, $addPath); + $this->_resource_dir = array_merge($this->_resource_dir, $addPath); } return true; } @@ -556,11 +548,11 @@ class Smarty_Security * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string" * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}. * - * @param string $uri + * @param string $uri * * @return boolean true if URI is trusted * @throws SmartyException if URI is not trusted - * @uses $trusted_uri for list of patterns to match against $uri + * @uses $trusted_uri for list of patterns to match against $uri */ public function isTrustedUri($uri) { @@ -573,14 +565,13 @@ class Smarty_Security } } } - throw new SmartyException("URI '{$uri}' not allowed by security setting"); } /** * Check if directory of file resource is trusted. * - * @param string $filepath + * @param string $filepath * * @return boolean true if directory is trusted * @throws SmartyException if PHP directory is not trusted @@ -590,22 +581,20 @@ class Smarty_Security if (empty($this->trusted_dir)) { throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)"); } - // check if index is outdated if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) { $this->_php_resource_dir = array(); - $this->_trusted_dir = $this->trusted_dir; - foreach ((array) $this->trusted_dir as $directory) { - $directory = $this->smarty->_realpath($directory . DIRECTORY_SEPARATOR, true); + foreach ((array)$this->trusted_dir as $directory) { + $directory = $this->smarty->_realpath($directory . '/', true); $this->_php_resource_dir[ $directory ] = true; } } - $addPath = $this->_checkDir($filepath, $this->_php_resource_dir); + $addPath = $this->_checkDir($filepath, $this->_php_resource_dir); if ($addPath !== false) { - $this->_php_resource_dir = array_merge($this->_php_resource_dir, $addPath); + $this->_php_resource_dir = array_merge($this->_php_resource_dir, $addPath); } - return true; + return true; } /** @@ -614,21 +603,23 @@ class Smarty_Security * @param array $oldDir * @param array $newDir */ - private function _updateResourceDir($oldDir, $newDir) { + private function _updateResourceDir($oldDir, $newDir) + { foreach ($oldDir as $directory) { - $directory = $this->smarty->_realpath($directory, true); + // $directory = $this->smarty->_realpath($directory, true); $length = strlen($directory); foreach ($this->_resource_dir as $dir) { - if (substr($dir, 0,$length) === $directory) { + if (substr($dir, 0, $length) === $directory) { unset($this->_resource_dir[ $dir ]); } } } foreach ($newDir as $directory) { - $directory = $this->smarty->_realpath($directory, true); + // $directory = $this->smarty->_realpath($directory, true); $this->_resource_dir[ $directory ] = true; } } + /** * Check if file is inside a valid directory * @@ -640,37 +631,34 @@ class Smarty_Security */ private function _checkDir($filepath, $dirs) { - $directory = dirname($filepath) . DIRECTORY_SEPARATOR; - if (isset($dirs[ $directory ])) { - return false; - } - $filepath = $this->smarty->_realpath($filepath, true); - $directory = dirname($filepath) . DIRECTORY_SEPARATOR; + $directory = dirname($this->smarty->_realpath($filepath, true)) . DIRECTORY_SEPARATOR; $_directory = array(); - while (true) { - // test if the directory is trusted - if (isset($dirs[ $directory ])) { - return $_directory; - } - // abort if we've reached root - if (!preg_match('#[\\\/][^\\\/]+[\\\/]$#', $directory)) { - break; + if (!preg_match('#[\\\\/][.][.][\\\\/]#', $directory)) { + while (true) { + // test if the directory is trusted + if (isset($dirs[ $directory ])) { + return $_directory; + } + // abort if we've reached root + if (!preg_match('#[\\\\/][^\\\\/]+[\\\\/]$#', $directory)) { + // give up + break; + } + // remember the directory to add it to _resource_dir in case we're successful + $_directory[ $directory ] = true; + // bubble up one level + $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', DIRECTORY_SEPARATOR, $directory); } - // remember the directory to add it to _resource_dir in case we're successful - $_directory[ $directory ] = true; - // bubble up one level - $directory = preg_replace('#[\\\/][^\\\/]+[\\\/]$#', DIRECTORY_SEPARATOR, $directory); } - // give up - throw new SmartyException("directory '{$filepath}' not allowed by security setting"); + throw new SmartyException(sprintf('Smarty Security: not trusted file path \'%s\' ', $filepath)); } /** * Loads security class and enables security * - * @param \Smarty $smarty - * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * @param \Smarty $smarty + * @param string|Smarty_Security $security_class if a string is used, it must be class-name * * @return \Smarty current Smarty instance for chaining * @throws \SmartyException when an invalid class name is provided @@ -695,6 +683,7 @@ class Smarty_Security } return $smarty; } + /** * Start template processing * @@ -704,19 +693,18 @@ class Smarty_Security */ public function startTemplate($template) { - if ($this->max_template_nesting > 0 && $this->_current_template_nesting ++ >= $this->max_template_nesting) { + if ($this->max_template_nesting > 0 && $this->_current_template_nesting++ >= $this->max_template_nesting) { throw new SmartyException("maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'"); } } /** * Exit template processing - * */ public function endTemplate() { if ($this->max_template_nesting > 0) { - $this->_current_template_nesting --; + $this->_current_template_nesting--; } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php index 45c83c895..508d27f36 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php @@ -92,7 +92,7 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base $this->cache_id = $_template->cache_id; $this->source = $_template->source; if (!class_exists('Smarty_CacheResource', false)) { - require SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; + include SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; } $this->handler = Smarty_CacheResource::load($_template->smarty); } @@ -102,7 +102,7 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base * * @return Smarty_Template_Cached */ - static function load(Smarty_Internal_Template $_template) + public static function load(Smarty_Internal_Template $_template) { $_template->cached = new Smarty_Template_Cached($_template); $_template->cached->handler->populate($_template->cached, $_template); @@ -118,7 +118,7 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base * Render cache template * * @param \Smarty_Internal_Template $_template - * @param bool $no_output_filter + * @param bool $no_output_filter * * @throws \Exception */ @@ -163,14 +163,14 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base } else { $this->valid = true; } - if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_CURRENT && - $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime) + 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->compile_check === Smarty::COMPILECHECK_ON && - $_template->source->getTimeStamp() > $this->timestamp + if ($this->valid && $_template->compile_check === Smarty::COMPILECHECK_ON + && $_template->source->getTimeStamp() > $this->timestamp ) { $this->valid = false; } @@ -204,9 +204,9 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base } else { return $this->valid; } - if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED && - $_template->cached->cache_lifetime >= 0 && - (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime)) + if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED + && $_template->cached->cache_lifetime >= 0 + && (time() > ($_template->cached->timestamp + $_template->cached->cache_lifetime)) ) { $this->valid = false; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php index 7ca2ebcb4..37d8f0a9e 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php @@ -7,7 +7,7 @@ * @package Smarty * @subpackage TemplateResources * @author Rodney Rehm - * @property string $content compiled content + * @property string $content compiled content */ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base { @@ -21,11 +21,11 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base /** * get a Compiled Object of this source * - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template $_template template object * * @return Smarty_Template_Compiled compiled object */ - static function load($_template) + public static function load($_template) { $compiled = new Smarty_Template_Compiled(); if ($_template->source->handler->hasCompiledHandler) { @@ -134,9 +134,9 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base $smarty = &$_smarty_tpl->smarty; if ($source->handler->recompiled) { $source->handler->process($_smarty_tpl); - } else if (!$source->handler->uncompiled) { - if (!$this->exists || $smarty->force_compile || - ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp()) + } elseif (!$source->handler->uncompiled) { + if (!$this->exists || $smarty->force_compile + || ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp()) ) { $this->compileTemplateSource($_smarty_tpl); $compileCheck = $_smarty_tpl->compile_check; @@ -145,7 +145,7 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base $_smarty_tpl->compile_check = $compileCheck; } else { $_smarty_tpl->mustCompile = true; - @include($this->filepath); + @include $this->filepath; if ($_smarty_tpl->mustCompile) { $this->compileTemplateSource($_smarty_tpl); $compileCheck = $_smarty_tpl->compile_check; @@ -182,8 +182,7 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base // call compiler $_template->loadCompiler(); $this->write($_template, $_template->compiler->compileTemplate($_template)); - } - catch (Exception $e) { + } catch (Exception $e) { // restore old timestamp in case of error if ($saved_timestamp && is_file($this->filepath)) { touch($this->filepath, $saved_timestamp); @@ -246,13 +245,13 @@ class Smarty_Template_Compiled extends Smarty_Template_Resource_Base && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) ) { opcache_invalidate($this->filepath, true); - } else if (function_exists('apc_compile_file')) { + } elseif (function_exists('apc_compile_file')) { apc_compile_file($this->filepath); } if (defined('HHVM_VERSION')) { eval('?>' . file_get_contents($this->filepath)); } else { - include($this->filepath); + include $this->filepath; } } } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_config.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_config.php index 44cdba6fd..850ae32e7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_config.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_config.php @@ -14,7 +14,6 @@ * @package Smarty * @subpackage TemplateResources * @author Uwe Tews - * */ class Smarty_Template_Config extends Smarty_Template_Source { @@ -64,16 +63,18 @@ class Smarty_Template_Config extends Smarty_Template_Source * initialize Source Object for given resource * Either [$_template] or [$smarty, $template_resource] must be specified * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier * * @return Smarty_Template_Config Source Object * @throws SmartyException */ - public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, - $template_resource = null) - { + public static function load( + Smarty_Internal_Template $_template = null, + Smarty $smarty = null, + $template_resource = null + ) { static $_incompatible_resources = array('extends' => true, 'php' => true); if ($_template) { $smarty = $_template->smarty; @@ -82,11 +83,11 @@ class Smarty_Template_Config extends Smarty_Template_Source if (empty($template_resource)) { throw new SmartyException('Source: Missing name'); } - // parse resource_name, load resource handler + // parse resource_name, load resource handler list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_config_type); // make sure configs are not loaded via anything smarty can't handle if (isset($_incompatible_resources[ $type ])) { - throw new SmartyException ("Unable to use resource '{$type}' for config"); + throw new SmartyException("Unable to use resource '{$type}' for config"); } $source = new Smarty_Template_Config($smarty, $template_resource, $type, $name); $source->handler->populate($source, $_template); diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php index 951e02af3..52bfba252 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php @@ -125,8 +125,7 @@ abstract class Smarty_Template_Resource_Base call_user_func($callback, $_template); } $_template->isRenderingCache = false; - } - catch (Exception $e) { + } catch (Exception $e) { $_template->isRenderingCache = false; while (ob_get_level() > $level) { ob_end_clean(); diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php b/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php index 4868706c8..16b47f23c 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php @@ -7,7 +7,6 @@ * @package Smarty * @subpackage TemplateResources * @author Rodney Rehm - * */ class Smarty_Template_Source { @@ -131,7 +130,7 @@ class Smarty_Template_Source * @param string $type type of resource * @param string $name resource name * - * @throws \SmartyException + * @throws \SmartyException * @internal param \Smarty_Resource $handler Resource Handler this source object communicates with */ public function __construct(Smarty $smarty, $resource, $type, $name) @@ -149,16 +148,18 @@ class Smarty_Template_Source * initialize Source Object for given resource * Either [$_template] or [$smarty, $template_resource] must be specified * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier * * @return Smarty_Template_Source Source Object * @throws SmartyException */ - public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, - $template_resource = null) - { + public static function load( + Smarty_Internal_Template $_template = null, + Smarty $smarty = null, + $template_resource = null + ) { if ($_template) { $smarty = $_template->smarty; $template_resource = $_template->template_resource; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php index e064f6551..6d31a8a05 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php @@ -12,13 +12,13 @@ class Smarty_Undefined_Variable extends Smarty_Variable /** * Returns null for not existing properties * - * @param string $name + * @param string $name * * @return null */ public function __get($name) { - return null; + return null; } /** diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_variable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_variable.php index 0b17bc7cf..914d99bd7 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_variable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_variable.php @@ -42,7 +42,6 @@ class Smarty_Variable */ public function __toString() { - return (string) $this->value; + return (string)$this->value; } } - diff --git a/view/pdl/mod_wiki.pdl b/view/pdl/mod_wiki.pdl index 2e99ea36b..be86be7e3 100644 --- a/view/pdl/mod_wiki.pdl +++ b/view/pdl/mod_wiki.pdl @@ -1,6 +1,5 @@ [region=aside] [widget=vcard][/widget] -[widget=wiki_list][/widget] [widget=wiki_pages][/widget] [/region] [region=right_aside] |