Anonymous Login
08-17-2018 05:09 AM

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004832SMF 2.0Generalpublic2014-01-26 20:49
Summary0004832: Should not use $php_errormsg without checking error tracking first
DescriptionSee discussion and link to original post at

In function template_include, if the template file cannot be found, and user is admin, eventually you get down to:

[code] require_once($sourcedir . '/Subs-Package.php');

            $error = fetch_web_data($boardurl . strtr($filename, array($boarddir => '', strtr($boarddir, '\\', '/') => '')));
            if (empty($error))
                $error = $php_errormsg;
If fetch_web_data returns nothing, then $php_errormsg is used to come up with the error.
But if error tracking is not turned on, this will be undefined.

TagsNo tags attached.
Attached Files




groundup (SMF Friend)

The easiest way to fix it is to change if (empty($error)) to if (empty($error) && !empty($php_errormsg))

Or we could check if $error was empty and then if $php_errormsg is empty we'd use a generic error message like "An error has occurred while attempting to fetch web data (be more descriptive) but error tracking appears to be disabled. Enable it to see what the message is"


arrowtotheknee (SMF Friend)

Fixed in 2.1
MantisBT (Modified for SMF Intergration)[^] Copyright © 2000 - 2010 Mantis Group