Looking for a page's feed link can panic on non-ASCII text #72
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feed.rs alternate_feed_link finds tags in text.to_lowercase() and slices the original text at those byte offsets. Unicode lowercasing can change a character's length (e.g. U+0130 becomes 3 bytes from 2), so a page with such a character before its tags is sliced at the wrong place, off a char boundary, which panics. Found while reading the code for #71.
Fixed in
c6980c3: alternate_feed_link lowercases ASCII only, so offsets match the original text; test a_feed_link_after_non_ascii_text_is_found. Deployed.