diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-26 19:47:05 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-04-27 14:33:01 +0200 |
commit | 2778e63d6c51b5ca77d9a309ddb7390b239fa491 (patch) | |
tree | 1813c5dd6d98c211dfcc734da902c45b6dee74fc /Zotlabs | |
parent | d16fbda0f8c97b504c20cbcfbd07031ef0fa62fe (diff) | |
download | volse-hubzilla-2778e63d6c51b5ca77d9a309ddb7390b239fa491.tar.gz volse-hubzilla-2778e63d6c51b5ca77d9a309ddb7390b239fa491.tar.bz2 volse-hubzilla-2778e63d6c51b5ca77d9a309ddb7390b239fa491.zip |
issues from hubzilla:#737
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/DB_Upgrade.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWiki.php | 4 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 15 |
3 files changed, 16 insertions, 5 deletions
diff --git a/Zotlabs/Lib/DB_Upgrade.php b/Zotlabs/Lib/DB_Upgrade.php index 55c69bcca..bb72e7a05 100644 --- a/Zotlabs/Lib/DB_Upgrade.php +++ b/Zotlabs/Lib/DB_Upgrade.php @@ -83,7 +83,7 @@ class DB_Upgrade { file_put_contents($lockfile, $x); $r = q("select account_language from account where account_email = '%s' limit 1", - dbesc(App::$config['system']['admin_email']) + dbesc(\App::$config['system']['admin_email']) ); push_lang(($r) ? $r[0]['account_language'] : 'en'); diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index 7786ec25a..4301feaa0 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -101,11 +101,11 @@ class NativeWiki { static public function sync_a_wiki_item($uid,$id,$resource_id) { - $r = q("SELECT * from item WHERE uid = %d AND ( id = %d OR ( resource_type = '%s' and resource_id = %d )) ", + $r = q("SELECT * from item WHERE uid = %d AND ( id = %d OR ( resource_type = '%s' and resource_id = '%s' )) ", intval($uid), intval($id), dbesc(NWIKI_ITEM_RESOURCE_TYPE), - intval($resource_id) + dbesc($resource_id) ); if($r) { xchan_query($r); diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index bd40367c9..ed3df436c 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -21,12 +21,23 @@ class NativeWikiPage { $sql_extra = item_permissions_sql($channel_id,$observer_hash); $r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and item_deleted = 0 - $sql_extra group by mid order by created asc", + $sql_extra order by created asc", dbesc($resource_id), intval($channel_id) ); if($r) { - $items = fetch_post_tags($r,true); + $x = []; + $y = []; + + foreach($r as $rv) { + if(! in_array($rv['mid'],$x)) { + $y[] = $rv; + $x[] = $rv['mid']; + } + } + + $items = fetch_post_tags($y,true); + foreach($items as $page_item) { $title = get_iconfig($page_item['id'],'nwikipage','pagetitle',t('(No Title)')); if(urldecode($title) !== 'Home') { |