[Customisation Database Commits] r1113 - /trunk/titania/includes/core/url.php

Nathan Guse exreaction at phpbb.com
Thu Apr 22 17:50:47 BST 2010


Author: EXreaction
Date: Thu Apr 22 17:50:47 2010
New Revision: 1113

Log:
Only add a slash at the end if one does not already exist (when exploding, if it ends in / it will have one item as blank at the end and would add two slashes at the end as it was before)

Modified:
    trunk/titania/includes/core/url.php

Modified: trunk/titania/includes/core/url.php
==============================================================================
*** trunk/titania/includes/core/url.php (original)
--- trunk/titania/includes/core/url.php Thu Apr 22 17:50:47 2010
***************
*** 82,88 ****
  		// URL Encode the base
  		$base = explode('/', $base);
  		$base = array_map('urlencode', $base);
! 		$base = implode('/', $base) . '/';
  
  		// Start building the final URL
  		$final_url = self::$root_url . $base;
--- 82,94 ----
  		// URL Encode the base
  		$base = explode('/', $base);
  		$base = array_map('urlencode', $base);
! 		$base = implode('/', $base);
! 
! 		// Add a slash to the end if we do not have one
! 		if (substr($base, -1) != '/')
! 		{
! 			$base .= '/';
! 		}
  
  		// Start building the final URL
  		$final_url = self::$root_url . $base;




More information about the customisationdb-commits mailing list