dont use deprecated tags

This commit is contained in:
Sebastian Mendel
2005-11-17 13:12:58 +00:00
parent 54f548d678
commit a27ae8e91e
2 changed files with 19 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ $Source$
error.php if this fails too error.php if this fails too
- moved loading of extension out of libraries/dbi/* into - moved loading of extension out of libraries/dbi/* into
libraries/database_interface.lib.php libraries/database_interface.lib.php
* libraries/sanitizing.lib.php: dont use deprecated tags
2005-11-16 Marc Delisle <lem9@users.sourceforge.net> 2005-11-16 Marc Delisle <lem9@users.sourceforge.net>
* tbl_properties_links.php: missing menu tabs * tbl_properties_links.php: missing menu tabs

View File

@@ -15,16 +15,24 @@
function PMA_sanitize($message) function PMA_sanitize($message)
{ {
$replace_pairs = array( $replace_pairs = array(
'<' => '&lt;', '<' => '&lt;',
'>' => '&gt;', '>' => '&gt;',
'[i]' => '<i>', '[i]' => '<em>', // deprecated by em
'[/i]' => '</i>', '[/i]' => '</em>', // deprecated by em
'[b]' => '<b>', '[em]' => '<em>',
'[/b]' => '</b>', '[/em]' => '</em>',
'[tt]' => '<tt>', '[b]' => '<strong>', // deprecated by strong
'[/tt]' => '</tt>', '[/b]' => '</strong>', // deprecated by strong
'[br]' => '<br />', '[strong]' => '<strong>',
'[/a]' => '</a>', '[/strong]' => '</strong>',
'[tt]' => '<code>', // deprecated by CODE or KBD
'[/tt]' => '</code>', // deprecated by CODE or KBD
'[code]' => '<code>',
'[/code]' => '</code>',
'[kbd]' => '<kbd>',
'[/kbd]' => '</kbd>',
'[br]' => '<br />',
'[/a]' => '</a>',
); );
return preg_replace('/\[a@([^"@]*)@([^]"]*)\]/', '<a href="\1" target="\2">', strtr($message, $replace_pairs)); return preg_replace('/\[a@([^"@]*)@([^]"]*)\]/', '<a href="\1" target="\2">', strtr($message, $replace_pairs));
} }