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.

This commit is contained in:
friendica 2013-09-01 19:15:08 -07:00
parent a1906482dc
commit caa148c1e3
3 changed files with 57 additions and 39 deletions

View File

@ -1361,6 +1361,17 @@ function item_store($arr,$allow_exec = false) {
return 0; 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 // Don't let anybody set these, either intentionally or accidentally
if(array_key_exists('id',$arr)) if(array_key_exists('id',$arr))

View File

@ -32,6 +32,12 @@ function ACPopup(elm,backend_url){
} }
} }
if(! w)
w = 530;
if(! h)
h = 130;
style.top=style.top+h; style.top=style.top+h;
style.width = w; style.width = w;
style.position = 'absolute'; style.position = 'absolute';

View File

@ -69,7 +69,8 @@ function item_post(&$a) {
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0); $preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
$categories = ((x($_REQUEST,'category')) ? escape_tags($_REQUEST['category']) : ''); $categories = ((x($_REQUEST,'category')) ? escape_tags($_REQUEST['category']) : '');
$webpage = ((x($_REQUEST,'webpage')) ? intval($_REQUEST['webpage']) : 0); $webpage = ((x($_REQUEST,'webpage')) ? intval($_REQUEST['webpage']) : 0);
$pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags($_REQUEST['pagetitle']): ''); $pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : '');
$layout_mid = ((x($_REQUEST,'layout_mid')) ? escape_tags($_REQUEST['layout_mid']): '');
if($pagetitle) { if($pagetitle) {
require_once('library/urlify/URLify.php'); require_once('library/urlify/URLify.php');
@ -547,7 +548,7 @@ function item_post(&$a) {
$datarray['postopts'] = ''; $datarray['postopts'] = '';
$datarray['item_restrict'] = $item_restrict; $datarray['item_restrict'] = $item_restrict;
$datarray['item_flags'] = $item_flags; $datarray['item_flags'] = $item_flags;
$datarray['layout_mid'] = $layout_mid;
$datarray['comment_policy'] = map_scope($channel['channel_w_comment']); $datarray['comment_policy'] = map_scope($channel['channel_w_comment']);
// preview mode - prepare the body for display and send it via json // preview mode - prepare the body for display and send it via json