Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12167 closed defect (bug) (fixed)

Syntax Error in PHP4

Reported by: blepoxp's profile blepoxp Owned by: westi's profile westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Warnings/Notices Keywords: has-patch tested
Focuses: Cc:


Steps to reproduce:
1) Load WordPress trunk (r. 13013) in PHP4
2) Observe following error on screen:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /Applications/MAMP/htdocs/wptrunk/wp-includes/theme.php on line 714

It appears that the arrow is causing the problem

$author = get_user_by( 'id', $author_id )->user_nicename;

I fixed by doing the following:

$author = get_user_by( 'id', $author_id );
$author = $author->user_nicename;

Attachments (2)

theme.php (40.1 KB) - added by blepoxp 14 years ago.
Adds a new line after 714.
theme.diff (425 bytes) - added by blepoxp 14 years ago.
Sorry. Here's the .diff version

Download all attachments as: .zip

Change History (7)

14 years ago

Adds a new line after 714.

#1 @aaroncampbell
14 years ago

You'll need to create a patch rather than upload the whole file. A patch is basically a .diff file that shows what CHANGES are made to the file and can be applied to the repository.

14 years ago

Sorry. Here's the .diff version

#3 @nacin
14 years ago

  • Keywords has-patch added; theme removed
  • Milestone changed from 2.9.2 to 3.0

FYI: There's no other instance of function_that_returns_object()->method() or function_that_returns_object()->property in core. This one is it (according to grep).

I wrote it in [12915] forgetting about the PHP4 compat issue.

#4 @aaroncampbell
14 years ago

  • Keywords tested added

Looks good, quick test seems to be working.

#5 @westi
14 years ago

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

(In [13014]) Ensure we are PHP4 compat. Fixes #12167 props blepoxp.

Note: See TracTickets for help on using tickets.