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...
1 parent 9f9376d commit 3560a557e0e9e38201536b1ec79c0a92d82ccd5e Kevin Burke committed Aug 16, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 Services/Twilio/InstanceResource.php
@@ -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;

0 comments on commit 3560a55

Please sign in to comment.