irm-1.6-b3/MDB/Manager.php
/**
     * add escapecharacters to all special characters in a string
     *
     * @param string $string string that should be escaped
     * @return string escaped string
     * @access private
     */
add escapecharacters to all special characters in a string
@param string $string string that should be escaped
@return string escaped string
@access private
add escapecharacters to all special characters in a string @param string $string string that should be escaped @return string escaped string @access private
function _escapeSpecialCharacters($string)
    {
        if(gettype($string) != 'string') {
            $string = strval($string);
        }
        for($escaped = '', $character = 0;
            $character < strlen($string);
            $character++)
        {
            switch($string[$character]) {
                case '\"':
                case '>':
                case '<':
                case '&':
                    $code = ord($string[$character]);
                    break;
                default:
                    $code = ord($string[$character]);
                    if($code < 32 || $code>127) {
                        break;
                    }
                    $escaped .= $string[$character];
                    continue 2;
            }
            $escaped .= "&#$code;";
        }
        return($escaped);
    }
function _escapeSpecialCharacters ( $ string ) { if ( gettype ( $ string ) != 'string' ) { $ string = strval ( $ string ) ; } for ( $ escaped = '' , $ character = 0 ; $ character < strlen ( $ string ) ; $ character ++ ) { switch ( $ string [ $ character ] ) { case '\"' : case '>' : case '<' : case '&' : $ code = ord ( $ string [ $ character ] ) ; break ; default : $ code = ord ( $ string [ $ character ] ) ; if ( $ code < 32 || $ code > 127 ) { break ; } $ escaped .= $ string [ $ character ] ; continue 2 ; } $ escaped .= " &# $ code ; " ; } return ( $ escaped ) ; }
add escapecharacters to all special characters in a string
 @param string $string string that should be escaped
 @return string escaped string
 @access private
add escapecharacters to all special characters in a string @param string $string string that should be escaped @return string escaped string @access private