-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed open_basedir restriction warning in Query Monitor.
- Loading branch information
1 parent
3f8c7ad
commit af2613b
Showing
4 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* CSS class file. | ||
* | ||
* @package hcaptcha-wp | ||
*/ | ||
|
||
namespace HCaptcha\Helpers\Minify; | ||
|
||
use HCaptcha\Vendors\MatthiasMullie\Minify\CSS as MinifyCSS; | ||
|
||
/** | ||
* Class CSS. | ||
*/ | ||
class CSS extends MinifyCSS { | ||
|
||
/** | ||
* Check if the path is a regular file and can be read. | ||
* | ||
* @param string $path A path. | ||
* | ||
* @return bool | ||
* @noinspection PhpMissingReturnTypeInspection | ||
* @noinspection ReturnTypeCanBeDeclaredInspection | ||
*/ | ||
protected function canImportFile( $path ) { | ||
// It is the fix of the library code. | ||
// The realpath() function does not throw warning when file does not exist. | ||
// In the parent method, is_file is silenced, but with the Query Monitor plugin, it becomes visible. | ||
if ( ! realpath( $path ) ) { | ||
return \false; | ||
} | ||
|
||
return parent::canImportFile( $path ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* JS class file. | ||
* | ||
* @package hcaptcha-wp | ||
*/ | ||
|
||
namespace HCaptcha\Helpers\Minify; | ||
|
||
use HCaptcha\Vendors\MatthiasMullie\Minify\JS as MinifyJS; | ||
|
||
/** | ||
* Class JS. | ||
*/ | ||
class JS extends MinifyJS { | ||
|
||
/** | ||
* Check if the path is a regular file and can be read. | ||
* | ||
* @param string $path A path. | ||
* | ||
* @return bool | ||
* @noinspection PhpMissingReturnTypeInspection | ||
* @noinspection ReturnTypeCanBeDeclaredInspection | ||
*/ | ||
protected function canImportFile( $path ) { | ||
// It is the fix of the library code. | ||
// The realpath() function does not throw warning when file does not exist. | ||
// In the parent method, is_file is silenced, but with the Query Monitor plugin, it becomes visible. | ||
if ( ! realpath( $path ) ) { | ||
return \false; | ||
} | ||
|
||
return parent::canImportFile( $path ); | ||
} | ||
} |