Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from andreaspe/master

XML Parsing fix if a rails resource contains underscores rather than CamelCase
  • Loading branch information...
commit 67d32d50914fe4b3550cb0467fe16a9bc19ee2be 2 parents ec52c2b + b232856
@jbroadway authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 ActiveResource.php
View
6 ActiveResource.php
@@ -531,8 +531,8 @@ function _send_and_receive ($url, $method, $data = array ()) {
// parse XML response
$xml = new SimpleXMLElement ($res);
-
- if ($xml->getName () == $this->element_name_plural) {
+ // normalize xml element name in case rails ressource contains an underscore
+ if (str_replace("-","_", $xml->getName ()) == $this->element_name_plural) {
// multiple
$res = array ();
$cls = get_class ($this);
@@ -670,4 +670,4 @@ function set ($k, $v = false) {
}
}
-?>
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.