aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-05-16 08:24:46 +0200
committerMichael Vogel <icarus@dabo.de>2012-05-16 08:24:46 +0200
commitf2c0c40f6e488f1a8e62bda9449b28115f343cac (patch)
treeae1418141f85be49b7d8cb3d2a0e8b2a7acc4eb4 /include
parentf2e648d62fe7cafb9a55c7505687ea4d1c294778 (diff)
parenta65bd73bf3f4a1e6ccfcdf0a06c70a4f1f4182ce (diff)
downloadvolse-hubzilla-f2c0c40f6e488f1a8e62bda9449b28115f343cac.tar.gz
volse-hubzilla-f2c0c40f6e488f1a8e62bda9449b28115f343cac.tar.bz2
volse-hubzilla-f2c0c40f6e488f1a8e62bda9449b28115f343cac.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php2
-rw-r--r--include/conversation.php7
-rw-r--r--include/items.php2
-rw-r--r--include/pgettext.php6
-rw-r--r--include/plugin.php11
-rwxr-xr-xinclude/security.php2
6 files changed, 22 insertions, 8 deletions
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);
diff --git a/include/conversation.php b/include/conversation.php
index e48a8e6d6..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']))
@@ -447,8 +450,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`,
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/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])
+ );
+ }
}
}
}
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()),