replace remove_trailing_slash with a simple rtrim
This commit is contained in:
parent
f28e78b6f0
commit
7eca12b495
1 changed files with 1 additions and 14 deletions
15
install.php
15
install.php
|
@ -100,7 +100,7 @@ assert_options(ASSERT_BAIL, 1);
|
||||||
* __SHIMMIE_ROOT__ = '/var/www/shimmie2/'
|
* __SHIMMIE_ROOT__ = '/var/www/shimmie2/'
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
define('__SHIMMIE_ROOT__', trim(remove_trailing_slash(dirname(__FILE__))) . '/');
|
define('__SHIMMIE_ROOT__', trim(rtrim(dirname(__FILE__), '/\\')) . '/');
|
||||||
|
|
||||||
// Pull in necessary files
|
// Pull in necessary files
|
||||||
require_once __SHIMMIE_ROOT__."core/util.inc.php";
|
require_once __SHIMMIE_ROOT__."core/util.inc.php";
|
||||||
|
@ -114,19 +114,6 @@ do_install();
|
||||||
// utilities {{{
|
// utilities {{{
|
||||||
// TODO: Can some of these be pushed into "core/util.inc.php" ?
|
// TODO: Can some of these be pushed into "core/util.inc.php" ?
|
||||||
|
|
||||||
/**
|
|
||||||
* Strips off any kind of slash at the end so as to normalise the path.
|
|
||||||
* @param string $path Path to normalise.
|
|
||||||
* @return string Path without trailing slash.
|
|
||||||
*/
|
|
||||||
function remove_trailing_slash($path) {
|
|
||||||
if ((substr($path, -1) === '/') || (substr($path, -1) === '\\')) {
|
|
||||||
return substr($path, 0, -1);
|
|
||||||
} else {
|
|
||||||
return $path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_gd_version() {
|
function check_gd_version() {
|
||||||
$gdversion = 0;
|
$gdversion = 0;
|
||||||
|
|
||||||
|
|
Reference in a new issue