From e0bb2a45e21778743b6985197fe24ee0d2374d60 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Marrese?= Date: Sun, 14 Aug 2005 18:47:38 +0000 Subject: [PATCH] Se corrige un error cuando se parseaban las variables. Si el _getVars no devolvia nada habia un error con el foreach que le seguia. Linea 260. --- lib/MLIB/HTML/Link.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/MLIB/HTML/Link.php b/lib/MLIB/HTML/Link.php index a799b20..511b387 100644 --- a/lib/MLIB/HTML/Link.php +++ b/lib/MLIB/HTML/Link.php @@ -257,21 +257,24 @@ If they doesn't exists, they are added, if they exists, they are updated. function getQueryString() { $vars = array(); - foreach ($this->_getVars as $var => $v) { - if (is_object($v) and method_exists($v, 'tostring')) { - $v = $v->tostring(); - } elseif (is_object($v)) { - $v = serialize($v); - } - if (is_array($v)) { - foreach ($v as $i) { - $vars[] = urlencode($var) . '[]=' . urlencode($i); + if ($this->_getVars) + { + foreach ($this->_getVars as $var => $v) { + if (is_object($v) and method_exists($v, 'tostring')) { + $v = $v->tostring(); + } elseif (is_object($v)) { + $v = serialize($v); + } + if (is_array($v)) { + foreach ($v as $i) { + $vars[] = urlencode($var) . '[]=' . urlencode($i); + } + } else { + $vars[] = urlencode($var) . '=' . urlencode($v); } - } else { - $vars[] = urlencode($var) . '=' . urlencode($v); } + return join('&', $vars); } - return join('&', $vars); } /** -- 2.43.0