ladogton2010 commited on
Commit
f2b19e5
·
1 Parent(s): 42c183a

test URL explode

Browse files
Files changed (1) hide show
  1. mvc/app/libs/Core.php +10 -2
mvc/app/libs/Core.php CHANGED
@@ -15,10 +15,18 @@
15
  protected $defaultParams = [];
16
 
17
  public function __construct(){
18
- $url = $this->getURL();
 
19
  }
20
 
21
  public function getURL(){
22
- echo $_GET['url'];
 
 
 
 
 
 
 
23
  }
24
  }
 
15
  protected $defaultParams = [];
16
 
17
  public function __construct(){
18
+ // $url = $this->getURL();
19
+ print_r($this->getURL(););
20
  }
21
 
22
  public function getURL(){
23
+ // echo $_GET['url'];
24
+
25
+ if (isset($_GET['url'])) {
26
+ $url = rtrim($_GET['url'], '/');
27
+ $url = filter_var($url,FILTER_SANITIZE_URL);
28
+ $url = explode('/', $url);
29
+ return $url;
30
+ }
31
  }
32
  }