[mirotalksfu] - add filterXSS

هذا الالتزام موجود في:
Miroslav Pejic
2024-07-02 15:21:05 +02:00
الأصل 8ed2e9a910
التزام 926e64d334
3 ملفات معدلة مع 12 إضافات و11 حذوفات

عرض الملف

@@ -7466,7 +7466,7 @@ class RoomClient {
} }
async startRTMP() { async startRTMP() {
if (!this.isRTMPVideoSupported(this.selectedRtmpFilename)) { if (!this.isRTMPVideoSupported(filterXSS(this.selectedRtmpFilename))) {
this.getId('file-name').textContent = ''; this.getId('file-name').textContent = '';
return this.userLog( return this.userLog(
'warning', 'warning',
@@ -7477,9 +7477,9 @@ class RoomClient {
this.socket this.socket
.request('startRTMP', { .request('startRTMP', {
file: this.selectedRtmpFilename, file: filterXSS(this.selectedRtmpFilename),
peer_name: this.peer_name, peer_name: filterXSS(this.peer_name),
peer_uuid: this.peer_uuid, peer_uuid: filterXSS(this.peer_uuid),
}) })
.then(function (rtmp) { .then(function (rtmp) {
rc.event(_EVENTS.startRTMP); rc.event(_EVENTS.startRTMP);
@@ -7523,7 +7523,7 @@ class RoomClient {
// ############################################## // ##############################################
startRTMPfromURL(inputVideoURL) { startRTMPfromURL(inputVideoURL) {
if (!this.isRTMPVideoSupported(inputVideoURL)) { if (!this.isRTMPVideoSupported(filterXSS(inputVideoURL))) {
this.getId('rtmpStreamURL').value = ''; this.getId('rtmpStreamURL').value = '';
return this.userLog( return this.userLog(
'warning', 'warning',
@@ -7534,9 +7534,9 @@ class RoomClient {
this.socket this.socket
.request('startRTMPfromURL', { .request('startRTMPfromURL', {
inputVideoURL: inputVideoURL, inputVideoURL: filterXSS(inputVideoURL),
peer_name: this.peer_name, peer_name: filterXSS(this.peer_name),
peer_uuid: this.peer_uuid, peer_uuid: filterXSS(this.peer_uuid),
}) })
.then(function (rtmp) { .then(function (rtmp) {
rc.event(_EVENTS.startRTMPfromURL); rc.event(_EVENTS.startRTMPfromURL);
@@ -7617,7 +7617,7 @@ class RoomClient {
} }
const rtmpUrl = rc.getId('rtmp-url'); const rtmpUrl = rc.getId('rtmp-url');
rtmpUrl.value = rtmp; rtmpUrl.value = filterXSS(rtmp);
Swal.fire({ Swal.fire({
background: swalBackground, background: swalBackground,

عرض الملف

@@ -12,8 +12,8 @@ const popupMessage = document.getElementById('popupMessage');
const closePopup = document.getElementById('closePopup'); const closePopup = document.getElementById('closePopup');
const qs = new URLSearchParams(window.location.search); const qs = new URLSearchParams(window.location.search);
const videoId = qs.get('v'); const videoId = filterXSS(qs.get('v'));
const audioId = qs.get('a'); const audioId = filterXSS(qs.get('a'));
console.log('Video/Audio id', { console.log('Video/Audio id', {
video: videoId, video: videoId,

عرض الملف

@@ -52,6 +52,7 @@
<!-- UAParser --> <!-- UAParser -->
<script defer src="https://cdn.jsdelivr.net/npm/ua-parser-js@latest/dist/ua-parser.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/ua-parser-js@latest/dist/ua-parser.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/xss/dist/xss.min.js"></script>
<!-- JS scripts --> <!-- JS scripts -->
<script defer src="../js/Brand.js"></script> <script defer src="../js/Brand.js"></script>