sanitizing.lib.php

来自「架設ROSE私服必備之物 ROSE數據庫」· PHP 代码 · 共 41 行

PHP
41
字号
<?php/* $Id: sanitizing.lib.php 7802 2005-11-17 13:12:58Z cybot_tm $ */// vim: expandtab sw=4 ts=4 sts=4:/** * Sanitizes $message, taking into account our special codes * for formatting * * @param   string   the message * * @return  string   the sanitized message * * @access  public */function PMA_sanitize($message){    $replace_pairs = array(        '<'         => '&lt;',        '>'         => '&gt;',        '[i]'       => '<em>',      // deprecated by em        '[/i]'      => '</em>',     // deprecated by em        '[em]'      => '<em>',        '[/em]'     => '</em>',        '[b]'       => '<strong>',  // deprecated by strong        '[/b]'      => '</strong>', // deprecated by strong        '[strong]'  => '<strong>',        '[/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));}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?