Defect #124

normalize_url causes a hard crash with preg_replace_callback

Added by Anonymous 510 days ago. Updated 396 days ago.

Status:Fixed Start:2009-03-06
Priority:Release Critical Due date:
Assigned to:- % Done:

0%

Category:IRI Handling
Target version:1.2
Affected Version:

1.1.3

PHP Version:

5.2.8

mbstring enabled:

No

iconv enabled:

No

cURL enabled:

No

zlib enabled:

No


Description

$url = preg_replace_callback('/%([0-9A-Fa-f]{2})/', 'SimplePie_Misc::percent_encoding_normalization', $url);

calls

function percent_encoding_normalization($match)

this should be

static function percent_encoding_normalization($match)

Static call, static function. There might be a bug in PHP preg_replace_callback as I tested this out. See for more at http://bugs.php.net/47586

What is odd is that the bug did not occur for a long time but since it started it always happens.

Simpel debugging showed where the problem was and by either eliminting the function or adding the keyword static I have so far not have had any problems.

History

Updated by Geoffrey Sneddon 510 days ago

Yay. Undocumented backwards compatibility breakage.

Updated by Geoffrey Sneddon 396 days ago

  • Category set to IRI Handling
  • Status changed from Unconfirmed to Fixed
  • Priority changed from Medium to Release Critical
  • Target version set to 1.2

This should be fixed as part of the changes in 1.2.

Also available in: Atom PDF