]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
af_comics: add happyjar
[tt-rss.git] / include / functions.php
index 821ca83f07344a5b1211727b5f764e57f8ee9bea..8e8832a58a2dedb3200c9682e9b64fd6d48fb020 100644 (file)
                }
        }
 
-       function fetch_file_contents($url, $type = false, $login = false, $pass = false, $post_query = false, $timeout = false, $timestamp = 0) {
+       function fetch_file_contents($url, $type = false, $login = false, $pass = false, $post_query = false, $timeout = false, $timestamp = 0, $useragent = false) {
 
                global $fetch_last_error;
                global $fetch_last_error_code;
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
-                       curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
+                       curl_setopt($ch, CURLOPT_USERAGENT, $useragent ? $useragent :
+                               SELF_USER_AGENT);
                        curl_setopt($ch, CURLOPT_ENCODING, "");
                        curl_setopt($ch, CURLOPT_REFERER, $url);