X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FParseUrl.php;h=35557067d7474ca4d7d85d522c0b1847fc33977a;hb=d50d693fe30a2520e018b682bee1a6163845b463;hp=943725ffe0819df55c4e2055f3bc87c5aa8e6abb;hpb=1f58bcc114928a5a3cd97bd0de34a5aa7d585931;p=friendica.git diff --git a/src/ParseUrl.php b/src/ParseUrl.php index 943725ffe0..35557067d7 100644 --- a/src/ParseUrl.php +++ b/src/ParseUrl.php @@ -1,32 +1,34 @@ The url of the parsed page @@ -41,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"]; @@ -61,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; } @@ -79,12 +88,12 @@ class ParseUrl { * like \