X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Ffunctions.php;h=b0b84a3f279274a2af7322f8234503439bd54905;hp=fe1b9c627428c134400fde15faa36bee89564224;hb=0fcb12718ed2c817e8be5b0bb1eb947ffb93d423;hpb=ee2375c0962984cbdf0c05a204e7e8eab8fb279a diff --git a/plugins/fortune/functions.php b/plugins/fortune/functions.php index fe1b9c62..b0b84a3f 100644 --- a/plugins/fortune/functions.php +++ b/plugins/fortune/functions.php @@ -1,8 +1,9 @@ \n". - "
\n". - "
\n"; - echo '
'; - if (!$exist) { - printf(_("%s is not found."),$fortune_location); - } else { - echo "
" . _("Today's Fortune") . "
\n" .
-            htmlspecialchars(shell_exec($fortune_command)) .
-            "
\n"; + /* if pclose return != 0, popen command failed. Yes, I know that it is broken when --enable-sigchild is used */ + if (pclose($handle)) { + // i18n: %s shows executed fortune cookie command. + $fortune = sprintf(_("Unable to execute \"%s\"."),$fortune_command); } - echo '
'; + $oTemplate->assign('color', $color); + $oTemplate->assign('fortune', htmlspecialchars($fortune)); + $output = $oTemplate->fetch('plugins/fortune/mailbox_index_before.tpl'); + return array('mailbox_index_before' => $output); + } /** @@ -90,4 +83,3 @@ function fortune_function_load() { $fortune_visible = getPref($data_dir, $username, 'fortune_visible'); } -?>