Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046773
D339.id849.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 29, 3:58 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Mon, Jun 30, 3:58 AM (4 h, 59 m)
Engine
blob
Format
Raw Data
Handle
676760
Attached To
D339: INP-1740 - Make CKEditor URL preview respect "SEO URL Ending"
D339.id849.diff
View Options
Index: core/units/fck/fck_eh.php
===================================================================
--- core/units/fck/fck_eh.php
+++ core/units/fck/fck_eh.php
@@ -79,27 +79,41 @@
$pages = $category_helper->getStructureTreeAsOptions();
- $sql = 'SELECT NamedParentPath, CategoryId
+ $sql = 'SELECT LOWER(NamedParentPath), CategoryId
FROM ' . TABLE_PREFIX . 'Categories
WHERE CategoryId IN (' . implode(',', array_keys($pages)) . ')';
$templates = $this->Conn->GetCol($sql, 'CategoryId');
- $templates[$this->Application->getBaseCategory()] .= '/Index'; // "Content" category will act as "Home Page"
+ // "Content" category will act as "Home Page".
+ $templates[$this->Application->getBaseCategory()] .= '/';
$res = '<?xml version="1.0" encoding="' . CHARSET . '" ?>' . "\n";
$res .= '<CmsPages>' . "\n";
- foreach ($pages as $id => $title) {
+ $url_params = array('pass' => 'm');
+
+ if ( $this->Application->ConfigValue('UseModRewrite') ) {
+ $url_params['__MOD_REWRITE__'] = 1;
+ }
+
+ $base_url = rtrim($this->Application->BaseURL(), '/');
+
+ foreach ( $pages as $id => $title ) {
$template = $templates[$id];
- $page_path = preg_replace('/^Content\//i', '', strtolower($template).'.html');
+ $real_url = $this->Application->HREF($template, '_FRONT_END_', $url_params, 'index.php');
+ $page_path = str_replace($base_url, '', $real_url);
$title = $title . ' (' . $page_path . ')';
- $real_url = $this->Application->HREF($template, '_FRONT_END_', array('pass' => 'm'), 'index.php');
- $res .= '<CmsPage real_url="' . kUtil::escape($real_url, kUtil::ESCAPE_HTML) . '" path="@@' . $id . '@@" title="' . kUtil::escape($title, kUtil::ESCAPE_HTML) . '" st_id="' . $id . '" serverpath="" />' . "\n";
+ $res .= sprintf(
+ '<CmsPage real_url="%1$s" path="@@%2$d@@" title="%3$s" st_id="%2$d" serverpath="" />' . "\n",
+ kUtil::escape($real_url, kUtil::ESCAPE_HTML),
+ $id,
+ kUtil::escape($title, kUtil::ESCAPE_HTML)
+ );
}
- $res.= "</CmsPages>";
+ $res .= '</CmsPages>';
$this->CreateXmlHeader();
echo $res;
Event Timeline
Log In to Comment