Your implementation of rtrim was invalid. The way you had it setup, the script would remove any "period, j, a, d, or e" from the end of the file name--that's how PHP's rtrim works. So, if someone passed in something like "homepage" like I did, the "e" kept getting removed from the filename. The solution is simple and even more powerful because it will replace .jade and even .JADE from the end of the file name.
Your implementation of
rtrim
was invalid. The way you had it setup, the script would remove any "period, j, a, d, or e" from the end of the file name--that's how PHP's rtrim works. So, if someone passed in something like "homepage" like I did, the "e" kept getting removed from the filename. The solution is simple and even more powerful because it will replace .jade and even .JADE from the end of the file name.