Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-774

Database size can get inaccuratly reported

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • 3.0.x
    • None
    • ACP
    • None
    • PHP Environment:
      Database:

    Description

      In ./includes/functions_admin.php, on line 2375, there's this check:

      if (is_int($dbsize))
      	{
      		$dbsize = ($dbsize >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($dbsize / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $dbsize));
      	}

      The problem with this check is that once a database gets past 2147483647 bytes (exactly 2GB), the datatype becomes a float to handle the resulting number. This means that past 2GB, your database size will be reported in bytes, which doesn't look good.

      The solution is a tiny change, the if-statement should look something like:

      	if (is_int($dbsize) || is_float($dbsize))

      If you need justification for this bug, consider that phpBB 3.0 is designed to operate better on larger databases than 2.0.x (which incidently suffers the same bug..). I think reporting that fact correctly to the admin would help

      NeoThermic

      Attachments

        Activity

          People

            Acyd Burn Meik Sievertsen [X] (Inactive)
            NeoThermic NeoThermic [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: