]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add our own protected urls
authorhannes <h@nnesmannerhe.im>
Mon, 25 Jan 2016 19:00:46 +0000 (19:00 +0000)
committerhannes <h@nnesmannerhe.im>
Mon, 25 Jan 2016 19:00:46 +0000 (19:00 +0000)
classes/File.php

index 46eae4d9a9d9bbbfdbc4abdea78f799cbf2967ce..6cad978a703cadaf66670014cea1cd6b05adccd8 100644 (file)
@@ -72,7 +72,19 @@ class File extends Managed_DataObject
     }
 
     function isProtected($url) {
-        return 'http://www.facebook.com/login.php' === $url;
+
+               $protected_urls_exps = array(
+                       'https://www.facebook.com/login.php',
+               common_path('main/login')
+               );
+
+               foreach ($protected_urls_exps as $protected_url_exp) {
+                       if (preg_match('!^'.preg_quote($protected_url_exp).'(.*)$!i', $url) === 1) {
+                               return true;
+                       }
+               }
+
+               return false;
     }
 
     /**