Skip to content

Commit

Permalink
Add explicit return to _id_to_path
Browse files Browse the repository at this point in the history
Fixes bug: paths ending with an extension were mangled to "1"

The other logical branches all returned `$id` (the result of .=), but the branch for paths with the extension has
```
$id =~ s{\.\w+$}{.markdown};
```
which returns that "match was successful" i.e. 1.
  • Loading branch information
wbazant authored and preaction committed Sep 8, 2019
1 parent c3b674c commit 3d6e4fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Yancy/Backend/Static.pm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ sub _id_to_path {
else {
$id .= '.markdown';
}
return $id;
}

sub _path_to_id {
Expand Down

0 comments on commit 3d6e4fe

Please sign in to comment.