Stop after replaceing the first instance
authorPlatonides <platonides@users.mediawiki.org>
Sun, 27 Mar 2011 17:18:52 +0000 (17:18 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 27 Mar 2011 17:18:52 +0000 (17:18 +0000)
includes/DjVuImage.php

index 59f49af..7a8b5e4 100644 (file)
@@ -270,7 +270,7 @@ class DjVuImage {
 EOR;
                                $txt = preg_replace_callback( $reg, array( $this, 'pageTextCallback' ), $txt );
                                $txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
-                               $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml );
+                               $xml = preg_replace( "/<DjVuXML>/", "<mw-djvu><DjVuXML>", $xml, 1 );
                                $xml = $xml . $txt. '</mw-djvu>' ;
                        }
                }