#6534 closed defect (bug) (fixed)
Use of ctype_digit in link_template.php can break uploader.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5.1 | Priority: | high |
Severity: | major | Version: | 2.5 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
The function ctype_digit() is used in get_attachment_link() in link-template.php, and I've had at least one user tell me that this broke the upload functionality for him.
He reports running PHP 4.3.10 and getting this error:
[Tue Apr 01 23:32:51 2008] [error] [client x.x.x.x] PHP Fatal error: Call to undefined function: ctype_digit() in /xxx/wp-includes/link-template.php on line 182, referer: http://xxx/wp-admin/media-upload.php?type=image&tab=library&post_id=1&post_mime_type=&s=&m=200804
He also reports that replacing it with is_numeric appears to work fine.
Similar ticket: #5481
Attachments (1)
Change History (7)
#2
@
17 years ago
- Owner changed from anonymous to westi
- Status changed from new to assigned
Gentoos recommended use flags do include ctype.
Note: See
TracTickets for help on using
tickets.
I get the same problem in my testbed running php 5.2.6. I don't know why Gentoo doesn't include the ctype functions by default. Ctype is preferred to str_* and is_* functions in most cases according to the php documentation (http://docs.php.net/manual/en/intro.ctype.php).
I changed it to is_numeric(), it works for me, and I hope the patch I've attached is the correct type.