Skip to content

Commit

Permalink
Merge pull request #325 from krytenuk/fix/remove-depreciation-messages
Browse files Browse the repository at this point in the history
Added typecast to stop depreciation messages
  • Loading branch information
develart-projects authored Aug 10, 2023
2 parents de90587 + e5a1915 commit 6ff9af2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions library/Zend/Controller/Router/Route/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,18 @@ public function assemble($data = [], $reset = false, $encode = true, $partial =
unset($params[$this->_actionKey]);

foreach ($params as $key => $value) {
$key = ($encode) ? urlencode($key) : $key;
$key = ($encode) ? urlencode((string) $key) : $key;
if (is_array($value)) {
foreach ($value as $arrayValue) {
if ($encode && !is_null($arrayValue)) {
$arrayValue = urlencode($arrayValue);
}


$arrayValue = ($encode) ? urlencode((string) $arrayValue) : $arrayValue;

$url .= self::URI_DELIMITER . $key;
$url .= self::URI_DELIMITER . $arrayValue;
}
} else {
if ($encode && is_string($value)) {
$value = urlencode($value);
$value = urlencode((string) $value);
}
$url .= self::URI_DELIMITER . $key;
$url .= self::URI_DELIMITER . $value;
Expand All @@ -279,21 +278,21 @@ public function assemble($data = [], $reset = false, $encode = true, $partial =

if (!empty($url) || $action !== $this->_defaults[$this->_actionKey]) {
if ($encode) {
$action = urlencode($action);
$action = urlencode((string) $action);
}
$url = self::URI_DELIMITER . $action . $url;
}

if (!empty($url) || $controller !== $this->_defaults[$this->_controllerKey]) {
if ($encode) {
$controller = urlencode($controller);
$controller = urlencode((string) $controller);
}
$url = self::URI_DELIMITER . $controller . $url;
}

if (isset($module)) {
if ($encode) {
$module = urlencode($module);
$module = urlencode((string) $module);
}
$url = self::URI_DELIMITER . $module . $url;
}
Expand Down

0 comments on commit 6ff9af2

Please sign in to comment.