Index: trunk/phase3/includes/Math.php |
— | — | @@ -157,8 +157,8 @@ |
158 | 158 | $dbw = wfGetDB( DB_MASTER ); |
159 | 159 | $dbw->replace( 'math', array( 'math_inputhash' ), |
160 | 160 | array( |
161 | | - 'math_inputhash' => $md5_sql, |
162 | | - 'math_outputhash' => $outmd5_sql, |
| 161 | + 'math_inputhash' => $dbw->encodeBlob($md5_sql), |
| 162 | + 'math_outputhash' => $dbw->encodeBlob($outmd5_sql), |
163 | 163 | 'math_html_conservativeness' => $this->conservativeness, |
164 | 164 | 'math_html' => $this->html, |
165 | 165 | 'math_mathml' => $this->mathml, |
— | — | @@ -186,13 +186,13 @@ |
187 | 187 | $dbr = wfGetDB( DB_SLAVE ); |
188 | 188 | $rpage = $dbr->selectRow( 'math', |
189 | 189 | array( 'math_outputhash','math_html_conservativeness','math_html','math_mathml' ), |
190 | | - array( 'math_inputhash' => pack("H32", $this->md5)), # Binary packed, not hex |
| 190 | + array( 'math_inputhash' => $dbr->encodeBlob(pack("H32", $this->md5))), # Binary packed, not hex |
191 | 191 | $fname |
192 | 192 | ); |
193 | 193 | |
194 | 194 | if( $rpage !== false ) { |
195 | 195 | # Tailing 0x20s can get dropped by the database, add it back on if necessary: |
196 | | - $xhash = unpack( 'H32md5', $rpage->math_outputhash . " " ); |
| 196 | + $xhash = unpack( 'H32md5', $dbr->decodeBlob($rpage->math_outputhash) . " " ); |
197 | 197 | $this->hash = $xhash ['md5']; |
198 | 198 | |
199 | 199 | $this->conservativeness = $rpage->math_html_conservativeness; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -142,6 +142,8 @@ |
143 | 143 | * Fix maintenance/importImages.php so it doesn't barf PHP errors when no suitable |
144 | 144 | files are found, and make the list of extensions an option (defaults to |
145 | 145 | $wgFileExtensions) |
| 146 | +* (bug 9909) Ensure access to binary fields in the math table use encodeBlob() |
| 147 | + and decodeBlob. |
146 | 148 | |
147 | 149 | == MediaWiki API changes since 1.10 == |
148 | 150 | |