dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
099f219
)
if available, use iconv because it requires less memory (fixes bug 21809) (follow...
author
ThomasV
<thomasv@users.mediawiki.org>
Tue, 19 Jan 2010 17:23:29 +0000
(17:23 +0000)
committer
ThomasV
<thomasv@users.mediawiki.org>
Tue, 19 Jan 2010 17:23:29 +0000
(17:23 +0000)
includes/DjVuImage.php
patch
|
blob
|
history
diff --git
a/includes/DjVuImage.php
b/includes/DjVuImage.php
index
544a455
..
75df0fd
100644
(file)
--- a/
includes/DjVuImage.php
+++ b/
includes/DjVuImage.php
@@
-251,7
+251,13
@@
class DjVuImage {
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
# Get rid of invalid UTF-8, strip control characters
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
# Get rid of invalid UTF-8, strip control characters
- $txt = UtfNormal::cleanUp( $txt );
+ if( is_callable( 'iconv' ) ) {
+ wfSuppressWarnings();
+ $txt = iconv( "UTF-8","UTF-8//IGNORE", $txt );
+ wfRestoreWarnings();
+ } else {
+ $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", "<PAGE value=\"$2\" />", $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", "<PAGE value=\"$2\" />", $txt );