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
Merge branch 'v1'
[lhc/web/www.git]
/
www
/
ecrire
/
req
/
pg.php
diff --git
a/www/ecrire/req/pg.php
b/www/ecrire/req/pg.php
index
57d23e1
..
66bd90f
100644
(file)
--- a/
www/ecrire/req/pg.php
+++ b/
www/ecrire/req/pg.php
@@
-3,7
+3,7
@@
/* *************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
/* *************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
- * Copyright (c) 2001-201
2
*
+ * Copyright (c) 2001-201
4
*
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
@@
-574,6
+574,10
@@
function spip_pg_groupby($groupby, $from, $select)
if (!$groupby) return '';
$groupby = spip_pg_frommysql($groupby);
if (!$groupby) return '';
$groupby = spip_pg_frommysql($groupby);
+ // Ne pas mettre dans le Group-By des valeurs numeriques
+ // issue de prepare_recherche
+ $groupby = preg_replace('/^\s*\d+\s+AS\s+\w+\s*,?\s*/i','', $groupby);
+ $groupby = preg_replace('/,\s*\d+\s+AS\s+\w+\s*/i','', $groupby);
$groupby = preg_replace('/\s+AS\s+\w+\s*/i','', $groupby);
return "\nGROUP BY $groupby";
$groupby = preg_replace('/\s+AS\s+\w+\s*/i','', $groupby);
return "\nGROUP BY $groupby";
@@
-1031,7
+1035,7
@@
function spip_pg_cite($v, $t){
if(is_null($v)) return 'NULL'; // null php se traduit en NULL SQL
if (sql_test_date($t)) {
if(is_null($v)) return 'NULL'; // null php se traduit en NULL SQL
if (sql_test_date($t)) {
- if (
strpos("0123456789", $v[0]) === false
)
+ if (
$v AND (strpos("0123456789", $v[0]) === false)
)
return spip_pg_frommysql($v);
else {
if (strncmp($v,'0000',4)==0)
return spip_pg_frommysql($v);
else {
if (strncmp($v,'0000',4)==0)