@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Correct an ambiguous regexp in DiffusionRequest

Summary:
See <https://discourse.phabricator-community.org/t/diffusionrequest-regex-error/2057/>.

The intent of `[\d-,]` is "digits, hyphen, and comma" but `[x-y]` means "character range x-y".

Specify `[\d,-]` instead to disambiguate the hyphen as "literal hyphen", not a character range marker.

Test Plan: I can't reproduce the original error as reported, but browsed around Diffusion for a bit.

Reviewers: amckinley, avivey

Reviewed By: avivey

Differential Revision: https://secure.phabricator.com/D19770

+1 -1
+1 -1
src/applications/diffusion/request/DiffusionRequest.php
··· 489 489 // Consume the back part of the URI, up to the first "$". Use a negative 490 490 // lookbehind to prevent matching '$$'. We double the '$' symbol when 491 491 // encoding so that files with names like "money/$100" will survive. 492 - $pattern = '@(?:(?:^|[^$])(?:[$][$])*)[$]([\d-,]+)$@'; 492 + $pattern = '@(?:(?:^|[^$])(?:[$][$])*)[$]([\d,-]+)$@'; 493 493 if (preg_match($pattern, $blob, $matches)) { 494 494 $result['line'] = $matches[1]; 495 495 $blob = substr($blob, 0, -(strlen($matches[1]) + 1));