fix regexp
authorThomasV <thomasv@users.mediawiki.org>
Wed, 17 Jun 2009 07:48:50 +0000 (07:48 +0000)
committerThomasV <thomasv@users.mediawiki.org>
Wed, 17 Jun 2009 07:48:50 +0000 (07:48 +0000)
includes/DjVuImage.php

index fbb2586..041ef73 100644 (file)
@@ -251,8 +251,7 @@ class DjVuImage {
                        wfProfileOut( 'djvutxt' );
                        if( $retval == 0) {
                                $txt = htmlspecialchars($txt);
-                               $txt = preg_replace( "/\(page\s\d*\s\d*\s\d*\s\d*\s*\&quot;(.*?)\&quot;\s*\)/s", "<PAGE value=\"$1\" />", $txt  );
-                               $txt = preg_replace( "/\(\)/", "<PAGE value=\"\" />", $txt );
+                               $txt = preg_replace( "/\((page\s\d*\s\d*\s\d*\s\d*\s*\&quot;([^<]*?)\&quot;\s*|)\)/s", "<PAGE value=\"$2\" />", $txt  );
                                $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
                                $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml );
                                $xml = $xml . $txt. '</mw-djvu>' ;