mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- Fix malfunction due to deprecated gpc notice in PHP 7.4 (mtt now requires php 5.4+)
This commit is contained in:
parent
a2ad0822ec
commit
6a92bc43cc
2 changed files with 25 additions and 8 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
This file is part of myTinyTodo.
|
||||
(C) Copyright 2009-2010 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
(C) Copyright 2009-2010,2020 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
Licensed under the GNU GPL v2 license. See file COPYRIGHT for details.
|
||||
*/
|
||||
|
||||
|
|
@ -32,14 +32,26 @@ function htmlarray_ref(&$a, $exclude=null)
|
|||
|
||||
function stop_gpc(&$arr)
|
||||
{
|
||||
if (!is_array($arr)) return 1;
|
||||
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
|
||||
// TODO: do not use get_magic_quotes_gpc() and stop_gpc()
|
||||
if (!@get_magic_quotes_gpc()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!get_magic_quotes_gpc()) return 1;
|
||||
reset($arr);
|
||||
foreach($arr as $k=>$v)
|
||||
foreach ($arr as $k=>$v)
|
||||
{
|
||||
if(is_array($arr[$k])) stop_gpc($arr[$k]);
|
||||
elseif(is_string($arr[$k])) $arr[$k] = stripslashes($v);
|
||||
if (is_array($arr[$k])) {
|
||||
stop_gpc($arr[$k]);
|
||||
}
|
||||
elseif (is_string($arr[$k])) {
|
||||
$arr[$k] = stripslashes($v);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
<?php
|
||||
/*
|
||||
This file is part of myTinyTodo.
|
||||
(C) Copyright 2009-2010 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
(C) Copyright 2009-2010,2020 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
Licensed under the GNU GPL v2 license. See file COPYRIGHT for details.
|
||||
*/
|
||||
|
||||
##### MyTinyTodo requires php 5.4.0 and above! #####
|
||||
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
|
||||
die("PHP 5.4+ is required");
|
||||
}
|
||||
|
||||
if(!defined('MTTPATH')) define('MTTPATH', dirname(__FILE__) .'/');
|
||||
|
||||
require_once(MTTPATH. 'common.php');
|
||||
|
|
@ -46,7 +51,7 @@ else {
|
|||
$db->prefix = Config::get('prefix');
|
||||
|
||||
//User can override language setting by cookies
|
||||
if(isset($_COOKIE['lang']) && preg_match("/^[a-z-]+$/i", $_COOKIE['lang']) && file_exists('lang/'. $_COOKIE['lang']. '.php')) {
|
||||
if(isset($_COOKIE['lang']) && preg_match("/^[a-z-]+$/i", $_COOKIE['lang']) && file_exists(MTTPATH. 'lang/'. $_COOKIE['lang']. '.php')) {
|
||||
Config::set('lang', $_COOKIE['lang']);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue