[dev] SuperGlobals

Nuno Loureiro nuno@co.eth.pt
24 May 2002 17:36:33 +0100


Hello!

Seems that some SuperGlobals were forgotten. 
I just realised now, because I did a cvs diff on the tree I did the patch before and I saw
the following:

Index: lib/MIME/Message.php
===================================================================
RCS file: /repository/horde/lib/MIME/Message.php,v
retrieving revision 1.24
diff -u -u -r1.24 Message.php
--- lib/MIME/Message.php	11 May 2002 22:17:03 -0000	1.24
+++ lib/MIME/Message.php	24 May 2002 14:53:59 -0000
@@ -60,7 +60,7 @@
     function MIME_Message($defaultServer = null)
     {
         if (!isset($defaultServer)) {
-            $this->defaultServer = $GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME'];
+            $this->defaultServer = $_SERVER['SERVER_NAME'];
         } else {
             $this->defaultServer = $defaultServer;
         }
@@ -184,10 +184,8 @@
      */
     function encode($headers)
     {
-        global $HTTP_SERVER_VARS;
-
-        if (!empty($HTTP_SERVER_VARS['HTTP_ACCEPT_CHARSET'])) {
-            $charsets = explode(',', $HTTP_SERVER_VARS['HTTP_ACCEPT_CHARSET']);
+        if (!empty($_SERVER['HTTP_ACCEPT_CHARSET'])) {
+            $charsets = explode(',', $_SERVER['HTTP_ACCEPT_CHARSET']);
             if (!empty($charsets[0])) {
                 $charsets = explode(';', $charsets[0]);
                 if (!empty($charsets[0])) {
Index: imp/templates/compose/bounce.inc
===================================================================
RCS file: /repository/imp/templates/compose/bounce.inc,v
retrieving revision 2.30
diff -u -u -r2.30 bounce.inc
--- imp/templates/compose/bounce.inc    5 Apr 2002 14:41:40 -0000       2.30
+++ imp/templates/compose/bounce.inc    24 May 2002 16:28:13 -0000
@@ -13,7 +13,7 @@
 //-->
 </script>
 
-<form method="post" action="<?= Horde::url($HTTP_SERVER_VARS['PHP_SELF'] . '?uniq=' . uniqid(rand())) ?>" name="compose" onsubmit="return bounceSubmit(this)">
+<form method="post" action="<?= Horde::url($_SERVER['PHP_SELF'] . '?uniq=' . uniqid(rand())) ?>" name="compose" onsubmit="return bounceSubmit(this)">
 <input type="hidden" name="mailbox" value="<?= htmlspecialchars($mailbox) ?>" />
 <input type="hidden" name="index" value="<?= htmlspecialchars(Horde::getFormData('index')) ?>" />
 <input type="hidden" name="actionID" value="<?= BOUNCE_MESSAGE ?>" />


Regards,

   Nuno

-- 
Nuno Loureiro <nuno@eth.pt>
Ethernet, Soluções Informáticas, LDA
http://www.eth.pt