*

nootkan

  • ***
  • 30 posts
Bug in oc-includes/AjaxUploader.php
« on: February 20, 2026, 04:56:40 AM »
I found this in my logs from a bot trying to hit the upload endpoint without a proper request and triggered a fatal error.
Quote
[19-Feb-2026 12:17:08 America/Vancouver] PHP Fatal error:  Uncaught Error: Call to a member function getOriginalName() on bool in /home/username/public_html/oc-includes/AjaxUploader.php:23
Stack trace:
#0 /home/username/public_html/oc-includes/osclass/controller/ajax.php(293): AjaxUploader->getOriginalName()
#1 /home/username/public_html/index.php(119): CWebAjax->doModel()
#2 {main}
  thrown in /home/username/public_html/oc-includes/AjaxUploader.php on line 23

There is an unprotected getOriginalName() method in oc-includes/AjaxUploader.php at line 23
Code: [Select]
public function getOriginalName() {
    return $this->_file->getOriginalName();
}

Which I fixed with this:
Code: [Select]
public function getOriginalName() {
    if(!$this->_file) { return false; }
    return $this->_file->getOriginalName();
}

*

MB Themes

Re: Bug in oc-includes/AjaxUploader.php
« Reply #1 on: February 20, 2026, 03:06:17 PM »
Thanks ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots