Skip to content

Commit

Permalink
Fix #79146: cscript can fail to run on some systems
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
clarodeus authored and cmb69 committed Jan 21, 2020
1 parent b67fc51 commit 3046e35
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PHP NEWS
- Core:
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
supported). (Nikita)
. Fixed bug ##79146 (cscript can fail to run on some systems). (clarodeus)

- CURL:
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
Expand Down
2 changes: 1 addition & 1 deletion buildconf.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
cscript /nologo win32\build\buildconf.js %*
cscript /nologo /e:jscript win32\build\buildconf.js %*
SET PHP_BUILDCONF_PATH=%~dp0
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
SET PHP_SDK_SCRIPT_PATH=
Expand Down
2 changes: 1 addition & 1 deletion win32/build/buildconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@ C.WriteBlankLines(1);
C.Write(file_get_contents("win32/build/configure.tail"));

B.WriteLine("@echo off");
B.WriteLine("cscript /nologo configure.js %*");
B.WriteLine("cscript /nologo /e:jscript configure.js %*");
2 changes: 1 addition & 1 deletion win32/build/configure.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
cscript /nologo configure.js %*
cscript /nologo /e:jscript configure.js %*
2 changes: 1 addition & 1 deletion win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function conf_process_args()
var i, j;
var configure_help_mode = false;
var analyzed = false;
var nice = "cscript /nologo configure.js ";
var nice = "cscript /nologo /e:jscript configure.js ";
var disable_all = false;

args = WScript.Arguments;
Expand Down
2 changes: 1 addition & 1 deletion win32/build/phpize.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
SET PHP_BUILDCONF_PATH=%~dp0
cscript /nologo %PHP_BUILDCONF_PATH%\script\phpize.js %*
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
IF NOT EXIST configure.bat (
echo Error generating configure script, configure script was not copied
exit /b 3
Expand Down
2 changes: 1 addition & 1 deletion win32/build/phpize.js.in
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,6 @@ C.WriteBlankLines(1);
C.Write(file_get_contents(PHP_DIR + "\\script\\configure.tail"));

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

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

0 comments on commit 3046e35

Please sign in to comment.