'; } /** * Callback function for replacing [doc@anchor] links in bb code. * * @param array $found Array of preg matches * * @return string Replaced string */ function PMA_replaceDocLink($found) { if (count($found) >= 4) { $page = $found[1]; $anchor = $found[3]; } else { $anchor = $found[1]; if (strncmp('faq', $anchor, 3) == 0) { $page = 'faq'; } else if (strncmp('cfg', $anchor, 3) == 0) { $page = 'config'; } else { /* Guess */ $page = 'setup'; } } $link = PMA\libraries\Util::getDocuLink($page, $anchor); return ''; } /** * Sanitizes $message, taking into account our special codes * for formatting. * * If you want to include result in element attribute, you should escape it. * * Examples: * *

* *
bar * * @param string $message the message * @param boolean $escape whether to escape html in result * @param boolean $safe whether string is safe (can keep < and > chars) * * @return string the sanitized message */ function PMA_sanitize($message, $escape = false, $safe = false) { if (!$safe) { $message = strtr($message, array('<' => '<', '>' => '>')); } /* Interpret bb code */ $replace_pairs = array( '[em]' => '', '[/em]' => '', '[strong]' => '', '[/strong]' => '', '[code]' => '', '[/code]' => '', '[kbd]' => '', '[/kbd]' => '', '[br]' => '
', '[/a]' => '', '[/doc]' => '', '[sup]' => '', '[/sup]' => '', // used in common.inc.php: '[conferr]' => '