r63449 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63448‎ | r63449 | r63450 >
Date:00:51, 9 March 2010
Author:nad
Status:deferred
Tags:
Comment:
add depth check in examineBraces to avoid errors on unmatched braces in content
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin.php (modified) (history)
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -798,9 +798,12 @@
799799 while ( preg_match( "/\\{\\{\\s*([#a-z0-9_]*)|\\}\\}/is", $content, $match, PREG_OFFSET_CAPTURE, $index ) ) {
800800 $index = $match[0][1] + 2;
801801 if ( $match[0][0] == '}}' ) {
802 - $brace =& $braces[$depths[$depth - 1]];
803 - $brace['LENGTH'] = $match[0][1] - $brace['OFFSET'] + 2;
804 - $brace['DEPTH'] = $depth--;
 802+ if ( $depth > 0 ) {
 803+ $brace =& $braces[$depths[$depth - 1]];
 804+ $brace['LENGTH'] = $match[0][1] - $brace['OFFSET'] + 2;
 805+ $brace['DEPTH'] = $depth--;
 806+ }
 807+ if ( $depth < 0 ) $depth = 0;
805808 }
806809 else {
807810 $depths[$depth++] = count( $braces );
Index: trunk/extensions/RecordAdmin/RecordAdmin.php
@@ -11,7 +11,7 @@
1212 * @licence GNU General Public Licence 2.0 or later
1313 */
1414
15 -define( 'RECORDADMIN_VERSION', '0.11.7, 2010-03-08' );
 15+define( 'RECORDADMIN_VERSION', '0.11.8, 2010-03-09' );
1616
1717 $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type
1818 $wgRecordAdminCategory = 'Records'; # Category containing record types

Status & tagging log