[MAGNOLIA-3119] unicodenormalization filter tries to overwrite orginaluri and orginalurl of aggregationstate: there are two pitfalls Created: 11/Mar/10  Updated: 23/Jan/13  Resolved: 19/Mar/10

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 4.3

Type: Bug Priority: Major
Reporter: Manuel Molaschi Assignee: Manuel Molaschi
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File fix-NullPointerException.patch    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

unicodenormalization filter tries to overwrite orginaluri and orginalurl of aggregationstate.
There are two pitfalls:

  1. if the url is sent in nfd and then normalized to nfc by the filter, that tries to set it back on AggregationState using setOriginalUri; but the new url is not equal (nfd -> nfc) to the previous and this will throw an illegalstateexception
  2. even if the original uri is nfc, but the contextpath has the same name as the first clean uri token:
    i.e. the uri is http://www.mydomain.com/thename/thename/en/home.html with context path = "/thename" and clean url "/thename/en/home.html"
    • contenttypefilter set originaluri /thename/en/home.html
    • unicodenormalizationfilter tries to overwrite with normalized /thename/en/home.html but the AggregationState.setOriginalUri strips /thename, compares /thename/en/home.html (original) with and /en/home.html and then throws illegalstateexception!


 Comments   
Comment by Diego Schivo [ 12/Mar/10 ]

Manuel, using revision 32572 of UnicodeNormalizationFilter I get a NullPointerException: aggregationState.originalURI is null because of MgnlContext.resetAggregationState().
I think aggregationState.originalBrowserURI should be used instead, see attachment: fix-NullPointerException.patch.

Comment by Magnolia International [ 19/Mar/10 ]

What is the status for this issue ?

(Sorry Manuel, realized just now you weren't in the right groups to get this assigned to you)

Comment by Manuel Molaschi [ 19/Mar/10 ]

fixed

Generated at Mon Feb 12 03:43:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.