Development

#624 ([PATCH] Fix the value obtained by passing ESC_RAW as the escaping method to be more as expected)

You must first sign up to be able to contribute.

Ticket #624 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Fix the value obtained by passing ESC_RAW as the escaping method to be more as expected

Reported by: Mike Squire Assigned to:
Priority: minor Milestone: 0.6.3
Component: Version: 0.7.X
Keywords: Cc:
Qualification:

Description

If you pass ESC_RAW as an escaping method and the value being requested is a non-scalar, instead of getting back the actual raw value you get the object decorated in such a way that values obtained from it are "raw".

There are certain things you can do to (for example) a raw array that you can't do to it's decorated counterpart so the current implementation could lead to unintuitive behaviour.

I don't think it's ideal for sfOutputEscaper to know about 'esc_raw', but I don't know there is any (pragmatic) way of doing this.

Index: lib/view/escaper/sfOutputEscaper.class.php
===================================================================
--- lib/view/escaper/sfOutputEscaper.class.php  (revision 1428)
+++ lib/view/escaper/sfOutputEscaper.class.php  (working copy)
@@ -74,7 +74,7 @@
    */
   public static function escape($escapingMethod, $value)
   {
-    if (is_null($value) || ($value === false))
+    if (is_null($value) || ($value === false) || ($escapingMethod === 'esc_raw'))
     {
       return $value;
     }

Change History

06/13/06 13:56:01 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 0.6.3.

in r1430