Skip to content

Commit

Permalink
refactor(encoding): Check if strings are valid for the specified enco…
Browse files Browse the repository at this point in the history
…ding

Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored Jan 29, 2025
1 parent a606b66 commit f3b4fdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/Wrapper/Encoding.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(array $parameters) {
* Returns whether the given string is only made of ASCII characters
*/
private function isAscii(string $str): bool {
return !preg_match('/[\\x80-\\xff]+/', $str);
return mb_check_encoding($str, 'ASCII');
}

/**
Expand Down

0 comments on commit f3b4fdc

Please sign in to comment.