Ejemplo n.º 1
0
function stop_gpc(&$arr)
{
    if (!is_array($arr)) {
        return 1;
    }
    if (!get_magic_quotes_gpc()) {
        return 1;
    }
    reset($arr);
    foreach ($arr as $k => $v) {
        if (is_array($arr[$k])) {
            stop_gpc($arr[$k]);
        } elseif (is_string($arr[$k])) {
            $arr[$k] = stripslashes($v);
        }
    }
    return 1;
}
Ejemplo n.º 2
0
        $t['total'] = 1;
    }
    jsonExit($t);
} elseif (isset($_GET['parseTaskStr'])) {
    check_write_access();
    stop_gpc($_POST);
    $t = array('title' => trim(_post('title')), 'prio' => 0, 'tags' => '');
    if (Config::get('smartsyntax') != 0 && false !== ($a = parse_smartsyntax($t['title']))) {
        $t['title'] = $a['title'];
        $t['prio'] = $a['prio'];
        $t['tags'] = $a['tags'];
    }
    jsonExit($t);
} elseif (isset($_GET['clearCompletedInList'])) {
    check_write_access();
    stop_gpc($_POST);
    $t = array();
    $t['total'] = 0;
    $listId = (int) _post('list');
    $db->ex("BEGIN");
    $db->ex("DELETE FROM {mytinytodo_tag2task} WHERE task_id IN (SELECT id FROM {mytinytodo_todos} WHERE list_id=? and compl=1)", array($listId));
    $result = $db->ex("DELETE FROM {mytinytodo_todos} WHERE list_id={$listId} and compl=1");
    $t['total'] = $result->affected();
    $db->ex("COMMIT");
    module_invoke_all('mytinytodo_clear_completed_in_list', $listId);
    jsonExit($t);
} elseif (isset($_GET['setShowNotesInList'])) {
    check_write_access();
    $listId = (int) _post('list');
    $flag = (int) _post('shownotes');
    $bitwise = $flag == 0 ? 'taskview & ~2' : 'taskview | 2';