Fix all PHP 8.1 messages for upgrade.php

This commit is contained in:
markjcrane
2023-05-17 10:07:49 -06:00
parent 6816921f47
commit 6d7e125743
22 changed files with 215 additions and 152 deletions

View File

@@ -85,9 +85,9 @@ if (!class_exists('scripts')) {
* Copy the switch scripts from the web directory to the switch directory
*/
public function copy_files() {
if (is_array($_SESSION['switch']['scripts'])) {
if (!empty($_SESSION['switch']['scripts'])) {
$destination_directory = $_SESSION['switch']['scripts']['dir'];
if (file_exists($destination_directory)) {
if ($destination_directory != '' && file_exists($destination_directory)) {
//get the source directory
if (file_exists('/usr/share/examples/fusionpbx/scripts')) {
$source_directory = '/usr/share/examples/fusionpbx/scripts';