Code cleanup + standards

This commit is contained in:
Hypolite Petovan 2017-03-25 01:54:16 -04:00
parent d799662992
commit b9f4a6e4f0
2 changed files with 18 additions and 18 deletions

View file

@ -41,8 +41,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
// These media files should now be caught in bbcode.php
// left here as a fallback in case this is called from another source
$noexts = array("mp3","mp4","ogg","ogv","oga","ogm","webm");
$ext = pathinfo(strtolower($embedurl),PATHINFO_EXTENSION);
$noexts = array("mp3", "mp4", "ogg", "ogv", "oga", "ogm", "webm");
$ext = pathinfo(strtolower($embedurl), PATHINFO_EXTENSION);
if (is_null($txt)) {
@ -85,10 +85,10 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
}
}
$txt=trim($txt);
$txt = trim($txt);
if ($txt[0]!="{") {
$txt='{"type":"error"}';
if ($txt[0] != "{") {
$txt = '{"type":"error"}';
} else { //save in cache
$j = json_decode($txt);
if ($j->type != "error") {