aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-27 19:44:55 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-27 19:44:55 +0000
commitd32e714cc14f54b06a09a203e6ec56d3da01a5a3 (patch)
tree24da3bb15ea2263e8fb514cb38c8ae93da0dab91 /engine/lib/sites.php
parenteb92e452d5d1493c657a1ccda53e083348427e32 (diff)
downloadelgg-d32e714cc14f54b06a09a203e6ec56d3da01a5a3.tar.gz
elgg-d32e714cc14f54b06a09a203e6ec56d3da01a5a3.tar.bz2
Updating walled garden to register public pages as regular expressions.
git-svn-id: http://code.elgg.org/elgg/trunk@6255 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r--engine/lib/sites.php31
1 files changed, 19 insertions, 12 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index e6eb71afc..c17154f3d 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -270,18 +270,22 @@ class ElggSite extends ElggEntity {
}
}
+ // always allow index page
+ if ($url == $CONFIG->url) {
+ return TRUE;
+ }
+
// default public pages
$defaults = array(
- $CONFIG->url,
- "{$CONFIG->url}action/login",
- "{$CONFIG->url}pg/register/",
- "{$CONFIG->url}action/register",
- "{$CONFIG->url}account/forgotten_password.php",
- "{$CONFIG->url}action/user/requestnewpassword",
- "{$CONFIG->url}pg/resetpassword",
- "{$CONFIG->url}upgrade.php",
- "{$CONFIG->url}xml-rpc.php",
- "{$CONFIG->url}mt/mt-xmlrpc.cgi",
+ 'action/login',
+ 'pg/register',
+ 'action/register',
+ 'account/forgotten_password\.php',
+ 'action/user/requestnewpassword',
+ 'pg/resetpassword',
+ 'upgrade\.php',
+ 'xml-rpc\.php',
+ 'mt/mt-xmlrpc\.cgi',
);
// include a hook for plugin authors to include public pages
@@ -290,8 +294,11 @@ class ElggSite extends ElggEntity {
// lookup admin-specific public pages
// allow public pages
- if (in_array($url, array_merge($defaults, $plugins))) {
- return TRUE;
+ foreach (array_merge($defaults, $plugins) as $public) {
+ $pattern = "`^{$CONFIG->url}$public/*$`i";
+ if (preg_match($pattern, $url)) {
+ return TRUE;
+ }
}
// non-public page