File tree Expand file tree Collapse file tree 7 files changed +29
-13
lines changed
engine/Library/ExtJs/overrides
Backend/ExtJs/backend/article
Frontend/Bare/frontend/detail Expand file tree Collapse file tree 7 files changed +29
-13
lines changed Original file line number Diff line number Diff line change 24
24
/** @lends Ext.String */
25
25
//{block name="extjs/overrides/string"}
26
26
Ext . override ( Ext . String , {
27
+ /**
28
+ * @var DOMParser _domParser
29
+ */
30
+ _domParser : new DOMParser ( ) ,
31
+
27
32
/**
28
33
* Return the text content of the element
29
34
*
30
35
* @returns string
31
36
*/
32
37
getText : function ( value ) {
33
- var me = this ,
34
- elementNode ;
38
+ var me = this ;
39
+
40
+ if ( ! value ) {
41
+ return '' ;
42
+ }
35
43
36
- elementNode = document . createElement ( 'div' ) ;
37
- elementNode . innerHTML = value ;
44
+ var elementNodes = me . _domParser
45
+ . parseFromString ( Ext . String . format ( '<div>[0]</div>' , value ) , "text/html" )
46
+ . documentElement
47
+ . querySelectorAll ( 'div' ) ;
38
48
39
- return me . _getText ( [ elementNode ] ) ;
49
+ return me . _getText ( elementNodes ) ;
40
50
} ,
41
51
42
52
/**
Original file line number Diff line number Diff line change @@ -267,7 +267,10 @@ Ext.define('Shopware.apps.Article.controller.Detail', {
267
267
success : function ( record , operation ) {
268
268
269
269
var newArticle = operation . getResultSet ( ) . records [ 0 ] ,
270
- message = Ext . String . format ( me . snippets . saved . message , article . get ( 'name' ) ) ;
270
+ message = Ext . String . format (
271
+ me . snippets . saved . message ,
272
+ Ext . String . htmlEncode ( article . get ( 'name' ) )
273
+ ) ;
271
274
272
275
if ( supplierNeedsReload ) {
273
276
mainWindow . supplierStore . filters . clear ( ) ;
Original file line number Diff line number Diff line change @@ -361,7 +361,10 @@ Ext.define('Shopware.apps.Article.view.detail.Window', {
361
361
362
362
title = me . snippets . titleNew ;
363
363
if ( me . article && me . article . get ( 'id' ) > 0 ) {
364
- title = Ext . String . format ( me . snippets . titleEdit , me . article . get ( 'name' ) ) ;
364
+ title = Ext . String . format (
365
+ me . snippets . titleEdit ,
366
+ Ext . String . htmlEncode ( me . article . get ( 'name' ) )
367
+ ) ;
365
368
}
366
369
me . setTitle ( title ) ;
367
370
Original file line number Diff line number Diff line change 7
7
{ * Product name *}
8
8
{ block name= ' frontend_detail_index_name' }
9
9
<h1 class =" product--title" itemprop =" name" >
10
- { $sArticle .articleName}
10
+ { $sArticle .articleName|escape }
11
11
</h1 >
12
12
{ /block }
13
13
Original file line number Diff line number Diff line change 1
1
{ extends file= ' frontend/index/header.tpl' }
2
2
3
3
{ * Meta title *}
4
- { block name= " frontend_index_header_title" } { if $sArticle .metaTitle} { $sArticle .metaTitle|escape Html} | { {config name= sShopname} |escapeHtml}{ else } { $sArticle .articleName} | { $smarty .block .parent} { /if } { /block }
4
+ { block name= " frontend_index_header_title" } { if $sArticle .metaTitle} { $sArticle .metaTitle|escape Html} | { {config name= sShopname} |escapeHtml}{ else } { $sArticle .articleName|escape } | { $smarty .block .parent} { /if } { /block }
5
5
6
6
{ * Meta opengraph tags *}
7
7
{ block name= ' frontend_index_header_meta_tags_opengraph' }
Original file line number Diff line number Diff line change 47
47
{ * Review title *}
48
48
{ block name= " frontend_detail_tabs_rating_title" }
49
49
<div class =" content--title" >
50
- { s name= " DetailCommentHeader" } { /s} "{ $sArticle .articleName} "
50
+ { s name= " DetailCommentHeader" } { /s} "{ $sArticle .articleName|escape } "
51
51
</div >
52
52
{ /block }
53
53
Original file line number Diff line number Diff line change 19
19
{ * Headline *}
20
20
{ block name= ' frontend_detail_description_title' }
21
21
<div class =" content--title" >
22
- { s name= " DetailDescriptionHeader" } { /s} "{ $sArticle .articleName} "
22
+ { s name= " DetailDescriptionHeader" } { /s} "{ $sArticle .articleName|escape } "
23
23
</div >
24
24
{ /block }
25
25
59
59
{ * Further links title *}
60
60
{ block name= ' frontend_detail_description_links_title' }
61
61
<div class =" content--title" >
62
- { s name= " ArticleTipMoreInformation" } { /s} "{ $sArticle .articleName} "
62
+ { s name= " ArticleTipMoreInformation" } { /s} "{ $sArticle .articleName|escape } "
63
63
</div >
64
64
{ /block }
65
65
148
148
{ * Comment title *}
149
149
{ block name= ' frontend_detail_description_our_comment_title' }
150
150
<div class =" content--title" >
151
- { s name= ' DetailDescriptionComment' } { /s} "{ $sArticle .articleName} "
151
+ { s name= ' DetailDescriptionComment' } { /s} "{ $sArticle .articleName|escape } "
152
152
</div >
153
153
{ /block }
154
154
You can’t perform that action at this time.
0 commit comments