Another try at issue #61 and #62 - an earlier fix was partially working but the issue persisted - this extends it a bit.
This commit is contained in:
parent
353ccaac05
commit
9fb2a87c9a
@ -773,14 +773,19 @@ function decode_tags($t) {
|
|||||||
|
|
||||||
function activity_sanitise($arr) {
|
function activity_sanitise($arr) {
|
||||||
if($arr) {
|
if($arr) {
|
||||||
$ret = array();
|
if(is_array($arr)) {
|
||||||
foreach($arr as $k => $x) {
|
$ret = array();
|
||||||
if(is_array($x))
|
foreach($arr as $k => $x) {
|
||||||
$ret[$k] = activity_sanitise($x);
|
if(is_array($x))
|
||||||
else
|
$ret[$k] = activity_sanitise($x);
|
||||||
$ret[$k] = htmlentities($x, ENT_COMPAT,'UTF-8',false);
|
else
|
||||||
|
$ret[$k] = htmlentities($x, ENT_COMPAT,'UTF-8',false);
|
||||||
|
}
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return htmlentities($arr, ENT_COMPAT,'UTF-8', false);
|
||||||
}
|
}
|
||||||
return $ret;
|
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -1572,10 +1577,10 @@ function item_store($arr,$allow_exec = false) {
|
|||||||
unset($arr['term']);
|
unset($arr['term']);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbesc_array($arr);
|
|
||||||
|
|
||||||
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
|
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
|
||||||
|
|
||||||
|
dbesc_array($arr);
|
||||||
|
|
||||||
$r = dbq("INSERT INTO `item` (`"
|
$r = dbq("INSERT INTO `item` (`"
|
||||||
. implode("`, `", array_keys($arr))
|
. implode("`, `", array_keys($arr))
|
||||||
. "`) VALUES ('"
|
. "`) VALUES ('"
|
||||||
|
34
js/main.js
34
js/main.js
@ -343,6 +343,8 @@
|
|||||||
|
|
||||||
function updateConvItems(mode,data) {
|
function updateConvItems(mode,data) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(mode === 'update') {
|
if(mode === 'update') {
|
||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
@ -391,15 +393,31 @@ function updateConvItems(mode,data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(mode === 'append') {
|
if(mode === 'append') {
|
||||||
|
|
||||||
next = 'threads-end';
|
next = 'threads-end';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.thread-wrapper.toplevel_item',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
|
|
||||||
|
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
|
||||||
|
var itmId = 0;
|
||||||
|
var isVisible = false;
|
||||||
|
|
||||||
|
if(typeof commentWrap !== 'undefined')
|
||||||
|
itmId = commentWrap.replace('collapsed-comments-','');
|
||||||
|
|
||||||
if($('#' + ident).length == 0) {
|
if($('#' + ident).length == 0) {
|
||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
if($('#collapsed-comments-'+itmId).is(':visible'))
|
||||||
|
isVisible = true;
|
||||||
$('#threads-end').before($(this));
|
$('#threads-end').before($(this));
|
||||||
|
if(isVisible)
|
||||||
|
showHideComments(itmId);
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
|
|
||||||
@ -408,7 +426,11 @@ function updateConvItems(mode,data) {
|
|||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
if($('#collapsed-comments-'+itmId).is(':visible'))
|
||||||
|
isVisible = true;
|
||||||
$('#' + ident).replaceWith($(this));
|
$('#' + ident).replaceWith($(this));
|
||||||
|
if(isVisible)
|
||||||
|
showHideComments(itmId);
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
}
|
}
|
||||||
@ -425,13 +447,25 @@ function updateConvItems(mode,data) {
|
|||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
$('.thread-wrapper.toplevel_item',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
|
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
|
||||||
|
var itmId = 0;
|
||||||
|
var isVisible = false;
|
||||||
|
|
||||||
|
if(typeof commentWrap !== 'undefined')
|
||||||
|
itmId = commentWrap.replace('collapsed-comments-','');
|
||||||
|
|
||||||
if($('#' + ident).length == 0 && profile_page == 1) {
|
if($('#' + ident).length == 0 && profile_page == 1) {
|
||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if($('#collapsed-comments-'+itmId).is(':visible'))
|
||||||
|
isVisible = true;
|
||||||
$('#' + prev).after($(this));
|
$('#' + prev).after($(this));
|
||||||
|
if(isVisible)
|
||||||
|
showHideComments(itmId);
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
|
|
||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-08-17.408
|
2013-08-18.409
|
||||||
|
Reference in New Issue
Block a user