From 496782e468fa206845b0baca8e91fb3a7d4278d4 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 11 May 2012 03:41:29 -0700 Subject: moderated comment templates --- include/plugin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/plugin.php b/include/plugin.php index 4ff78a8b4..ae8eee78a 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -70,8 +70,10 @@ function reload_plugins() { $installed = array(); $parr = explode(',',$plugins); + if(count($parr)) { foreach($parr as $pl) { + $pl = trim($pl); $fname = 'addon/' . $pl . '/' . $pl . '.php'; @@ -101,6 +103,7 @@ function reload_plugins() { } } } + }} @@ -163,6 +166,14 @@ function call_hooks($name, &$data = null) { $func = $hook[HOOK_FUNCTION]; $func($a,$data); } + else { + // remove orphan hooks + q("delete from hook where hook = '%s' and file = '$s' and function = '%s' limit 1", + dbesc($hook[HOOK_HOOK]), + dbesc($hook[HOOK_FILE]), + dbesc($hook[HOOK_FUNCTION]) + ); + } } } } -- cgit v1.2.3 From 20229ce18719b82b1a4d3ed2d8fd4b265cfbc57e Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 11 May 2012 05:11:53 -0700 Subject: better test of email reply visibility --- include/conversation.php | 4 ++-- include/items.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index e48a8e6d6..ff68462ab 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -447,8 +447,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { else { // prevent private email reply to public conversation from leaking. - if($item['private'] && ! $threads[$threadsid]['private']) - continue; + if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) + continue; $comments_seen ++; $comment_lastcollapsed = false; diff --git a/include/items.php b/include/items.php index b1dc1708f..129499967 100644 --- a/include/items.php +++ b/include/items.php @@ -119,7 +119,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) $check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s'); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, + `contact`.`name`, `contact`.`network`, `contact`.`photo`, `contact`.`url`, `contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`, -- cgit v1.2.3 From 4e0b0d4e43a26dc9bfddd2980a44fd738652cfda Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 11 May 2012 05:19:29 -0700 Subject: fix search/new against possible email leakage --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index ff68462ab..6bf673b97 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -278,6 +278,9 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { else $nickname = $a->user['nickname']; + // prevent private email from leaking. + if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) + continue; $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']); if($item['author-link'] && (! $item['author-name'])) -- cgit v1.2.3 From 3811fe288fe4446aaa890f9d98acbb3b670b7f3b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 13 May 2012 04:52:29 -0700 Subject: rename get_language() to get_browser_language() --- include/pgettext.php | 6 +++--- include/security.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/pgettext.php b/include/pgettext.php index a079a4687..5a0eab0b0 100644 --- a/include/pgettext.php +++ b/include/pgettext.php @@ -15,10 +15,10 @@ */ -if(! function_exists('get_language')) { -function get_language() { +if(! function_exists('get_browser_language')) { +function get_browser_language() { - if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + if (x($_SERVER,'HTTP_ACCEPT_LANGUAGE')) { // break up string into pieces (languages and q factors) preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse); diff --git a/include/security.php b/include/security.php index a92400b5c..af201d2af 100755 --- a/include/security.php +++ b/include/security.php @@ -76,7 +76,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"'); if($login_initial) { - $l = get_language(); + $l = get_browser_language(); q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d LIMIT 1", dbesc(datetime_convert()), -- cgit v1.2.3 From e574514e2177798e9c0c530737864e971a8275ab Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Sun, 13 May 2012 10:15:54 +0200 Subject: Allow plugins to modify the contact photo menu --- include/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index 2523fc023..675d1c81e 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -209,7 +209,7 @@ function contact_photo_menu($contact) { ); - $args = array('contact' => $contact, 'menu' => $menu); + $args = array('contact' => $contact, 'menu' => &$menu); call_hooks('contact_photo_menu', $args); -- cgit v1.2.3