Merge pull request #8865 from Ayesh/regex-improvements

Regex improvements with unnecessary `.*` matchers
main
Jordi Boggiano 4 years ago committed by GitHub
commit c39391323d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,7 +178,7 @@ class SvnDownloader extends VcsDownloader
*/
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
$command = sprintf('svn info --non-interactive --xml %s', ProcessExecutor::escape($path));
if (0 !== $this->process->execute($command, $output, $path)) {

@ -997,7 +997,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
}
// 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);
}

Loading…
Cancel
Save