diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-05-31 23:22:19 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-05-31 23:22:19 -0400 |
commit | b1dacd6d838ecf75fe828279e57c2e7a866be22f (patch) | |
tree | 46b41c1f463ab90588f109105c95e85dad8fd432 /mod/item.php | |
parent | 04119d31e51c749cfa81b9a8ac5f52005d71f8c4 (diff) | |
parent | 93bc29a711637c84a4ffc380078277de89af4e6d (diff) | |
download | volse-hubzilla-b1dacd6d838ecf75fe828279e57c2e7a866be22f.tar.gz volse-hubzilla-b1dacd6d838ecf75fe828279e57c2e7a866be22f.tar.bz2 volse-hubzilla-b1dacd6d838ecf75fe828279e57c2e7a866be22f.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
turn registration code into a standalone function for re-use
query using both `id` and `parent`
prevent email from leaking in feeds
y didn't i think of this b4?
some zero theming on settings page
missing delimiter
transition to beta for private forums
rev update
Friendicaland - you can't 'live' on a demo server.
Create a "potential default group" called "Friends" on registration.
fix private photos that also have a size specification
private group tests, cont.
hide private group if desired
prvgroup should see intros
private group fix
possible sql injection in search
bugfixes: private photo embeds and search for strings with %
* master:
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/mod/item.php b/mod/item.php index df242d6f7..497cf5daa 100644 --- a/mod/item.php +++ b/mod/item.php @@ -262,17 +262,17 @@ function item_post(&$a) { } } - if(strlen($categories)) { - // get the "fileas" tags for this post - $filedas = file_tag_file_to_list($categories, 'file'); + if(strlen($categories)) { + // get the "fileas" tags for this post + $filedas = file_tag_file_to_list($categories, 'file'); } - // save old and new categories, so we can determine what needs to be deleted from pconfig - $categories_old = $categories; - $categories = file_tag_list_to_file(trim($_REQUEST['category']), 'category'); - $categories_new = $categories; - if(strlen($filedas)) { - // append the fileas stuff to the new categories list - $categories .= file_tag_list_to_file($filedas, 'file'); + // save old and new categories, so we can determine what needs to be deleted from pconfig + $categories_old = $categories; + $categories = file_tag_list_to_file(trim($_REQUEST['category']), 'category'); + $categories_new = $categories; + if(strlen($filedas)) { + // append the fileas stuff to the new categories list + $categories .= file_tag_list_to_file($filedas, 'file'); } // Work around doubled linefeeds in Tinymce 3.5b2 @@ -453,6 +453,7 @@ function item_post(&$a) { $tagged = array(); + $private_forum = false; if(count($tags)) { foreach($tags as $tag) { @@ -471,11 +472,22 @@ function item_post(&$a) { continue; $success = handle_tag($a, $body, $inform, $str_tags, (local_user()) ? local_user() : $profile_uid , $tag); - if($success) + if($success['replaced']) $tagged[] = $tag; + if(is_array($success['contact']) && intval($success['contact']['prv'])) { + $private_forum = true; + $private_id = $success['contact']['id']; + } } } + if(($private_forum) && (! $parent) && (! $private)) { + // we tagged a private forum in a top level post and the message was public. + // Restrict it. + $private = 1; + $str_contact_allow = '<' . $private_id . '>'; + } + $attachments = ''; $match = false; @@ -893,6 +905,7 @@ function item_content(&$a) { function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { $replaced = false; + $r = null; //is it a hash tag? if(strpos($tag,'#') === 0) { @@ -1023,5 +1036,5 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { } } - return $replaced; + return array('replaced' => $replaced, 'contact' => $r[0]); } |