Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2015 at 18:14 UTC
Updated:
15 Sep 2015 at 18:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerI think this is as minimal as we want.
Comment #3
effulgentsia commentedThanks for opening this as a separate issue.
This is as minimal as I would want.
I'm open to us choosing a different prefix per #2565895-50: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols.
Comment #4
lauriiiJust a very small nit but have could be after that :)
Comment #5
stefan.r commentedIn #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols some concerns were raised about calling it ":", any thoughts on using another character? I think someone mentioned "~" earlier?
Comment #6
effulgentsia commentedKeeping up with reviews (#4) while we await discussion on #5.
Comment #7
lauriiiDon't know if it makes any difference but at least in my keyboard making ~ is a lot harder than :
Comment #8
dawehnerWell, ideally it would be "@", given its usage in mails, given that this clearly indicates a URL. For me ":" is the next character which appears often in URLs. ~ though is just a random character.
Well, my goal was to conflict as less as possible with the other issue.
This is just a small improvement to the way how we deal with data providers.
Comment #9
effulgentsia commentedI don't know what URLs you work with, but for me, the character I see most often is "/" :) Maybe that would help convey "this is a URL", but it would not convey "and that's important because of xss injection via untrusted protocols". In other words, the sanitization does (will do) nothing special related to "/" characters within the value, but maybe that's ok, since that's an implementation detail anyway.
Comment #10
lauriiiOther suggestions from me are # and +, both simply because they should exist in many of the keyboards and at least for me both of them are still easier than ~.
Comment #11
dawehnerWell, for absolute URLs, the first non alphabet character is always a ":" :) For me "/" feels a bit odd, given that people could use it in the
t()string itself.Comment #12
effulgentsia commentedJust for completeness, I'd like to ask if ":" is really a bad choice. #2565895-50: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols correctly points out that PDO placeholders always use ":" regardless of whether it's a URL or not, but:
$database->query()to be very commonly used by module developers? Given that $database->select(), $database->update(), etc. are generally better choices, and using even higher-level APIs like $config, $entity, etc. is an even better choice than coupling directly to a relational database.$database->query()andt()occupy sufficiently different mental compartments that their placeholder syntax can also be remembered contextually?Comment #13
dawehnerWell, I think developers are intelligent enough to be able to distinct between the context of t()/formatString() and database queries. They are two different domains, as you said.
Comment #14
xjmI think we agreed on the call to go ahead with #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols straightaway, so this can probably be closed as duplicate then?
Comment #15
effulgentsia commentedYep.