X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/2828826fd20134db9bd8e67e2c3ce883b5b97146..56c363442764a21af0820b0e3dd6e9b771119abf:/pear_lib_tmp/HTML/Link.php?ds=sidebyside diff --git a/pear_lib_tmp/HTML/Link.php b/pear_lib_tmp/HTML/Link.php index 6f956f9..6e508ae 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 "" . $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 @@ -242,7 +244,7 @@ If they doesn't exists, they are added, if they exists, they are updated. if (is_object($c) and method_exists($c, 'tohtml')) { $html .= $c->toHtml(); } else { - $html .= $c; + $html .= htmlentities($c); } } return $html;