Last modified: 2013-09-13 01:00:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56084, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54084 - Fatal error: Call to undefined function gzdecode()
Fatal error: Call to undefined function gzdecode()
Status: RESOLVED DUPLICATE of bug 54058
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-12 17:50 UTC by dan
Modified: 2013-09-13 01:00 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description dan 2013-09-12 17:50:34 UTC
steps to reproduce
==================
1. create a test template, Template:Test in a wiki using PHP < 5.4.0 and with the TemplateData extension active.
2. place a test <templatedata/> JSON in the template
3. use the api to retrieve the templatedata as a JSON with api.php?action=templatedata&titles=Template:Test

result
======
Fatal error: Call to undefined function gzdecode() in /core/extensions/TemplateData/TemplateDataBlob.php on line 59

expected result
===============
the JSON in Template:Test.

issue
=====
TemplateData/TemplateDataBlob.php line 59 relies on gzdecode() to decode a potentially gzipped JSON. gzdecode() is only available in (PHP 5 >= 5.4.0) when compiled with zlib.

potential solution
==================
public static function newFromDatabase( $json ) {
  // Handle GZIP compression. \037\213 is the header for GZIP files.
  if ( substr( $json, 0, 2 ) === "\037\213" ) {
    if ( function_exists( 'gzdecode' ) ) {
      $json = gzdecode( $json );
    } else {
      $json = gzinflate( substr( $json, 10, -8 ) );
    }
  }
  return self::newFromJSON( $json );
}

@see http://stackoverflow.com/questions/9801908/php-call-to-undefined-function-gzdecode#answer-10381158.
Comment 1 Gerrit Notification Bot 2013-09-12 17:55:58 UTC
Change 84015 had a related patch set uploaded by Dan-nl:
Bug: 54084 Fatal error: Call to undefined function gzdecode()

https://gerrit.wikimedia.org/r/84015
Comment 2 Bartosz Dziewoński 2013-09-12 17:57:41 UTC

*** This bug has been marked as a duplicate of bug 54058 ***
Comment 3 Gerrit Notification Bot 2013-09-12 18:43:08 UTC
Change 84015 had a related patch set uploaded by Krinkle:
Bug: 54084 Fatal error: Call to undefined function gzdecode()

https://gerrit.wikimedia.org/r/84015
Comment 4 Sam Reed (reedy) 2013-09-12 21:56:09 UTC

*** This bug has been marked as a duplicate of bug 54058 ***
Comment 5 Gerrit Notification Bot 2013-09-13 01:00:19 UTC
Change 84015 abandoned by Dan-nl:
Fix "PHP Fatal error: Call to undefined function gzdecode"

Reason:
Superseded by 0e4339d.

https://gerrit.wikimedia.org/r/84015

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links