WebsiteBaker Community Forum

General Community => Off-Topic => Topic started by: Anonymous on April 30, 2007, 05:22:17 PM

Title: save.php: duplicate code?
Post by: Anonymous on April 30, 2007, 05:22:17 PM
Hi,
browsing through the source and noticed on line 150 in install/save.php

Code: [Select]
// Remove any slashes at the end of the URL
if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
}
if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
}
if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
}
if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
}

Seems to me that if-statements 2 and 4 are exactly the same?
Should the slashes perhaps be // in statement 4?