Skip to content

Don't quote commands on Windows anymore (#210)#213

Merged
michael-o merged 1 commit intomasterfrom
dont-quote
Jan 30, 2024
Merged

Don't quote commands on Windows anymore (#210)#213
michael-o merged 1 commit intomasterfrom
dont-quote

Conversation

@michael-o
Copy link
Copy Markdown
Member

With PHP 8.0.0-RC2 the command handling has been simplified and improved. Quoting can be removed since it is now handled properly internally.

See also php/php-src@9ca449e

This fixes #210 and closes #213

@michael-o
Copy link
Copy Markdown
Member Author

@raspopov Please have a look.

@raspopov
Copy link
Copy Markdown
Contributor

Looks good but I thought about something like that:

	if ($config->serverIsWindows) {
		if (!strpos($cmd, '>') && !strpos($cmd, '|')) {
			$opts = array('bypass_shell' => true);
		} else if ( PHP_MAJOR_VERSION < 8 ) {
			$cmd = '"'.$cmd.'"';
		}
	}

Not sure what system requirement for WebSVN is.

@michael-o
Copy link
Copy Markdown
Member Author

Looks good but I thought about something like that:

	if ($config->serverIsWindows) {
		if (!strpos($cmd, '>') && !strpos($cmd, '|')) {
			$opts = array('bypass_shell' => true);
		} else if ( PHP_MAJOR_VERSION < 8 ) {
			$cmd = '"'.$cmd.'"';
		}
	}

Not sure what system requirement for WebSVN is.

You are right, it still works with 7.x technically. I will modify.

michael-o added a commit that referenced this pull request Jan 30, 2024
With PHP 8.0.0-RC2 the command handling has been simplified and improved.
Quoting can be removed since it is now handled properly internally.

See also php/php-src@9ca449e

This fixes #210 and closes #213
@michael-o
Copy link
Copy Markdown
Member Author

Please check again.

With PHP 8.0.0-RC2 the command handling has been simplified and improved.
Quoting can be removed since it is now handled properly internally.

See also php/php-src@9ca449e

This fixes #210 and closes #213
@raspopov
Copy link
Copy Markdown
Contributor

Good work! 👌

@michael-o michael-o merged commit cd5c5f2 into master Jan 30, 2024
@michael-o michael-o deleted the dont-quote branch January 30, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebSVN's diffs do not work on Windows

2 participants