X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=contrib%2Fdecrypt_headers.php;h=2fec8df750be760566416fba12271da8c9f77e5b;hb=ad2d75f676d6567af5439e27ee338b54eb5d028d;hp=7f0f393554679e40cfc6e5452bd94e6a10d2c2d0;hpb=b953f34f3599975505663213e14e7868ac8c5816;p=squirrelmail.git diff --git a/contrib/decrypt_headers.php b/contrib/decrypt_headers.php index 7f0f3935..2fec8df7 100644 --- a/contrib/decrypt_headers.php +++ b/contrib/decrypt_headers.php @@ -3,7 +3,7 @@ /** * Script provides form to decode encrypted header information. * - * @copyright © 2005-2006 The SquirrelMail Project Team + * @copyright 2005-2010 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -16,10 +16,11 @@ define('SM_PATH','../'); /** - * include SquirrelMail string functions + * include SquirrelMail string and generic functions * script needs OneTimePadDecrypt() (functions/strings.php) - * and sqgetGlobalVar() (functions/global.php, loaded by strings.php) + * and sqgetGlobalVar() (functions/global.php) */ +include_once(SM_PATH.'functions/global.php'); include_once(SM_PATH.'functions/strings.php'); /** @@ -59,32 +60,39 @@ echo 'You must enter encryption key.
\n"; + empty($secret)) { + $continue = FALSE; + echo "You must enter an encryption key.
\n"; + } if (! sqgetGlobalVar('enc_string',$enc_string,SQ_POST) || - empty($enc_string)) - echo "You must enter encrypted string.
\n"; + empty($enc_string)) { + $continue = FALSE; + echo "You must enter an encrypted string.
\n"; + } - if (isset($enc_string) && ! base64_decode($enc_string)) { - echo "Encrypted string should be BASE64 encoded.
\n"
- ."Please enter all characters that are listed after header name.
Encrypted string should be BASE64 encoded.
\n"
+ ."Please enter all characters that are listed after header name.
Decoded string: ".htmlspecialchars($string)."
\n"; } - echo "Decoded string: ".$string."
\n"; } echo "