composer-update-patch

This commit is contained in:
Manish Verma
2016-11-03 05:44:29 +05:30
parent 2dca47f5a4
commit 5d49d384a0
5118 changed files with 51603 additions and 122575 deletions

View File

@@ -85,7 +85,7 @@ class Util
$normalized = preg_replace('#\p{C}+|^\./#u', '', $path);
$normalized = static::normalizeRelativePath($normalized);
if (preg_match('#/\.{2}|^\.{2}/|^\.{2}$#', $normalized)) {
if (preg_match('#(^|/)\.{2}(/|$)#', $normalized)) {
throw new LogicException(
'Path is outside of the defined root, path: [' . $path . '], resolved: [' . $normalized . ']'
);
@@ -110,7 +110,7 @@ class Util
$path = preg_replace('#/\.(?=/)|^\./|(/|^)\./?$#', '', $path);
// Regex for resolving relative paths
$regex = '#/*[^/\.]+/\.\.#Uu';
$regex = '#/*[^/\.]+/\.\.(?=/|$)#Uu';
while (preg_match($regex, $path)) {
$path = preg_replace($regex, '', $path);