Merge remote branch 'upstream/master'

This commit is contained in:
Michael Vogel 2012-05-16 08:24:46 +02:00
commit f2c0c40f6e
109 changed files with 17648 additions and 12649 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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`,

View file

@ -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);

View file

@ -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])
);
}
}
}
}

View file

@ -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()),