r52026 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52025‎ | r52026 | r52027 >
Date:07:48, 17 June 2009
Author:thomasv
Status:ok
Tags:
Comment:
fix regexp
Modified paths:
  • /trunk/phase3/includes/DjVuImage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DjVuImage.php
@@ -251,8 +251,7 @@
252252 wfProfileOut( 'djvutxt' );
253253 if( $retval == 0) {
254254 $txt = htmlspecialchars($txt);
255 - $txt = preg_replace( "/\(page\s\d*\s\d*\s\d*\s\d*\s*\&quot;(.*?)\&quot;\s*\)/s", "<PAGE value=\"$1\" />", $txt );
256 - $txt = preg_replace( "/\(\)/", "<PAGE value=\"\" />", $txt );
 255+ $txt = preg_replace( "/\((page\s\d*\s\d*\s\d*\s\d*\s*\&quot;([^<]*?)\&quot;\s*|)\)/s", "<PAGE value=\"$2\" />", $txt );
257256 $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
258257 $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml );
259258 $xml = $xml . $txt. '</mw-djvu>' ;

Status & tagging log