X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnetwork.php;h=16c8185e1abb48b0fec1ada966fe06a0e9ffce35;hb=0457bd995fe4e723a7cad33c8d464186646db5db;hp=52e3409573347db9754dc7f1249fb09a95f14f5b;hpb=7fe549b8d2ce8addc58fb308dccb194f88fcca6e;p=friendica.git diff --git a/include/network.php b/include/network.php index 52e3409573..16c8185e1a 100644 --- a/include/network.php +++ b/include/network.php @@ -6,7 +6,7 @@ use Friendica\App; use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Network\Probe; -use Friendica\Object\Photo; +use Friendica\Object\Image; use Friendica\Util\XML; /** @@ -126,8 +126,8 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array()) if (x($opts, 'timeout')) { @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']); } else { - $curl_time = intval(Config::get('system', 'curl_timeout')); - @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); + $curl_time = Config::get('system', 'curl_timeout', 60); + @curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time)); } // by default we will allow self-signed certs @@ -302,8 +302,8 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0) if (intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); } else { - $curl_time = intval(Config::get('system', 'curl_timeout')); - curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); + $curl_time = Config::get('system', 'curl_timeout', 60); + curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time)); } if (defined('LIGHTTPD')) { @@ -710,18 +710,18 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = } // guess mimetype from headers or filename - $type = Photo::guessImageType($mtch[1], true); + $type = Image::guessType($mtch[1], true); if ($i) { - $ph = new Photo($i, $type); - if ($ph->isValid()) { - $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],