mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 23:32:17 +00:00
[BUGFIX] Fixed get-parameters as array (param[id]=value) causing array-to-string notice.
This commit is contained in:
@@ -300,8 +300,8 @@ class RouterBase {
|
|||||||
public function arrayToParams(array $getParams = null, $includeEmpty = true) {
|
public function arrayToParams(array $getParams = null, $includeEmpty = true) {
|
||||||
if (is_array($getParams) && count($getParams) > 0) {
|
if (is_array($getParams) && count($getParams) > 0) {
|
||||||
foreach ($getParams as $key => $val) {
|
foreach ($getParams as $key => $val) {
|
||||||
if (!empty($val) || empty($val) && $includeEmpty) {
|
if (!empty($val) || $includeEmpty) {
|
||||||
$getParams[$key] = $key . '=' . $val;
|
$getParams[$key] = (is_array($val) ? $this->arrayToParams($val, $includeEmpty) : $key . '=' . $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return join('&', $getParams);
|
return join('&', $getParams);
|
||||||
|
|||||||
Reference in New Issue
Block a user