浏览代码

Allow also non CLI

mscherer 2 年之前
父节点
当前提交
fb4299527b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Utility/Utility.php

+ 1 - 1
src/Utility/Utility.php

@@ -378,7 +378,7 @@ class Utility {
 			}
 
 			if ($detectHttps === null) {
-				$detectHttps = !Configure::read('debug');
+				$detectHttps = !Configure::read('debug') || PHP_SAPI !== 'cli';
 			}
 			if ($prefix === 'http://' && $detectHttps && static::urlExists('https://' . $url)) {
 				$modifiedUrl = 'https://' . $url;