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

@adamlundrigan

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.

@adamlundrigan adamlundrigan [hotfix/ZF-11356]
Update Zend\Json\Encoder::_encodeObject to encode the object's class name using _encodeString
c92553c
@weierophinney

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. @adamlundrigan

    [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
View
5 library/Zend/Json/Encoder.php
@@ -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.