mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* Remove restriction on having some characters (<, >, &, ', ") in list names (closes GH-108)
This commit is contained in:
parent
ff53d7e443
commit
3acf78b77e
2 changed files with 4 additions and 6 deletions
|
|
@ -215,11 +215,9 @@ class ListsController extends ApiController {
|
|||
$db = DBConnection::instance();
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
$name = str_replace(
|
||||
array('"',"'",'<','>','&'),
|
||||
array('','','','',''),
|
||||
trim($this->req->jsonBody['name'] ?? '')
|
||||
);
|
||||
$name = trim($this->req->jsonBody['name'] ?? '');
|
||||
if ($name == '')
|
||||
return $t;
|
||||
$db->dq("UPDATE {$db->prefix}lists SET name=?,d_edited=? WHERE id=$id", array($name, time()) );
|
||||
$t['total'] = $db->affected();
|
||||
$r = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$id");
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class DBCore
|
|||
function createListWithName(string $name): ?int
|
||||
{
|
||||
$db = DBConnection::instance();
|
||||
$name = str_replace( ['"',"'",'<','>','&'], '', trim($name) );
|
||||
$name = trim($name);
|
||||
if ($name == '') {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue