r13523 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13522‎ | r13523 | r13524 >
Date:08:46, 6 April 2006
Author:tstarling
Status:old
Tags:
Comment:
fixed stack check
Modified paths:
  • /trunk/extensions/ParserFunctions/Expr.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/Expr.php
@@ -32,7 +32,7 @@
3333 define( 'EXPR_ROUND', 21 );
3434
3535 class ExprParser {
36 - var $maxStackSize = 1000;
 36+ var $maxStackSize = 100;
3737
3838 var $precedence = array(
3939 EXPR_NEGATIVE => 9,
@@ -136,8 +136,9 @@
137137
138138
139139 while ( $p < $end ) {
140 - if ( count( $operands ) > $this->maxStackSize || count( $operands ) > $this->maxStackSize ) {
 140+ if ( count( $operands ) > $this->maxStackSize || count( $operators ) > $this->maxStackSize ) {
141141 $this->error( 'stack_exhausted' );
 142+ return false;
142143 }
143144 $char = $expr[$p];
144145 $char2 = substr( $expr, $p, 2 );

Status & tagging log