diff options
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php index 6b579e35c..c130a9b8a 100644 --- a/include/text.php +++ b/include/text.php @@ -92,10 +92,10 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { return escape_tags($s); if($type == 'text/plain') return escape_tags($s); - $r = q("select account_id, account_roles from account left join channel on channel_account_id = account_id where channel_id = %d limit 1", + $r = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1", intval($channel_id) ); - if($r && ($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) { + if($r && (($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE))) { if(local_user() && (get_account_id() == $r[0]['account_id'])) { return $s; } @@ -620,7 +620,7 @@ function get_tags($s) { // Match full names against @tags including the space between first and last // We will look these up afterward to see if they are full names or not recognisable. - if(preg_match_all('/(@[^ \x0D\x0A,:?]+ [^ \x0D\x0A@,:?]+)([ \x0D\x0A@,:?]|$)/',$s,$match)) { + if(preg_match_all('/(@[^ \x0D\x0A,:?\[]+ [^ \x0D\x0A@,:?\[]+)([ \x0D\x0A@,:?\[]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { // we might be inside a bbcode color tag - leave it alone @@ -636,7 +636,7 @@ function get_tags($s) { // Otherwise pull out single word tags. These can be @nickname, @first_last // and #hash tags. - if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) { + if(preg_match_all('/([@#][^ \x0D\x0A,;:?\[]+)([ \x0D\x0A,;:?\[]|$)/',$s,$match)) { foreach($match[1] as $mtch) { if(strstr($mtch,"]")) { // we might be inside a bbcode color tag - leave it alone @@ -1584,13 +1584,13 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { 'text/plain' ); - $r = q("select account_id, account_roles from account left join channel on account_id = channel_account_id where + $r = q("select account_id, account_roles, channel_pageflags from account left join channel on account_id = channel_account_id where channel_id = %d limit 1", intval($channel_id) ); if($r) { - if($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) { + if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) { if(local_user() && get_account_id() == $r[0]['account_id']) $x[] = 'application/x-php'; } |