Re: Tiny pathinfo() patch
| From: | Christian Schneider | Date: | Fri, 14 Jul 2006 20:09:28 +0000 |
| Subject: | Re: Tiny pathinfo() patch | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24381@lists.php.net to get a copy of this message | ||
Tobias Schlitt wrote:
using string manipulation, I now patched pathinfo() to provide the filename without extension per default with key "filename". Find the patch here: http://schlitt.info/misc/pathinfo.patchIf the patch is considered then I would propose to also return the key "filename" if the filename does not have a suffix. The current code seems to only return it if it can find a '.' in the filename. I.e. change if (p) { idx = p - ret; add_assoc_stringl(tmp, "filename", ret, idx, 1); } to idx = p ? (p - ret) : ret_len; add_assoc_stringl(tmp, "filename", ret, idx, 1); or something like that. - Chris