We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 807644f commit 75e3a18Copy full SHA for 75e3a18
Ajax/JsUtils.php
@@ -513,4 +513,8 @@ public function _add_event($element, $js, $event, $preventDefault = false, $stop
513
public function getInjected() {
514
return $this->injected;
515
}
516
+
517
+ public function setParam(string $param,$value){
518
+ $this->params[$param]=$value;
519
+ }
520
Ajax/php/ubiquity/JsUtils.php
@@ -15,14 +15,23 @@ class JsUtils extends \Ajax\JsUtils {
15
*/
16
protected function _open_script($src = '') {
17
$str = '<script ';
18
- if (($this->params['nonce']??false) && ContentSecurityManager::isStarted()) {
+ if (($this->params['csp']??false)==='nonce' && ContentSecurityManager::isStarted()) {
19
$nonce = ContentSecurityManager::getNonce('jsUtils');
20
$str .= ' nonce="' . $nonce . '" ';
21
22
$str .= ($src == '') ? '>' : ' src="' . $src . '">';
23
return $str;
24
25
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);
30
31
+ return $this->_open_script().$script.$this->_close_script();
32
33
34
35
public function getUrl($url) {
36
return URequest::getUrl($url);
37
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments