[wp-hackers] Re: [wp-svn] [5020] trunk/wp-includes: new function:
untrailingslashit().
Robin Adrianse
robin.adr at gmail.com
Sat Mar 10 17:40:29 GMT 2007
I agree. I'll open up a ticket and attach a patch.
On 3/9/07, Jamie Talbot <wphackers at jamietalbot.com> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> m at wordpress.org wrote:
> > +function untrailingslashit($string) {
> > + return preg_replace('|/+$|', '', $string);
> > +}
> > +
>
> Instead of the overhead of a regular expression, why not use rtrim?
>
> function untrailingslashit($string) {
> return rtrim($string, '/');
> }
>
> Cheers,
>
> Jamie.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF8lZZrovxfShShFARAtINAJ9IzkDcN8PO/pmBPlF2NGADmHpg/ACgkHI8
> 2Fh09te4i7pXYJOlq5OXqOE=
> =xOMG
> -----END PGP SIGNATURE-----
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list