Bad file mapping to URL causes open_basedir error
-
Hi,
Query monitor extension allowed me to spot this:
is_file(): open_basedir restriction in effect. File(/https://terageek.org/wp-content/plugins/hcaptcha-for-forms-and-more/assets/images/hcaptcha-div-logo.svg) is not within the allowed path(s): (/var/www/vhosts/terageek.org/:/tmp/)
wp-content/plugins/hcaptcha-for-forms-and-more/vendors/matthiasmullie/minify/src/Minify.php:439
1 Extension : hcaptcha-for-forms-and-moreIt appears it tries to look for file “/https://” instead of the actual file or actual URL.
I guess there’s a bogus in your code.
Relevant code :
425 /**
426 * Check if the path is a regular file and can be read.
427 *
428 * @param string $path
429 *
430 * @return bool
431 */
432 protected function canImportFile($path)
433 {
434 $parsed = parse_url($path);
435 if (isset($parsed['host']) || isset($parsed['query'])) {
436 return \false;
437 }
438 try {
439 return strlen($path) < \PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
440 } catch (\Exception $e) {
441 return \false;
442 }
443 }I’m no PHP dev, but I guess there is something wrong with this path.
Note: Latest WP and plugin. PHP 8.2 & 8.3 tested: same issue.
I hope this is useful for the plugin development.
Best regards.
The page I need help with: [log in to see the link]
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.