Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#14315 closed defect (bug) (fixed)

comments_template() generates bad theme-compat path

Reported by: dougal's profile dougal Owned by: westi's profile westi
Milestone: 3.0.1 Priority: normal
Severity: major Version: 3.0
Component: Template Keywords: has-patch
Focuses: Cc:

Description

In the final fallback case of comments_template() it attempts to include theme-compat/comments.php, however, the path it generates is incorrect, because it fails to prepend ABSPATH.

This causes an error to be output to the page in older themes that rely on this feature.

Warning: require(wp-includes/theme-compat/comments.php): failed to open stream: 
No such file or directory in 
/var/www/vhosts/example.com/wordpress/wp-includes/comment-template.php on line 920 
Fatal error: require(): Failed opening required 'wp-includes/theme-compat/comments.php' 
(include_path='.:/usr/share/php:/usr/share/pear') 
in /var/www/vhosts/example.com/wordpress/wp-includes/comment-template.php on line 920

Attachments (1)

14315-comment-template.diff (509 bytes) - added by dougal 13 years ago.
Fix theme-compat.php path

Download all attachments as: .zip

Change History (10)

@dougal
13 years ago

Fix theme-compat.php path

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.0.1

#2 @westi
13 years ago

  • Owner set to westi
  • Status changed from new to accepted

My bad.

#3 @westi
13 years ago

Confusingly this all works in my test install as I must be lucky with the php path.

There are a number of places where the ABSPATH needs adding, working on this now.

#4 @westi
13 years ago

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

(In [15433]) Fix the theme compat file require paths to be fully absolute so they don't rely on a particular php path to work. Fixes #14315 for trunk props dougal.

#5 @westi
13 years ago

(In [15434]) Fix the theme compat file require paths to be fully absolute so they don't rely on a particular php path to work. Fixes #14315 for 3.0 branch
props dougal.

#6 follow-up: @scribu
13 years ago

Erm, what is the purpose of error_log( $_template_file ); in [15433]?

#7 in reply to: ↑ 6 @westi
13 years ago

Replying to scribu:

Erm, what is the purpose of error_log( $_template_file ); in [15433]?

oops

#8 @westi
13 years ago

(In [15435]) Remove debug cruft. See #14315 props scribu.

#9 @westi
13 years ago

(In [15436]) Remove debug cruft. See #14315 props scribu.

Note: See TracTickets for help on using tickets.