Post by FedericoAruba » Thu Sep 09, 2021 7:15 pm

Hi, I noticed that in Opencart you use the GLOB_BRACE flag in the glob function.

Code: Select all

admin/controller/design/theme.php:                      $files = glob(rtrim(DIR_CATALOG . 'view/theme/{default,' . $theme . '}/template/' . $path, '/') . '/*', GLOB_BRACE);
admin/controller/marketplace/extension.php:             $files = glob(DIR_APPLICATION . 'controller/extension/extension/*.php', GLOB_BRACE);
admin/controller/marketplace/extension.php:                             $files = glob(DIR_APPLICATION . 'controller/extension/' . $extension . '/*.php', GLOB_BRACE);
admin/controller/marketplace/modification.php:                                                  $files = glob($path, GLOB_BRACE);
admin/controller/common/filemanager.php:                        $files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', GLOB_BRACE);
install/model/upgrade/1006.php:                 $files = glob(DIR_OPENCART . '{config.php,admin/config.php}', GLOB_BRACE);
install/model/upgrade/1006.php:                 $files = glob(DIR_OPENCART . '{config.php,admin/config.php}', GLOB_BRACE);
install/model/upgrade/1009.php:         $files = glob(DIR_OPENCART . '{config.php,admin/config.php}', GLOB_BRACE);
install/model/upgrade/1001.php:                 $files = glob(DIR_OPENCART . '{config.php,admin/config.php}', GLOB_BRACE);
As you can see from https://www.php.net/manual/en/function.glob.php, the GLOB_BRACE should not be used because has no compatibility with all systems.

Code: Select all

Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris.
Alpine actually is the most used system with dockerized PHPs and is MIT based, so all these glob function returns NULL.

Will you patch it?
Regards

Newbie

Posts

Joined
Thu Sep 09, 2021 7:01 pm

Post by straightlight » Thu Sep 09, 2021 11:02 pm

OC version. Already fixed on the master branch.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by FedericoAruba » Fri Sep 10, 2021 4:29 pm

Thank you!

Newbie

Posts

Joined
Thu Sep 09, 2021 7:01 pm
Who is online

Users browsing this forum: No registered users and 10 guests