WordPress.org

Ready to get started?Download WordPress

Forums

Downloads Manager
Unsupported operand on line 69 of functions.php (1 post)

  1. Texiwill
    Member
    Posted 4 years ago #

    Hello,

    PHP Fatal error: Unsupported operand types....

    there is a bug in functions.php on line 69 if the $file variable has no contents for whatever reason. The fix is to wrap an if around the size calculation if strlen($file) > 1.

    This way if the $file has length then the size manipulation takes place else a 0 size could be set. This bug prevents the downloads from appearing within the download manager. Such as the following code.

    if (strlen($file) > 1) {
      $i = 0;^M
      $type = array("B", "KB", "MB", "GB");^M
      while (($size/1024)>1) {^M
        $size=$size/1024;^M
        $i++;^M
      }^M
      } else {
            $size="0.00";
      }

    Best regards,
    Edward

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic