Neo
##############################################################
# Title: Template->make_filename Message Fix
# Author: Thoul thoul@users.sourceforge.net http://darkmods.sourceforge.net
# Description: Repairs broken functionality in template error message.
# Version: 1.0.0
#
# Installation Level: Easy
# Installation Time: 2 Minutes
# Files To Edit: includes/template.php
# Included Files: n/a
##############################################################
# Author's Notes:
# This is a quick hack to fix an error in the phpBB error message
# "Template->make_filename(): Error - file does not exist." This error message is
# supposed to include the filename of the non-existent file, but this was broken in
# phpBB 2.0.4 and later versions.
#
# Please note that this fix is neither compatible with nor required in the eXtreme
# Styles hack or phpBB 2.0.0 - 2.0.3.
##############################################################
# BEFORE ADDING THIS TO YOUR FORUM, YOU SHOULD BACK UP ALL RELATED FILES.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/template.php
#
#-----[ FIND ]------------------------------------------
#
function make_filename($filename)
{
// Check if it's an absolute or relative path.
if (substr($filename, 0, 1) != '/')
{
$filename = phpbb_realpath($this->root . '/' . $filename);
}
if (!file_exists($filename))
{
die("Template->make_filename(): Error - file $filename does not exist");
}
return $filename;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
function make_filename($filename)
{
$old_filename = $filename;
// Check if it's an absolute or relative path.
if (substr($filename, 0, 1) != '/')
{
$old_filename = $this->root . '/' . $old_filename;
$filename = phpbb_realpath($this->root . '/' . $filename);
}
if (!file_exists($filename))
{
if ( !$filename )
{
$filename = $old_filename;
}
die("Template->make_filename(): Error - file $filename does not exist");
}
return $filename;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EndUsers browsing this forum: No registered users and 9 guests