From c8df2b9821059912253eca35a0822a02addd390b Mon Sep 17 00:00:00 2001 From: huangjx Date: Sat, 5 Mar 2022 08:10:22 +0800 Subject: [PATCH] fixed #35;keep space chars in filename instead of replacing it with hyphens --- lib/Tools/Helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Tools/Helper.php b/lib/Tools/Helper.php index b81a43c..1f452bd 100644 --- a/lib/Tools/Helper.php +++ b/lib/Tools/Helper.php @@ -127,7 +127,7 @@ class Helper '/–/' => '-', // UTF-8 hyphen to "normal" hyphen '/[’‘‹›‚]/u' => '', // Literally a single quote '/[“”«»„]/u' => '', // Double quote - '/ /' => '_', // nonbreaking space(equiv. to 0x160) + //'/ /' => '_', // nonbreaking space(equiv. to 0x160) // '/[^a-z0-9_\s.-]/i' => '_', ); return preg_replace(array_keys($replace), array_values($replace), $string); @@ -327,9 +327,9 @@ class Helper return self::doSignal($pid, 9); } - public static function pythonInstalled() + public static function pythonInstalled(): bool { - return (bool) self::findBinaryPath('python'); + return (self::findBinaryPath('python') || self::findBinaryPath('python3')); } public static function findSearchSites($dir, $suffix = 'php'): array