From 3ab19733e0a1f7b438b5b989ee923ca3a88ee889 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Wed, 7 Jun 2006 15:07:40 +0000 Subject: [PATCH] =?UTF-8?q?Pataqu=C3=A8s=20lors=20de=20[6410]=20lors=20d'i?= =?UTF-8?q?ntroduction=20semi-automatique=20de=20spip=5Fabstract=5Fquote.?= =?UTF-8?q?=20Corrige=20#310=20(Ben)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/exec/ajax_page.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/ecrire/exec/ajax_page.php b/ecrire/exec/ajax_page.php index 4b644102de..df395c9e63 100644 --- a/ecrire/exec/ajax_page.php +++ b/ecrire/exec/ajax_page.php @@ -87,22 +87,15 @@ function ajax_page_test($id, $exclus, $col, $id_ajax_fonc, $type, $rac) function ajax_page_recherche($id, $exclus, $col, $id_ajax_fonc, $type, $rac) { - include_spip('inc/texte'); - $where = split("[[:space:]]+", $recherche); - if ($where) { - foreach ($where as $k => $v) - $where[$k] = "'%" . substr(str_replace("%","\%", spip_abstract_quote($v)),1,-1) . "%'"; - $where = ($testnum ? "OR " : '') . - ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")"); - } - $rech2 = split("[[:space:]]+", $recherche); - if ($rech2) { - $where_titre = " (titre LIKE ".join(" AND titre LIKE ", $where).") "; - $where_desc = " (descriptif LIKE ".join(" AND descriptif LIKE ", $where).") "; - // ????? - $where_id = " (id_rubrique = ".join(" AND id_rubrique = ", $where).") "; - } - else { + include_spip('inc/texte'); + $where = split("[[:space:]]+", $type); + if ($where) { + foreach ($where as $k => $v) + $where[$k] = "'%" . substr(str_replace("%","\%", spip_abstract_quote($v)),1,-1) . "%'"; + $where_titre = ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")"); + $where_desc = ("(descriptif LIKE " . join(" AND descriptif LIKE ", $where) . ")"); + $where_id = ("(id_rubrique = " . join(" AND id_rubrique = ", $where) . ")"); + } else { $where_titre = " 1=2"; $where_desc = " 1=2"; $where_id = " 1=2"; -- GitLab