Use parentheses for bit* to be on the safe side
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Jun 2009 20:13:17 +0000 (20:13 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Jun 2009 20:13:17 +0000 (20:13 +0000)
Follow-up to r51815.

includes/db/Database.php

index fe31766..4c151d7 100644 (file)
@@ -1445,15 +1445,15 @@ abstract class DatabaseBase {
         */
 
        function bitNot($field) {
-               return '~'.$bitField;
+               return "(~$bitField)";
        }
 
        function bitAnd($fieldLeft, $fieldRight) {
-               return $fieldLeft.'&'.$fieldRight;
+               return "($fieldLeft & $fieldRight)";
        }
 
        function bitOr($fieldLeft, $fieldRight) {
-               return $fieldLeft.'|'.$fieldRight;
+               return "($fieldLeft | $fieldRight)";
        }
 
        /**