WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#6534 closed defect (bug) (fixed)

Use of ctype_digit in link_template.php can break uploader.

Reported by: Otto42 Owned by: westi
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)

link-template.php.diff (722 bytes) - added by mtekk 6 years ago.

Download all attachments as: .zip

Change History (7)

mtekk6 years ago

comment:1 mtekk6 years ago

  • Keywords has-patch added

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.

comment:2 westi6 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Gentoos recommended use flags do include ctype.

comment:3 westi6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7588]) Replace the last usage of ctype_digit with is_numeric. Fixes #6534 for trunk props mtekk.

comment:4 westi6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

re-open for 2.5.1

comment:5 westi6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [7589]) Replace the last usage of ctype_digit with is_numeric. Fixes #6534 for 2.5.1 props mtekk.

comment:6 scribu4 years ago

Related: #11620

Note: See TracTickets for help on using tickets.