View Issue Details

IDProjectCategoryView StatusLast Update
0003317OXID eShop (all versions)4.09. SEO, SEO URLpublic2012-12-10 13:34
Reporterivoba Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.3 revision 39087 
Fixed in Version4.5.12 revision 52682 
Summary0003317: _prepareMetaDescription doesnt remove style tags properly
DescriptionIf _getMetaFromContent is the source of the meta decription, then strip_tags in prepareMetaDescription is not sufficient.
If you would have rich text in your content, by f.e. using fckeditor, you will have style definitions and strip_tags wont replace the style declarations.

see: "strip_tags has doesn't recognize that css within the style tags are not document text. To fix this do something similar to the following:

$htmlstring = preg_replace("'<style[^>]*>.*</style>'siU",'',$htmlstring);"

http://php.net/manual/en/function.strip-tags.php
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

ivoba

2011-10-17 16:29

reporter   ~0005328

Last edited: 2011-10-17 17:08

maybe this also belongs to:

_getMetaFromContent()

and should be:

$r = preg_replace("'<style[^>]*>.*</style>'siU",'',$oContent->oxcontents__oxcontent->value);
                return strip_tags( $r );

ivoba

2011-10-17 17:20

reporter   ~0005329

$sMeta = preg_replace('#<(script|style)[^>]*>.+</\1>#Usi','',$sMeta);
this should also go into:
views/details.php (Line: 433 _prepareMetaDescription())

ivoba

2011-10-17 17:31

reporter   ~0005330

and
views/alist.php (Line: 579)
$sDesc = strip_tags( trim( $oStr->strtolower( preg_replace('#<(script|style)[^>]*>.+</\1>#Usi','',$oProduct->getArticleLongDesc()->value )) ) );