MyBB Community Forums

Full Version: Error 500
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, when i try to make a new topic i get an error 500.
[20-Sep-2018 18:40:10 Europe/Bucharest] PHP Fatal error:  Call to undefined function return_bytes() in /home/memet/public_html/forum/newthread.php on line 1109

My newthread.php ( unmodified ) : https://pastebin.com/BDbcMMaR
have you recently updated your forum or installed any plugin (which changes ~/inc/functions_post.php file) ?
exactly which version of MyBB you are using & what is your forum url ?

run file verification tool from below location. what does it report ?
admin panel >> tools & maintenance >> file verification

ignore reported images & ignore files reported from install folder & its sub-folders
Yes it appears it was modified, but i renamed the folder plugins to plugins2 and still the same.

MyBB Version 1.8.19
PHP Version 5.6.38
Check file "inc/functions_post.php" and check if at the and there is a function called return_bytes().
Hi,
if the function return_bytes($val) is not at the end of inc/functions_post.php then add this:


/**
* Returns bytes count from human readable string
* Used to parse ini_get human-readable values to int
*
* @param string $val Human-readable value
*/
function return_bytes($val) {
$val = trim($val);
if ($val == "")
{
return 0;
}

$last = strtolower($val[strlen($val)-1]);
switch($last)
{
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}

return intval($val);
}

I updated from 1.8.15 to 1.8.19 the file functions_post.php is not included in the update package.

Don't know if this is an error or by design ;-)

Regards
Gunnar