use microformat to mark html from [embed] tag, convert html with oembed microformat to [embed] tag

This commit is contained in:
Fabio Comuni
2011-01-31 16:45:58 +01:00
parent 6ea87223d3
commit 49ea05b8ff
3 changed files with 44 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
<?php
require_once('bbcode.php');
require_once('oembed.php');
function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
@@ -395,6 +396,8 @@ function get_atom_elements($feed,$item) {
$res['body'] = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s',
'[youtube]$1[/youtube]', $res['body']);
$res['body'] = oembed_html2bbcode($res['body']);
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null);