mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
commit
a6afdc4279
4 changed files with 6 additions and 16 deletions
13
src/ajax.php
13
src/ajax.php
|
|
@ -30,7 +30,6 @@ if(isset($_GET['loadLists']))
|
|||
}
|
||||
elseif(isset($_GET['loadTasks']))
|
||||
{
|
||||
stop_gpc($_GET);
|
||||
$listId = (int)_get('list');
|
||||
check_read_access($listId);
|
||||
|
||||
|
|
@ -118,7 +117,6 @@ elseif(isset($_GET['loadTasks']))
|
|||
}
|
||||
elseif(isset($_GET['newTask']))
|
||||
{
|
||||
stop_gpc($_POST);
|
||||
$listId = (int)_post('list');
|
||||
check_write_access($listId);
|
||||
$t = array();
|
||||
|
|
@ -161,7 +159,6 @@ elseif(isset($_GET['newTask']))
|
|||
}
|
||||
elseif(isset($_GET['fullNewTask']))
|
||||
{
|
||||
stop_gpc($_POST);
|
||||
$listId = (int)_post('list');
|
||||
check_write_access($listId);
|
||||
$title = trim(_post('title'));
|
||||
|
|
@ -226,7 +223,6 @@ elseif(isset($_GET['editNote']))
|
|||
{
|
||||
check_write_access();
|
||||
$id = (int)_post('id');
|
||||
stop_gpc($_POST);
|
||||
$note = str_replace("\r\n", "\n", trim(_post('note')));
|
||||
$db->dq("UPDATE {$db->prefix}todolist SET note=?,d_edited=? WHERE id=$id", array($note, time()) );
|
||||
$t = array();
|
||||
|
|
@ -238,7 +234,6 @@ elseif(isset($_GET['editTask']))
|
|||
{
|
||||
check_write_access();
|
||||
$id = (int)_post('id');
|
||||
stop_gpc($_POST);
|
||||
$title = trim(_post('title'));
|
||||
$note = str_replace("\r\n", "\n", trim(_post('note')));
|
||||
$prio = (int)_post('prio');
|
||||
|
|
@ -273,7 +268,6 @@ elseif(isset($_GET['editTask']))
|
|||
elseif(isset($_GET['changeOrder']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$s = _post('order');
|
||||
parse_str($s, $order);
|
||||
$t = array();
|
||||
|
|
@ -302,7 +296,6 @@ elseif(isset($_POST['login']))
|
|||
$t['disabled'] = 1;
|
||||
jsonExit($t);
|
||||
}
|
||||
stop_gpc($_POST);
|
||||
$password = _post('password');
|
||||
if($password == Config::get('password')) {
|
||||
$t['logged'] = 1;
|
||||
|
|
@ -380,7 +373,6 @@ elseif(isset($_GET['tagCloud']))
|
|||
elseif(isset($_GET['addList']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
$name = str_replace( array('"',"'",'<','>','&'), '', trim(_post('name')) );
|
||||
|
|
@ -396,7 +388,6 @@ elseif(isset($_GET['addList']))
|
|||
elseif(isset($_GET['renameList']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
$id = (int)_post('list');
|
||||
|
|
@ -410,7 +401,6 @@ elseif(isset($_GET['renameList']))
|
|||
elseif(isset($_GET['deleteList']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
$id = (int)_post('list');
|
||||
|
|
@ -458,7 +448,6 @@ elseif(isset($_GET['moveTask']))
|
|||
elseif(isset($_GET['changeListOrder']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$order = (array)_post('order');
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
|
|
@ -481,7 +470,6 @@ elseif(isset($_GET['changeListOrder']))
|
|||
elseif(isset($_GET['parseTaskStr']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$t = array(
|
||||
'title' => trim(_post('title')),
|
||||
'prio' => 0,
|
||||
|
|
@ -498,7 +486,6 @@ elseif(isset($_GET['parseTaskStr']))
|
|||
elseif(isset($_GET['clearCompletedInList']))
|
||||
{
|
||||
check_write_access();
|
||||
stop_gpc($_POST);
|
||||
$t = array();
|
||||
$t['total'] = 0;
|
||||
$listId = (int)_post('list');
|
||||
|
|
|
|||
|
|
@ -30,14 +30,15 @@ function htmlarray_ref(&$a, $exclude=null)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
function stop_gpc(&$arr)
|
||||
{
|
||||
if (!is_array($arr)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Since PHP v5.4.0 magic quotes feature was removed from PHP
|
||||
// In PHP v7.4 get_magic_quotes_gpc is deprecated
|
||||
// Since PHP v5.4.0 magic quotes config option was removed from PHP.
|
||||
// In PHP v7.4 get_magic_quotes_gpc() is deprecated, in v8.0 is removed.
|
||||
// TODO: do not use get_magic_quotes_gpc() and stop_gpc()
|
||||
if (!@get_magic_quotes_gpc()) {
|
||||
return 1;
|
||||
|
|
@ -56,6 +57,8 @@ function stop_gpc(&$arr)
|
|||
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
function _post($param,$defvalue = '')
|
||||
{
|
||||
if(!isset($_POST[$param])) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ define('MTT_VERSION', '@VERSION');
|
|||
|
||||
##### MyTinyTodo requires php 5.4.0 and above! #####
|
||||
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
|
||||
# If you adopt the script for old php version, look at stop_gpc() function in the sources of MTT v1.6
|
||||
die("PHP 5.4+ is required");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ if ( !is_logged() )
|
|||
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
stop_gpc($_POST);
|
||||
$t = array();
|
||||
$langs = getLangs();
|
||||
Config::$params['lang']['options'] = array_keys($langs);
|
||||
|
|
|
|||
Loading…
Reference in a new issue