regression: allow position attributes in oembedable zcards by separating allow_position from the decision to allow zrls.

Should probably turn the entire zcard into a gd image as other consumers of zcards are also likely to purify the position attributes.
This commit is contained in:
zotlabs 2017-07-09 16:02:45 -07:00
parent 799d4ad549
commit ddc454bd82

View File

@ -134,7 +134,9 @@ function oembed_fetch_url($embedurl){
$txt = null; $txt = null;
// we should try to cache this and avoid a lookup on each render // we should try to cache this and avoid a lookup on each render
$zrl = ((get_config('system','oembed_zrl')) ? is_matrix_url($embedurl) : false); $is_matrix = is_matrix_url($embedurl);
$zrl = ((get_config('system','oembed_zrl')) ? $is_matrix : false);
$furl = ((local_channel() && $zrl) ? zid($embedurl) : $embedurl); $furl = ((local_channel() && $zrl) ? zid($embedurl) : $embedurl);
@ -222,7 +224,7 @@ function oembed_fetch_url($embedurl){
if($action === 'filter') { if($action === 'filter') {
if($j['html']) { if($j['html']) {
$orig = $j['html']; $orig = $j['html'];
$allow_position = (($zrl) ? true : false); $allow_position = (($is_matrix) ? true : false);
$j['html'] = purify_html($j['html'],$allow_position); $j['html'] = purify_html($j['html'],$allow_position);
if($j['html'] != $orig) { if($j['html'] != $orig) {
logger('oembed html was purified. original: ' . $orig . ' purified: ' . $j['html'], LOGGER_DEBUG, LOG_INFO); logger('oembed html was purified. original: ' . $orig . ' purified: ' . $j['html'], LOGGER_DEBUG, LOG_INFO);