From a91b21aba38b0d22cd4f16feb7c6f7c0135803ae Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 11 Dec 2002 14:51:10 +0000 Subject: [PATCH] fix popup to allow newlines in text data --- libs/plugins/function.popup.php | 2 +- plugins/function.popup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/plugins/function.popup.php b/libs/plugins/function.popup.php index 3ad24b5d..3ce7bb6b 100644 --- a/libs/plugins/function.popup.php +++ b/libs/plugins/function.popup.php @@ -19,7 +19,7 @@ function smarty_function_popup($params, &$smarty) if (empty($trigger)) { $trigger = "onMouseOver"; } - echo $trigger.'="return overlib(\''.str_replace("'","\'",$text).'\''; + echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]+!"),array("\'",'\r'),$text).'\''; if ($sticky) { echo ",STICKY"; } if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; } diff --git a/plugins/function.popup.php b/plugins/function.popup.php index 3ad24b5d..3ce7bb6b 100644 --- a/plugins/function.popup.php +++ b/plugins/function.popup.php @@ -19,7 +19,7 @@ function smarty_function_popup($params, &$smarty) if (empty($trigger)) { $trigger = "onMouseOver"; } - echo $trigger.'="return overlib(\''.str_replace("'","\'",$text).'\''; + echo $trigger.'="return overlib(\''.preg_replace(array("!'!","![\r\n]+!"),array("\'",'\r'),$text).'\''; if ($sticky) { echo ",STICKY"; } if (!empty($caption)) { echo ",CAPTION,'".str_replace("'","\'",$caption)."'"; } if (!empty($fgcolor)) { echo ",FGCOLOR,'$fgcolor'"; }