Last modified: 2012-06-19 16:08:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39709, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37709 - EXPR_MOD sometime attempt to divide by zero
EXPR_MOD sometime attempt to divide by zero
Status: RESOLVED DUPLICATE of bug 35866
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 10:10 UTC by Antoine "hashar" Musso (WMF)
Modified: 2012-06-19 16:08 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-06-19 10:10:29 UTC
Seen on Wikimedia cluster:

      1 Warning:  Division by zero in /usr/local/apache/common-local/php-1.20wmf5/extensions/ParserFunctions/Expr.php on line 423

Relevant code:

            case EXPR_MOD:
                if ( count( $stack ) < 2 ) {
                    throw new ExprError( 'missing_operand', $this->names[$op] );
                }
                $right = array_pop( $stack );
                $left = array_pop( $stack );
                if ( $right == 0 ) {
                    throw new ExprError( 'division_by_zero', $this->names[$op] );
                }
                $stack[] = $left % $right;
                break;

So it seems somecode manage to pass the ( $right == 0 ) condition though it is still evaluated as a zero in $left % $right :(

Lovely PHP!
Comment 1 Sam Reed (reedy) 2012-06-19 16:08:12 UTC

*** This bug has been marked as a duplicate of bug 35866 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links