Zend Framework

Route_Regex::assemble ignoring $encode

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.1
  • Fix Version/s: 1.7.0
  • Component/s: Zend_Controller
  • Labels:
    None

Description

When using assemble with the regex router, parameters are not encoded when the $encode param to assemble is true. $encode is not referenced at all in assemble. I've not been able to tell if this is intentional or not, so presuming it's a bug.

Patch:

Index: library/Zend/Controller/Router/Route/Regex.php
===================================================================
— library/Zend/Controller/Router/Route/Regex.php (revision 11434)
+++ library/Zend/Controller/Router/Route/Regex.php (working copy)
@@ -169,6 +169,12 @@
$mergedData = $this->_arrayMergeNumericKeys($mergedData, $matchedValuesMapped);
$mergedData = $this->_arrayMergeNumericKeys($mergedData, $dataValuesMapped);

+ if ($encode) {
+ foreach ($mergedData as $key => &$value) { + $value = urlencode($value); + }
+ }
+
ksort($mergedData);

$return = @vsprintf($this->_reverse, $mergedData);

Activity

Hide
Felix De Vliegher added a comment -

Fixed in revision 12434.
ZF-4335: (felixdv) Route_Regex::assemble() is ignoring $encode.

Thanks for reporting this bug!

Show
Felix De Vliegher added a comment - Fixed in revision 12434. ZF-4335: (felixdv) Route_Regex::assemble() is ignoring $encode. Thanks for reporting this bug!
Hide
Wil Sinclair added a comment -

Changing issues in preparation for the 1.7.0 release.

Show
Wil Sinclair added a comment - Changing issues in preparation for the 1.7.0 release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: