Fix crash when push notification icon URL has illegal characters - #23138
Merged
Conversation
A push notification icon URL that decodes to an illegal character (e.g. an unencoded space) caused ImageUtils.downloadBitmap to throw an unchecked IllegalArgumentException, crashing the entire Firebase push-message handler. Widen the catch in getLargeIconBitmap to skip the large icon instead. Fixes JETPACK-ANDROID-1BYM Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
adalpari
marked this pull request as ready for review
July 23, 2026 11:29
Contributor
|
|
Contributor
|
|
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.


Description
Fixes JETPACK-ANDROID-1BYM
Incoming push notifications can carry an icon URL that, after
URLDecoder.decode, contains an illegal character such as an unencoded space (e.g..../uploads/Board Logo/cropped-...png). That decoded URL flows intoImageUtils.downloadBitmap, which builds ajava.net.URIand throws an uncheckedIllegalArgumentException("Illegal character in path"). Because it was uncaught, a single malformed icon URL crashed the entire Firebase push-message handler (fatal,UncaughtExceptionHandler).ImageUtils.downloadBitmaplives in the externalWordPress-Utils-Androidlibrary and can't be changed here, so the fix is in the caller: the existingcatchingetLargeIconBitmapnow also handlesIllegalArgumentException. A malformed icon URL is logged and the notification is shown without the large icon instead of crashing.This is the only large-icon entry point, so the other notification code paths that call
getLargeIconBitmapare covered as well.Testing instructions
This crash requires a push notification whose
iconfield decodes to a URL containing an illegal character (e.g. a space), which is hard to reproduce on demand. Since the PR just handling a new exception, green CI should be enough