mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Fixes #497 - Prevent frontpage setting of index.php
This commit is contained in:
@@ -37,7 +37,7 @@ $frontPref = e107::pref('core'); // Get prefs
|
|||||||
// Get list of possible options for front page
|
// Get list of possible options for front page
|
||||||
$front_page['news'] = array('page' => 'news.php', 'title' => ADLAN_0); // TODO Move to e107_plugins/news
|
$front_page['news'] = array('page' => 'news.php', 'title' => ADLAN_0); // TODO Move to e107_plugins/news
|
||||||
|
|
||||||
$front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28);
|
$front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28, 'diz'=>'index.php');
|
||||||
|
|
||||||
if($sql->db_Select('page', 'page_id, page_title', "menu_name=''")) // TODO Move to e107_plugins/page
|
if($sql->db_Select('page', 'page_id, page_title', "menu_name=''")) // TODO Move to e107_plugins/page
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,6 @@ if($sql->db_Select('page', 'page_id, page_title', "menu_name=''")) // TODO Move
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Make sure links relative to SITEURL
|
// Make sure links relative to SITEURL
|
||||||
foreach($front_page as &$front_value)
|
foreach($front_page as &$front_value)
|
||||||
{
|
{
|
||||||
@@ -91,7 +90,7 @@ foreach($front_page as &$front_value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print_a($front_page);
|
||||||
|
|
||||||
|
|
||||||
// Now sort out list of rules for display (based on $pref data to start with)
|
// Now sort out list of rules for display (based on $pref data to start with)
|
||||||
@@ -159,6 +158,15 @@ elseif(isset($_POST['fp_dec']))
|
|||||||
|
|
||||||
if (isset($_POST))
|
if (isset($_POST))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// avoid endless loop.
|
||||||
|
if($_POST['frontpage'] == 'other' && (trim($_POST['frontpage_other']) == 'index.php' || trim($_POST['frontpage_other']) == '{e_BASE}index.php'))
|
||||||
|
{
|
||||||
|
$_POST['frontpage'] = 'wmessage';
|
||||||
|
$_POST['frontpage_other'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($_POST as $k => $v)
|
foreach ($_POST as $k => $v)
|
||||||
{
|
{
|
||||||
$incDec = substr($k, 0, 6);
|
$incDec = substr($k, 0, 6);
|
||||||
@@ -674,7 +682,7 @@ class frontpage
|
|||||||
".$this->frm->radio($ob_name, $front_key, $type_selected, array('label'=>$front_value['title']))."
|
".$this->frm->radio($ob_name, $front_key, $type_selected, array('label'=>$front_value['title']))."
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td> </td>";
|
<td>".vartrue($front_value['diz']," ")."</td>";
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user