From ed8224e4e05068a4fdd2c3af2ed64afae23e5cec Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 11 Feb 2024 14:50:03 +0100 Subject: [PATCH] Update twig to 1.14.5 (add php 8 support) --- composer.json | 5 +- composer.lock | 172 ++++++++++++++++-- templates/generic_page.html | 4 +- templates/header.html | 4 +- templates/index.html | 4 +- templates/main.js | 52 +++--- templates/page.html | 4 +- templates/post_form.html | 4 +- templates/themes/basic/index.html | 4 +- templates/themes/calendar/calendar.html | 4 +- templates/themes/catalog/catalog.html | 4 +- templates/themes/donate/donate.html | 4 +- templates/themes/faq/index.html | 4 +- templates/themes/irc/irc.html | 4 +- templates/themes/radio/radio.html | 4 +- templates/themes/rules/rules.html | 4 +- .../staffapplication/staffapplication.html | 4 +- templates/themes/stream/stream.html | 4 +- templates/thread.html | 4 +- templates/thread2_old.html | 4 +- 20 files changed, 218 insertions(+), 79 deletions(-) diff --git a/composer.json b/composer.json index 56624b27..1b0bedc5 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,11 @@ "description": "leftypol imageboard", "type": "project", "require": { - "twig/twig": "^2.9", + "twig/twig": "^2.14.5", "lifo/ip": "^1.0", "gettext/gettext": "^1.0", - "mrclay/minify": "^2.1.6" + "mrclay/minify": "^2.1.6", + "phpmyadmin/twig-i18n-extension": "^4.1" }, "autoload": { "classmap": ["inc/"], diff --git a/composer.lock b/composer.lock index 5c8f851a..395d94cb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b3695c356f94b9226e689a31f8dc1463", + "content-hash": "9390756f1db53a7bb4475fe5b68c9f9d", "packages": [ { "name": "gettext/gettext", @@ -157,6 +157,62 @@ }, "time": "2017-11-03T21:04:01+00:00" }, + { + "name": "phpmyadmin/twig-i18n-extension", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/twig-i18n-extension.git", + "reference": "a514a2afd29717a2a68c298582cc2739e8edeed0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/twig-i18n-extension/zipball/a514a2afd29717a2a68c298582cc2739e8edeed0", + "reference": "a514a2afd29717a2a68c298582cc2739e8edeed0", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "twig/twig": "^1.42.3|^2.0|^3.0" + }, + "require-dev": { + "phpmyadmin/coding-standard": "^3.0.0", + "phpmyadmin/motranslator": "^5.2", + "phpstan/phpstan": "^1.9.4", + "phpunit/phpunit": "^7 || ^8 || ^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\Twig\\Extensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "Internationalization support for Twig via the gettext library", + "keywords": [ + "gettext", + "i18n" + ], + "support": { + "issues": "https://github.com/phpmyadmin/twig-i18n-extension/issues", + "source": "https://github.com/phpmyadmin/twig-i18n-extension" + }, + "time": "2023-09-12T18:31:42+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.24.0", @@ -319,34 +375,107 @@ ], "time": "2024-01-29T20:11:03+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, { "name": "twig/twig", - "version": "v2.9.0", + "version": "v2.15.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "82a1c055c8ed4c4705023bfd0405f3c74db6e3ae" + "reference": "3e059001d6d597dd50ea7c74dd2464b4adea48d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/82a1c055c8ed4c4705023bfd0405f3c74db6e3ae", - "reference": "82a1c055c8ed4c4705023bfd0405f3c74db6e3ae", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3e059001d6d597dd50ea7c74dd2464b4adea48d3", + "reference": "3e059001d6d597dd50ea7c74dd2464b4adea48d3", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.1.3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.9-dev" + "dev-master": "2.15-dev" } }, "autoload": { @@ -368,15 +497,14 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://twig.symfony.com/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -386,9 +514,19 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.9.0" + "source": "https://github.com/twigphp/Twig/tree/v2.15.4" }, - "time": "2019-04-28T06:57:38+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2022-12-27T12:26:20+00:00" } ], "packages-dev": [], diff --git a/templates/generic_page.html b/templates/generic_page.html index 830d1f43..775da16e 100644 --- a/templates/generic_page.html +++ b/templates/generic_page.html @@ -49,8 +49,8 @@ {% for footer in config.footer %}

{{ footer }}

{% endfor %} - + {% endverbatim %} diff --git a/templates/header.html b/templates/header.html index 68c0b8af..2314f201 100644 --- a/templates/header.html +++ b/templates/header.html @@ -30,7 +30,7 @@ {% endif %} {% if config.recaptcha %} - {% endif %} + {% endverbatim %}{% endif %} diff --git a/templates/index.html b/templates/index.html index 52059a3c..262a2b2a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -132,9 +132,9 @@ - + {% endverbatim %} diff --git a/templates/main.js b/templates/main.js index dc858dc7..ef7ab248 100755 --- a/templates/main.js +++ b/templates/main.js @@ -1,4 +1,4 @@ -{% raw %} +{% verbatim %} /* gettext-compatible _ function, example of usage: * @@ -109,16 +109,16 @@ function alert(a, do_confirm, confirm_ok_action, confirm_cancel_action) { var saved = {}; -var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}'; +var selectedstyle = '{% endverbatim %}{{ config.default_stylesheet.0|addslashes }}{% verbatim %}'; var styles = { - {% endraw %} - {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', - {% endraw %}{% endfor %}{% raw %} + {% endverbatim %} + {% for stylesheet in stylesheets %}{% verbatim %}'{% endverbatim %}{{ stylesheet.name|addslashes }}{% verbatim %}' : '{% endverbatim %}{{ stylesheet.uri|addslashes }}{% verbatim %}', + {% endverbatim %}{% endfor %}{% verbatim %} }; var codestyles = { - {% endraw %} - {% for stylesheet in code_stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', - {% endraw %}{% endfor %}{% raw %} + {% endverbatim %} + {% for stylesheet in code_stylesheets %}{% verbatim %}'{% endverbatim %}{{ stylesheet.name|addslashes }}{% verbatim %}' : '{% endverbatim %}{{ stylesheet.uri|addslashes }}{% verbatim %}', + {% endverbatim %}{% endfor %}{% verbatim %} }; if (typeof board_name === 'undefined') { @@ -126,16 +126,16 @@ if (typeof board_name === 'undefined') { } function changeStyle(styleName, link) { - {% endraw %} - {% if config.stylesheets_board %}{% raw %} + {% endverbatim %} + {% if config.stylesheets_board %}{% verbatim %} if (board_name) { stylesheet_choices[board_name] = styleName; localStorage.board_stylesheets = JSON.stringify(stylesheet_choices); } - {% endraw %}{% else %} + {% endverbatim %}{% else %} localStorage.stylesheet = styleName; {% endif %} - {% raw %} + {% verbatim %} // Main stylesheet if (!document.getElementById('stylesheet')) { @@ -178,9 +178,9 @@ function changeStyle(styleName, link) { } -{% endraw %} +{% endverbatim %} {% if config.stylesheets_board %} - {% raw %} + {% verbatim %} if (!localStorage.board_stylesheets) { localStorage.board_stylesheets = '{}'; @@ -197,7 +197,7 @@ function changeStyle(styleName, link) { } {% endraw%} {% else %} - {% raw %} + {% verbatim %} if (localStorage.stylesheet) { for (var styleName in styles) { if (styleName == localStorage.stylesheet) { @@ -206,9 +206,9 @@ function changeStyle(styleName, link) { } } } - {% endraw %} + {% endverbatim %} {% endif %} -{% raw %} +{% verbatim %} function init_stylechooser() { var newElement = document.createElement('div'); @@ -261,7 +261,7 @@ function highlightReply(id) { function generatePassword() { var pass = ''; - var chars = '{% endraw %}{{ config.genpassword_chars }}{% raw %}'; + var chars = '{% endverbatim %}{{ config.genpassword_chars }}{% verbatim %}'; for (var i = 0; i < 8; i++) { var rnd = Math.floor(Math.random() * chars.length); pass += chars.substring(rnd, rnd + 1); @@ -355,15 +355,15 @@ function rememberStuff() { if (sessionStorage.body) { var saved = JSON.parse(sessionStorage.body); - if (get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')) { + if (get_cookie('{% endverbatim %}{{ config.cookies.js }}{% verbatim %}')) { // Remove successful posts - var successful = JSON.parse(get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')); + var successful = JSON.parse(get_cookie('{% endverbatim %}{{ config.cookies.js }}{% verbatim %}')); for (var url in successful) { saved[url] = null; } sessionStorage.body = JSON.stringify(saved); - document.cookie = '{% endraw %}{{ config.cookies.js }}{% raw %}={};expires=0;path=/;'; + document.cookie = '{% endverbatim %}{{ config.cookies.js }}{% verbatim %}={};expires=0;path=/;'; } if (saved[document.location]) { document.forms.post.body.value = saved[document.location]; @@ -391,13 +391,13 @@ var script_settings = function(script_name) { function init() { init_stylechooser(); - {% endraw %} + {% endverbatim %} {% if config.allow_delete %} if (document.forms.postcontrols) { document.forms.postcontrols.password.value = localStorage.password; } {% endif %} - {% raw %} + {% verbatim %} if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1)) highlightReply(window.location.hash.substring(1)); @@ -418,16 +418,16 @@ function ready() { } } -{% endraw %} +{% endverbatim %} var post_date = "{{ config.post_date }}"; var max_images = {{ config.max_images }}; onready(init); -{% if config.google_analytics %}{% raw %} +{% if config.google_analytics %}{% verbatim %} -var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %} +var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endverbatim %}{{ config.google_analytics }}{% verbatim %}']);{% endverbatim %}{% if config.google_analytics_domain %}{% verbatim %}_gaq.push(['_setDomainName', '{% endverbatim %}{{ config.google_analytics_domain }}{% verbatim %}']){% endverbatim %}{% endif %}{% if not config.google_analytics_domain %}{% verbatim %}_gaq.push(['_setDomainName', 'none']){% endverbatim %}{% endif %}{% verbatim %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endverbatim %}{% endif %} {% if config.statcounter_project and config.statcounter_security %} var sc = document.createElement('script'); diff --git a/templates/page.html b/templates/page.html index a651af7b..e3db5ab6 100644 --- a/templates/page.html +++ b/templates/page.html @@ -35,8 +35,8 @@
- + {% endverbatim %} diff --git a/templates/post_form.html b/templates/post_form.html index 89b60a09..1a766b52 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -220,6 +220,6 @@ {% if 'js/upload-selection.js' in config.additional_javascript %} {% endif %} - +{% endverbatim %} diff --git a/templates/themes/basic/index.html b/templates/themes/basic/index.html index 3fbb7f43..94814c0a 100644 --- a/templates/themes/basic/index.html +++ b/templates/themes/basic/index.html @@ -49,9 +49,9 @@
vichan Copyright © 2012-2016 vichan-devel

- + {% endverbatim %} {% endapply %} diff --git a/templates/themes/calendar/calendar.html b/templates/themes/calendar/calendar.html index eeb08f1c..22bc0303 100644 --- a/templates/themes/calendar/calendar.html +++ b/templates/themes/calendar/calendar.html @@ -185,8 +185,8 @@ }); - + {% endverbatim %} diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index ade8023b..a2d14013 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -107,9 +107,9 @@
- + {% endverbatim %} {% endapply %} diff --git a/templates/themes/donate/donate.html b/templates/themes/donate/donate.html index 4cacc030..b64f16f5 100644 --- a/templates/themes/donate/donate.html +++ b/templates/themes/donate/donate.html @@ -52,9 +52,9 @@
- + {% endverbatim %} diff --git a/templates/themes/faq/index.html b/templates/themes/faq/index.html index 634ff36b..ba6322e5 100644 --- a/templates/themes/faq/index.html +++ b/templates/themes/faq/index.html @@ -139,9 +139,9 @@
vichan Copyright © 2012-2016 vichan-devel

- +{% endverbatim %} {% endfilter %} diff --git a/templates/themes/irc/irc.html b/templates/themes/irc/irc.html index 6d1ffb18..0b21aae5 100644 --- a/templates/themes/irc/irc.html +++ b/templates/themes/irc/irc.html @@ -27,9 +27,9 @@
- + {% endverbatim %} {% endfilter %} diff --git a/templates/themes/radio/radio.html b/templates/themes/radio/radio.html index ed73b47e..fa3c3a2a 100644 --- a/templates/themes/radio/radio.html +++ b/templates/themes/radio/radio.html @@ -127,8 +127,8 @@ $(document).ready(function(){

To upload a voice-over / bump to radio click here

- + {% endverbatim %} diff --git a/templates/themes/rules/rules.html b/templates/themes/rules/rules.html index 956ec476..2233f76b 100755 --- a/templates/themes/rules/rules.html +++ b/templates/themes/rules/rules.html @@ -26,9 +26,9 @@ {% include 'rules.html' %}
- + {% endverbatim %} {% endfilter %} diff --git a/templates/themes/staffapplication/staffapplication.html b/templates/themes/staffapplication/staffapplication.html index 4d4e425b..132081fd 100644 --- a/templates/themes/staffapplication/staffapplication.html +++ b/templates/themes/staffapplication/staffapplication.html @@ -72,9 +72,9 @@
lainchan Copyright © 2014-2017 lainchan Administration

- + {% endverbatim %} {% endfilter %} diff --git a/templates/themes/stream/stream.html b/templates/themes/stream/stream.html index dadb0dba..e30df1a9 100644 --- a/templates/themes/stream/stream.html +++ b/templates/themes/stream/stream.html @@ -174,8 +174,8 @@ function change_format(e) {
lainchan Copyright © 2014-2017 lainchan Administration

- + {% endverbatim %} diff --git a/templates/thread.html b/templates/thread.html index 1be7f568..7acfc4fb 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -113,9 +113,9 @@
- + {% endverbatim %} diff --git a/templates/thread2_old.html b/templates/thread2_old.html index ca020f19..af773643 100644 --- a/templates/thread2_old.html +++ b/templates/thread2_old.html @@ -111,9 +111,9 @@
- + {% endverbatim %}