diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/poche/Tools.class.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 393a415d..eeb101b4 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -263,10 +263,12 @@ class Tools | |||
263 | } | 263 | } |
264 | } | 264 | } |
265 | // Saving and clearing session | 265 | // Saving and clearing session |
266 | $REAL_SESSION = array(); | 266 | if ( isset($_SESSION) ) { |
267 | foreach( $_SESSION as $key => $value ) { | 267 | $REAL_SESSION = array(); |
268 | $REAL_SESSION[$key] = $value; | 268 | foreach( $_SESSION as $key => $value ) { |
269 | unset($_SESSION[$key]); | 269 | $REAL_SESSION[$key] = $value; |
270 | unset($_SESSION[$key]); | ||
271 | } | ||
270 | } | 272 | } |
271 | 273 | ||
272 | // Running code in different context | 274 | // Running code in different context |
@@ -282,7 +284,8 @@ class Tools | |||
282 | ); | 284 | ); |
283 | ob_start(); | 285 | ob_start(); |
284 | require func_get_arg(0); | 286 | require func_get_arg(0); |
285 | $json = ob_get_flush(); | 287 | $json = ob_get_contents(); |
288 | ob_end_clean(); | ||
286 | return $json; | 289 | return $json; |
287 | }; | 290 | }; |
288 | $json = $scope( "inc/3rdparty/makefulltextfeed.php", array("url" => $url) ); | 291 | $json = $scope( "inc/3rdparty/makefulltextfeed.php", array("url" => $url) ); |
@@ -297,12 +300,15 @@ class Tools | |||
297 | $GLOBALS[$key] = $value; | 300 | $GLOBALS[$key] = $value; |
298 | } | 301 | } |
299 | // Clearing and restoring session | 302 | // Clearing and restoring session |
300 | foreach( $_SESSION as $key => $value ) { | 303 | if ( isset($REAL_SESSION) ) { |
301 | unset($_SESSION[$key]); | 304 | foreach( $_SESSION as $key => $value ) { |
302 | } | 305 | unset($_SESSION[$key]); |
303 | foreach( $REAL_SESSION as $key => $value ) { | 306 | } |
304 | $_SESSION[$key] = $value; | 307 | foreach( $REAL_SESSION as $key => $value ) { |
308 | $_SESSION[$key] = $value; | ||
309 | } | ||
305 | } | 310 | } |
311 | |||
306 | return json_decode($json, true); | 312 | return json_decode($json, true); |
307 | } | 313 | } |
308 | } | 314 | } |