Skip to content

Commit 4663bf4

Browse files
committed
Remove deprecated usage of get_magic_quotes_runtime()
This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. From PHP v7.4 this function always returns false
1 parent 0388ecb commit 4663bf4

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

lib/classes/Swift/ByteStream/FileByteStream.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ public function __construct($path, $writable = false)
4949
}
5050
$this->_path = $path;
5151
$this->_mode = $writable ? 'w+b' : 'rb';
52-
53-
if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) {
54-
$this->_quotes = true;
55-
}
5652
}
5753

5854
/**

lib/classes/Swift/KeyCache/DiskKeyCache.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache
4545
*/
4646
private $_keys = array();
4747

48-
/**
49-
* Will be true if magic_quotes_runtime is turned on.
50-
*
51-
* @var bool
52-
*/
53-
private $_quotes = false;
54-
5548
/**
5649
* Create a new DiskKeyCache with the given $stream for cloning to make
5750
* InputByteStreams, and the given $path to save to.
@@ -63,10 +56,6 @@ public function __construct(Swift_KeyCache_KeyCacheInputStream $stream, $path)
6356
{
6457
$this->_stream = $stream;
6558
$this->_path = $path;
66-
67-
if (function_exists('get_magic_quotes_runtime') && @get_magic_quotes_runtime() == 1) {
68-
$this->_quotes = true;
69-
}
7059
}
7160

7261
/**
@@ -176,16 +165,10 @@ public function getString($nsKey, $itemKey)
176165
$this->_prepareCache($nsKey);
177166
if ($this->hasKey($nsKey, $itemKey)) {
178167
$fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START);
179-
if ($this->_quotes) {
180-
ini_set('magic_quotes_runtime', 0);
181-
}
182168
$str = '';
183169
while (!feof($fp) && false !== $bytes = fread($fp, 8192)) {
184170
$str .= $bytes;
185171
}
186-
if ($this->_quotes) {
187-
ini_set('magic_quotes_runtime', 1);
188-
}
189172
$this->_freeHandle($nsKey, $itemKey);
190173

191174
return $str;
@@ -203,15 +186,9 @@ public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is)
203186
{
204187
if ($this->hasKey($nsKey, $itemKey)) {
205188
$fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START);
206-
if ($this->_quotes) {
207-
ini_set('magic_quotes_runtime', 0);
208-
}
209189
while (!feof($fp) && false !== $bytes = fread($fp, 8192)) {
210190
$is->write($bytes);
211191
}
212-
if ($this->_quotes) {
213-
ini_set('magic_quotes_runtime', 1);
214-
}
215192
$this->_freeHandle($nsKey, $itemKey);
216193
}
217194
}

0 commit comments

Comments
 (0)