Dan-nl has uploaded a new change for review.
https://gerrit.wikimedia.org/r/84015
Change subject: Bug: 54084 Fatal error: Call to undefined function gzdecode()
......................................................................
Bug: 54084 Fatal error: Call to undefined function gzdecode()
adding in logic to take care of wiki installs using PHP < 5.4.0
Change-Id: I26e9930841b209691ebeb1a545c92cd13964cf54
---
M TemplateDataBlob.php
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateData
refs/changes/15/84015/1
diff --git a/TemplateDataBlob.php b/TemplateDataBlob.php
index d41b4dd..d6ec7d9 100644
--- a/TemplateDataBlob.php
+++ b/TemplateDataBlob.php
@@ -52,10 +52,14 @@
* @param string $json
* @return TemplateInfo
*/
- public static function newFromDatabase( $json ) {
+ public static function newFromDatabase( $json ) {
// Handle GZIP compression. \037\213 is the header for GZIP
files.
if ( substr( $json, 0, 2 ) === "\037\213" ) {
- $json = gzdecode( $json );
+ if ( function_exists( 'gzdecode' ) ) {
+ $json = gzdecode( $json );
+ } else {
+ $json = gzinflate( substr( $json, 10, -8 ) );
+ }
}
return self::newFromJSON( $json );
}
--
To view, visit https://gerrit.wikimedia.org/r/84015
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26e9930841b209691ebeb1a545c92cd13964cf54
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Dan-nl <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits