]> git.mxchange.org Git - friendica.git/blobdiff - mod/toggle_mobile.php
The curl result is an object, not an array
[friendica.git] / mod / toggle_mobile.php
index 00991e44ca04da87fb8b0c8664dedd55d30cf385..388c40891a80b2d64419e96daf6d775f1bd82361 100644 (file)
@@ -1,17 +1,21 @@
 <?php
 
-function toggle_mobile_init(&$a) {
+use Friendica\App;
+use Friendica\Core\System;
 
-       if(isset($_GET['off']))
+function toggle_mobile_init(App $a) {
+
+       if (isset($_GET['off'])) {
                $_SESSION['show-mobile'] = false;
-       else
+       } else {
                $_SESSION['show-mobile'] = true;
+       }
 
-       if(isset($_GET['address']))
+       if (isset($_GET['address'])) {
                $address = $_GET['address'];
-       else
-               $address = $a->get_baseurl();
+       } else {
+               $address = '';
+       }
 
-       goaway($address);
+       System::externalRedirect($address);
 }
-