Page MenuHomePhabricator

Update documentation for "uri.allowed-protocols"
ClosedPublic

Authored by epriestley on Apr 15 2019, 6:59 PM.
Tags
None
Referenced Files
F19837344: D20430.diff
Wed, Mar 11, 2:52 PM
F19810266: D20430.id48732.diff
Mar 3 2026, 6:19 PM
F19767628: D20430.diff
Feb 19 2026, 4:39 PM
F19303629: D20430.diff
Dec 24 2025, 3:25 AM
F19303232: D20430.diff
Dec 23 2025, 9:28 PM
F18842722: D20430.diff
Oct 28 2025, 5:58 PM
F18816919: D20430.diff
Oct 21 2025, 10:34 AM
F18791157: D20430.id48736.diff
Oct 16 2025, 4:27 AM
Subscribers

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey added a subscriber: avivey.
avivey added inline comments.
src/applications/config/option/PhabricatorSecurityConfigOptions.php
178

maybe pht should know %n for newline?

This revision is now accepted and ready to land.Apr 15 2019, 7:43 PM
This revision was automatically updated to reflect the committed changes.
src/applications/config/option/PhabricatorSecurityConfigOptions.php
178

Currently, pht() resolves more or less as an unmodified sprintf(), and PHP sprintf() doesn't know "%n", so we'd have to do at least a bit more mangling than we currently do (versus qsprintf(), which uses xsprintf() to parse the pattern and which we can add new "%" rules to pretty easily).

I'd be slightly worried about the performance cost to parse the pattern at runtime, although this particular rule could probably be safely implemented with str_replace() since it doesn't actually consume or interact with arguments.

We might also need to clean this up on the bin/i18n extract pathway, but this is doable.

Mostly, it's not obvious to me that "%n" is dramatically better than "\n", even though this "\n\n". construction is pretty awkward. We'd still probably end up with '%n%n'. as the most visually clear representation of the string, I think? Dropping the mixed single-quoted and double-quoted strings would be a little bit nice, but this doesn't seem like a huge step forward unless I'm misunderstanding?

A bigger win here might be teaching PHP some kind of better HEREDOC to get rid of ALL the string quoting nonsense, although I think this is a dangerous path to walk down.

We could also put blocks like this in some kind of external file, but then we need to teach a bunch of editors how to interact with that sensibly.

src/applications/config/option/PhabricatorSecurityConfigOptions.php
178

yeah, I was thinking we would inline %n%n into the preceding paragraph and get rid of both mixed quote and extra line, but it's probably more clear to just have it separate anyway. 🤷‍♂️