Page MenuHomePhabricator

Hyperlink URLs from form input with <a href="URL">URL</a> after escape()ing
Open, LowPublic

Description

all the templates need to show the file data fields as |safe for this, so be sure to call escape()

Event Timeline

Jsalsman created this task.Jul 3 2016, 11:54 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 3 2016, 11:54 AM

@prnk28: If this is done, is there a reason to not change the task status to resolved?

I'll get these. @Aklapper the phabricator tasks are out of synch with the
other tasks in the etherpad and chat logs, but this one is still valid so
let me do this.

@prnk I am thinking of pulling all the templates into a single file with
string constants, but am afraid that would crash syntax highlighting
somewhere, so you please work on the scripts to POST to /ask or create -q
file sets for now while I get that part, please. Do you think we should
include the last N filenumbers with -d files when /inspect is given no
arguments, in addition to the summary statistics header? And to answer your
question about what pull-down menus have over checkboxes for categories,
I'm not sure.

Jsalsman lowered the priority of this task from High to Low.Jul 8 2016, 5:41 AM

Most of this is done in https://github.com/jsalsman/minireview/commit/376d42656098db23ca6cf57d8ab663679a73482b

But it still needs a better URL regexp, and "include the last N filenumbers with -d files when /inspect is given no
arguments, in addition to the summary statistics header" should probably happen, too

@Aklapper , we were wondering how hyperlinking of urls is handled on Phabricator. It seems to catch most urls. I am looking for a regex pattern that's stronger than the one we are already using in our project . Could you direct me towards any useful resources in this regard?

@Aklapper, @prnk28 is asking about regexps which match URLs with both
unicode and internal matched parentheses (as are relatively more common in
Wikipedia URLs) but also properly match a URL enclosed in external
parentheses. Here is what I found:

http://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string

Would it be better to get the regex that the wikitext parser uses instead
of the one phabricator uses?

P.S. http://stackoverflow.com/a/37960256 has specific provisions for
Unicode, I should say.

@prnk28: Not sure, sorry... Regex code is either in https://github.com/phacility/libphutil/ or https://github.com/phacility/phabricator/ . Maybe ask in #phabricator on Freenode IRC.