X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fcompose.php;h=25beaec8f7f3bb1d152bc9be5971082e3aacdbf4;hb=82dcbb1e9ed564374ffe9d6dec1b1f1e4ca57a0d;hp=5a30de5f92af5468e51b509d96bb59dddec962fb;hpb=3673a2deb33a13b35bd05b8693da08f1b64fbc42;p=squirrelmail.git diff --git a/src/compose.php b/src/compose.php index 5a30de5f..25beaec8 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1173,21 +1173,24 @@ function showInputForm ($session, $values=false) { // Onsubmit text is enclosed inside of double quotes, so plugins // need to quote accordingly. if (checkForJavascript()) { - $onsubmit_text = ' onsubmit="'; if (empty($compose_onsubmit)) $compose_onsubmit = array(); else if (!is_array($compose_onsubmit)) $compose_onsubmit = array($compose_onsubmit); + $onsubmit_text = ''; foreach ($compose_onsubmit as $text) { $text = trim($text); - if (substr($text, -1) != ';' && substr($text, -1) != '}') - $text .= '; '; - $onsubmit_text .= $text; + if (!empty($text)) { + if (substr($text, -1) != ';' && substr($text, -1) != '}') + $text .= '; '; + $onsubmit_text .= $text; + } } + if (!empty($onsubmit_text)) //FIXME: DON'T ECHO HTML FROM CORE! - echo $onsubmit_text . ' return true;"'; + echo ' onsubmit="' . $onsubmit_text . ' return true;"'; }