Skip to content

Commit

Permalink
Fixed subreddits with '-' and '_' chars in their name not working.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 12, 2015
1 parent 3ec5a1c commit 8496d69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feed/index.php
Expand Up @@ -271,7 +271,7 @@ function verify_cache($fname, $url, $subreddit, $maxage)
{
$use_google = false; // these tend to be broken on Google Reader. :/
$str = $_REQUEST['subreddit'];
if ((strlen($str) < 32) && (preg_match('/^[a-zA-Z0-9]+$/', $str) == 1))
if ((strlen($str) < 32) && (preg_match('/^[a-zA-Z0-9\-_]+$/', $str) == 1))
{
$cachefname = "$str-$cachefname";
$feedurl .= "r/$str/";
Expand Down Expand Up @@ -302,7 +302,7 @@ function verify_cache($fname, $url, $subreddit, $maxage)
} // if

$str = $_REQUEST['multireddit'];
if ((strlen($str) < 32) && (preg_match('/^[a-zA-Z0-9]+$/', $str) == 1))
if ((strlen($str) < 32) && (preg_match('/^[a-zA-Z0-9\-_]+$/', $str) == 1))
{
$cachefname = "multireddit-user-$user-$str-$cachefname";
$cachefname = "$str-$cachefname";
Expand Down

0 comments on commit 8496d69

Please sign in to comment.