Skip to content

Commit feafa2b

Browse files
author
Samuel Akopyan
committed
Removed magic_quotes functionality from all code
1 parent 9e696d7 commit feafa2b

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

framework/vendors/phpmailer/class.phpmailer.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* #002 - 26.06.2012 : commented echo invalid_address (doesn't present in current version)
2424
* #003 - 13.03.2015 : added auto include of class.smtp.php
2525
* #004 - 14.12.2016 : default CharSet changed from 'iso-8859-1' to 'utf-8'
26+
* #005 - 11.12.2020 : commented magic_quotes functionality
2627
*/
2728

2829
/**
@@ -2711,26 +2712,28 @@ protected function encodeFile($path, $encoding = 'base64')
27112712
if (!is_readable($path)) {
27122713
throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
27132714
}
2714-
$magic_quotes = get_magic_quotes_runtime();
2715-
if ($magic_quotes) {
2716-
if (version_compare(phpversion(), '5.3.0', '<')) {
2717-
set_magic_quotes_runtime(false);
2718-
} else {
2719-
//Doesn't exist in PHP 5.4, but we don't need to check because
2720-
//get_magic_quotes_runtime always returns false in 5.4+
2721-
//so it will never get here
2722-
ini_set('magic_quotes_runtime', false);
2723-
}
2724-
}
2715+
//#005
2716+
//$magic_quotes = get_magic_quotes_runtime();
2717+
//if ($magic_quotes) {
2718+
// if (version_compare(phpversion(), '5.3.0', '<')) {
2719+
// set_magic_quotes_runtime(false);
2720+
// } else {
2721+
// //Doesn't exist in PHP 5.4, but we don't need to check because
2722+
// //get_magic_quotes_runtime always returns false in 5.4+
2723+
// //so it will never get here
2724+
// ini_set('magic_quotes_runtime', false);
2725+
// }
2726+
//}
27252727
$file_buffer = file_get_contents($path);
27262728
$file_buffer = $this->encodeString($file_buffer, $encoding);
2727-
if ($magic_quotes) {
2728-
if (version_compare(phpversion(), '5.3.0', '<')) {
2729-
set_magic_quotes_runtime($magic_quotes);
2730-
} else {
2731-
ini_set('magic_quotes_runtime', $magic_quotes);
2732-
}
2733-
}
2729+
//#005
2730+
//if ($magic_quotes) {
2731+
// if (version_compare(phpversion(), '5.3.0', '<')) {
2732+
// set_magic_quotes_runtime($magic_quotes);
2733+
// } else {
2734+
// ini_set('magic_quotes_runtime', $magic_quotes);
2735+
// }
2736+
//}
27342737
return $file_buffer;
27352738
} catch (Exception $exc) {
27362739
$this->setError($exc->getMessage());

framework/vendors/tcpdf/include/tcpdf_static.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
* @version 1.1.2
4242
*/
4343

44+
/**
45+
* ApPHP Changes to compatible this class with ApPHP Framework:
46+
* #001 - 11.12.2020 : commented magic_quotes functionality
47+
*/
48+
49+
4450
/**
4551
* @class TCPDF_STATIC
4652
* Static methods used by the TCPDF class.
@@ -139,9 +145,10 @@ public static function set_mqr($mqr) {
139145
$version = PHP_VERSION;
140146
define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
141147
}
142-
if (PHP_VERSION_ID < 50300) {
143-
@set_magic_quotes_runtime($mqr);
144-
}
148+
//#001
149+
//if (PHP_VERSION_ID < 50300) {
150+
// @set_magic_quotes_runtime($mqr);
151+
//}
145152
}
146153

147154
/**
@@ -155,9 +162,10 @@ public static function get_mqr() {
155162
$version = PHP_VERSION;
156163
define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
157164
}
158-
if (PHP_VERSION_ID < 50300) {
159-
return @get_magic_quotes_runtime();
160-
}
165+
//#001
166+
//if (PHP_VERSION_ID < 50300) {
167+
// return @get_magic_quotes_runtime();
168+
//}
161169
return 0;
162170
}
163171

0 commit comments

Comments
 (0)