Bug #23179
Page Path is displayed incorrectly if there is a Slash (/) in the Page Name
| Status: | New | Start date: | 2010-07-14 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | 4.5.23 | |||
| TYPO3 Version: | 4.4 | Complexity: | ||
| PHP Version: | 5.3 | |||
| Votes: | 0 |
Description
You can best understand the problem when you have a look at the attached screenshot.
If the current page has a slash in the Page Name, the first part of that page name is also displayed in the Path at the upper right, which is not correct.
In the screenshot the "2008/" should not be there.
This problem was introduced with #22799.
(issue imported from #M15115)
Related issues
| related to Core - Bug #22799: rootline says "pid" where it should be "uid" or just "ID" | Closed | 2010-06-03 |
History
Updated by Jo Hasenau 4 months ago
- Target version changed from 0 to 4.5.23
Confirmed for TYPO3 versions up to 6.0.1
The problem is this part of the method getPagePath:
if (is_array($pageRecord) && $pageRecord['uid']) {
$title = substr($pageRecord['_thePathFull'], 0, -1);
// remove current page title
$pos = strrpos($title, '/');
if ($pos !== FALSE) {
$title = substr($title, 0, $pos) . '/';
}
}
This way we just check for the position of the last slash within the string, which is of course the one within the page title.
Actually we should check for the position of the page title instead of the slash, thus making the additional slash superfluous as well.
IMHO it should be
if (is_array($pageRecord) && $pageRecord['uid']) {
$title = substr($pageRecord['_thePathFull'], 0, -1);
// remove current page title
$pos = strrpos($title, $pageRecord['title']);
if ($pos !== FALSE) {
$title = substr($title, 0, $pos);
}
}