aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-11-19 19:36:07 -0500
committerDavid King <imkingdavid@gmail.com>2013-07-06 23:21:56 -0400
commit0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea (patch)
treedcaf6516fd866455e5086e8dabf618adb60ad788 /phpBB
parentc20f92ba1eb089222bfbe7d7acd5992682a9c936 (diff)
downloadforums-0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea.tar
forums-0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea.tar.gz
forums-0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea.tar.bz2
forums-0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea.tar.xz
forums-0f522ddf5fb6e7d268f9d9cf428b8e3985f374ea.zip
[ticket/11215] A few minor optimizations for phpbb_get_web_root_path()
PHPBB3-11215
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 60181c488e..213f178694 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5745,16 +5745,12 @@ function phpbb_get_web_root_path(Request $symfony_request)
$path_info = $symfony_request->getPathInfo();
if ($path_info == '/')
{
- return '';
+ $path = '';
+ return $path;
}
- $corrections = substr_count($symfony_request->getPathInfo(), '/');
-
- $path = '';
- for ($i = 0; $i < $corrections; $i++)
- {
- $path .= '../';
- }
+ $corrections = substr_count($path_info, '/');
+ $path = str_repeat('../', $corrections);
return $path;
}