Revision 1254
Added by Luisehahne almost 16 years ago
| search.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 |
/**************************************************************************** |
|
| 3 |
* SVN Version information: |
|
| 2 |
/* |
|
| 4 | 3 |
* |
| 5 |
* $Id$
|
|
| 4 |
* About WebsiteBaker
|
|
| 6 | 5 |
* |
| 7 |
* |
|
| 8 |
* |
|
| 9 |
***************************************************************************** |
|
| 10 |
* WebsiteBaker |
|
| 11 |
* |
|
| 12 |
* WebsiteBaker Project <http://www.websitebaker2.org/> |
|
| 13 |
* Copyright (C) 2009, Website Baker Org. e.V. |
|
| 14 |
* http://start.websitebaker2.org/impressum-datenschutz.php |
|
| 15 |
* Copyright (C) 2004-2009, Ryan Djurovich |
|
| 16 |
* |
|
| 17 |
* About WebsiteBaker |
|
| 18 |
* |
|
| 19 | 6 |
* Website Baker is a PHP-based Content Management System (CMS) |
| 20 | 7 |
* designed with one goal in mind: to enable its users to produce websites |
| 21 | 8 |
* with ease. |
| 22 | 9 |
* |
| 23 |
*****************************************************************************
|
|
| 10 |
* LICENSE INFORMATION
|
|
| 24 | 11 |
* |
| 25 |
***************************************************************************** |
|
| 26 |
* LICENSE INFORMATION |
|
| 27 |
* |
|
| 28 | 12 |
* WebsiteBaker is free software; you can redistribute it and/or |
| 29 | 13 |
* modify it under the terms of the GNU General Public License |
| 30 | 14 |
* as published by the Free Software Foundation; either version 2 |
| ... | ... | |
| 38 | 22 |
* You should have received a copy of the GNU General Public License |
| 39 | 23 |
* along with this program; if not, write to the Free Software |
| 40 | 24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 41 |
**************************************************************************** |
|
| 42 | 25 |
* |
| 43 | 26 |
* WebsiteBaker Extra Information |
| 44 | 27 |
* |
| 45 | 28 |
* |
| 46 |
* |
|
| 47 |
* |
|
| 48 |
* |
|
| 49 |
* |
|
| 50 |
* |
|
| 51 |
*****************************************************************************/ |
|
| 29 |
*/ |
|
| 52 | 30 |
/** |
| 53 | 31 |
* |
| 54 |
* @category frontend |
|
| 55 |
* @package account |
|
| 56 |
* @author Ryan Djurovich |
|
| 57 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 58 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
| 59 |
* @version $Id$ |
|
| 60 |
* @platform WebsiteBaker 2.8.x |
|
| 61 |
* @requirements >= PHP 4.3.4 |
|
| 62 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 32 |
* @category frontend |
|
| 33 |
* @package search |
|
| 34 |
* @filesource $HeadURL$ |
|
| 35 |
* @author Ryan Djurovich |
|
| 36 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 63 | 37 |
* |
| 38 |
* @author WebsiteBaker Project |
|
| 39 |
* @link http://www.websitebaker2.org/ |
|
| 40 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
| 41 |
* @link http://start.websitebaker2.org/impressum-datenschutz.php |
|
| 42 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 43 |
* @version $Id$ |
|
| 44 |
* @platform WebsiteBaker 2.8.x |
|
| 45 |
* @requirements PHP 4.3.4 and higher |
|
| 46 |
* @lastmodified $Date: $ |
|
| 47 |
* |
|
| 64 | 48 |
*/ |
| 65 | 49 |
|
| 66 | 50 |
if(!defined('WB_URL')) {
|
| ... | ... | |
| 235 | 219 |
$search_display_string = ''; // for displaying |
| 236 | 220 |
$search_url_string = ''; // for $_GET -- ATTN: unquoted! Will become urldecoded later |
| 237 | 221 |
$string = ''; |
| 238 |
if(isset($_REQUEST['string'])) {
|
|
| 239 |
if($match!='exact') { // $string will be cleaned below
|
|
| 222 |
if(isset($_REQUEST['string'])) |
|
| 223 |
{
|
|
| 224 |
if($match!='exact') // $string will be cleaned below |
|
| 225 |
{
|
|
| 240 | 226 |
$string=str_replace(',', '', $_REQUEST['string']);
|
| 241 | 227 |
} else {
|
| 242 | 228 |
$string=$_REQUEST['string']; |
| 243 | 229 |
} |
| 244 |
// redo possible magic quotes
|
|
| 245 |
$string = $wb->strip_slashes($string);
|
|
| 246 |
$string = preg_replace('/\s+/', ' ', $string);
|
|
| 247 |
$string = trim($string);
|
|
| 230 |
// redo possible magic quotes
|
|
| 231 |
$string = $wb->strip_slashes($string);
|
|
| 232 |
$string = preg_replace('/[ \r\n\t]+/', ' ', $string);
|
|
| 233 |
$string = trim($string);
|
|
| 248 | 234 |
// remove some bad chars |
| 249 | 235 |
$string = str_replace ( array('[[',']]'),'', $string);
|
| 250 | 236 |
$string = preg_replace('/(^|\s+)[|.]+(?=\s+|$)/', '', $string);
|
Also available in: Unified diff
Ticket #915 fix bug in search (utf-8 characters corrupted)(thanks to Thorn)