@@ -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