Skip to content

Commit e74b249

Browse files
committed
Fix Textpattern >= 4.8.0 compatibility on PHP >= 8.1
1 parent 7eda86f commit e74b249

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=====
33

4+
1.0.13 - 2022/04/22
5+
-----
6+
7+
* Fixed: Textpattern >= 4.8 compatibility on PHP >= 8.1. Before would halt
8+
to `trying to access array offset on value of type null` error about
9+
`$txp_sections` global variable on PHP >= 8.1.
10+
411
1.0.12 - 2022/04/14
512
-----
613

src/Textpattern/Composer/Installer/Textpattern/Inject.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Inject
8989
$is_article_list, $status, $id, $c, $context, $q, $m, $pg, $p, $month, $author, $request_uri, $qs,
9090
$subpath, $req, $page, $css, $pfr, $nolog, $has_article_tag, $txp_current_form, $parentid, $thisauthor,
9191
$thissection, $is_article_body, $stack_article, $thispage, $uPosted, $limit, $permlinks, $thiscategory,
92-
$thisarticle, $variable, $thislink, $theme, $event, $step, $trace;
92+
$thisarticle, $thisversion, $txp_sections, $variable, $thislink, $theme, $event, $step, $trace;
9393

9494
Inject::$ready = true;
9595
Inject::$cwd = getcwd();
@@ -118,11 +118,13 @@ class Inject
118118
$trace = new \Trace();
119119
}
120120

121+
define('txp_version', get_pref('version'));
122+
define('LANG', get_pref('language'));
123+
121124
// Disable plugins during the updating and installing.
122125
// Loading plugins here would cause a FATAL error when invoking
123126
// plugin's updater callback, as the plugin would be evaluated
124127
// twice.
125-
126128
Inject::$plugins = get_pref('use_plugins', 1, true);
127129
Inject::$admin_side_plugins = get_pref('admin_side_plugins', 1, true);
128130
set_pref('use_plugins', 0);

0 commit comments

Comments
 (0)