8
8
* License: GNU/GPLv2
9
9
* @see LICENSE.txt
10
10
*
11
- * This file: The loader (last modified: 2022.06.16 ).
11
+ * This file: The loader (last modified: 2022.06.19 ).
12
12
*/
13
13
14
14
namespace phpMussel \Core ;
@@ -751,7 +751,7 @@ public function pseudonymiseIP(string $IP): string
751
751
public function buildPath (string $ Path , bool $ PointsToFile = true ): string
752
752
{
753
753
/** Input guard. */
754
- if (! strlen ( $ Path) ) {
754
+ if ($ Path === '' ) {
755
755
return '' ;
756
756
}
757
757
@@ -810,7 +810,7 @@ public function buildPath(string $Path, bool $PointsToFile = true): string
810
810
*/
811
811
public function substrBeforeFirst (string $ Haystack , string $ Needle ): string
812
812
{
813
- return ! strlen ( $ Needle) ? '' : substr ($ Haystack , 0 , strpos ($ Haystack , $ Needle ));
813
+ return $ Needle === '' ? '' : substr ($ Haystack , 0 , strpos ($ Haystack , $ Needle ));
814
814
}
815
815
816
816
/**
@@ -834,7 +834,7 @@ public function substrAfterFirst(string $Haystack, string $Needle): string
834
834
*/
835
835
public function substrBeforeLast (string $ Haystack , string $ Needle ): string
836
836
{
837
- return ! strlen ( $ Needle) ? '' : substr ($ Haystack , 0 , strrpos ($ Haystack , $ Needle ));
837
+ return $ Needle === '' ? '' : substr ($ Haystack , 0 , strrpos ($ Haystack , $ Needle ));
838
838
}
839
839
840
840
/**
@@ -858,7 +858,7 @@ public function substrAfterLast(string $Haystack, string $Needle): string
858
858
public function readFileContent (string $ File ): string
859
859
{
860
860
/** Guard. */
861
- if (! strlen ( $ File) || !is_file ($ File ) || !is_readable ($ File )) {
861
+ if ($ File === '' || !is_file ($ File ) || !is_readable ($ File )) {
862
862
return '' ;
863
863
}
864
864
@@ -875,7 +875,7 @@ public function readFileContent(string $File): string
875
875
public function readFileContentGZ (string $ File ): string
876
876
{
877
877
/** Guard. */
878
- if (! strlen ( $ File) || !is_file ($ File ) || !is_readable ($ File ) || !$ Filesize = filesize ($ File )) {
878
+ if ($ File === '' || !is_file ($ File ) || !is_readable ($ File ) || !$ Filesize = filesize ($ File )) {
879
879
return '' ;
880
880
}
881
881
@@ -961,7 +961,7 @@ public function arrayify(&$Input): void
961
961
public function gZCompressFile (string $ File ): bool
962
962
{
963
963
/** Guard. */
964
- if (! strlen ( $ File) || !is_file ($ File ) || !is_readable ($ File )) {
964
+ if ($ File === '' || !is_file ($ File ) || !is_readable ($ File )) {
965
965
return false ;
966
966
}
967
967
0 commit comments