* Newly created list shows completed tasks; List name can not have @ and # symbols

This commit is contained in:
Max Pozdeev 2020-08-29 12:35:07 +03:00
parent 48778729d3
commit e34b90fe33
2 changed files with 4 additions and 4 deletions

View file

@ -378,10 +378,10 @@ elseif(isset($_GET['addList']))
stop_gpc($_POST);
$t = array();
$t['total'] = 0;
$name = str_replace(array('"',"'",'<','>','&'),array('','','','',''),trim(_post('name')));
$name = str_replace(array('"',"'",'<','>','&','@','#'),array('','','','','','',''),trim(_post('name')));
$ow = 1 + (int)$db->sq("SELECT MAX(ow) FROM {$db->prefix}lists");
$db->dq("INSERT INTO {$db->prefix}lists (uuid,name,ow,d_created,d_edited) VALUES (?,?,?,?,?)",
array(generateUUID(), $name, $ow, time(), time()) );
$db->dq("INSERT INTO {$db->prefix}lists (uuid,name,ow,d_created,d_edited,taskview) VALUES (?,?,?,?,?,?)",
array(generateUUID(), $name, $ow, time(), time(), 1) );
$id = $db->last_insert_id();
$t['total'] = 1;
$r = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$id");

View file

@ -221,7 +221,7 @@ if(!$ver)
}
# create default list
$db->ex("INSERT INTO {$db->prefix}lists (uuid,name,d_created) VALUES (?,?,?)", array(generateUUID(), 'Todo', time()));
$db->ex( "INSERT INTO {$db->prefix}lists (uuid,name,d_created,taskview) VALUES (?,?,?,?)", array(generateUUID(), 'Todo', time(), 1) );
}
elseif($ver == $lastVer)