fixed for on??? atributes, which contain single quotes

This commit is contained in:
Ralf Becker 2004-05-09 10:18:56 +00:00
parent 291da54d43
commit ce9c339c87

View File

@ -86,9 +86,14 @@
*/
function get_body_attribs()
{
$js = ($this->body['onLoad'] ? 'onLoad="' . addslashes($this->body['onLoad']) . '"' : '');
$js .= ($this->body['onUnload'] ? 'onUnLoad="' . addslashes($this->body['onUnload']) . '"': '');
$js .= ($this->body['onResize'] ? 'onResize="' . addslashes($this->body['onResize']) . '"': '');
$js = '';
foreach(array('onLoad','onUnload','onResize') as $what)
{
if (!empty($this->body[$what]))
{
$js .= ' '.$what.'="' . str_replace(array('"','\\'),array('\\"','\\\\'),$this->body[$what]) . '"';
}
}
return $js;
}