Support displaying in UTC (RFE #1440386).
[phpmyadmin/last10db.git] / libraries / sanitizing.lib.php
blobb36af285af7fbe0df3292d8c45b292031f480952
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Sanitizes $message, taking into account our special codes
7 * for formatting
9 * @param string the message
11 * @return string the sanitized message
13 * @access public
15 function PMA_sanitize($message)
17 $replace_pairs = array(
18 '<' => '&lt;',
19 '>' => '&gt;',
20 '[i]' => '<em>', // deprecated by em
21 '[/i]' => '</em>', // deprecated by em
22 '[em]' => '<em>',
23 '[/em]' => '</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
30 '[code]' => '<code>',
31 '[/code]' => '</code>',
32 '[kbd]' => '<kbd>',
33 '[/kbd]' => '</kbd>',
34 '[br]' => '<br />',
35 '[/a]' => '</a>',
37 return preg_replace('/\[a@([^"@]*)@([^]"]*)\]/', '<a href="\1" target="\2">', strtr($message, $replace_pairs));