Skip to content

Commit

Permalink
* websites: purify "aliases" entries
Browse files Browse the repository at this point in the history
  • Loading branch information
NavigateCMS committed Jun 19, 2020
1 parent a5e758b commit b1a17ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/packages/websites/website.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ public function load_from_post()

foreach($_POST['website-aliases-alias'] as $key => $value)
{
$value = trim($value);
$value = core_purify_string($value);
if(!empty($value))
{
$value_real = trim($_POST['website-aliases-real'][$key]);
$value_real = core_purify_string($_POST['website-aliases-real'][$key]);
if(!empty($value_real))
{
$this->aliases[$value] = $value_real;
Expand Down
6 changes: 6 additions & 0 deletions lib/packages/websites/websites.php
Original file line number Diff line number Diff line change
Expand Up @@ -1392,9 +1392,15 @@ function navigate_naviorderedtable_website_languages_table_reorder()
));

if(!is_array($item->aliases))
{
$item->aliases = array();
}

foreach($item->aliases as $alias => $realurl)
{
$alias = core_special_chars($alias);
$realurl = core_special_chars($realurl);

$table->addRow($lang->code, array(
array('content' => '<input type="text" name="website-aliases-alias[]" value="'.$alias.'" style="width: 300px;" />', 'align' => 'left'),
array('content' => '&rarr;', 'align' => 'center'),
Expand Down

0 comments on commit b1a17ae

Please sign in to comment.