Skip to content
Browse files

# Additional escaping for backslashes on windows.

git-svn-id: svn://pureenergy.cc/systemProcess/trunk@24 31603df9-db43-4f3c-b741-60c6c1c776c2
  • Loading branch information...
1 parent 8674d9d commit 48fee259e3820919df493e8e974ab2e9a6bb76cd @kore kore committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/classes/argument/escaped.php
View
7 src/classes/argument/escaped.php
@@ -39,6 +39,13 @@ class pbsEscapedArgument extends pbsArgument
*/
public function getPrepared()
{
+ if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' )
+ {
+ // Backslashes require additional escaping on windows, which is not
+ // handled by escapeshellarg itself.
+ $this->value = str_replace( '\\', '\\\\', $this->value );
+ }
+
return escapeshellarg( $this->value );
}
}

0 comments on commit 48fee25

Please sign in to comment.
Something went wrong with that request. Please try again.