Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2009 at 00:26 UTC
Updated:
8 Jan 2010 at 00:01 UTC
this patch removes the check_plain() from urls inside t() in the system.install file
(and also replaces tabulators with spaces.)
but one thing I do not understand in this file. see this example:
function system_update_7003() {
...
$messages[] = t('The host !host is no longer blocked because it is not a valid IP address.', array('!host' => $invalid_host ));
}
}
if (isset($invalid_host)) {
drupal_set_message('Drupal no longer supports wildcard IP address blocking. Visitors whose IP addresses match ranges you have previously set using <em>access rules</em> will no longer be blocked from your site when you put the site online. See the <a href="http://drupal.org/node/24302">IP address and referrer blocking Handbook page</a> for alternative methods.', 'warning');
}
t() is used on a variable which is not even used, and after that the drupal_set_message() is not translated. The messages are not translated in this file.. Is it a bug or is it some kind of limitation of drupal_set_message() inside update?
| Comment | File | Size | Author |
|---|---|---|---|
| url_in_t.patch | 9 KB | pasqualle |
Comments
Comment #1
damien tournoud commentedThose @url are correct. I'm not sure why you want to change them.
Comment #2
pasquallehttp://api.drupal.org/api/function/t/7
Comment #3
pasquallethis is the common format used in Drupal:
<a href="!url">Comment #4
damien tournoud commentedThe documentation is wrong. The URL is being output in an HTML context here, so it needs to be encoded.
See this snippet from the l() function:
Comment #5
sunWhat's unclear here?
Comment #6
pasqualleI do not know what are you trying to explain me, why do you need an extra check_plain() for?
so, I wrote a test for every !url in the patch:
test.php
I think you know the result..
Comment #7
damien tournoud commentedAs explained, all HTML arguments need to be encoded.
URLs can contain any kind of invalid HTML characters, most notably '&'.