|
18 | 18 | */ |
19 | 19 |
|
20 | 20 | /* |
21 | | - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. |
| 21 | + * Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. |
22 | 22 | * Portions Copyright (c) 2011, Jens Elkner. |
23 | 23 | * Portions Copyright (c) 2017, 2020, Chris Fraire <cfraire@me.com>. |
24 | 24 | * Portions Copyright (c) 2023, Gino Augustine <gino.augustine@oracle.com>. |
@@ -1101,7 +1101,10 @@ public Prefix getPrefix() { |
1101 | 1101 | * Get the canonical path of the related resource relative to the source |
1102 | 1102 | * root directory (used file separators are all {@link org.opengrok.indexer.index.Indexer#PATH_SEPARATOR}). |
1103 | 1103 | * No check is made, whether the obtained path is really an accessible resource on disk. |
1104 | | - * |
| 1104 | + * <p> |
| 1105 | + * Also, care needs to be taken when embedding the result in a page. Consider using {@link Util#htmlize(String)} |
| 1106 | + * or {@link Util#uriEncodePath(String)}. |
| 1107 | + * </p> |
1105 | 1108 | * @return a possible empty String (denotes the source root directory) but not {@code null}. |
1106 | 1109 | * @see HttpServletRequest#getPathInfo() |
1107 | 1110 | */ |
@@ -1738,6 +1741,9 @@ public String getHistoryTitle() { |
1738 | 1741 | return Util.htmlize(getShortPath(strPath) + " - OpenGrok history log for " + strPath); |
1739 | 1742 | } |
1740 | 1743 |
|
| 1744 | + /** |
| 1745 | + * @return page title string with base name of the path and optionally revision ID, HTML encoded |
| 1746 | + */ |
1741 | 1747 | public String getPathTitle() { |
1742 | 1748 | String strPath = getPath(); |
1743 | 1749 | String title = getShortPath(strPath); |
|
0 commit comments