dwooding
03-07-2013, 03:57 AM
I'm using a custom php script to create users in VBulletin 4.x. The scripts calls core VBulletin files, ex - require_once(CWD . '/includes/class_core.php');.
Unfortunately, when a username already exists, the script throws a fatal error:
Fatal error: Call to undefined function fetch_phrase() in /home/xxxxx/public_html/members/includes/functions.php on line 4030
Line 4030 in the functions looks like this:
// API only needs error phrase name and args.
if (defined('VB_API') AND VB_API === true)
{
return $args;
}
$args[0] = fetch_phrase($args[0], 'error', '', false); // line 4030
if (sizeof($args) > 1)
{
return call_user_func_array('construct_phrase', $args);
}
else
{
return $args[0];
}
Of course, the fetch_phrase function does exist, in /includes/functions_misc.php.
Within functions.php, the only time I see the fetch_phrase function get loaded is within the print_standard_redirect function
if (!function_exists('fetch_phrase'))
{
require_once(DIR . '/includes/functions_misc.php');
}
My take after looking around the functions.php file is that when an error occurs, there is an attempt to redirect ????
Given what I have shown, any idea on why I'm getting the "Call to ?" error message.
I'm using vBulletin 4.2.0 Patch Level 2.
Thanks.
Dave
Other related posts:
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/396256-php-error-call-to-undefined-function-fetch-phrase-in-functions-php-line-3518?
https://vborg.vbsupport.ru/showthread.php?t=269898&highlight=fetch_phrase
Unfortunately, when a username already exists, the script throws a fatal error:
Fatal error: Call to undefined function fetch_phrase() in /home/xxxxx/public_html/members/includes/functions.php on line 4030
Line 4030 in the functions looks like this:
// API only needs error phrase name and args.
if (defined('VB_API') AND VB_API === true)
{
return $args;
}
$args[0] = fetch_phrase($args[0], 'error', '', false); // line 4030
if (sizeof($args) > 1)
{
return call_user_func_array('construct_phrase', $args);
}
else
{
return $args[0];
}
Of course, the fetch_phrase function does exist, in /includes/functions_misc.php.
Within functions.php, the only time I see the fetch_phrase function get loaded is within the print_standard_redirect function
if (!function_exists('fetch_phrase'))
{
require_once(DIR . '/includes/functions_misc.php');
}
My take after looking around the functions.php file is that when an error occurs, there is an attempt to redirect ????
Given what I have shown, any idea on why I'm getting the "Call to ?" error message.
I'm using vBulletin 4.2.0 Patch Level 2.
Thanks.
Dave
Other related posts:
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/396256-php-error-call-to-undefined-function-fetch-phrase-in-functions-php-line-3518?
https://vborg.vbsupport.ru/showthread.php?t=269898&highlight=fetch_phrase