aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2014-03-07 11:57:11 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2014-03-07 11:57:11 +0100
commitbf79463070c0dc96eacc52a949c1e3ad356817c0 (patch)
treef1c40616b0518c063d5791d7eaae550d72d95664 /inc
parent53e3158dfe697ea59da1fa0e401e8da75ae13030 (diff)
parentf98373cc34f1826ba93fd93ae7f291726af1f933 (diff)
downloadwallabag-bf79463070c0dc96eacc52a949c1e3ad356817c0.tar.gz
wallabag-bf79463070c0dc96eacc52a949c1e3ad356817c0.tar.zst
wallabag-bf79463070c0dc96eacc52a949c1e3ad356817c0.zip
Merge pull request #531 from mariroz/upload-file
getPageContent moved to Tools, fix of #426
Diffstat (limited to 'inc')
-rw-r--r--inc/poche/Tools.class.php26
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}