Miscellaneous Changes (#368)

* Corrected "powered by" link in admin panel

* Fix changing the admin theme

https://github.com/boxbilling/boxbilling/pull/1346

* Avoid strtolower(): Passing null to parameter #1 ($string) of type string is deprecated

* Also use isset

* Avoid json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
This commit is contained in:
Belle Aerni authored and GitHub committed 2022-10-20 22:12:02 +02:00
1 parent 88f1b9996b
commit 557a5dcbf2
5 files changed
+20 -12

No files matched your search

+6 -2
View File
@@ -354,8 +354,12 @@ class Box_Tools
public function decodeJ($json_str)
{
$config = json_decode($json_str, true);
return is_array($config) ? $config : array();
if(isset($json_str)){
$config = json_decode($json_str, true);
return is_array($config) ? $config : array();
} else {
return array();
}
}
public function sortByOneKey(array $array, $key, $asc = true) {
+6 -2
View File
@@ -17,8 +17,12 @@ class Model_ServiceLicense extends \RedBean_SimpleModel
{
private function _decodeJson($j)
{
$config = json_decode($j, true);
return is_array($config) ? $config : array();
if(isset($j)){
$config = json_decode($j, true);
return is_array($config) ? $config : array();
} else {
return array();
}
}
public function getAllowedIps()
+6 -6
View File
@@ -509,12 +509,12 @@ class Service implements InjectionAwareInterface
* It will, however, avoid instances like this when a domain name is entered with a capital letter:
* https://github.com/boxbilling/boxbilling/discussions/1022#discussioncomment-1311819
*/
$item['register_sld'] = strtolower($item['register_sld']);
$item['transfer_sld'] = strtolower($item['transfer_sld']);
$item['sld'] = strtolower($item['sld']);
$item['domain']['owndomain_sld'] = strtolower($item['domain']['owndomain_sld']);
$item['domain']['register_sld'] = strtolower($item['domain']['register_sld']);
$item['domain']['transfer_sld'] = strtolower($item['domain']['transfer_sld']);
$item['register_sld'] = (isset($item['register_sld'])) ? strtolower($item['register_sld']) : null;
$item['transfer_sld'] = (isset($item['transfer_sld'])) ? strtolower($item['transfer_sld']) : null;
$item['sld'] = (isset($item['sld'])) ? strtolower($item['sld']) : null;
$item['domain']['owndomain_sld'] = (isset($item['domain']['owndomain_sld'])) ? strtolower($item['domain']['owndomain_sld']) : null;
$item['domain']['register_sld'] = (isset($item['domain']['register_sld'])) ? strtolower($item['domain']['register_sld']) : null;
$item['domain']['transfer_sld'] = (isset($item['domain']['transfer_sld'])) ? strtolower($item['domain']['transfer_sld']) : null;
$order = $this->di['db']->dispense('ClientOrder');
$order->client_id = $client->id;
+1 -1
View File
@@ -250,7 +250,7 @@ class Service implements InjectionAwareInterface
';
$default = 'admin_default';
$theme = $this->di['db']->getCell($query, ['param' => 'admin_theme']);
$path = BB_PATH_THEMES.DIRECTORY_SEPARATOR.$theme;
$path = BB_PATH_THEMES.DIRECTORY_SEPARATOR;
if (null == $theme || !file_exists($path.$theme)) {
$theme = $default;
}
@@ -216,7 +216,7 @@
<footer class="footer footer-transparent d-print-none">
<div class="container-xl">
<div>Copyright &copy; {{ now|date('Y') }}. All rights reserved. Powered by <a href="https://boxbilling.org" title="Billing system" target="_blank" rel="noopener">FOSSBilling {{ guest.system_version }}</a></div>
<div>Copyright &copy; {{ now|date('Y') }}. All rights reserved. Powered by <a href="https://fossbilling.org" title="Billing system" target="_blank" rel="noopener">FOSSBilling {{ guest.system_version }}</a></div>
</div>
</footer>
</div>