X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FDjVuImage.php;h=dbbe991b18f01d182871fa79502d926660c94e68;hb=ef9a75c4d545c2edde9d3f0ea78ba92cf6b9658b;hp=596d3e817687d9b0e0c0d557c922772fd0d1d681;hpb=e737c3451ae5c158c0de4e755aaae2ac9c221317;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index 596d3e8176..dbbe991b18 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -123,9 +123,9 @@ class DjVuImage { } function getInfo() { - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); $file = fopen( $this->mFilename, 'rb' ); - wfRestoreWarnings(); + MediaWiki\restoreWarnings(); if ( $file === false ) { wfDebug( __METHOD__ . ": missing or failed file read\n" ); @@ -269,7 +269,6 @@ class DjVuImage { */ function retrieveMetaData() { global $wgDjvuToXML, $wgDjvuDump, $wgDjvuTxt; - wfProfileIn( __METHOD__ ); if ( !$this->isValid() ) { return false; @@ -278,28 +277,22 @@ class DjVuImage { if ( isset( $wgDjvuDump ) ) { # djvudump is faster as of version 3.5 # http://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583 - wfProfileIn( 'djvudump' ); $cmd = wfEscapeShellArg( $wgDjvuDump ) . ' ' . wfEscapeShellArg( $this->mFilename ); $dump = wfShellExec( $cmd ); $xml = $this->convertDumpToXML( $dump ); - wfProfileOut( 'djvudump' ); } elseif ( isset( $wgDjvuToXML ) ) { - wfProfileIn( 'djvutoxml' ); $cmd = wfEscapeShellArg( $wgDjvuToXML ) . ' --without-anno --without-text ' . wfEscapeShellArg( $this->mFilename ); $xml = wfShellExec( $cmd ); - wfProfileOut( 'djvutoxml' ); } else { $xml = null; } # Text layer if ( isset( $wgDjvuTxt ) ) { - wfProfileIn( 'djvutxt' ); $cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename ); wfDebug( __METHOD__ . ": $cmd\n" ); $retval = ''; $txt = wfShellExec( $cmd, $retval, array(), array( 'memory' => self::DJVUTXT_MEMORY_LIMIT ) ); - wfProfileOut( 'djvutxt' ); if ( $retval == 0 ) { # Strip some control characters $txt = preg_replace( "/[\013\035\037]/", "", $txt ); @@ -320,14 +313,13 @@ EOR; $xml = $xml . $txt . ''; } } - wfProfileOut( __METHOD__ ); return $xml; } function pageTextCallback( $matches ) { # Get rid of invalid UTF-8, strip control characters - $val = htmlspecialchars( UtfNormal::cleanUp( stripcslashes( $matches[1] ) ) ); + $val = htmlspecialchars( UtfNormal\Validator::cleanUp( stripcslashes( $matches[1] ) ) ); $val = str_replace( array( "\n", '�' ), array( ' ', '' ), $val ); return ''; }