Skip to content

Commit

Permalink
Fix BOM removal when a classlist file is read.
Browse files Browse the repository at this point in the history
This was broken when the UTF-8 encoding method was changed in #1831.
Since the file contents are now UTF-8 decoded, a different regular
expression is needed to match a BOM.

This replaces #2305.  That pull request will be closed.
  • Loading branch information
drgrice1 committed Feb 14, 2024
1 parent 24f276d commit cc9dcac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WeBWorK/File/Classlist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sub parse_classlist($) {

# Remove a byte order mark from the beginning of the file if present. Excel inserts this on some systems, and
# the presence of this multibyte character causes a classlist import to fail.
s/^\xEF\xBB\xBF//;
s/^\x{FEFF}//;

s/^\s*//;
s/\s*$//;
Expand Down

0 comments on commit cc9dcac

Please sign in to comment.