Skip to content

Commit 86c85d9

Browse files
committed
updates to the json encoding enabling hte unescaped unicode and slashes options
1 parent 59b883a commit 86c85d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

web/github.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
} elseif (isset($Message['commit']) && isset($Message['commit']['commit']['author']['name'])) {
5151
$Msg['alias'] = $Message['commit']['commit']['author']['name'];
5252
}
53-
file_put_contents(__DIR__.'/../log/'.date('Ymd_His').'_'.$EventType.(isset($Message['action']) ? '_'.$Message['action'] : '').'_'.$User.'_'.str_replace(['/', '-', ' '], ['_', '_', '_'], $RepositoryName).'.json', json_encode($log, JSON_PRETTY_PRINT));
53+
file_put_contents(__DIR__.'/../log/'.date('Ymd_His').'_'.$EventType.(isset($Message['action']) ? '_'.$Message['action'] : '').'_'.$User.'_'.str_replace(['/', '-', ' '], ['_', '_', '_'], $RepositoryName).'.json', json_encode($log, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
5454
if (empty($Message)) {
5555
throw new Exception('Empty message, not sending.');
5656
}
@@ -207,7 +207,7 @@ function SendToChat(string $Where, array $Payload) : bool
207207
CURLOPT_CONNECTTIMEOUT => 30,
208208
CURLOPT_URL => $Url,
209209
CURLOPT_POST => true,
210-
CURLOPT_POSTFIELDS => json_encode($Payload),
210+
CURLOPT_POSTFIELDS => json_encode($Payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
211211
CURLOPT_HTTPHEADER => [
212212
'Content-Type: application/json',
213213
],
@@ -231,7 +231,7 @@ function SendToChat(string $Where, array $Payload) : bool
231231
CURLOPT_POSTFIELDS => json_encode([
232232
'type' => 'message',
233233
'message' => $Payload['text']
234-
]),
234+
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
235235
CURLOPT_HTTPHEADER => [
236236
'Content-Type: application/json',
237237
],

0 commit comments

Comments
 (0)