SimplePie: Fix HTTP 301 permanent redirection (#3180)
* SimplePie: Fix HTTP 301 permanent redirection When adding feeds it worked fine, but detecting permanent redirects for existing feeds was sometimes broken (only when PHP open_basedir was not set). Indeed, using the built-in CURLOPT_FOLLOWLOCATION instead of the manual method in SimplePie hides the list of HTTP redirects along the way, and prevents the distinction of e.g. 301 vs. 302 redirects. This patch disables CURLOPT_FOLLOWLOCATION in SimplePie, and fixes the manual method at the same time. The use of CURLOPT_FOLLOWLOCATION was nevertheless not systematic (only when open_basedir was not set), so now there is only one logic independent of open_basedir. I will send a PR upstream to SimplePie. How to test: pick a feed with 301 redirection such as HTTP to HTTPS, e.g. http://ing.dk/rss/term/341 Manually change back to previous address (to simulate a feed that is changing address) Refresh feed and observe whether the 301 redirect is obeyed. * Wrong blankpull/3183/head
parent
bb9b166eb1
commit
1c0e7b4feb
1 changed files with 7 additions and 7 deletions
Loading…
Reference in new issue