| Index: trunk/phase3/includes/DjVuImage.php |
| — | — | @@ -266,10 +266,7 @@ |
| 267 | 267 | | # Or page can be empty ; in this case, djvutxt dumps () |
| 268 | 268 | \(\s*()\)/sx |
| 269 | 269 | EOR; |
| 270 | | - $txt = preg_replace_callback( $reg, |
| 271 | | - create_function('$matches', 'return \'<PAGE value="\'.htmlspecialchars($matches[1]).\'" />\';'), |
| 272 | | - $txt ); |
| 273 | | - |
| | 270 | + $txt = preg_replace_callback( $reg, array( $this, 'pageTextCallback' ), $txt ); |
| 274 | 271 | $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n"; |
| 275 | 272 | $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml ); |
| 276 | 273 | $xml = $xml . $txt. '</mw-djvu>' ; |
| — | — | @@ -278,6 +275,10 @@ |
| 279 | 276 | return $xml; |
| 280 | 277 | } |
| 281 | 278 | |
| | 279 | + function pageTextCallback( $matches ) { |
| | 280 | + return '<PAGE value="' . htmlspecialchars( $matches[1] ) . '" />'; |
| | 281 | + } |
| | 282 | + |
| 282 | 283 | /** |
| 283 | 284 | * Hack to temporarily work around djvutoxml bug |
| 284 | 285 | */ |