Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[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 adamlundrigan [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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 31, 2011
  1. Adam Lundrigan

    [hotfix/ZF-11356]

    adamlundrigan authored
    Update Zend\Json\Encoder::_encodeObject to encode the object's class name using _encodeString
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 library/Zend/Json/Encoder.php
5 library/Zend/Json/Encoder.php
View
@@ -165,8 +165,9 @@ protected function _encodeObject(&$value)
}
}
- return '{"__className":"'
- . str_replace('\\', '\\\\', get_class($value)) . '"'
+ $className = get_class($value);
+ return '{"__className":'
+ . $this->_encodeString($className)
. $props . '}';
}
Something went wrong with that request. Please try again.