aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/cron.php22
-rw-r--r--engine/lib/sites.php31
2 files changed, 29 insertions, 24 deletions
diff --git a/engine/lib/cron.php b/engine/lib/cron.php
index 75897fb21..223b6774f 100644
--- a/engine/lib/cron.php
+++ b/engine/lib/cron.php
@@ -57,18 +57,16 @@ function cron_page_handler($page) {
}
function cron_public_pages($hook, $type, $return_value, $params) {
- global $CONFIG;
-
- $return_value[] = "{$CONFIG->url}pg/cron/minute";
- $return_value[] = "{$CONFIG->url}pg/cron/fiveminute";
- $return_value[] = "{$CONFIG->url}pg/cron/fifteenmin";
- $return_value[] = "{$CONFIG->url}pg/cron/halfhour";
- $return_value[] = "{$CONFIG->url}pg/cron/hourly";
- $return_value[] = "{$CONFIG->url}pg/cron/daily";
- $return_value[] = "{$CONFIG->url}pg/cron/weekly";
- $return_value[] = "{$CONFIG->url}pg/cron/monthly";
- $return_value[] = "{$CONFIG->url}pg/cron/yearly";
- $return_value[] = "{$CONFIG->url}pg/cron/reboot";
+ $return_value[] = 'pg/cron/minute';
+ $return_value[] = 'pg/cron/fiveminute';
+ $return_value[] = 'pg/cron/fifteenmin';
+ $return_value[] = 'pg/cron/halfhour';
+ $return_value[] = 'pg/cron/hourly';
+ $return_value[] = 'pg/cron/daily';
+ $return_value[] = 'pg/cron/weekly';
+ $return_value[] = 'pg/cron/monthly';
+ $return_value[] = 'pg/cron/yearly';
+ $return_value[] = 'pg/cron/reboot';
return $return_value;
}
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