Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionRequest.php
| Show First 20 Lines • Show All 483 Lines • ▼ Show 20 Lines | if ($supports_branches) { | ||||
| $result['branch'] = phutil_unescape_uri_path_component($matches[1]); | $result['branch'] = phutil_unescape_uri_path_component($matches[1]); | ||||
| $blob = substr($blob, strlen($matches[1]) + 1); | $blob = substr($blob, strlen($matches[1]) + 1); | ||||
| } | } | ||||
| } | } | ||||
| // Consume the back part of the URI, up to the first "$". Use a negative | // Consume the back part of the URI, up to the first "$". Use a negative | ||||
| // lookbehind to prevent matching '$$'. We double the '$' symbol when | // lookbehind to prevent matching '$$'. We double the '$' symbol when | ||||
| // encoding so that files with names like "money/$100" will survive. | // encoding so that files with names like "money/$100" will survive. | ||||
| $pattern = '@(?:(?:^|[^$])(?:[$][$])*)[$]([\d-,]+)$@'; | $pattern = '@(?:(?:^|[^$])(?:[$][$])*)[$]([\d,-]+)$@'; | ||||
| if (preg_match($pattern, $blob, $matches)) { | if (preg_match($pattern, $blob, $matches)) { | ||||
| $result['line'] = $matches[1]; | $result['line'] = $matches[1]; | ||||
| $blob = substr($blob, 0, -(strlen($matches[1]) + 1)); | $blob = substr($blob, 0, -(strlen($matches[1]) + 1)); | ||||
| } | } | ||||
| // We've consumed the line number if it exists, so unescape "$" in the | // We've consumed the line number if it exists, so unescape "$" in the | ||||
| // rest of the string. | // rest of the string. | ||||
| $blob = str_replace('$$', '$', $blob); | $blob = str_replace('$$', '$', $blob); | ||||
| ▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines | |||||