UI: Restrict regex pattern for OAuth secrets

The current regex pattern will successfully match if the cache variable
contains the pattern anywhere inside the string. Let's restrict the
regex pattern such that it requires the pattern to be precisely between
the beginning and end of the string with no other characters in between
those anchor points.
This commit is contained in:
Ryan Foster
2023-09-06 15:06:59 -04:00
parent d97950445e
commit 3239e2a1f2
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
if(RESTREAM_CLIENTID
AND RESTREAM_HASH MATCHES "(0|[a-fA-F0-9]+)"
AND RESTREAM_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND TARGET OBS::browser-panels)
target_sources(obs-studio PRIVATE auth-restream.cpp auth-restream.hpp)
target_enable_feature(obs-studio "Restream API connection" RESTREAM_ENABLED)
+1 -1
View File
@@ -1,5 +1,5 @@
if(TWITCH_CLIENTID
AND TWITCH_HASH MATCHES "(0|[a-fA-F0-9]+)"
AND TWITCH_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND TARGET OBS::browser-panels)
target_sources(obs-studio PRIVATE auth-twitch.cpp auth-twitch.hpp)
target_enable_feature(obs-studio "Twitch API connection" TWITCH_ENABLED)
+2 -2
View File
@@ -1,7 +1,7 @@
if(YOUTUBE_CLIENTID
AND YOUTUBE_SECRET
AND YOUTUBE_CLIENTID_HASH MATCHES "(0|[a-fA-F0-9]+)"
AND YOUTUBE_SECRET_HASH MATCHES "(0|[a-fA-F0-9]+)")
AND YOUTUBE_CLIENTID_HASH MATCHES "^(0|[a-fA-F0-9]+)$"
AND YOUTUBE_SECRET_HASH MATCHES "^(0|[a-fA-F0-9]+)$")
target_sources(
obs-studio
PRIVATE # cmake-format: sortable