Fix block channel channel ID validation#4366
Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom Nov 21, 2023
Merged
Fix block channel channel ID validation#4366FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom
Conversation
PikachuEXE
approved these changes
Nov 21, 2023
ChunkyProgrammer
approved these changes
Nov 21, 2023
kommunarr
approved these changes
Nov 21, 2023
PikachuEXE
added a commit
to PikachuEXE/FreeTube
that referenced
this pull request
Nov 23, 2023
* development: Translated using Weblate (Italian) Translated using Weblate (Polish) Translated using Weblate (Kurdish (Central)) Translated using Weblate (Spanish) Translated using Weblate (Kurdish (Central)) Translated using Weblate (Kurdish) A new way to subscribe (FreeTubeApp#4238) Display more profiles on the profile drop-down list, v2 (fixed for low res, fixed linter) (FreeTubeApp#4359) Translated using Weblate (Estonian) Translated using Weblate (Serbian) Translated using Weblate (Arabic) Translated using Weblate (Chinese (Simplified)) Display currently watching viewer count on live streams (FreeTubeApp#4206) Translated using Weblate (Spanish) Translated using Weblate (Czech) Translated using Weblate (Chinese (Traditional)) Translated using Weblate (Italian) Fix block channel channel ID validation (FreeTubeApp#4366)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix block channel channel ID validation
Pull Request Type
Related issue
Noticed while testing #4347
Description
This fixes the regex used to validate the channel IDs passed into the block channel box in the distraction free settings. The regex was missing the start (
^) and end ($) anchors, which means that this invalid stringbla-UCUQo7nzH1sXVpzL92VesANw-blawould be seen as a valid channel ID, resulting in requests getting sent to YouTube and Invidious which then understandably errored. This pull request adds those missing anchors so that the regex test only returns true if the whole string matches, instead of just a substring, I also changed it from\S, which is any non-whitespace character, to[\w-](A-Za-z0-9_-), previously strings like this would be counted as validUC@@@@@@@@@@@@@@@@@@@@@@too.Testing
bla-UCUQo7nzH1sXVpzL92VesANw-blaUC@@@@@@@@@@@@@@@@@@@@@@It should now show "Channel ID provided was invalid", instead of sending a request to YouTube and Invidious, erorring with "Error retrieving user with the ID provided. Please check again if the ID is correct."
Desktop