@@ -15,7 +15,7 @@ class JsUtils extends \Ajax\JsUtils {
15
15
*/
16
16
protected function _open_script ($ src = '' ) {
17
17
$ str = '<script ' ;
18
- if (($ this ->params ['csp ' ]?? false )==='nonce ' && ContentSecurityManager::isStarted ()) {
18
+ if (($ this ->params ['csp ' ] ?? false ) === 'nonce ' && ContentSecurityManager::isStarted ()) {
19
19
$ nonce = ContentSecurityManager::getNonce ('jsUtils ' );
20
20
$ str .= ' nonce=" ' . $ nonce . '" ' ;
21
21
}
@@ -24,14 +24,13 @@ protected function _open_script($src = '') {
24
24
}
25
25
26
26
public function inline ($ script , $ cdata = true ) {
27
- if (($ this ->params ['csp ' ]?? false )==='hash ' && ContentSecurityManager::isStarted ()) {
28
- $ script = ($ cdata ) ? "\n// <![CDATA[ \n{$ script }\n// ]]> \n" : "\n{$ script }\n" ;
29
- ContentSecurityManager::getHash ('jsUtils ' ,$ script );
27
+ if (($ this ->params ['csp ' ] ?? false ) === 'hash ' && ContentSecurityManager::isStarted ()) {
28
+ $ script = ($ cdata ) ? "\n// <![CDATA[ \n{$ script }\n// ]]> \n" : "\n{$ script }\n" ;
29
+ ContentSecurityManager::getHash ('jsUtils ' , $ script );
30
30
}
31
- return $ this ->_open_script (). $ script. $ this ->_close_script ();
31
+ return $ this ->_open_script () . $ script . $ this ->_close_script ();
32
32
}
33
33
34
-
35
34
public function getUrl ($ url ) {
36
35
return URequest::getUrl ($ url );
37
36
}
@@ -75,9 +74,7 @@ public function renderView($viewName, $parameters = [], $asString = false) {
75
74
if (isset ($ this ->injected )) {
76
75
$ view = $ this ->injected ->getView ();
77
76
$ this ->compile ($ view );
78
- if (isset ($ parameters ))
79
- $ view ->setVars ($ parameters );
80
- return $ view ->render ($ viewName , $ asString );
77
+ return $ this ->injected ->loadView ($ viewName , $ parameters , $ asString );
81
78
}
82
79
throw new \Exception (get_class () . " instance is not properly instancied : you omitted the second parameter \$controller! " );
83
80
}
0 commit comments