]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/BasePath.php
Merge pull request #13161 from annando/bluesky-activities
[friendica.git] / src / Util / BasePath.php
index 06fa5246797028fb1bbee1dc75a5b7184db7726c..4811239295a36e421e1c4c9f209f545e5ed36449 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Util;
 
@@ -24,7 +43,7 @@ class BasePath
        }
 
        /**
-        * @brief Returns the base filesystem path of the App
+        * Returns the base Friendica filesystem path without trailing slash
         *
         * It first checks for the internal variable, then for DOCUMENT_ROOT and
         * finally for PWD
@@ -52,11 +71,11 @@ class BasePath
                        throw new \Exception(sprintf('\'%s\' is not a valid basepath', $baseDir));
                }
 
-               return $baseDir;
+               return rtrim($baseDir, '/');
        }
 
        /**
-        * @brief Returns a normalized file path
+        * Returns a normalized file path
         *
         * This is a wrapper for the "realpath" function.
         * That function cannot detect the real path when some folders aren't readable.