Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't update the URI when updating a resource

An InstanceResource would overwrite its URI if properties were retrieved or
updated on the object. However the URI returned from the API already has
'.json' appended to it, so when the library tries to also append .json, the
extension has been appended twice.

This is a similar bug to #71.
I have checked to try and make sure it cannot appear under any other
circumstances in the library.
  • Loading branch information...
commit 3560a557e0e9e38201536b1ec79c0a92d82ccd5e 1 parent 9f9376d
Kevin Burke authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 Services/Twilio/InstanceResource.php
7 Services/Twilio/InstanceResource.php
View
@@ -29,9 +29,14 @@ public function update($params, $value = null)
/*
* Add all properties from an associative array (the JSON response body) as
- * properties on this instance resource
+ * properties on this instance resource, except the URI
+ *
+ * @param stdClass $params An object containing all of the parameters of
+ * this instance
+ * @return null Purely side effecting
*/
public function updateAttributes($params) {
+ unset($params->uri);
foreach ($params as $name => $value) {
$this->$name = $value;
}
Please sign in to comment.
Something went wrong with that request. Please try again.