]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
name change continued, social graph tools and stuctures, fix for spanish province...
[friendica.git] / include / api.php
index 74b4aaf6e1d85e5cedbf998194c7c57c2813f1bc..d94cc2942ac071e7644f48857d590372fb2aa1b2 100644 (file)
                return $ret; 
        }
 
-       /**
-        * apply xmlify() to all values of array $val, recursively
-        */
-       function api_xmlify($val){
-               if (is_bool($val)) return $val?"true":"false";
-               if (is_array($val)) return array_map('api_xmlify', $val);
-               return xmlify((string) $val);
-       }
 
        /**
         *  load api $templatename for $type and replace $data array
                        case "atom":
                        case "rss":
                        case "xml":
-                               $data = api_xmlify($data);
+                               $data = array_xmlify($data);
                                $tpl = get_markup_template("api_".$templatename."_".$type.".tpl");
                                $ret = replace_macros($tpl, $data);
                                break;
                        $txt = requestdata('htmlstatus');
                        if((strpos($txt,'<') !== false) || (strpos($txt,'>') !== false)) {
 
-                               $txt = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s',
-                                       '[youtube]$1[/youtube]', $txt);
-
-                               $txt = preg_replace('#<iframe[^>].+?' . 'http://www.youtube.com/embed/([A-Za-z0-9\-_=]+).+?</iframe>#s',
-                                       '[youtube]$1[/youtube]', $txt);
+                               $txt = html2bb_video($txt);
 
                                $config = HTMLPurifier_Config::createDefault();
                                $config->set('Cache.DefinitionImpl', null);