Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mime types broke my feeds #818

Closed
Kourai opened this issue Sep 11, 2018 · 7 comments
Closed

Mime types broke my feeds #818

Kourai opened this issue Sep 11, 2018 · 7 comments
Labels
Bug-Report Confirmed bug report

Comments

@Kourai
Copy link

Kourai commented Sep 11, 2018

I just update to the latest release, and since then, several of my feeds seems to be broken.

I Can't access them using firefox (it just download a text file).
Chrome seems to display the text file directly.

All of text files have something in comon and begin with 👍
<br /> <b>Warning</b>: is_file(): open_basedir restriction in effect. File(/etc/mime.types) is not within the allowed path(s): (/home/users3/j/[my_id]:/home/temporaire/upload:/tmp:/usr/local/lib/php:/usr/local/lib/ZFramework:/dev/urandom) in <b>/home/users3/j/[my_id]/www/kourai/rss-bridge/lib/contents.php</b> on line <b>172</b><br />

(Then, it's the regular
<?xml version="1.0" encoding="UTF-8"?> that I expected)

Most of the broken one are using the wordpress bridge, or the Instagram bridge.

I'm on a shared host, so there's no way I can modify my open_basedir configuration...

Any idea ?
(Other wise, I'll just rollback to the previous version!)

@Kourai Kourai changed the title Mime types broke the feeds Mime types broke my feeds Sep 11, 2018
@ORelio
Copy link
Contributor

ORelio commented Sep 12, 2018

Didn't know is_file could pose an issue on some shared hosts, that mean we need additional checks before calling that fonction. I'll look into this.

Meanwhile, please put error_reporting(0); on top of index.php to mute the warning, that should restore your feeds

@Kourai
Copy link
Author

Kourai commented Sep 12, 2018

Works perfectly ! :)

Thanks!

@ORelio
Copy link
Contributor

ORelio commented Sep 12, 2018

According to this thread (https://stackoverflow.com/questions/21427211/) there is no proper way of checking if a file can be accessed, other than manually parsing the open_basedir whitelist or muting errors on the is_readable function. Given that constraint, do you think it is reasonable to do this:

if(@is_readble('/etc/mime.types')) {
   //...

I know using @ is a bad practice but it seems like that's the only straightforward way...
Any thought on this, @logmanoriginal @teromene?

@teromene
Copy link
Member

Would a try/catch block be able to silence this ? If not, I am OK with using @

@ORelio
Copy link
Contributor

ORelio commented Sep 13, 2018

After some research, I managed to enable open_basedir restriction on my server to start investigating. A try/catch does not seems to do anything. According to this thread (https://stackoverflow.com/questions/1241728/) it is possible catch it by messing with error handlers, but that seems even more hacky than just using a single @. I'll fix it that way and leave a comment.

logmanoriginal pushed a commit that referenced this issue Sep 15, 2018
@logmanoriginal logmanoriginal added the Bug-Report Confirmed bug report label Sep 15, 2018
@logmanoriginal
Copy link
Member

@Kourai Can you confirm the bug is fixed in master?

@Kourai
Copy link
Author

Kourai commented Sep 17, 2018

Hey! Sorry for the delay, I wasn't home this weekend!
I just updated to master, and actualize all my bridged-feeds, and everything is fine! :)

Thanks again for fixing things so quickly! ❤️

@Kourai Kourai closed this as completed Sep 17, 2018
infominer33 pushed a commit to web-work-tools/rss-bridge that referenced this issue Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Report Confirmed bug report
Projects
None yet
Development

No branches or pull requests

4 participants