Skip to content
This repository

[hotfix/ZF-11356] Zend\Json\Encoder #371

Closed
wants to merge 1 commit into from

2 participants

Adam Lundrigan Matthew Weier O'Phinney
Adam Lundrigan

Update Zend\Json\Encoder::_encodeObject to encode the object's class name using _encodeString
I did not provide any unit test, as tests covering the encoding of class names is already in place to ensure that the switch proposed in this patch works properly.

Adam Lundrigan [hotfix/ZF-11356]
Update Zend\Json\Encoder::_encodeObject to encode the object's class name using _encodeString
c92553c
Matthew Weier O'Phinney

Reviewed, merged, and pushed to master - thanks!

Matthew Weier O'Phinney weierophinney closed this September 02, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 31, 2011
Adam Lundrigan [hotfix/ZF-11356]
Update Zend\Json\Encoder::_encodeObject to encode the object's class name using _encodeString
c92553c
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  library/Zend/Json/Encoder.php
5  library/Zend/Json/Encoder.php
@@ -165,8 +165,9 @@ protected function _encodeObject(&$value)
165 165
             }
166 166
         }
167 167
 
168  
-        return '{"__className":"' 
169  
-            . str_replace('\\', '\\\\', get_class($value)) . '"'
  168
+        $className = get_class($value);
  169
+        return '{"__className":' 
  170
+            . $this->_encodeString($className)
170 171
             . $props . '}';
171 172
     }
172 173
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.