![]() |
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch cli_process_title_windows8_nonEnglish for Testing related Bug #65678Patch version 2013-09-16 09:49 UTC Return to Bug #65678 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions:Developer: pierre.renaudet@gmail.comdiff --git a/sapi/cli/tests/cli_process_title_windows.phpt b/sapi/cli/tests/cli_process_title_windows.phpt index 309c09c..472f9c1 100644 --- a/sapi/cli/tests/cli_process_title_windows.phpt +++ b/sapi/cli/tests/cli_process_title_windows.phpt @@ -20,7 +20,7 @@ // no warnings/errors. $is_windows8 = false; -$ps_output = shell_exec("PowerShell \"(Get-Host).UI.RawUI.WindowTitle\""); +$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\""); if ($ps_output === null) { echo "Get-Host failed\n"; @@ -28,7 +28,8 @@ } $ps_output = trim($ps_output); -if (($ps_output == "Windows PowerShell") || ($ps_output == "Administrator: Windows PowerShell")) +$end_title_windows8 = ": Windows PowerShell"; +if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8)) $is_windows8 = true; echo "*** Testing setting the process title ***\n"; @@ -45,7 +46,7 @@ } else { - $loaded_title = shell_exec("PowerShell \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); + $loaded_title = shell_exec("PowerShell -NoProfile \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); if ($loaded_title === null) { |
![]() All rights reserved. |
Last updated: Fri May 02 11:01:28 2025 UTC |