symfony API

EscapingHelper Functions

« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

The functions are primarily used by the output escaping component.

Function Summary

  • string esc_entities($value)
    Runs the PHP function htmlentities on the value passed.
  • string esc_js($value)
    A function that c-escapes a string after applying {@link esc_entities()}. The
  • string esc_js_no_entities($value)
    A function the c-escapes a string, making it suitable to be placed in a
  • string esc_raw($value)
    An identity function that merely returns that which it is given, the purpose
  • string esc_specialchars($value)
    Runs the PHP function htmlspecialchars on the value passed.

Function Details

  • (string) esc_entities ($value) Browse code

    $value the value to escape

    Runs the PHP function htmlentities on the value passed.

    returns the escaped value

  • (string) esc_js ($value) Browse code

    $value the value to escape

    A function that c-escapes a string after applying {@link esc_entities()}. The

    assumption is that the value will be used to generate dynamic HTML in some
    way and the safest way to prevent mishap is to assume the value should have
    HTML entities set properly.

    The {@link esc_js_no_entities()} method should be used to escape a string
    that is ultimately not going to end up as text in an HTML document.

    returns the escaped value

  • (string) esc_js_no_entities ($value) Browse code

    $value the value to escape

    A function the c-escapes a string, making it suitable to be placed in a

    JavaScript string.

    returns the escaped value

  • (string) esc_raw ($value) Browse code

    $value the value to escape

    An identity function that merely returns that which it is given, the purpose

    being to be able to specify that the value is not to be escaped in any way.

    returns the escaped value

  • (string) esc_specialchars ($value) Browse code

    $value the value to escape

    Runs the PHP function htmlspecialchars on the value passed.

    returns the escaped value

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.