diff options
author | Sem <sembrestels@riseup.net> | 2012-11-15 01:16:42 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-11-15 01:16:42 +0100 |
commit | 4f01b88b9fc1fe476189d53df7a34303502ba17e (patch) | |
tree | a135501cecf08e1969d59ada8070fe7c32a34ffe /mod | |
parent | 45480715e699ed61cd2b70242c323de99d7325c5 (diff) | |
download | elgg-4f01b88b9fc1fe476189d53df7a34303502ba17e.tar.gz elgg-4f01b88b9fc1fe476189d53df7a34303502ba17e.tar.bz2 |
Refs #4904. Checking if page has segments before using them.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/lib/blog.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 1ccfe4dc4..4dcc7d56e 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -411,8 +411,8 @@ function blog_url_forwarder($page) { global $CONFIG; // group usernames - if (substr_count("$page[0]/$page[1]", 'group:')) { - preg_match('/group\:([0-9]+)/i', "$page[0]/$page[1]", $matches); + if (substr_count(implode('/', $page), 'group:')) { + preg_match('/group\:([0-9]+)/i', implode('/', $page), $matches); $guid = $matches[1]; $entity = get_entity($guid); if ($entity) { @@ -426,6 +426,10 @@ function blog_url_forwarder($page) { } } + if (!isset($page[0])) { + return; + } + // user usernames $user = get_user_by_username($page[0]); if (!$user) { |