php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65678
Patch cli_process_title_windows8_nonEnglish revision 2013-09-16 09:49 UTC by pierre dot renaudet at gmail dot com
revision 2013-09-16 09:48 UTC by pierre dot renaudet at gmail dot com

Patch cli_process_title_windows8_nonEnglish for Testing related Bug #65678

Patch version 2013-09-16 09:49 UTC

Return to Bug #65678 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: pierre.renaudet@gmail.com

diff --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)
   {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 19:01:32 2024 UTC