1
0
Fork 0

Merge pull request #8865 from Ayesh/regex-improvements

Regex improvements with unnecessary `.*` matchers
pull/8869/head
Jordi Boggiano 2020-05-04 09:37:52 +02:00 committed by GitHub
commit c39391323d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ class SvnDownloader extends VcsDownloader
*/ */
protected function getCommitLogs($fromReference, $toReference, $path) protected function getCommitLogs($fromReference, $toReference, $path)
{ {
if (preg_match('{.*@(\d+)$}', $fromReference) && preg_match('{.*@(\d+)$}', $toReference)) { if (preg_match('{@(\d+)$}', $fromReference) && preg_match('{@(\d+)$}', $toReference)) {
// retrieve the svn base url from the checkout folder // retrieve the svn base url from the checkout folder
$command = sprintf('svn info --non-interactive --xml %s', ProcessExecutor::escape($path)); $command = sprintf('svn info --non-interactive --xml %s', ProcessExecutor::escape($path));
if (0 !== $this->process->execute($command, $output, $path)) { if (0 !== $this->process->execute($command, $output, $path)) {

View File

@ -997,7 +997,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
} }
// url-encode $ signs in URLs as bad proxies choke on them // url-encode $ signs in URLs as bad proxies choke on them
if (($pos = strpos($filename, '$')) && preg_match('{^https?://.*}i', $filename)) { if (($pos = strpos($filename, '$')) && preg_match('{^https?://}i', $filename)) {
$filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos + 1); $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos + 1);
} }