From 93fbe8dccec7b14c024259f83543bde4a95be298 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 29 Jan 2023 14:10:25 +0100 Subject: feat(PHP8.2): Fix deprecated string interpolation Signed-off-by: Florian Pritz --- application/controllers/User.php | 10 +++++----- application/libraries/Image/Drivers/imagemagick.php | 8 ++++---- application/models/Mfile.php | 2 +- application/service/files.php | 6 +++--- application/test/tests/api_v2/test_api_permissions.php | 2 +- application/third_party/test-more-php/Test-More-OO.php | 4 ++-- application/third_party/test-more-php/Test-Simple-OO.php | 2 +- application/views/file/deleted.php | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index 3b5c3b7e0..43b5040b3 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -265,10 +265,10 @@ class User extends MY_Controller { $this->email->to($useremail); $this->email->subject("FileBin account deleted"); $this->email->message("" - ."Your FileBin account '${username}' at ".site_url()."\n" + ."Your FileBin account '{$username}' at ".site_url()."\n" ."has been permemently deleted.\n" ."\n" - ."The request has been sent from the IP address '${_SERVER["REMOTE_ADDR"]}'\n" + ."The request has been sent from the IP address '{$_SERVER["REMOTE_ADDR"]}'\n" ."and was confirmed with your password.\n" ."\n" ."Thank you for using FileBin!\n" @@ -348,8 +348,8 @@ class User extends MY_Controller { $this->email->to($userinfo["email"]); $this->email->subject("FileBin password reset"); $this->email->message("" - ."Someone requested a password reset for the account '${userinfo["username"]}'\n" - ."from the IP address '${_SERVER["REMOTE_ADDR"]}'.\n" + ."Someone requested a password reset for the account '{$userinfo["username"]}'\n" + ."from the IP address '{$_SERVER["REMOTE_ADDR"]}'.\n" ."\n" ."Please follow this link to reset your password:\n" .site_url("user/reset_password/$key") @@ -553,7 +553,7 @@ class User extends MY_Controller { $this->email->to($email['email']); $this->email->subject("FileBin email change confirmation"); $this->email->message("" - ."A request has been sent to change the email address of account '${old["username"]}'\n" + ."A request has been sent to change the email address of account '{$old["username"]}'\n" ."from ".$old['email']." to $value.\n" ."\n" ."Please follow this link to CONFIRM the change:\n" diff --git a/application/libraries/Image/Drivers/imagemagick.php b/application/libraries/Image/Drivers/imagemagick.php index 33e62ffe4..e65d05d3e 100644 --- a/application/libraries/Image/Drivers/imagemagick.php +++ b/application/libraries/Image/Drivers/imagemagick.php @@ -80,14 +80,14 @@ class imagemagick implements \libraries\Image\ImageDriver { public function resize($width, $height) { $this->arguments[] = "-resize"; - $this->arguments[] = "${width}x${height}"; + $this->arguments[] = "{$width}x{$height}"; } public function crop($x, $y, $width, $height) { $this->arguments[] = "+repage"; $this->arguments[] = "-crop"; - $this->arguments[] = "${width}x${height}+${x}+${y}"; + $this->arguments[] = "{$width}x{$height}+{$x}+{$y}"; $this->arguments[] = "+repage"; } @@ -100,11 +100,11 @@ class imagemagick implements \libraries\Image\ImageDriver { $this->apply_exif_orientation(); $this->arguments[] = "-thumbnail"; - $this->arguments[] = "${target_width}x${target_height}^"; + $this->arguments[] = "{$target_width}x{$target_height}^"; $this->arguments[] = "-gravity"; $this->arguments[] = "center"; $this->arguments[] = "-extent"; - $this->arguments[] = "${target_width}x${target_height}^"; + $this->arguments[] = "{$target_width}x{$target_height}^"; } public function apply_exif_orientation() diff --git a/application/models/Mfile.php b/application/models/Mfile.php index 977240c89..0bdac286d 100644 --- a/application/models/Mfile.php +++ b/application/models/Mfile.php @@ -258,7 +258,7 @@ class Mfile extends CI_Model { rmdir($dir); } } - delete_cache("${data_id}_thumb_150"); + delete_cache("{$data_id}_thumb_150"); } public function get_owner($id) diff --git a/application/service/files.php b/application/service/files.php index a21b1d65c..576adb2ef 100644 --- a/application/service/files.php +++ b/application/service/files.php @@ -439,14 +439,14 @@ class files { // likely unsupported filetype } - $tooltip = "${filedata["id"]} - $filesize
"; + $tooltip = "{$filedata["id"]} - $filesize
"; $tooltip .= "$upload_date
"; if ($height > 0 && $width > 0) { - $tooltip .= "${width}x${height} - ${filedata["mimetype"]}
"; + $tooltip .= "{$width}x{$height} - {$filedata["mimetype"]}
"; } else { - $tooltip .= "${filedata["mimetype"]}
"; + $tooltip .= "{$filedata["mimetype"]}
"; } return $tooltip; diff --git a/application/test/tests/api_v2/test_api_permissions.php b/application/test/tests/api_v2/test_api_permissions.php index 6df612911..281457c45 100644 --- a/application/test/tests/api_v2/test_api_permissions.php +++ b/application/test/tests/api_v2/test_api_permissions.php @@ -99,7 +99,7 @@ class test_api_permissions extends common { $this->t->is_deeply(array( 'status' => "error", 'error_id' => "api/insufficient-permissions", - 'message' => "Access denied: Access level too low. Required: ${test['wanted_level']}; Have: ${test['have_level']}", + 'message' => "Access denied: Access level too low. Required: {$test['wanted_level']}; Have: {$test['have_level']}", ), $ret, "expected permission error"); } } diff --git a/application/third_party/test-more-php/Test-More-OO.php b/application/third_party/test-more-php/Test-More-OO.php index 7ce9f9421..6020288bd 100755 --- a/application/third_party/test-more-php/Test-More-OO.php +++ b/application/third_party/test-more-php/Test-More-OO.php @@ -215,7 +215,7 @@ class TestMore extends TestSimple { if ( is_int($this->NumberOfTests) ) { $unrun = $this->NumberOfTests - (int)$this->TestsRun; $plural = $unrun == 1 ? '' : 's'; - $unrunmsg = "# Looks like ${unrun} planned test${plural} never ran.\n"; + $unrunmsg = "# Looks like {$unrun} planned test{$plural} never ran.\n"; } $gasp = $this->LastFail . "\n" @@ -268,7 +268,7 @@ class TestMore extends TestSimple { $error = " Syntax check for '$module' failed"; } } else { - $error = " Cannot find ${type}d file '$module'"; + $error = " Cannot find {$type}d file '$module'"; } $pass = !$retval && $done; diff --git a/application/third_party/test-more-php/Test-Simple-OO.php b/application/third_party/test-more-php/Test-Simple-OO.php index 9bbe4aada..33fb643a9 100755 --- a/application/third_party/test-more-php/Test-Simple-OO.php +++ b/application/third_party/test-more-php/Test-Simple-OO.php @@ -103,7 +103,7 @@ class TestSimple { $skipinfo = ''; if ($this->NumberOfTests === 'skip_all') $skipinfo = ' # '.$this->SkipAllReason; - echo "1..${NumberOfTests}${skipinfo}\n"; + echo "1..{$NumberOfTests}{$skipinfo}\n"; $this->NumberOfTests = $NumberOfTests; return; diff --git a/application/views/file/deleted.php b/application/views/file/deleted.php index 8a5818f2d..741824e58 100644 --- a/application/views/file/deleted.php +++ b/application/views/file/deleted.php @@ -2,7 +2,7 @@ "; foreach ($errors as $error) { - echo "${error["id"]}: ${error["reason"]}
\n"; + echo "{$error["id"]}: {$error["reason"]}
\n"; } echo "

"; } ?> -- cgit v1.2.3-24-g4f1b