Error on "Theme Options"

More
6 months 3 weeks ago - 6 months 3 weeks ago #164456 by jansch2015
jansch2015 created the topic: Error on "Theme Options"

File Attachment:

File Name: PHPwarning.zip
File Size:6 KB
Hi


I get the attached error when trying to open "Theme options". I don't think its a bug since it works totally fine on my dev system (which is totally different, different server, different php version, etc.).

Attached you can find the error.

Any idea how this is caused?

I did not change anything on the themes. It's totally out of the box.

BR
Jan
Attachments:
Last Edit: 6 months 3 weeks ago by jansch2015.

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164461 by ollehar
ollehar replied the topic: Error on "Theme Options"
We need to know what $file really is here. Weirdly it's not included in the error message. You can also contact your hosting provider about open_basedir restriction.

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago - 6 months 3 weeks ago #164462 by ollehar
ollehar replied the topic: Error on "Theme Options"
Try setting debug => 2 in config.php and try again.
Last Edit: 6 months 3 weeks ago by ollehar.

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164473 by jansch2015
jansch2015 replied the topic: Error on "Theme Options"
This is on debug 2. It works fine on 0.

Based on the error message, $file is "..", which causes the error.

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164474 by ollehar
ollehar replied the topic: Error on "Theme Options"
Which theme?

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164475 by jansch2015
jansch2015 replied the topic: Error on "Theme Options"
Any of the 3 standard.

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164476 by ollehar
ollehar replied the topic: Error on "Theme Options"
Could it be that

$file = readdir($handle)

return files '.' and '..'? Could you disable line 344 and var_dump all the $file?

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164478 by ollehar
ollehar replied the topic: Error on "Theme Options"
Maybe we need this line?

stackoverflow.com/a/9697772/2138090

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164514 by jansch2015
jansch2015 replied the topic: Error on "Theme Options"
Correct!

Changing line 344 to
if ($file != ".." && $file != "." && !is_dir($file)) {
did the trick...

Could you add that to github since I'm not registered?

Cheers and thanks!

Please Log in or Create an account to join the conversation.

More
6 months 3 weeks ago #164529 by ollehar
ollehar replied the topic: Error on "Theme Options"
Yes, no problem. Thank you for your feedback!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!