Closing website / breaks favicon

kapearl

Member
If a member has added a / at the end of their website, it breaks the favicon on a members site list since /favicon.ico is added. Not a major issue but was something I have finally been able to debug and was still curious about. This was happening in the member control panel pages- not sure where else a members favicon appears but that is where I was seeing it.

Is there a way to strip closing / from any members websites if they have added them? Most people don't but in case they do?

Example:
http://www.website.com vs http://www.website.com/
 

Mark

Administrator
Staff member
yup, you can do this with a plugin to run the trim() function on the $TMPL['url'] variable. When I get a few free moments I will find the best hook location for you so we can spin up a plugin to handle this.
 

Basti

Administrator
Staff member
better to include it into the core right on if you ask me and post the changes here
 

Mark

Administrator
Staff member
My fear with including in the core is some sites use rewrites that require the trailing slash, these sites produce 404 if the slash is missing. This mostly only applies to internal pages and not the root domain, but still not sure if this would be a good idea for the core.
 

Basti

Administrator
Staff member
I think either of us understood the issue wrong.
As i understand his issue is that some sites submit a url ending with traling slash. Nothing wrong at this point

Now in userpanel for users with multiple sites submitted, they see the favicon in the list
Code:
background: url('.$ourl.'/favicon.ico)
My propose was meant for this, strip trailing slash from $ourl, since as he said it breaks

Not touch $TMPL['url'] at all, since that as you said has to be as the user submits it
 

Mark

Administrator
Staff member
good call :) this is easy and the correct fix. I will update the core and post back the change here.
 
Top