aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-08 23:20:28 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-08 23:20:28 -0700
commit4fd80304a55d7edb1a558ff1fdcbff795fa12302 (patch)
treec20cb741583f0737fadf77d47fe878ff80506faf
parent4289c8adb2ae9e09a2ebce301c8c6869fd831246 (diff)
downloadvolse-hubzilla-4fd80304a55d7edb1a558ff1fdcbff795fa12302.tar.gz
volse-hubzilla-4fd80304a55d7edb1a558ff1fdcbff795fa12302.tar.bz2
volse-hubzilla-4fd80304a55d7edb1a558ff1fdcbff795fa12302.zip
that didn't work out well - let's do this instead
-rw-r--r--include/text.php43
1 files changed, 16 insertions, 27 deletions
diff --git a/include/text.php b/include/text.php
index ef38c03d7..5666998f0 100644
--- a/include/text.php
+++ b/include/text.php
@@ -101,25 +101,20 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') {
$a = get_app();
if($a->is_sys) {
- $sys = get_sys_channel();
- $channel_id = $sys['channel_id'];
+ return $s;
}
$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) {
- if($r[0]['channel_pageflags'] & PAGE_SYSTEM) {
- return $s;
- }
- else {
- if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) {
- if(local_channel() && (get_account_id() == $r[0]['account_id'])) {
- return $s;
- }
+ if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) {
+ if(local_channel() && (get_account_id() == $r[0]['account_id'])) {
+ return $s;
}
}
}
+
if($type === 'text/html')
return purify_html($s);
@@ -1618,12 +1613,6 @@ function layout_select($channel_id, $current = '') {
function mimetype_select($channel_id, $current = 'text/bbcode') {
- $a = get_app();
- if($a->is_sys) {
- $sys = get_sys_channel();
- $channel_id = $sys['channel_id'];
- }
-
$x = array(
'text/bbcode',
'text/html',
@@ -1631,23 +1620,23 @@ function mimetype_select($channel_id, $current = 'text/bbcode') {
'text/plain'
);
- $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)
- );
+ $a = get_app();
+ if($a->is_sys) {
+ $x[] = 'application/x-php';
+ }
+ else {
+ $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]['channel_pageflags'] & PAGE_SYSTEM) {
- $x[] = 'application/x-php';
- }
- else {
+ if($r) {
if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) {
if(local_channel() && get_account_id() == $r[0]['account_id']) {
$x[] = 'application/x-php';
}
}
- }
-
+ }
}
$o = t('Page content type: ');