From a88829413594f4577c2f307c974b4094f2a96caa Mon Sep 17 00:00:00 2001 From: hannes Date: Mon, 25 Jan 2016 19:00:46 +0000 Subject: [PATCH] add our own protected urls --- classes/File.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/classes/File.php b/classes/File.php index 46eae4d9a9..6cad978a70 100644 --- a/classes/File.php +++ b/classes/File.php @@ -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; } /** -- 2.39.5