X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/a95943233a2de759001c620447075bacbadbb211..b6ce5f0536503a2dc458c2b7a857dea6b324d97e:/lib/MECON/HTML/Link.php diff --git a/lib/MECON/HTML/Link.php b/lib/MECON/HTML/Link.php index 75f5d35..4d97b34 100644 --- a/lib/MECON/HTML/Link.php +++ b/lib/MECON/HTML/Link.php @@ -126,10 +126,12 @@ class MECON_HTML_Link extends HTML_Common { $vars[] = urlencode($var) . '=' . urlencode($v); } if ($vars) { - $val = '?' . join('&', $vars); + $val .= '?' . join('&', $vars); } + } else { + $val = htmlentities($val); } - $attrs .= ' ' . $key . '="' . htmlentities($val) . '"'; + $attrs .= ' ' . $key . '="' . $val . '"'; } return "" . $this->getContents() . ''; } @@ -176,9 +178,9 @@ class MECON_HTML_Link extends HTML_Common { function setGetVar($key, &$value) // ~X2C { if (is_object($value)) { - $this->attrs[$key] =& $value; + $this->_getVars[$key] =& $value; } else { - $this->attrs[$key] = $value; + $this->_getVars[$key] = $value; } } // -X2C @@ -226,13 +228,9 @@ If they doesn't exists, they are added, if they exists, they are updated. * @return void * @access public */ - function addContents(&$contents) // ~X2C + function addContents($contents) // ~X2C { - if (is_object($contents)) { - $this->_contents[] =& $contents; - } else { - $this->_contents[] = $contents; - } + $this->_contents[] = $contents; } // -X2C @@ -264,9 +262,10 @@ If they doesn't exists, they are added, if they exists, they are updated. */ function setContents($contents) // ~X2C { - $this->_contents = $contents; + $this->_contents = array($contents); } // -X2C } // -X2C Class :MECON_HTML_Link + ?> \ No newline at end of file