From 78366f4312a1f156f66e89e28a492263af2b6c4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Marrese?= Date: Tue, 22 Jul 2003 22:27:34 +0000 Subject: [PATCH] Se corrigen bugs. --- pear_lib_tmp/HTML/Link.php | 14 ++++++++------ pear_lib_tmp/HTML/Link/uml.xmi | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pear_lib_tmp/HTML/Link.php b/pear_lib_tmp/HTML/Link.php index 6f956f9..2059785 100644 --- a/pear_lib_tmp/HTML/Link.php +++ b/pear_lib_tmp/HTML/Link.php @@ -80,14 +80,14 @@ class HTML_Link extends HTML_Common { * Constructor. * * @param string $href Hypertext reference. - * @param mixed &$contents Link contents. + * @param mixed $contents Link contents. * @param array $getVars Array (as key => value pairs) of GET variables to pass to the link. * @param array $attrs Other links (A tag) attributes. * * @return void * @access public */ - function HTML_Link($href = '', &$contents = '', $getVars = array(), $attrs = array()) // ~X2C + function HTML_Link($href = '', $contents = '', $getVars = array(), $attrs = array()) // ~X2C { if (is_array($attrs)) { $attrs['href'] = $href; @@ -113,7 +113,7 @@ class HTML_Link extends HTML_Common { foreach ($this->getAttributes() as $key => $val) { if ($key == 'href') { $vars = array(); - foreach ($this->_getVars() as $var => $v) { + foreach ($this->_getVars as $var => $v) { if (is_object($v) and method_exists($v, 'tostring')) { $v = $v->tostring(); } elseif (is_object($v) or is_array($v)) { @@ -121,11 +121,13 @@ class HTML_Link extends HTML_Common { } $vars[] = urlencode($var) . '=' . urlencode($v); } - $val = '?' . join('&', $vars); + if ($vars) { + $val = '?' . join('&', $vars); + } } $attrs .= ' ' . $key . '="' . htmlentities($val) . '"'; } - return "" . htmlentities($this->getContents) . ''; + return "" . htmlentities($this->getContents()) . ''; } // -X2C @@ -206,7 +208,7 @@ If they doesn't exists, they are added, if they exists, they are updated. { $keys = func_get_args(); foreach ($keys as $key) { - unset($this->_getVars($key)); + unset($this->_getVars[$key]); } } // -X2C diff --git a/pear_lib_tmp/HTML/Link/uml.xmi b/pear_lib_tmp/HTML/Link/uml.xmi index 9a22c6b..5ad0fa8 100644 --- a/pear_lib_tmp/HTML/Link/uml.xmi +++ b/pear_lib_tmp/HTML/Link/uml.xmi @@ -17,7 +17,7 @@ When adding GET variables, if the value is an object, it looks for a toString() This is done in toHtml() method. Object are stored as references." name="HTML_Link" static="0" scope="200" > - + -- 2.43.0