Skip to content

Commit

Permalink
Fix Textpattern >= 4.8.0 compatibility on PHP >= 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gocom committed Apr 23, 2022
1 parent 7eda86f commit e74b249
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=====

1.0.13 - 2022/04/22
-----

* Fixed: Textpattern >= 4.8 compatibility on PHP >= 8.1. Before would halt
to `trying to access array offset on value of type null` error about
`$txp_sections` global variable on PHP >= 8.1.

1.0.12 - 2022/04/14
-----

Expand Down
6 changes: 4 additions & 2 deletions src/Textpattern/Composer/Installer/Textpattern/Inject.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Inject
$is_article_list, $status, $id, $c, $context, $q, $m, $pg, $p, $month, $author, $request_uri, $qs,
$subpath, $req, $page, $css, $pfr, $nolog, $has_article_tag, $txp_current_form, $parentid, $thisauthor,
$thissection, $is_article_body, $stack_article, $thispage, $uPosted, $limit, $permlinks, $thiscategory,
$thisarticle, $variable, $thislink, $theme, $event, $step, $trace;
$thisarticle, $thisversion, $txp_sections, $variable, $thislink, $theme, $event, $step, $trace;

Inject::$ready = true;
Inject::$cwd = getcwd();
Expand Down Expand Up @@ -118,11 +118,13 @@ class Inject
$trace = new \Trace();
}

define('txp_version', get_pref('version'));
define('LANG', get_pref('language'));

// Disable plugins during the updating and installing.
// Loading plugins here would cause a FATAL error when invoking
// plugin's updater callback, as the plugin would be evaluated
// twice.

Inject::$plugins = get_pref('use_plugins', 1, true);
Inject::$admin_side_plugins = get_pref('admin_side_plugins', 1, true);
set_pref('use_plugins', 0);
Expand Down

0 comments on commit e74b249

Please sign in to comment.