Foxtrott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/176462

Change subject: Fix "Balloc() allocation exceeds list boundary"
......................................................................

Fix "Balloc() allocation exceeds list boundary"

A similar error apparently occurred in the MW parser.and was worked around a 
while back (see T10689) by replacing == with ===.
Might be connected to PHP trying to convert a string to a number value.

Bug: T70710
Change-Id: I4e6fa33bd778945799df9c484c4eae3d891474ab
---
M Lingo.php
M LingoParser.php
2 files changed, 11 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Lingo 
refs/changes/62/176462/1

diff --git a/Lingo.php b/Lingo.php
index 9cb52c2..6ec670f 100644
--- a/Lingo.php
+++ b/Lingo.php
@@ -19,7 +19,7 @@
                die( 'This file is part of a MediaWiki extension, it is not a 
valid entry point.' );
        }
 
-       define( 'LINGO_VERSION', '1.2.0' );
+       define( 'LINGO_VERSION', '1.2.1-dev' );
 
        // set defaults for settings
 
diff --git a/LingoParser.php b/LingoParser.php
index 799a523..f616b97 100644
--- a/LingoParser.php
+++ b/LingoParser.php
@@ -23,6 +23,10 @@
 class LingoParser {
 
        private $mLingoTree = null;
+
+       /**
+        * @var LingoBackend
+        */
        private $mLingoBackend = null;
        private static $parserSingleton = null;
 
@@ -160,10 +164,10 @@
 
                $action = $wgRequest->getVal( 'action', 'view' );
 
-               if ( $text == null ||
-                       $text == '' ||
-                       $action == 'edit' ||
-                       $action == 'ajax' ||
+               if ( $text === null ||
+                       $text === '' ||
+                       $action === 'edit' ||
+                       $action === 'ajax' ||
                        isset( $_POST['wpPreview'] )
                ) {
 
@@ -183,10 +187,8 @@
                wfProfileIn( __METHOD__ . ' 1 loadHTML' );
                wfSuppressWarnings();
 
-               $doc = new DOMDocument();
-               $doc->loadHTML(
-                               '<html><head><meta http-equiv="content-type" 
content="charset=utf-8"/></head><body>' . $text . '</body></html>'
-               );
+               $doc = new DOMDocument('1.0','utf-8');
+               $doc->loadHTML( '<html><head><meta http-equiv="content-type" 
content="charset=utf-8"/></head><body>' . $text . '</body></html>' );
 
                wfRestoreWarnings();
                wfProfileOut( __METHOD__ . ' 1 loadHTML' );

-- 
To view, visit https://gerrit.wikimedia.org/r/176462
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e6fa33bd778945799df9c484c4eae3d891474ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Lingo
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <s7ep...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to