* FIX: Fix unneeded access outside open_basedir when looking for modules
# FIX: Fix unneeded access outside open_basedir when looking for modules
Change the order in which the if conditions are tested so that an is_dir("dir/..") is avoided
by first testing if the subpath starts with a dot.
Also changed uppercased the first 3 letters of the file before comparing to CVS.
Finally, improved the typing hint and documentation.
The PHPUNIT test failed like this:
```
35) ExportTest::testExportModulesDatasets
is_dir(): open_basedir restriction in effect. File(D:\a\dolibarr\dolibarr\htdocs/..) is not within the allowed path(s): (D:\a\dolibarr\dolibarr\htdocs;D:\a\dolibarr\dolibarr\documents;D:\a\dolibarr\dolibarr\test;D:\a\dolibarr\dolibarr\dev\initdemo;c:\tools\php)
D:\a\dolibarr\dolibarr\htdocs\core\lib\functions2.lib.php:100
D:\a\dolibarr\dolibarr\htdocs\exports\class\export.class.php:119
D:\a\dolibarr\dolibarr\test\phpunit\ExportTest.php:463
```
* Fix spelling
* qual: phpstan for htdocs/compta/bank/class/account.class.php
htdocs/compta/bank/class/account.class.php 206 PHPDoc type array of property Account::$status is not covariant with PHPDoc type int of overridden property CommonObject::$status.
htdocs/compta/bank/class/account.class.php 799 Property AccountLine::$amount (float) does not accept string.
* Update commonobject.class.php
* phpcs
* qual: phpstan for htdocs/core/modules/barcode/modules_barcode.class.php
htdocs/core/modules/barcode/modules_barcode.class.php 59 PHPDoc type int of property ModeleNumRefBarCode::$code_null is not covariant with PHPDoc type int<0, 1> of overridden property CommonNumRefGenerator::$code_null.
htdocs/core/modules/barcode/modules_barcode.class.php 64 PHPDoc type int of property ModeleNumRefBarCode::$code_auto is not covariant with PHPDoc type int<0, 1> of overridden property CommonNumRefGenerator::$code_auto.
* Update modules_barcode.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
# FIX: Check valid mail server record correction.
The test for isValidMXRecord did not pass on Windows platform:
```bash
php -r '$a=getmxrr("yhaoo.com", $mxhosts, $weight);var_dump([$a,$mxhosts]);'
array(2) {
[0] =>
bool(true)
[1] =>
array(1) {
[0] =>
string(1) "."
}
}
array(2) {
[0] =>
bool(true)
[1] =>
array(3) {
[0] =>
string(21) "mta5.am0.yahoodns.net"
[1] =>
string(21) "mta7.am0.yahoodns.net"
[2] =>
string(21) "mta6.am0.yahoodns.net"
}
}
```
So an "invalid" MX record can be returned as a dot '.'.
* fix warnings in select_resource_list
* fix warnings in select_resource_list
* fix warnings in select_resource_list
* fix warnings in select_resource_list
# SEC: #28168 Correct protocol limitations (PHP7.4/Win)
Protocol limitation was not active during test on windows platform.
Moving the application of the limitation just before the curl_exec
instruction made the limitation effective.
Also extended the code to enable allowing ftp and ftps and extended
the code for [CURLOPT_REDIR_PROTOCOLS_STR](https://www.php.net/manual/en/curl.constants.php#constant.curlopt-redir-protocols-str).
* qual: phpstan for commonnumrefgenerator.class.php
* qual: phpstan for mod_codeproduct_elephant.php
* qual: phpstan for mod_codeproduct_leopard.php
htdocs/core/modules/product/mod_codeproduct_leopard.php 79 Property mod_codeproduct_leopard::$code_modifiable (string) does not accept int.
* qual: phpstan for mod_lot_free.php
htdocs/core/modules/product_batch/mod_lot_free.php 76 Property mod_lot_free::$code_modifiable (string) does not accept int.
* Update mod_codeclient_elephant.php
htdocs/core/modules/societe/mod_codeclient_elephant.php 46 PHPDoc type int of property mod_codeclient_elephant::$code_modifiable is not covariant with PHPDoc type string of overridden property ModeleThirdPartyCode::$code_modifiable.
* qual: phpstan for mod_codeclient_leopard.php
htdocs/core/modules/societe/mod_codeclient_leopard.php 76 Property mod_codeclient_leopard::$code_modifiable (string) does not accept int.
* qual: phpstan for mod_codeclient_monkey.php
htdocs/core/modules/societe/mod_codeclient_monkey.php 76 Property mod_codeclient_monkey::$code_modifiable (string) does not accept int.
* phpcs
* phpcs
* phpcs
* qual: phpstan for modules_societe.class.php
* Update mod_lot_free.php