Skip to content

Commit 3046e35

Browse files
clarodeuscmb69
authored andcommitted
Fix #79146: cscript can fail to run on some systems
In the buildconf and configure batch files, Windows' cscript utility was being run without the /e:jscript flag. This works on systems that have not had the default .js file association changed, but if .js has been re-associated to (say) an IDE, the batch files fail with the error message: Input Error: There is no script engine for file extension ".js".
1 parent b67fc51 commit 3046e35

File tree

7 files changed

+7
-6
lines changed

7 files changed

+7
-6
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP NEWS
55
- Core:
66
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
77
supported). (Nikita)
8+
. Fixed bug ##79146 (cscript can fail to run on some systems). (clarodeus)
89

910
- CURL:
1011
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).

buildconf.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
cscript /nologo win32\build\buildconf.js %*
2+
cscript /nologo /e:jscript win32\build\buildconf.js %*
33
SET PHP_BUILDCONF_PATH=%~dp0
44
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
55
SET PHP_SDK_SCRIPT_PATH=

win32/build/buildconf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,4 @@ C.WriteBlankLines(1);
258258
C.Write(file_get_contents("win32/build/configure.tail"));
259259

260260
B.WriteLine("@echo off");
261-
B.WriteLine("cscript /nologo configure.js %*");
261+
B.WriteLine("cscript /nologo /e:jscript configure.js %*");

win32/build/configure.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
cscript /nologo configure.js %*
2+
cscript /nologo /e:jscript configure.js %*

win32/build/confutils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function conf_process_args()
352352
var i, j;
353353
var configure_help_mode = false;
354354
var analyzed = false;
355-
var nice = "cscript /nologo configure.js ";
355+
var nice = "cscript /nologo /e:jscript configure.js ";
356356
var disable_all = false;
357357

358358
args = WScript.Arguments;

win32/build/phpize.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
SET PHP_BUILDCONF_PATH=%~dp0
3-
cscript /nologo %PHP_BUILDCONF_PATH%\script\phpize.js %*
3+
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
44
IF NOT EXIST configure.bat (
55
echo Error generating configure script, configure script was not copied
66
exit /b 3

win32/build/phpize.js.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,6 @@ C.WriteBlankLines(1);
260260
C.Write(file_get_contents(PHP_DIR + "\\script\\configure.tail"));
261261

262262
B.WriteLine("@echo off");
263-
B.WriteLine("cscript /nologo configure.js %*");
263+
B.WriteLine("cscript /nologo /e:jscript configure.js %*");
264264

265265
FSO.CopyFile(PHP_DIR + "\\script\\run-tests.php", "run-tests.php", true);

0 commit comments

Comments
 (0)