Page MenuHomePhabricator

Wrong errormessage from includes/Math.php
Closed, InvalidPublic

Description

Author: fredrik.agert

Description:
in file ../includes/Math.php

Debugging my wiki I keep getting 'math_unknown_error' from the code line 113-118 even
though the $retval is set to 'E' meaning 'math_lexing_error'

switch block has no "break;"-statement
current code
<pre>

switch( $retval ) {
   case 'E': $errmsg = $this->_error( 'math_lexing_error', $errbit );
   case 'S': $errmsg = $this->_error( 'math_syntax_error', $errbit );
   case 'F': $errmsg = $this->_error( 'math_unknown_function', $errbit );
   default:  $errmsg = $this->_error( 'math_unknown_error', $errbit );
}

</pre>
suggested change
<pre>

switch( $retval ) {
   case 'E': $errmsg = $this->_error( 'math_lexing_error', $errbit );
   break;
   case 'S': $errmsg = $this->_error( 'math_syntax_error', $errbit );
   break;
   case 'F': $errmsg = $this->_error( 'math_unknown_function', $errbit );
   break;
   default:  $errmsg = $this->_error( 'math_unknown_error', $errbit );
}

</pre>


Version: 1.11.x
Severity: trivial
OS: Linux
Platform: PC
URL: http://agert.homelinux.org/blog/index.php/Superheterodyn#Teknisk_funktion

Details

Reference
bz12844

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:01 PM
bzimport set Reference to bz12844.
bzimport added a subscriber: Unknown Object (MLST).

fredrik.agert wrote:

Suggested change row 112-118 add break; statement

Attached:

Sorry, but I'm afraid you're not using the "current" code as you said.

http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Math.php?r1=24065&r2=26184

That link shows the bug you mentioned was fixed (by robchurch) on Sep 27 2007.

fredrik.agert wrote:

Sorry for bugging you but when redownloading 1.11.1 from http://download.wikimedia.org/mediawiki/1.11/mediawiki-1.11.1.tar.gz the patch as seen on SVN is not in the release. What happened?
b.r. //Fredrik

1.11.1 is a security release only and does not contain any other bugfixes/patches added since release of 1.11.0 on Sep 10 2007.

The above patch will be part of 1.12.0