@@ -62,7 +62,8 @@ public static function getNonce(string $name): string {
6262 public static function getHash (string $ name , string $ code , string $ algo = 'sha256 ' ): string {
6363 $ code = \preg_replace ('/\r\n/ ' , '\n ' , $ code );
6464 $ hash = \base64_encode (\hash ($ algo , $ code , true ));
65- if (isset (self ::$ onGenerate ) && ! URequest::isAjax ()) {
65+ $ hash ="$ algo- $ hash " ;
66+ if (isset (self ::$ onGenerate ) && !URequest::isAjax ()) {
6667 $ onG = self ::$ onGenerate ;
6768 $ onG ($ name , $ hash , $ algo );
6869 }
@@ -114,7 +115,7 @@ public static function clearCsp(): void {
114115 * @return ContentSecurity
115116 */
116117 public static function defaultUbiquity (?bool $ reportOnly = null ): ContentSecurity {
117- return self ::$ csp [] = ContentSecurity::defaultUbiquity ()->reportOnly ($ reportOnly );
118+ return self ::$ csp [' defaultUbiquity ' ] ?? = ContentSecurity::defaultUbiquity ()->reportOnly ($ reportOnly );
118119 }
119120
120121 /**
@@ -125,7 +126,7 @@ public static function defaultUbiquity(?bool $reportOnly = null): ContentSecurit
125126 * @return ContentSecurity
126127 */
127128 public static function defaultUbiquityDebug (?bool $ reportOnly = null , string $ livereloadServer = '127.0.0.1:35729 ' ): ContentSecurity {
128- return self ::$ csp [] = ContentSecurity::defaultUbiquityDebug ($ livereloadServer )->reportOnly ($ reportOnly );
129+ return self ::$ csp [' defaultUbiquity ' ] ?? = ContentSecurity::defaultUbiquityDebug ($ livereloadServer )->reportOnly ($ reportOnly );
129130 }
130131
131132 /**
0 commit comments