Ticket #14315 (closed defect (bug): fixed)

Opened 20 months ago

Last modified 20 months ago

comments_template() generates bad theme-compat path

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

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

14315-comment-template.diff Download (509 bytes) - added by dougal 20 months ago.
Fix theme-compat.php path

Change History

Fix theme-compat.php path

  • Milestone changed from Awaiting Review to 3.0.1
  • Owner set to westi
  • Status changed from new to accepted

My bad.

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.

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

(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.

(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.

comment:6 follow-up: ↓ 7   scribu20 months ago

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

comment:7 in reply to: ↑ 6   westi20 months ago

Replying to scribu:

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

oops

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

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

Note: See TracTickets for help on using tickets.