ForumHulp / uploadimage

Upload Images, a phpBB 3 extension enables you to upload images in your images folder of your board.
GNU General Public License v2.0
6 stars 3 forks source link

UnexpectedValueException #9

Open Leinad4Mind opened 4 years ago

Leinad4Mind commented 4 years ago

I'm getting this kind of error:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::construct(http://www...com/images/ui/): failed to open dir: not implemented' in ./ext/forumhulp/uploadimage/controller/admin_controller.php:157 Stack trace: #0 ./ext/forumhulp/uploadimage/controller/admin_controller.php(157): RecursiveDirectoryIterator->construct('http://www.live...', 12288) #1 ./ext/forumhulp/uploadimage/acp/uploadimage_module.php(75): forumhulp\uploadimage\controller\admin_controller->display_images() #2 ./includes/functions_module.php(674): forumhulp\uploadimage\acp\uploadimage_module->main('\forumhulp\uplo...', 'main') #3 ./adm/index.php(81): p_master->load_active() #4 {main} thrown in ./ext/forumhulp/uploadimage/controller/admin_controller.php on line 157

I read at phpbb: https://www.phpbb.com/community/viewtopic.php?f=501&t=2268786&start=15

And there are some extensions that could cause this, so I disabled one by one and found out that cBB Chat causes this.

If you could take a look I would appreciate. Thanks

Leinad4Mind commented 4 years ago

I've news about this.

Today I had some free time and I've saw that if I disabled cBB chat it solves this issue, but since I wanted to use cBB chat and this ext too, I decided to dig it up this is my findings.

If I've cBB Chat enabled defined('PHPBB_USE_BOARD_URL_PATH') returns true. If I disable cBB Chat then it returns false.

Since we've this line: $image_path = ((defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path) . 'images/' . $this->config['uploadimage_folder'] . '/';

Where $board_url = "https://www.mywebsite.com/images/ui/" and $corrected_path = "./../"

With the ternary returning true with cbbchat installed it uses a full path url and the bug rises up.

So by changing that line to: $image_path = $corrected_path . 'images/' . $this->config['uploadimage_folder'] . '/';

Solves the problem.

But I dont know why you are doing that ternary in the first place. And the real problem could be to fix cBB Chat instead probably.

let me know!