Use noreferrer in external links

This commit is contained in:
Jakub Vrana 2014-03-21 22:32:31 -07:00
parent 6980d1a1d2
commit cd64b707bd
2 changed files with 2 additions and 2 deletions

View file

@ -225,7 +225,7 @@ username.form['auth[driver]'].onchange();
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($original));
}
return ($link ? "<a href='" . h($link) . "'>$return</a>" : $return);
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>" : $return);
}
/** Value conversion used in select and edit

View file

@ -183,7 +183,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = ($val ? lang('yes') : lang('no'));
}
if ($link) {
$return = "<a href='$link'>$return</a>";
$return = "<a href='$link'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>";
}
if (!$link && !like_bool($field) && preg_match('~int|float|double|decimal~', $field["type"])) {
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>