Beispiel #1
0
 function privSwapBackMagicQuotes()
 {
     $v_result = 1;
     // ----- Look if function exists
     if (!function_exists("get_magic_Quotes_runtime") || !function_exists("set_magic_Quotes_runtime")) {
         return $v_result;
     }
     // ----- Look if something to do
     if ($this->magic_Quotes_status != -1) {
         return $v_result;
     }
     // ----- Swap back magic_Quotes
     if ($this->magic_Quotes_status == 1) {
         @set_magic_Quotes_runtime($this->magic_Quotes_status);
     }
     // ----- Return
     return $v_result;
 }
Beispiel #2
0
 /**
  * Encodes attachment in requested format.
  * Returns an empty string on failure.
  * @param string $path The full path to the file
  * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'Quoted-printable'
  * @see EncodeFile()
  * @access private
  * @return string
  */
 private function EncodeFile($path, $encoding = 'base64')
 {
     try {
         if (!is_readable($path)) {
             throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
         }
         if (function_exists('get_magic_Quotes')) {
             function get_magic_Quotes()
             {
                 return false;
             }
         }
         if (PHP_VERSION < 5.3) {
             $magic_Quotes = get_magic_Quotes_runtime();
             set_magic_Quotes_runtime(0);
         }
         $file_buffer = file_get_contents($path);
         $file_buffer = $this->EncodeString($file_buffer, $encoding);
         if (PHP_VERSION < 5.3) {
             set_magic_Quotes_runtime($magic_Quotes);
         }
         return $file_buffer;
     } catch (Exception $e) {
         $this->SetError($e->getMessage());
         return '';
     }
 }