Skip to content

Commit

Permalink
Don't add an extra slash to an article's permalink (thanks, Yardena!).
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 14, 2018
1 parent c9d3003 commit cbd8280
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion feed/index.php
Expand Up @@ -239,7 +239,8 @@ function recache($subreddit, $fname, $url)

$nsfw = $item->over_18 ? "<font color='#FF0000'>[NSFW]</font>" : '';

$permalink = "https://www.reddit.com/{$item->permalink}";
$maybeslash = (substr($item->permalink, 0, 1) == '/') ? '' : '/';
$permalink = "https://www.reddit.com{$maybeslash}{$item->permalink}";
$itemurl = $item->url;
$titleurl = $linktothread ? $permalink : $itemurl;

Expand Down

0 comments on commit cbd8280

Please sign in to comment.