Skip to content

Commit

Permalink
NOMDL MNet: improved trailing slashes removal
Browse files Browse the repository at this point in the history
Double slashes and eventual whitespace after trailing slash are now
removed, too.
  • Loading branch information
mudrd8mz committed Jul 12, 2010
1 parent e7c1d02 commit d55b0e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/mnet/peers.php
Expand Up @@ -77,7 +77,8 @@
// if the first form has been submitted, bootstrap the peer and load up the review form
if ($formdata = $simpleform->get_data()) {
// ensure we remove trailing slashes
$formdata->wwwroot = preg_replace(':/$:', '', $formdata->wwwroot);
$formdata->wwwroot = trim($formdata->wwwroot);
$formdata->wwwroot = rtrim($formdata->wwwroot, '/');

// ensure the wwwroot starts with a http or https prefix
if (strtolower(substr($formdata->wwwroot, 0, 4)) != 'http') {
Expand Down

0 comments on commit d55b0e6

Please sign in to comment.