Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [Done 1.4.0] meta tags not stripping HTML out of titles

[Done 1.4.0] meta tags not stripping HTML out of titles

Locked

Started by emmdee on 5 Jul 2008, 7:55 AM · Views: 2,795

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Jul 2008, 7:55 AM
#1
emmdee avatar

emmdee

New Zenner

Join Date:
Nov 2005
Posts:
40
Plugin Contributions:
0

[Done 1.4.0] meta tags not stripping HTML out of titles

php5.2.5
zen1.3.8a
mysql 5.2
My client has large product names...
He has inserted html break tags in the prod_name field. (varchar)
ie BIG product <br> 60mm <br> etc.
He has done the meta tag setup for some products which include product name.
The top bar of the browser shows the product name and the site description. The products without metatag definitions set do not show the html <br> tags.
The products with meta tags set Do show them as text..ie
BIG product <br> 60mm <br>.
Can anyone help me with this.
Ive tried changing the mime-type in the db but it makes no difference.
Would it be that the function that is generating the top bar info is not stripping out the html??,,,...but the tags only show up as text when metatags are defined...
Its an ugly look, ALSO the<> parts of the tags are stripped out in the navigation toolbar but the br becomes part of the address. Very messy.
UNDEFINED EXAMPLE
http://thebeadman.com.au/catalog/glass-bugle-bead-budgetbrpink-6mmbrclear-colour-lined-p-225.html
DEFINED EXAMPLE
http://thebeadman.com.au/catalog/glass-bugle-bead-budgetbraquamarine-6mmbrtransparent-ab-p-144.html
If someone could throw some light on this I would be eternally grateful.
Cheers
emmdee

5 Jul 2008, 8:11 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done 1.4.0] meta tags not stripping HTML out of titles

Try this:
/includes/modules/meta_tags.php
around line 258, you'll see this:define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name)); define('META_TAG_DESCRIPTION', str_replace('"','',$metatags_description . ' ')); define('META_TAG_KEYWORDS', str_replace('"','',$metatags_keywords)); // KEYWORDS and CUSTOM_KEYWORDS are added abovemake the additions shown:```
define('META_TAG_TITLE', str_replace('"','',[B]zen_clean_html([/B]$review_on . $meta_products_name[B])[/B]));
define('META_TAG_DESCRIPTION', str_replace('"','',[B]zen_clean_html([/B]$metatags_description . ' '[B])[/B]));
define('META_TAG_KEYWORDS', str_replace('"','',[B]zen_clean_html([/B]$metatags_keywords[B])[/B])); // KEYWORDS and CUSTOM_KEYWORDS are added above

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Jul 2008, 8:22 AM
#3
emmdee avatar

emmdee

New Zenner

Join Date:
Nov 2005
Posts:
40
Plugin Contributions:
0

Re: [Done 1.4.0] meta tags not stripping HTML out of titles

Thanks dr

works a treat locally...will do the remote thing later
much appreciated

cheers emmdee

5 Jul 2008, 8:38 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [Done 1.4.0] meta tags not stripping HTML out of titles

Moving to bug reports area to be addressed in future release.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Jul 2008, 11:04 PM
#5
emmdee avatar

emmdee

New Zenner

Join Date:
Nov 2005
Posts:
40
Plugin Contributions:
0

Re: [Done 1.4.0] meta tags not stripping HTML out of titles

Dr Byte
I made a mistake with my version nos.
I applied the html clean to 1.3.7 cart mods/meta_tags.
Solved the info bar prob.
Did the same on 1.3.8a locally and the prob is NOT solved.
There must be some more cleaning to do.
Regards
emmdee