-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from humhub/internal-f-53-external-links-issu…
…e-ios Redirect to external screen for links in ios
- Loading branch information
Showing
3 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class BlackListRules { | ||
// Define the blacklist of URLs | ||
static const List<String> _blacklist = [ | ||
'https://discord.com/', | ||
]; | ||
|
||
/// Checks if the provided [url] is on the blacklist. | ||
/// Returns true if the URL is blacklisted, false otherwise. | ||
static bool check(String url) { | ||
// Normalize the URL by trimming whitespace and converting to lowercase | ||
final normalizedUrl = url.trim().toLowerCase(); | ||
|
||
// Check if the normalized URL is in the blacklist | ||
return _blacklist.contains(normalizedUrl); | ||
} | ||
} |