[GH-ISSUE #671] Use another variable assignment with a combined operator #474

Open
opened 2026-03-02 15:59:02 +03:00 by kerem · 0 comments
Owner

Originally created by @elfring on GitHub (Nov 23, 2021).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/671

👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 I propose to increase the usage of combined operators accordingly.

diff --git a/tinyfilemanager.php b/tinyfilemanager.php
index 3d7052a..9c53ae5 100644
--- a/tinyfilemanager.php
+++ b/tinyfilemanager.php
@@ -220,7 +220,7 @@ $is_https = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['
 // update $root_url based on user specific directories
 if (isset($_SESSION[FM_SESSION_ID]['logged']) && !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']])) {
     $wd = fm_clean_path(dirname($_SERVER['PHP_SELF']));
-    $root_url =  $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
+    $root_url .= $wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
 }
 // clean $root_url
 $root_url = fm_clean_path($root_url);
Originally created by @elfring on GitHub (Nov 23, 2021). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/671 :eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to [increase the usage of combined operators](https://www.php.net/manual/en/language.operators.assignment.php#language.operators.assignment.arithmetic "Description for assignment operators") accordingly. ```diff diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 3d7052a..9c53ae5 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -220,7 +220,7 @@ $is_https = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER[' // update $root_url based on user specific directories if (isset($_SESSION[FM_SESSION_ID]['logged']) && !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']])) { $wd = fm_clean_path(dirname($_SERVER['PHP_SELF'])); - $root_url = $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']]; + $root_url .= $wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']]; } // clean $root_url $root_url = fm_clean_path($root_url); ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#474
No description provided.