X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FParseUrl.php;h=2183a9c1e05698cdacd8c1bb42905121547af2e0;hb=79ed1568b6c1aaf2aa040d5d279399ee1d78b3b1;hp=e8b58806d987aa5d611f2aa78bbfd00efe0ded1e;hpb=abc924bc8fab830a7d98d348eb892998d2ebe432;p=friendica.git diff --git a/src/ParseUrl.php b/src/ParseUrl.php index e8b58806d9..2183a9c1e0 100644 --- a/src/ParseUrl.php +++ b/src/ParseUrl.php @@ -1,37 +1,34 @@ The url of the parsed page @@ -46,14 +43,18 @@ class ParseUrl { * @see ParseUrl::getSiteinfo() for more information about scraping * embeddable content */ - public static function getSiteinfoCached($url, $no_guessing = false, $do_oembed = true) { - + public static function getSiteinfoCached($url, $no_guessing = false, $do_oembed = true) + { if ($url == "") { return false; } - $r = q("SELECT * FROM `parsed_url` WHERE `url` = '%s' AND `guessing` = %d AND `oembed` = %d", - dbesc(normalise_link($url)), intval(!$no_guessing), intval($do_oembed)); + $r = q( + "SELECT * FROM `parsed_url` WHERE `url` = '%s' AND `guessing` = %d AND `oembed` = %d", + dbesc(normalise_link($url)), + intval(!$no_guessing), + intval($do_oembed) + ); if ($r) { $data = $r[0]["content"]; @@ -66,11 +67,14 @@ class ParseUrl { $data = self::getSiteinfo($url, $no_guessing, $do_oembed); - q("INSERT INTO `parsed_url` (`url`, `guessing`, `oembed`, `content`, `created`) VALUES ('%s', %d, %d, '%s', '%s') - ON DUPLICATE KEY UPDATE `content` = '%s', `created` = '%s'", - dbesc(normalise_link($url)), intval(!$no_guessing), intval($do_oembed), - dbesc(serialize($data)), dbesc(datetime_convert()), - dbesc(serialize($data)), dbesc(datetime_convert())); + dba::insert( + 'parsed_url', + array( + 'url' => normalise_link($url), 'guessing' => !$no_guessing, + 'oembed' => $do_oembed, 'content' => serialize($data), + 'created' => datetime_convert()), + true + ); return $data; } @@ -84,12 +88,12 @@ class ParseUrl { * like \