mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Update cpage.php
Added check to prevent saving page\menu with empty page_title & menu_name fields when edit.
This commit is contained in:
parent
d01a0b6e83
commit
e72b1ca30e
@ -1030,7 +1030,7 @@ class page_admin_ui extends e_admin_ui
|
||||
|
||||
$newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata);
|
||||
|
||||
$newdata['menu_name'] = preg_replace('/[^\w-*]/','-',$newdata['menu_name']);
|
||||
$newdata['menu_name'] = preg_replace('/[^\w\-*]/','-',$newdata['menu_name']);
|
||||
|
||||
if(empty($newdata['page_sef']))
|
||||
{
|
||||
@ -1074,11 +1074,16 @@ class page_admin_ui extends e_admin_ui
|
||||
function beforeUpdate($newdata,$olddata, $id)
|
||||
{
|
||||
|
||||
if(isset($newdata['page_title']) && isset($newdata['menu_name']) && empty($newdata['page_title']) && empty($newdata['menu_name']))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_79);
|
||||
return false;
|
||||
}
|
||||
$newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata);
|
||||
|
||||
if(isset($newdata['menu_name']))
|
||||
{
|
||||
$newdata['menu_name'] = preg_replace('/[^\w-*]/','',$newdata['menu_name']);
|
||||
$newdata['menu_name'] = preg_replace('/[^\w\-*]/','',$newdata['menu_name']);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user