Problem within comment-functions.php (patch included)
-
Hi, i just found the following error when upgrading:
[Mon Jun 13 14:31:05 2005] [error] PHP Fatal error: comments_template(): Failed opening required ‘/usr/local/www/vhosts/blog.foxalpha.de/htdocs/wp-content/themes/men_in_grey’ (include_path=’.:/usr/local/lib/php:/www/templates’) in /usr/local/www/vhosts/blog.foxalpha.de/htdocs/wp-includes/comment-functions.php on line 26
This is caused by the if statement at about line 26 checking with file_exists() for a COMMENTS_TEMPLATE to include, and returns true even if not found, because file_exists() returns true on present directories, which results in static pages to be displayed only partially because it’s aborting on this error.
The following patch is fixing this:
*** comment-functions.php.orig Mon Jun 13 14:33:54 2005
--- comment-functions.php Mon Jun 13 14:35:09 2005
***************
*** 22,28 ****define('COMMENTS_TEMPLATE', true);
$include = apply_filters('comments_template', TEMPLATEPATH . $file );
! if ( file_exists( $include ) )
require( $include );
else
require( ABSPATH . 'wp-content/themes/default/comments.php');
--- 22,28 ----define('COMMENTS_TEMPLATE', true);
$include = apply_filters('comments_template', TEMPLATEPATH . $file );
! if ( file_exists( $include ) && is_file( $include ) )
require( $include );
else
require( ABSPATH . 'wp-content/themes/default/comments.php');This adds is_file() to the check and thus makes sure that the default/comments.php is loaded when $file is a directory and no file.
Please apply 🙂
Regards,
Frank
The topic ‘Problem within comment-functions.php (patch included)’ is closed to new replies.