aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/lib/blog.php11
-rw-r--r--mod/thewire/tests/regex.php10
2 files changed, 12 insertions, 9 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 6ab51ccbd..7fa1b9c5b 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -407,15 +407,16 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) {
* @return array
*/
function blog_get_blog_months($user_guid = NULL, $container_guid = NULL) {
- global $CONFIG;
+
+ $db_prefix = elgg_get_config('dbprefix');
$subtype = get_subtype_id('object', 'blog');
$q = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM FROM_UNIXTIME(mdv.string)) AS yearmonth
- FROM {$CONFIG->dbprefix}entities e, {$CONFIG->dbprefix}metadata, {$CONFIG->dbprefix}metastrings mdn, {$CONFIG->dbprefix}metastrings mdv
- WHERE e.guid = {$CONFIG->dbprefix}metadata.entity_guid
- AND {$CONFIG->dbprefix}metadata.name_id = mdn.id
- AND {$CONFIG->dbprefix}metadata.value_id = mdv.id
+ FROM {$db_prefix}entities e, {$db_prefix}metadata, {$db_prefix}metastrings mdn, {$db_prefix}metastrings mdv
+ WHERE e.guid = {$db_prefix}metadata.entity_guid
+ AND {$db_prefix}metadata.name_id = mdn.id
+ AND {$db_prefix}metadata.value_id = mdv.id
AND mdn.string = 'publish_date'";
if ($user_guid) {
diff --git a/mod/thewire/tests/regex.php b/mod/thewire/tests/regex.php
index 9e187cf29..5b53c69d6 100644
--- a/mod/thewire/tests/regex.php
+++ b/mod/thewire/tests/regex.php
@@ -39,13 +39,15 @@ class TheWireRegexTest extends ElggCoreUnitTest {
}
protected function getUserWireLink($username) {
- global $CONFIG;
- return "<a href=\"{$CONFIG->wwwroot}pg/thewire/owner/$username\">@$username</a>";
+ $url = "pg/thewire/owner/$username";
+ $url = elgg_normalize_url($url);
+ return "<a href=\"$url\">@$username</a>";
}
protected function getHashtagLink($tag) {
- global $CONFIG;
- return "<a href=\"{$CONFIG->wwwroot}pg/thewire/tag/$tag\">#$tag</a>";
+ $url = "pg/thewire/tag/$tag";
+ $url = elgg_normalize_url($url);
+ return "<a href=\"$url\">#$tag</a>";
}
protected function getEmailLink($address) {