]> git.wh0rd.org Git - tt-rss.git/commitdiff
Enable cookies when fetching feeds with curl
authorFelipe Sateler <fsateler@gmail.com>
Fri, 4 Oct 2013 20:18:30 +0000 (17:18 -0300)
committerFelipe Sateler <fsateler@gmail.com>
Fri, 4 Oct 2013 20:56:46 +0000 (17:56 -0300)
If a feed requires cookies, curl needs to have them active in order to
access it. This is done by setting the COOKIE_JAR option.
Since we do not need the actual cookie jar, send it to /dev/null, curl
will still have a valid in-memory cookie jar.

include/functions.php

index e9b1270fb6eff60a994170bb919982b6da168493..7c67b6d099dc63f5fcffd18ab2c8d0824e2b5a59 100644 (file)
                        curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
                        curl_setopt($ch, CURLOPT_ENCODING, "");
                        curl_setopt($ch, CURLOPT_REFERER, $url);
+                       curl_setopt($ch, CURLOPT_COOKIEJAR, "/dev/null");
 
                        if (defined('_CURL_HTTP_PROXY')) {
                                curl_setopt($ch, CURLOPT_PROXY, _CURL_HTTP_PROXY);