Procházet zdrojové kódy

* Got rid of problem with passwords (finally)
* Added a new function in strings.php to quote a string to be sent to
the IMAP server

Tyler Akins před 24 roky
rodič
revize
1b97851467
2 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 2 2
      functions/imap_general.php
  2. 5 0
      functions/strings.php

+ 2 - 2
functions/imap_general.php

@@ -128,8 +128,8 @@
          exit;
       }
 
-      fputs ($imap_stream, "a001 LOGIN \"" . addslashes($username) . 
-         '" "' . addslashes($password) . "\"\r\n");
+      fputs ($imap_stream, "a001 LOGIN \"" . quoteIMAP($username) . 
+         '" "' . quoteIMAP($password) . "\"\r\n");
       $read = sqimap_read_data ($imap_stream, 'a001', false, $response, $message);
 
       /** If the connection was not successful, lets see why **/

+ 5 - 0
functions/strings.php

@@ -569,5 +569,10 @@
       
       return $String;
    }
+   
+   function quoteIMAP($str)
+   {
+       return ereg_replace('(["\\])', '\\\\1', $str);
+   }
 
 ?>