X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FHelper%2FTools.php;h=be29ab994ea95c5f73429e9639d07a47268e9c46;hb=4346a86068781f4acdeb574d7e2af08b77b58ea7;hp=0fd5f259c42d5fd56adb2a6151f57ee8a6207dc6;hpb=399bd777d7900f532bfcfa367da88767739391bc;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Helper/Tools.php b/src/Wallabag/CoreBundle/Helper/Tools.php index 0fd5f259..be29ab99 100755 --- a/src/Wallabag/CoreBundle/Helper/Tools.php +++ b/src/Wallabag/CoreBundle/Helper/Tools.php @@ -5,15 +5,16 @@ namespace Wallabag\CoreBundle\Helper; final class Tools { /** - * Download a file (typically, for downloading pictures on web server) + * Download a file (typically, for downloading pictures on web server). * * @param $url + * * @return bool|mixed|string */ public static function getFile($url) { $timeout = 15; - $useragent = "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"; + $useragent = 'Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0'; if (in_array('curl', get_loaded_extensions())) { # Fetch feed from URL @@ -32,7 +33,7 @@ final class Tools # FeedBurner requires a proper USER-AGENT... curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); - curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); + curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate'); curl_setopt($curl, CURLOPT_USERAGENT, $useragent); $data = curl_exec($curl); @@ -45,7 +46,7 @@ final class Tools array( 'http' => array( 'timeout' => $timeout, - 'header' => "User-Agent: ".$useragent, + 'header' => 'User-Agent: '.$useragent, 'follow_location' => true, ), 'ssl' => array( @@ -91,9 +92,10 @@ final class Tools } /** - * Encode a URL by using a salt + * Encode a URL by using a salt. * * @param $string + * * @return string */ public static function encodeString($string)