aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-01 19:15:08 -0700
committerfriendica <info@friendica.com>2013-09-01 19:15:08 -0700
commitcaa148c1e3736b6d51327883b04405b00a4cda0b (patch)
tree2d3d213a5011b54840a199cad430a0278f179193 /include
parenta1906482dc3323f747744a1447aace78b494ddbd (diff)
downloadvolse-hubzilla-caa148c1e3736b6d51327883b04405b00a4cda0b.tar.gz
volse-hubzilla-caa148c1e3736b6d51327883b04405b00a4cda0b.tar.bz2
volse-hubzilla-caa148c1e3736b6d51327883b04405b00a4cda0b.zip
Sheesh. Three lines of Javascript. All you have to do is find which of the three lines is doing something wrong. Or FILE A BUG. Or use a different browser (not *try* a different browser, *use* a different browser), or turn off freaking tinymce. But no - let's argue about browsers instead.
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index c695a9b72..712c416de 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1361,6 +1361,17 @@ function item_store($arr,$allow_exec = false) {
return 0;
}
+ // If a page layout is provided, ensure it exists and belongs to us.
+
+ if(array_key_exists('layout_mid',$arr) && $arr['layout_mid']) {
+ $l = q("select item_restrict from item where mid = '%s' and uid = %d limit 1",
+ dbesc($arr['layout_mid']),
+ intval($arr['uid'])
+ );
+ if((! $l) || (! ($l[0]['item_restrict'] & ITEM_PDL)))
+ unset($arr['layout_mid']);
+ }
+
// Don't let anybody set these, either intentionally or accidentally
if(array_key_exists('id',$arr))