Index: includes/DjVuImage.php
===================================================================
--- includes/DjVuImage.php (révision 69132)
+++ includes/DjVuImage.php (copie de travail)
@@ -259,8 +259,21 @@
$txt = UtfNormal::cleanUp( $txt );
}
$txt = preg_replace( "/[\013\035\037]/", "", $txt );
- $txt = htmlspecialchars($txt);
- $txt = preg_replace( "/\((page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*\"([^<]*?)\"\s*|)\)/s", "", $txt );
+ $reg = << # Text to match is composed of atoms of either:
+ \\\\. # - any escaped character
+ | # - any character different from " and \
+ [^"\\\\]+
+ )*?)
+ "\s*\)
+ | # Or page can be empty ; in this case, djvutxt dumps ()
+ \(\s*()\)/sx
+EOR;
+ $txt = preg_replace_callback( $reg,
+ create_function('$matches', 'return \'\';'),
+ $txt );
+
$txt = "\n\n\n" . $txt . "\n\n";
$xml = preg_replace( "//", "", $xml );
$xml = $xml . $txt. '' ;