dépôts
/
lhc
/
web
/
www.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[SPIP] v3.2.7-->v3.2.9
[lhc/web/www.git]
/
www
/
ecrire
/
req
/
mysql.php
diff --git
a/www/ecrire/req/mysql.php
b/www/ecrire/req/mysql.php
index
dae0356
..
5cd2c0d
100644
(file)
--- a/
www/ecrire/req/mysql.php
+++ b/
www/ecrire/req/mysql.php
@@
-1543,12
+1543,13
@@
function spip_mysql_quote($v, $type = '') {
* Expression SQL
**/
function spip_mysql_date_proche($champ, $interval, $unite) {
* Expression SQL
**/
function spip_mysql_date_proche($champ, $interval, $unite) {
+ $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false );
return '('
. $champ
. (($interval <= 0) ? '>' : '<')
. (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
. '('
return '('
. $champ
. (($interval <= 0) ? '>' : '<')
. (($interval <= 0) ? 'DATE_SUB' : 'DATE_ADD')
. '('
- .
sql_quote(date('Y-m-d H:i:s'
))
+ .
($use_now ? 'NOW()' : sql_quote(date('Y-m-d H:i:s')
))
. ', INTERVAL '
. (($interval > 0) ? $interval : (0 - $interval))
. ' '
. ', INTERVAL '
. (($interval > 0) ? $interval : (0 - $interval))
. ' '