rename function

rename function and update calls.
This commit is contained in:
Adam Magness 2018-11-06 06:31:48 -05:00
parent 237fc30b4e
commit 3eecd108c5
3 changed files with 4 additions and 4 deletions

View file

@ -1046,7 +1046,7 @@ function api_statuses_mediap($type)
//$txt = urldecode(requestdata('status')); //$txt = urldecode(requestdata('status'));
if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) { if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) {
$txt = HTML::htmlToBBVideo($txt); $txt = HTML::toBBVideo($txt);
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);
$purifier = new HTMLPurifier($config); $purifier = new HTMLPurifier($config);
@ -1092,7 +1092,7 @@ function api_statuses_update($type)
if (requestdata('htmlstatus')) { if (requestdata('htmlstatus')) {
$txt = requestdata('htmlstatus'); $txt = requestdata('htmlstatus');
if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) { if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) {
$txt = HTML::htmlToBBVideo($txt); $txt = HTML::toBBVideo($txt);
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null); $config->set('Cache.DefinitionImpl', null);

View file

@ -711,7 +711,7 @@ class HTML
* *
* @param string $s * @param string $s
*/ */
public static function htmlToBBVideo($s) public static function toBBVideo($s)
{ {
$s = preg_replace( $s = preg_replace(
'#<object[^>]+>(.*?)https?://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism', '#<object[^>]+>(.*?)https?://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism',

View file

@ -2502,7 +2502,7 @@ class DFRN
$base_url = get_app()->getBaseURL(); $base_url = get_app()->getBaseURL();
$item['body'] = HTML::relToAbs($item['body'], $base_url); $item['body'] = HTML::relToAbs($item['body'], $base_url);
$item['body'] = HTML::htmlToBBVideo($item['body']); $item['body'] = HTML::toBBVideo($item['body']);
$item['body'] = OEmbed::HTML2BBCode($item['body']); $item['body'] = OEmbed::HTML2BBCode($item['body']);