From: Martín Marrese Date: Sun, 14 Aug 2005 18:47:38 +0000 (+0000) Subject: Se corrige un error cuando se parseaban las variables. Si el _getVars no X-Git-Tag: svn_import~6 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/e0bb2a45e21778743b6985197fe24ee0d2374d60 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. --- 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); } /**