Mahiro Ando > EJS-Template-0.03 > EJS::Template::Util

Download:
EJS-Template-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

clean_text_ref

Usage:

    my $original_ref = \'some text';
    my $modified_ref = clean_text_ref($original_ref,
            $encode_utf8, $sanitize_utf8, $force_untaint);
    
    # where the last three arguments are boolean values
    # to indicate whether each conversion is required.

Depending on JavaScript engines, the text value passed from Perl to JavaScript needs to be cleaned up, especially related to the UTF8 flag and the taint mode.

It takes a reference to the text as the first argument, and returns a reference to the modified text, of if no conversion is necessary, the original reference is returned.

syntax highlighting: