From b247aba7f569716327003dac8928d08ece22530a Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Fri, 13 Sep 2002 09:59:52 +0000
Subject: [PATCH] hack rapide pour {par num titre, date}
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

ne pas créer l'article si $titre=''
---
 ecrire/articles.php3  | 2 +-
 inc-calcul-squel.php3 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ecrire/articles.php3 b/ecrire/articles.php3
index d3f2a8e08e..a6c9024699 100644
--- a/ecrire/articles.php3
+++ b/ecrire/articles.php3
@@ -16,7 +16,7 @@ $articles_redac = lire_meta("articles_redac");
 $articles_mots = lire_meta("articles_mots");
 
 if ($id_article==0) {
-	if ($new=='oui') {
+	if (($new=='oui') AND ($titre!='')) {
 		$forums_publics = substr(lire_meta('forums_publics'),0,3);
 		spip_query("INSERT INTO spip_articles (id_rubrique, statut, date, accepter_forum) VALUES ($id_rubrique, 'prepa', NOW(), '$forums_publics')");
 		$id_article = mysql_insert_id();
diff --git a/inc-calcul-squel.php3 b/inc-calcul-squel.php3
index 00c9c1336c..0996fa0c4a 100644
--- a/inc-calcul-squel.php3
+++ b/inc-calcul-squel.php3
@@ -450,9 +450,9 @@ function parser_boucle($texte, $id_parent) {
 						else if ($tri == 'points'){ // par points
 							$req_order= " ORDER BY points";
 						}
-						else if (ereg("^num[[:space:]]+(.*)",$tri, $match2)) { // par num champ
+						else if (ereg("^num[[:space:]]+([^,]*)(,.*)",$tri, $match2)) { // par num champ
 							$req_select[] = "0+$table.".$match2[1]." AS num";
-							$req_order = " ORDER BY num";
+							$req_order = " ORDER BY num".$match2[2];
 						}
 						else if (ereg("^[a-z0-9]+$", $tri)) { // par champ
 							$col = $tri;
-- 
GitLab