Skip to content

Commit

Permalink
Regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CupOfTea696 committed Jun 11, 2015
1 parent 6d1628e commit 96dc894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Abstraction/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function getAllParameters($parameters){
$fields = preg_replace('/\/([^\{\},]*)(?:(\{.*?\})?(,|$)|(\}))/', ':{$1$2}$3$4', $fields);
}

$fields = preg_replace('/(?<=[^:\w])(\w+)(?=[^:\w])/', '$1:""', $fields);
$fields = preg_replace('/(?<=[^:\w]|^)(\w+)(?=[^:\w]|$)/', '$1:""', $fields);
$fields = preg_replace('/(\w+)/', '"$1"', $fields);
$fields = '{' . $fields . '}';
$fields = json_decode($fields, true);
Expand Down

0 comments on commit 96dc894

Please sign in to comment.