Skip to content

Commit

Permalink
Encoding user input in path
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasmiller committed Feb 28, 2020
1 parent 15d2e91 commit ec4ebf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/recurly/base_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function interpolatePath(string $path, array $options = []): string
{
return array_reduce(
array_keys($options), function ($p, $i) use ($options) {
return str_replace("{{$i}}", $options[$i], $p);
return str_replace("{{$i}}", rawurlencode($options[$i]), $p);
}, $path
);
}
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">lib</directory>
<exclude>
<directory suffix=".php">lib/recurly/resources</directory>
<file>lib/recurly.php</file>
<file>lib/recurly/version.php</file>
<file>lib/recurly/client.php</file>
<directory suffix=".php">lib/recurly/resources</directory>
<directory suffix=".php">lib/recurly/errors</directory>
</exclude>
</whitelist>
</filter>
Expand Down

0 comments on commit ec4ebf4

Please sign in to comment.