News for hackers. Stuff that matters.
Re:My temporary PHP fix from 2014 has nearly 20M installs. T... by swiftcoder on Thursday September 17, 2026 @11:36AM (#49742385)
> Under a comment that reads // Workaround for trailing slashes, my code tacks an “a” onto the path so there’s always a last segment to cut off, then cuts it off with a find-and-replace. When the path ends in a slash, that last segment is just the “a”, and the find-and-replace takes every other “a” in the path with it.

This is top-tier. left-pad levels of "we should just implement trivial functions in our own codebases"

(I do not mean that as a knock on the author - it solved his use case just fine. Everyone who took a dependency on it afterward though...)

Re:My temporary PHP fix from 2014 has nearly 20M installs. T... by kstrauser on Thursday September 17, 2026 @11:43AM (#49742498)
Heh, right?

Author: Ugh, this is ugly, but it fixes the specific problem I’m having so I can go on and work on other things.

Author, later: What do you mean, you’re all using this?

Re:My temporary PHP fix from 2014 has nearly 20M installs. T... by jakeasmith on Thursday September 17, 2026 @05:16PM (#49746660)
hahaha yes, this exactly