mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
more strictness
This commit is contained in:
parent
6b97296251
commit
b0a104ea01
2 changed files with 4 additions and 3 deletions
|
|
@ -200,6 +200,7 @@ function checkReadAccess(?int $listId = null)
|
|||
$id = $db->sq("SELECT id FROM {$db->prefix}lists WHERE id=? AND published=1", array($listId));
|
||||
if ($id) return;
|
||||
}
|
||||
http_response_code(403);
|
||||
jsonExit( array('total'=>0, 'list'=>array(), 'denied'=>1) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ date_default_timezone_set(Config::get('timezone'));
|
|||
|
||||
//User can override language setting by cookies or query
|
||||
$forceLang = '';
|
||||
if( isset($_COOKIE['lang']) ) $forceLang = $_COOKIE['lang'];
|
||||
//else if ( isset($_GET['lang']) ) $forceLang = $_GET['lang'];
|
||||
if (isset($_COOKIE['lang'])) $forceLang = (string) $_COOKIE['lang'];
|
||||
//else if (isset($_GET['lang'])) $forceLang = (string) $_GET['lang'];
|
||||
|
||||
if ( $forceLang != '' && preg_match("/^[a-z-]+$/i", $forceLang) ) {
|
||||
if ( $forceLang !== '' && preg_match("/^[a-z-]+$/i", $forceLang) ) {
|
||||
Config::set('lang', $forceLang); //TODO: special for demo, do not change config
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue