[zi-cvs] packages/com.zzoss.zic/inc init.php,1.2,1.3

[email protected] Wed, 21 Jan 2004 03:38:42 -0800
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic/inc
In directory sc8-pr-cvs1:/tmp/cvs-serv21679

Modified Files:
	init.php 
Log Message:
handle magic quotes

Index: init.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/inc/init.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** init.php	21 Jan 2004 10:53:54 -0000	1.2
--- init.php	21 Jan 2004 11:38:40 -0000	1.3
***************
*** 56,66 ****
      // Handle magic quotes.
      set_magic_quotes_runtime(0);
!     if(get_magic_quotes_gpc())
      {
!        $_REQUEST = array_map("stripslashes", $_REQUEST);
!        $_GET = array_map("stripslashes", $_GET);
!        $_POST = array_map("stripslashes", $_POST);
!     }
      
      // Debugging
      define('ZI_DEBUG', false);
--- 56,78 ----
      // Handle magic quotes.
      set_magic_quotes_runtime(0);
! 
!     if (get_magic_quotes_gpc())
      {
!        function stripslashes_recursive($element)
!        {
!            if (is_array($element)){
!                return array_map("stripslashes_recursive", $element);
!            } else{ 
!                return stripslashes($element);
!            }
!        }
      
+        // Add slashes to all incoming GET/POST/COOKIE data.
+        $_REQUEST    = array_map("stripslashes_recursive", $_REQUEST);
+        $_GET    = array_map("stripslashes_recursive", $_GET);
+        $_POST  = array_map("stripslashes_recursive", $_POST);
+        $_COOKIE = array_map("stripslashes_recursive", $_COOKIE);
+     }
+ 
      // Debugging
      define('ZI_DEBUG', false);
***************
*** 78,82 ****
      
      require_once 'PEAR.php';
!     //PEAR::setErrorHandling(PEAR_ERROR_PRINT);
      
      // The root directory where the installer resides.
--- 90,94 ----
      
      require_once 'PEAR.php';
!     PEAR::setErrorHandling(PEAR_ERROR_DIE);
      
      // The root directory where the installer resides.




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn