Correct value of undefined hostname
[squirrelmail.git] / contrib / decrypt_headers.php
index 1e38107378b43efb9cc49a8f4bf150836b19f6d6..7f0f393554679e40cfc6e5452bd94e6a10d2c2d0 100644 (file)
@@ -1,24 +1,10 @@
 <?php
+
 /**
  * Script provides form to decode encrypted header information.
  *
- * Copyright (c) 2005 The SquirrelMail Project Team
- * This file is part of SquirrelMail webmail interface.
- *
- * SquirrelMail is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * SquirrelMail is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with SquirrelMail; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * @copyright &copy; 2005-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
@@ -41,7 +27,7 @@ include_once(SM_PATH.'functions/strings.php');
  * @param string $hex hexadecimal string created with squirrelmail ip2hex 
  *  function in delivery class.
  * @return string ip address
- * @since 1.5.1
+ * @since 1.5.1 and 1.4.5
  */
 function hex2ip($hex) {
     if (strlen($hex)==8) {
@@ -50,14 +36,14 @@ function hex2ip($hex) {
             .hexdec(substr($hex,4,2)).'.'
             .hexdec(substr($hex,6,2));
     } elseif (strlen($hex)==32) {
-        $ret=hexdec(substr($hex,0,4)).':'
-            .hexdec(substr($hex,4,4)).':'
-            .hexdec(substr($hex,8,4)).':'
-            .hexdec(substr($hex,12,4)).':'
-            .hexdec(substr($hex,16,4)).':'
-            .hexdec(substr($hex,20,4)).':'
-            .hexdec(substr($hex,24,4)).':'
-            .hexdec(substr($hex,28,4));
+        $ret=substr($hex,0,4).':'
+            .substr($hex,4,4).':'
+            .substr($hex,8,4).':'
+            .substr($hex,12,4).':'
+            .substr($hex,16,4).':'
+            .substr($hex,20,4).':'
+            .substr($hex,24,4).':'
+            .substr($hex,28,4);
     } else {
         $ret=$hex;
     }
@@ -67,7 +53,8 @@ function hex2ip($hex) {
 /** create page headers */
 header('Content-Type: text/html');
 
-echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'
+echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"'."\n"
+    .'  "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">'
     ."\n<head>\n<meta name=\"robots\" content=\"noindex,nofollow\">\n"
     ."</head><body>";
 
@@ -101,4 +88,4 @@ Check, if it is an address string: <input type="checkbox" name="ip_addr" /><br /
 <button type="submit" name="submit" value="submit">Submit</button>
 </p>
 </form>
-</body></html>
\ No newline at end of file
+</body></html>