From 4037beebab8d84121e832bcb144f890a88ce058c Mon Sep 17 00:00:00 2001 From: Daniel Saunders Date: Thu, 23 Jan 2020 01:03:47 -0500 Subject: [PATCH] Twig 2.9 updates --- composer.json | 2 +- composer.lock | 2 +- inc/config.php | 2 +- inc/template.php | 22 +++------------------- templates/banned.html | 18 +++++++++--------- templates/mod/ban_appeals.html | 8 ++++---- templates/mod/ban_form.html | 2 +- templates/mod/ban_list.html | 6 +++--- templates/mod/board.html | 2 +- templates/mod/config-editor-php.html | 2 +- templates/mod/config-editor.html | 2 +- templates/mod/dashboard.html | 4 ++-- templates/mod/debug/antispam.html | 12 ++++++------ templates/mod/debug/recent_posts.html | 8 ++++---- templates/mod/inbox.html | 2 +- templates/mod/log.html | 4 ++-- templates/mod/move.html | 4 ++-- templates/mod/move_reply.html | 4 ++-- templates/mod/news.html | 2 +- templates/mod/noticeboard.html | 2 +- templates/mod/pm.html | 2 +- templates/mod/rebuild.html | 2 +- templates/mod/report.html | 4 ++-- templates/mod/search_results.html | 14 +++++++------- templates/mod/theme_rebuilt.html | 2 +- templates/mod/user.html | 6 +++--- templates/mod/users.html | 2 +- templates/mod/view_ip.html | 16 ++++++++-------- templates/post/flag.html | 2 +- templates/post/image.html | 8 ++++---- templates/post/time.html | 2 +- templates/post_reply.html | 8 ++++---- templates/post_thread.html | 8 ++++---- templates/post_thread_fileboard.html | 4 ++-- templates/themes/awsumchan | 2 +- templates/themes/basic/index.html | 8 ++++---- templates/themes/catalog/catalog.html | 6 +++--- templates/themes/categories/news.html | 8 ++++---- templates/themes/categories/sidebar.html | 4 ++-- templates/themes/frameset/news.html | 8 ++++---- templates/themes/frameset/sidebar.html | 6 +++--- templates/themes/recent/recent.html | 6 +++--- templates/themes/rss/rss.xml | 4 ++-- templates/themes/sitemap/sitemap.xml | 6 +++--- 44 files changed, 116 insertions(+), 132 deletions(-) diff --git a/composer.json b/composer.json index da521855..ebbe92fa 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ }, "require": { "gettext/gettext": "^4.4", - "twig/twig": "^2.4", + "twig/twig": "^2.9", "twig/extensions": "^1.5", "geoip/geoip": "^1.16", "mrclay/minify": "^3.0", diff --git a/composer.lock b/composer.lock index 518078a8..a661a191 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": "024e398738753e998a1e2b62235843a3", + "content-hash": "cd1eb38aad1ab9b78eddde4761daa8b6", "packages": [ { "name": "awsumchan/ip", diff --git a/inc/config.php b/inc/config.php index 69c22186..8f902c44 100644 --- a/inc/config.php +++ b/inc/config.php @@ -875,7 +875,7 @@ // Timezone to use for displaying dates/tiems. $config['timezone'] = 'America/Los_Angeles'; // The format string passed to strftime() for displaying dates. - // http://www.php.net/manual/en/function.strftime.php + // https://www.php.net/manual/en/function.strftime.php $config['post_date'] = '%m/%d/%y (%a) %H:%M:%S'; // Same as above, but used for "you are banned' pages. $config['ban_date'] = '%A %e %B, %Y'; diff --git a/inc/template.php b/inc/template.php index a46660f0..047888e3 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1,7 +1,7 @@ $length) { if ($preserve) { diff --git a/templates/banned.html b/templates/banned.html index 0444d1f1..e507e676 100644 --- a/templates/banned.html +++ b/templates/banned.html @@ -1,4 +1,4 @@ -{% filter remove_whitespace %} +{% apply spaceless %} {# Automatically removes unnecessary whitespace #}
{% if ban.expires and time() >= ban.expires %} @@ -13,7 +13,7 @@ {% trans %}You have been banned from{% endtrans %} {% endif %} {% if ban.board %} - {{ config.board_abbreviation|sprintf(ban.board) }} + {{ config.board_abbreviation|format(ban.board) }} {% else %} {% trans %}all boards{% endtrans %} {% endif %} @@ -30,7 +30,7 @@ {% endif %}

{% trans %}Your ban was filed on{% endtrans %} - {{ ban.created|date(config.ban_date) }} + {{ ban.created|strftime(config.ban_date) }} {% if config.show_modname %} {% if ban.username %} {% trans %}by{% endtrans %} {{ ban.username }} @@ -44,7 +44,7 @@ {% elseif ban.expires %} {% trans %}expires{% endtrans %} {{ ban.expires|until }} {% trans %}from now, which is on{% endtrans %} - {{ ban.expires|date(config.ban_date) }} + {{ ban.expires|strftime(config.ban_date) }} {% endverbatim %} -{% endfilter %} +{% endapply %} diff --git a/templates/themes/categories/news.html b/templates/themes/categories/news.html index 32c6c6c9..6a05fb56 100644 --- a/templates/themes/categories/news.html +++ b/templates/themes/categories/news.html @@ -1,4 +1,4 @@ -{% filter remove_whitespace %} +{% apply spaceless %} @@ -24,7 +24,7 @@ {% else %} {% trans %}no subject{% endtrans %} {% endif %} - — {% trans %}by{% endtrans %} {{ entry.name }} {% trans %}at{% endtrans %} {{ entry.time|date(config.post_date) }} + — {% trans %}by{% endtrans %} {{ entry.name }} {% trans %}at{% endtrans %} {{ entry.time|strftime(config.post_date) }}

{{ entry.body }}

{% endfor %} @@ -33,9 +33,9 @@

Powered by Tinyboard {{ config.version }} -
Tinyboard Copyright © 2010-2018 Tinyboard Development Group +
Tinyboard Copyright © 2010-2020 Tinyboard Development Group
vichan Copyright © 2012-2016 vichan-devel

-{% endfilter %} +{% endapply %} diff --git a/templates/themes/categories/sidebar.html b/templates/themes/categories/sidebar.html index e386c948..1a35667e 100644 --- a/templates/themes/categories/sidebar.html +++ b/templates/themes/categories/sidebar.html @@ -1,4 +1,4 @@ -{% filter remove_whitespace %} +{% apply spaceless %} @@ -51,4 +51,4 @@ {% endfor %} -{% endfilter %} +{% endapply %} diff --git a/templates/themes/frameset/news.html b/templates/themes/frameset/news.html index 68178aa5..a3d07f5d 100644 --- a/templates/themes/frameset/news.html +++ b/templates/themes/frameset/news.html @@ -1,4 +1,4 @@ -{% filter remove_whitespace %} +{% apply spaceless %} @@ -23,7 +23,7 @@ {% else %} no subject {% endif %} - — by {{ entry.name }} at {{ entry.time|date(config.post_date) }} + — by {{ entry.name }} at {{ entry.time|strftime(config.post_date) }}

{{ entry.body }}

{% endfor %} @@ -32,9 +32,9 @@

Powered by Tinyboard {{ config.version }} -
Tinyboard Copyright © 2010-2018 Tinyboard Development Group +
Tinyboard Copyright © 2010-2020 Tinyboard Development Group
vichan Copyright © 2012-2016 vichan-devel

-{% endfilter %} +{% endapply %} diff --git a/templates/themes/frameset/sidebar.html b/templates/themes/frameset/sidebar.html index 40e2d719..1bb81330 100644 --- a/templates/themes/frameset/sidebar.html +++ b/templates/themes/frameset/sidebar.html @@ -1,4 +1,4 @@ -{% filter remove_whitespace %} +{% apply spaceless %} @@ -29,7 +29,7 @@