X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnetwork.php;h=16c8185e1abb48b0fec1ada966fe06a0e9ffce35;hb=e44da4a49825ed575e0168e8d2f5644c14bbc524;hp=7e388112367b562aa1c7accb58e3cf9a27c4cd4b;hpb=f245bc83590879948d588fa9a2ac1ed50adefdb6;p=friendica.git diff --git a/include/network.php b/include/network.php index 7e38811236..16c8185e1a 100644 --- a/include/network.php +++ b/include/network.php @@ -1,14 +1,13 @@ $result); - echo Xml::from_array($xmldata, $xml); + echo XML::fromArray($xmldata, $xml); killme(); } @@ -570,7 +569,8 @@ function allowed_url($url) * Checks if the provided url domain is on the domain blocklist. * Returns true if it is or malformed URL, false if not. * - * @param string $url The url to check the domain from + * @param string $url The url to check the domain from + * * @return boolean */ function blocked_url($url) @@ -686,7 +686,6 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = $matches = null; $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER); if ($c) { - require_once 'include/Photo.php'; foreach ($matches as $mtch) { logger('scale_external_image: ' . $mtch[1]); @@ -711,18 +710,18 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = } // guess mimetype from headers or filename - $type = guess_image_type($mtch[1], true); + $type = Image::guessType($mtch[1], true); if ($i) { - $ph = new Photo($i, $type); - if ($ph->is_valid()) { - $orig_width = $ph->getWidth(); - $orig_height = $ph->getHeight(); + $Image = new Image($i, $type); + if ($Image->isValid()) { + $orig_width = $Image->getWidth(); + $orig_height = $Image->getHeight(); if ($orig_width > 640 || $orig_height > 640) { - $ph->scaleImage(640); - $new_width = $ph->getWidth(); - $new_height = $ph->getHeight(); + $Image->scaleDown(640); + $new_width = $Image->getWidth(); + $new_height = $Image->getHeight(); logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); $s = str_replace( $mtch[0],