Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated: Upgrade for PHP version 8.x and MYSql 8 compatibility #1315

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ sudo: required
dist: trusty

php:
- 5.6
- 7.2
- 8.1
- 8.2
- 8.3
- 8.4

before_script:
- sudo cp -f tests/travis-ci-apache-vhost /etc/apache2/sites-available/default
Expand Down
2 changes: 1 addition & 1 deletion Adapter/Adapter_ProductPriceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getProductPrice(
&$specific_price_output = null,
$with_ecotax = true,
$use_group_reduction = true,
Context $context = null,
?Context $context = null,
$use_customer_price = true,
$id_roomtype = false
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class Core_Foundation_Exception_Exception extends Exception
{
public function __construct($message = null, $code = 0, Exception $previous = null)
public function __construct($message = null, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Foundation/IoC/Core_Foundation_IoC_Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ private function makeInstanceFromClassName($className, array $alreadySeen)

if ($classConstructor) {
foreach ($classConstructor->getParameters() as $param) {
$paramClass = $param->getClass();
$paramClass = ($param->getType() && !$param->getType()->isBuiltin()) ? new ReflectionClass($param->getType()>getName()) : null;
if ($paramClass) {
$args[] = $this->doMake($param->getClass()->getName(), $alreadySeen);
$args[] = $this->doMake($paramClass->getName(), $alreadySeen);
} elseif ($param->isDefaultValueAvailable()) {
$args[] = $param->getDefaultValue();
} else {
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ The system compatibility will also be checked by the system with installation an
#### Hosted Server Configurations

* **Web server**: Apache 1.3, Apache 2.x, Nginx or Microsoft IIS
* **PHP version**: PHP 5.6+ to PHP 7.4
* **MySQL version**: 5.1+ to 5.7 installed with a database created
* **PHP version**: PHP 8.1+ to PHP 8.4
* **MySQL version**: 5.7+ to 8.4 installed with a database created
* SSH or FTP access (ask your hosting service for your credentials)
* In the PHP configuration ask your provider to set memory_limit to "128M", upload_max_filesize to "16M" , max_execution_time to "500" and allow_url_fopen "on"
* SSL certificate if you plan to process payments internally (not using PayPal for instance)
Expand All @@ -59,8 +59,8 @@ The system compatibility will also be checked by the system with installation an
* **Supported operating system**: Windows, Mac, and Linux
* **A prepared package**: WampServer (for Windows), Xampp (for Windows and Mac) or EasyPHP (for Windows)
* **Web server**: Apache 1.3, Apache 2.x, Nginx or Microsoft IIS
* **PHP**: PHP 5.6+ to PHP 7.4
* **MySQL** 5.1+ to 5.7 installed with a database created
* **PHP**: PHP 8.1+ to PHP 8.4
* **MySQL** 5.7+ to 8.4 installed with a database created
* In the PHP configuration, set memory_limit to "128M", upload_max_filesize to "16M" and max_execution_time to "500"
* **Required PHP extensions**: PDO_MySQL, cURL, OpenSSL, SOAP, GD, SimpleXML, DOM, Zip, Phar

Expand Down Expand Up @@ -88,7 +88,7 @@ Please don't disclose security vulnerabilities publicly. If you find any securit

### Documentation & Demo

#### QloApps Documentation
#### QloApps Documentation
[https://qloapps.com/qlo-reservation-system](https://qloapps.com/qlo-reservation-system)
#### QloApps Demo
**Link** : https://demo.qloapps.com </br>
Expand Down
2 changes: 1 addition & 1 deletion admin/filemanager/include/php_image_magician.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cro
// *** Crop this bad boy
$crop = imagecreatetruecolor($newWidth, $newHeight);
$this->keepTransparancy($optimalWidth, $optimalHeight, $crop);
imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight);
imagecopyresampled($crop, $this->imageResized, 0, 0, (int) $cropStartX, (int) $cropStartY, (int) $newWidth, (int) $newHeight, (int) $newWidth, (int) $newHeight);

$this->imageResized = $crop;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
</span>
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
id="{$input_name}_{$language.id_lang}"
class="form-control {if isset($input_class)}{$input_class} {/if}"
name="{$input_name}_{$language.id_lang}"
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
value="{$input_value[$language.id_lang]|default:''|escape:'html'}"
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"
onblur="updateLinkRewrite();"
{if isset($required)} required="required"{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@

<dd><b><i class="icon-calendar"></i> &nbsp; {$customer->date_add|date_format:"%d %b, %Y"}</b> ({l s='Member since'})</dd>
<dd><b><i class="icon-list"></i> &nbsp; {$customerStats['nb_orders']|intval}</b> ({l s='Total valid order placed'})</dd>
<dd><b><i class="icon-credit-card"></i> &nbsp; {displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_spent'], $currency), 2) currency=$currency->id}</b> ({l s='Total spent since registration'})</dd>
<dd><b><i class="icon-credit-card"></i> &nbsp; {displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_spent']|floatval, $currency), 2) currency=$currency->id}</b> ({l s='Total spent since registration'})</dd>
{if Configuration::get('PS_B2B_ENABLE')}
<dd><b>{$customer->siret}</b> ({l s='Siret'})</dd>
<dd><b>{$customer->ape|date_format:"%d %b, %Y"}</b> ({l s='APE'})</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{/if}
</div>

{if sizeof($invoices_collection)}
{if isset($invoices_collection) && sizeof($invoices_collection)}
<div class="form-group">
<label class="control-label">{l s='Invoice'}</label>
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<td>
<div class="input-group">
<span class="input-group-addon">{$currencySign}</span>
<input type="text" class="form-control unit_price" value="{Tools::ps_round($service['unit_price_tax_excl'], 2)}" data-id-product="{$product['id_product']}">
<input type="text" class="form-control unit_price" value="{Tools::ps_round($service['unit_price_tax_excl'], 2)}" data-id-product="{$service['id_product']}">
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $service.product_price_calculation_method}
<span class="input-group-addon">{l s='/ night'}</span>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<img class="img img-responsive" width="15px" src="{$base_url}img/rf/{$value.value}" title="Room image" />
</td>
{/foreach}
<!--<td>
{*<td>
{if sizeof($available_feature.featureValues)}
<select id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value"
onchange="$('.custom_{$available_feature.id_feature}_').val('');">
Expand All @@ -74,9 +74,9 @@
<a href="{$link->getAdminLink('AdminFeatures')|escape:'html':'UTF-8'}&amp;addfeature_value&amp;id_feature={$available_feature.id_feature}"
class="confirm_leave btn btn-link"><i class="icon-plus-sign"></i> {l s='Add pre-defined values first'} <i class="icon-external-link-sign"></i></a>
</span>
{/if} --><!-- By Webkul -->
{/if} <!-- By Webkul -->*}
</td>
<!-- <td>
{* <td>

<div class="row lang-0" style='display: none;'>
<div class="col-lg-9">
Expand Down Expand Up @@ -132,7 +132,7 @@
</div>
{/if}
{/foreach}
</td> --><!-- By Webkul -->
</td> <!-- By Webkul -->*}

</tr>
{foreachelse}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
id="{$input_name}_{$language.id_lang}"
class="form-control {if isset($input_class)}{$input_class} {/if}"
name="{$input_name}_{$language.id_lang}"
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
value="{$input_value[$language.id_lang]|default:''|escape:'html'}"
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"
onblur="updateLinkRewrite();"
{if isset($required)} required="required"{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
</span>
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
<label class="tree-toggler"><a href="{$url_shop_group|escape:'html':'UTF-8'}&amp;id_shop_group={$node['id']}">{$node['name']|escape:'html':'UTF-8'}</a></label>
</span>
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
</li>
2 changes: 1 addition & 1 deletion admin/themes/default/template/helpers/options/options.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
</div>
{elseif $field['type'] == 'text'}
<div class="col-lg-9">{if isset($field['suffix'])}<div class="input-group{if isset($field.class)} {$field.class}{/if}">{/if}
<input class="form-control {if isset($field['class'])}{$field['class']}{/if}" type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{if isset($field['no_escape']) && $field['no_escape']}{$field['value']|escape:'UTF-8'}{else}{$field['value']|escape:'html':'UTF-8'}{/if}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/>
<input class="form-control {if isset($field['class'])}{$field['class']}{/if}" type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{if isset($field['no_escape']) && $field['no_escape']}{$field['value']}{else}{$field['value']|escape:'html'}{/if}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/>
{if isset($field['suffix'])}
<span class="input-group-addon">
{$field['suffix']|strval}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
<div class="node-hint">{$node['hint']}</div>
{/if}
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
<div class="node-hint">{$node['hint']}</div>
{/if}
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
<label class="tree-toggler">{l s='Group: %s' sprintf=$node['name']|escape:'html':'UTF-8'}</label>
</span>
<ul class="tree">
{$children|escape:'UTF-8'}
{$children}
</ul>
</li>
</li>
4 changes: 4 additions & 0 deletions classes/AddressFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ protected static function _setOriginalDisplayFormat(&$formattedValueList, $curre
}
}

if (empty($formattedValueList[$key])) {
return;
}

if ($formattedValue = preg_replace('/^'.$key.'$/', $formattedValueList[$key], $replacedValue, -1, $count)) {
if ($count) {
// Allow to check multiple key in the same pattern,
Expand Down
8 changes: 4 additions & 4 deletions classes/AdminTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ protected function _displayEnableLink($token, $id, $value, $active, $id_category
alt="'.((bool)$value ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.((bool)$value ? $this->l('Enabled') : $this->l('Disabled')).'" /></a>';
}

protected function _displayDuplicate($token = null, $id)
protected function _displayDuplicate($token, $id)
{
$_cacheLang['Duplicate'] = $this->l('Duplicate');
$_cacheLang['Copy images too?'] = $this->l('This will copy the images too. If you wish to proceed, click "OK". If not, click "Cancel".', __CLASS__, true, false);
Expand All @@ -1811,7 +1811,7 @@ protected function _displayDuplicate($token = null, $id)
<img src="../img/admin/duplicate.png" alt="'.$_cacheLang['Duplicate'].'" title="'.$_cacheLang['Duplicate'].'" /></a>';
}

protected function _displayViewLink($token = null, $id)
protected function _displayViewLink($token, $id)
{
$_cacheLang['View'] = $this->l('View');
$href = Tools::safeOutput(self::$currentIndex.'&'.$this->identifier.'='.(int)$id.'&view'.$this->table.'&token='.($token != null ? $token : $this->token));
Expand All @@ -1820,7 +1820,7 @@ protected function _displayViewLink($token = null, $id)
<img src="../img/admin/details.gif" alt="'.$_cacheLang['View'].'" title="'.$_cacheLang['View'].'" /></a>';
}

protected function _displayEditLink($token = null, $id)
protected function _displayEditLink($token, $id)
{
$_cacheLang['Edit'] = $this->l('Edit');
$href = Tools::safeOutput(self::$currentIndex.'&'.$this->identifier.'='.(int)$id.'&update'.$this->table.'&token='.($token != null ? $token : $this->token));
Expand All @@ -1829,7 +1829,7 @@ protected function _displayEditLink($token = null, $id)
<img src="../img/admin/edit.gif" alt="" title="'.$_cacheLang['Edit'].'" /></a>';
}

protected function _displayDeleteLink($token = null, $id)
protected function _displayDeleteLink($token, $id)
{
$_cacheLang['Delete'] = $this->l('Delete');
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false);
Expand Down
Loading