mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Move bb_translate_video
- To new Class BBCode\Video - Adding tests - Make BaseObject::getClass() public
This commit is contained in:
parent
7f49c73730
commit
2870f42ca2
5 changed files with 80 additions and 20 deletions
|
@ -223,22 +223,6 @@ function return_bytes($size_str) {
|
|||
}
|
||||
}
|
||||
|
||||
function bb_translate_video($s) {
|
||||
|
||||
$matches = null;
|
||||
$r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER);
|
||||
if ($r) {
|
||||
foreach ($matches as $mtch) {
|
||||
if ((stristr($mtch[1], 'youtube')) || (stristr($mtch[1], 'youtu.be'))) {
|
||||
$s = str_replace($mtch[0], '[youtube]' . $mtch[1] . '[/youtube]', $s);
|
||||
} elseif (stristr($mtch[1], 'vimeo')) {
|
||||
$s = str_replace($mtch[0], '[vimeo]' . $mtch[1] . '[/vimeo]', $s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
/// @TODO Rewrite this
|
||||
function is_a_date_arg($s) {
|
||||
$i = intval($s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue