[MAGNOLIA-6882] Remove legacy code that allows to access site with duplicate prefix in the url Created: 03/Nov/16 Updated: 22/May/17 Resolved: 14/Dec/16 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 5.4, 5.5 |
| Fix Version/s: | 5.4.11, 5.5.1 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Ondrej Chytil | Assignee: | Jaroslav Simak |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Kromeriz 74 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Story Points: | 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Can be seen on the travel demo project: https://demopublic.magnolia-cms.com/travel/travel handle = cleanHandle(handle);
try {
final Session session = MgnlContext.getJCRSession(this.repository);
if (!session.itemExists(handle)) {
String maybeHandle = (this.handlePrefix.endsWith("/") ? "/" : "") + StringUtils.removeStart(handle, this.handlePrefix);
// prefix might have been prepended incorrectly. Second part of the condition is there to match links to binary nodes
if (session.itemExists(maybeHandle) || (maybeHandle.lastIndexOf("/") > 0 && session.itemExists(StringUtils.substringBeforeLast(maybeHandle, "/")))) {
return maybeHandle;
}
}
} catch (RepositoryException e) {
//Log the exception and return handle
log.debug(e.getMessage(), e);
}
return handle;
This code causes that the first /travel is cleared from the url and the result of that is that page that does not exist under path /travel/travel is served. |
| Comments |
| Comment by Milan Divilek [ 15/Dec/16 ] |
|
Please during QA check all potentially duplicate tickets and link them with this ticket. |
| Comment by Philip Mundt [ 22/May/17 ] |
|
Linking to |