Skip to content

Commit

Permalink
Be sure to quote the channel name when running preg_match, as channel…
Browse files Browse the repository at this point in the history
…s may include the / character
  • Loading branch information
saltybeagle committed Sep 14, 2011
1 parent 4dca84b commit c0d62b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pyrus/SimpleChannelServer/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function __construct($channel, $webpath, $pyruspath = null)
}
$rest = $channel->protocols->rest;
foreach ($rest as $restpath) {
if (preg_match('/https?:\/\/'.$channel->name.'\//', $restpath, $matches)) {
if (preg_match('/https?:\/\/'.preg_quote($channel->name, '/').'\//', $restpath, $matches)) {
$this->uri = $matches[0];
$restpath = str_replace($matches[0], '', $restpath);
break;
Expand Down

0 comments on commit c0d62b0

Please sign in to comment.