Zend Framework

Zend_Filter_StripTags (falls into infinite loop)

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.10.7
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Filter
  • Labels:
    None

Description

line[243]

// Strip HTML comments first
        while (strpos($value, '<!--') !== false) {
            $pos   = strrpos($value, '<!--');
            $start = substr($value, 0, $pos);
            $value = substr($value, $pos);
            $value = preg_replace('/<(?:!(?:--[\s\S]*?--\s*)?(>))/s', '',  $value);
            $value = $start . $value;
        }

if you try to filter string "<!---" then filter falls into infinite loop

$filter = Zend_Filter_StripTags();
$filter->filter('<!------- text');

Activity

Hide
Piotr Mlocek added a comment -

This is my proposition for patch for this bug.

Show
Piotr Mlocek added a comment - This is my proposition for patch for this bug.
Hide
Thomas Weidner added a comment -

Fixed with r22806
Thank you for the patch

Show
Thomas Weidner added a comment - Fixed with r22806 Thank you for the patch

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: