3 // vim: expandtab sw=4 ts=4 sts=4:
6 * Sanitizes $message, taking into account our special codes
9 * @param string the message
11 * @return string the sanitized message
15 function PMA_sanitize($message)
17 $replace_pairs = array(
20 '[i]' => '<em>', // deprecated by em
21 '[/i]' => '</em>', // deprecated by em
24 '[b]' => '<strong>', // deprecated by strong
25 '[/b]' => '</strong>', // deprecated by strong
26 '[strong]' => '<strong>',
27 '[/strong]' => '</strong>',
28 '[tt]' => '<code>', // deprecated by CODE or KBD
29 '[/tt]' => '</code>', // deprecated by CODE or KBD
31 '[/code]' => '</code>',
37 return preg_replace('/\[a@([^"@]*)@([^]"]*)\]/', '<a href="\1" target="\2">', strtr($message, $replace_pairs));