File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,20 @@ public function renderHead()
63
63
$ cssRoute = preg_replace ('/\Ahttps?:/ ' , '' , $ cssRoute );
64
64
$ jsRoute = preg_replace ('/\Ahttps?:/ ' , '' , $ jsRoute );
65
65
66
+ $ nonce = $ this ->getNonceAttribute ();
67
+
66
68
$ html = "<link rel='stylesheet' type='text/css' property='stylesheet' href=' {$ cssRoute }' data-turbolinks-eval='false' data-turbo-eval='false'> " ;
67
- $ html .= "<script src=' {$ jsRoute }' data-turbolinks-eval='false' data-turbo-eval='false'></script> " ;
69
+ $ html .= "<script { $ nonce } src=' {$ jsRoute }' data-turbolinks-eval='false' data-turbo-eval='false'></script> " ;
68
70
69
71
if ($ this ->isJqueryNoConflictEnabled ()) {
70
- $ html .= ' <script data-turbo-eval=" false" >jQuery.noConflict(true);</script> ' . "\n" ;
72
+ $ html .= " <script { $ nonce } data-turbo-eval=' false' >jQuery.noConflict(true);</script> " . "\n" ;
71
73
}
72
74
73
- $ html .= $ this ->getInlineHtml ();
75
+ $ inlineHtml = $ this ->getInlineHtml ();
76
+ if ($ nonce != '' ) {
77
+ $ inlineHtml = preg_replace ("/<script>/ " , "<script {$ nonce }> " , $ inlineHtml );
78
+ }
79
+ $ html .= $ inlineHtml ;
74
80
75
81
76
82
return $ html ;
You can’t perform that action at this time.
0 commit comments