Commit graph

40 commits

Author SHA1 Message Date
Tim Starling
cb68c863f0 Make the SQL search subclasses less nerve-wracking to read, by using makeList() instead of implode(), addQuotes() instead of strencode(), and by documenting the fact that parseQuery() is intentionally returning an SQL fragment to be included into a query without further escaping. No actual vulnerabilities fixed, due to effective UI-side validation, so this is just to minimise reviewer anxiety. 2008-12-22 12:31:15 +00:00
Greg Sabino Mullane
8a45585945 Double-check that all old revision are set null. 2008-07-29 14:14:10 +00:00
Brion Vibber
e38a69fd4e Cleanup for r36660: use PHP 5 __construct() name for constructors to make things a little clearer when calling parent constructors and such 2008-07-02 02:02:26 +00:00
Robert Stojnić
346562de57 Do proper inheritance here instead of copy-paste of top level constructor.
Fixes problem with missing search results on Postgres, thanks to pyroplasm on IRC for pointing it out and testing.
2008-06-25 22:07:11 +00:00
Brion Vibber
3afabc850d Revert r36413 -- renaming of search files into 'search' subdirectory
The loss of specific names would create a visible name conflict; when you've got "MySQL.php" open, what the hell is it? Is it the DatabaseMySQL class? Some other random MySQL-related thing? Update.php is also confusing -- we have an update.php which is a command-line script.
Don't do these confusing names; there's no pressing functional need to move the files at all, but if you must move them at least keep their distinct names so I can find my code.
2008-06-19 21:02:23 +00:00
Bryan Tong Minh
f0a89957f8 Recommit r36403 with working version history hopefully: Move Search*.php to search/*.php 2008-06-18 09:01:41 +00:00
Bryan Tong Minh
de73a13544 Revert r36403: Breaking SVN version history 2008-06-18 08:41:05 +00:00
Chad Horohoe
61b77c1b0b More ~/includes cleanup. Moving all the Search*.php files to ~/includes/search. 2008-06-17 20:58:32 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Robert Stojnić
7532064d27 Search backend:
* add "all:" prefix that searches all namespaces (port from LuceneSearch)
* added a simplistic replacePrefixes so that now image:something will
  always search the image namespace
2008-03-23 17:29:43 +00:00
Greg Sabino Mullane
c07e337da6 Fix for bug 13004, in which the Postgres full-text search has too many results,
so it throws an error. Created a "too many" class as an alternate search result 
to return, and consider any error in SearchPostgres when running the actual search as a "too many" 
problem. Not an ideal solution, but I'm not sure how to get at the error message 
without requiring a newer version of PHP.
2008-02-17 14:11:55 +00:00
Greg Sabino Mullane
03572542a1 No longer need this cast. 2008-02-12 21:41:40 +00:00
Greg Sabino Mullane
fa02443300 Make Postgres 8.3 compatible. 2008-02-10 15:48:06 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Greg Sabino Mullane
5b79cfb9b1 More defined() that should be isset(), thanks to David Ford, david@blue-labs.org 2007-05-16 20:31:58 +00:00
Greg Sabino Mullane
c6549e5a81 Bug 9908: check server version and adjust rank() argument accordingly 2007-05-15 12:39:41 +00:00
Nick Jenkins
b4d37577b9 Removing or commenting out unused variables or globals, and adding declarations for two arrays. 2007-05-08 09:09:46 +00:00
Greg Sabino Mullane
0ccdb6c085 Defer populating searchTerms until later on - allows for better highlighting. 2007-04-27 03:45:43 +00:00
Greg Sabino Mullane
57b41fad2c Don't try to highlight non-words. 2007-04-26 19:35:27 +00:00
Nick Jenkins
f9619da3f0 Yet more doc tweaks:
* Add @addtogroup tags to various classes, to try and group conceptually-related classes together.
* Add brief descriptions to various Special pages, thanks to Phil Boswell.
* Moving some docs to be right above the classes they represent, so that they are picked up.
2007-04-20 08:55:14 +00:00
Greg Sabino Mullane
0fc57a354c More tweaks to tsearch2 parsing 2007-04-09 14:24:15 +00:00
Greg Sabino Mullane
d046c0b3b3 Trim trailing whitespace from string. 2007-04-06 12:32:26 +00:00
Greg Sabino Mullane
e7f2cb7f7b More cleanups of tsearch2 parse query 2007-04-05 13:51:16 +00:00
Greg Sabino Mullane
e702a780ed Since used as regex elsewhere, strip out non-words. 2007-04-04 16:21:24 +00:00
Greg Sabino Mullane
e19c24c26e Overhaul. 2007-04-04 00:14:03 +00:00
Greg Sabino Mullane
6ff98a40d1 Begin simple tests to catch invalid search queries. 2007-03-26 13:05:55 +00:00
Greg Sabino Mullane
5889edf36d Typo in var name 2007-03-01 03:12:36 +00:00
Greg Sabino Mullane
b835cf7a41 Properly handle search operators "+" and "-", thanks cedric.villemain@gmail.com
Fixes bug #8958
2007-02-22 17:35:44 +00:00
Greg Sabino Mullane
cbb2ef79ff Escape exclamation marks for now. 2007-02-07 15:34:39 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Greg Sabino Mullane
6569533150 Don't index old versions via tsearch2 2007-01-14 22:57:31 +00:00
Greg Sabino Mullane
45b2743559 Fix typo, thanks to Sven Klemm for finding. 2006-12-06 21:45:45 +00:00
Greg Sabino Mullane
75df09b077 Minor tweaks to search query. 2006-11-29 16:49:10 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Greg Sabino Mullane
9ab8dcda19 Explicitly use 'default' locale for tsearch2 queries. 2006-09-03 02:43:26 +00:00
Greg Sabino Mullane
7b9af4c70b Change reserved word table names "user" and "text" 2006-07-23 02:04:40 +00:00
Greg Sabino Mullane
58303aa5df Change hard-coded vector fields to variables. 2006-07-05 04:11:20 +00:00
Greg Sabino Mullane
4346921176 Add SearchPostgres.php 2006-07-05 03:54:01 +00:00