Commit graph

52 commits

Author SHA1 Message Date
Alexandre Emsenhuber
5cf24493fa bug fixes:
* Be sure that article name is escaped when outputing a redirect page
* Mark Xml::buildForm() as static
2008-04-28 18:00:58 +00:00
Andrew Garrett
3e1d5464d1 Typo 2008-04-24 12:01:26 +00:00
Andrew Garrett
14b8af061d Fix loss of in moving buildForm to Xml.php, generalise it (this isn't just for global blocking anymore :-)) 2008-04-24 11:53:05 +00:00
Andrew Garrett
34ee5d8675 By suggestion of NikeRabbit, move wfBuildForm into Xml.php 2008-04-24 11:46:20 +00:00
Niklas Laxström
cab3560abc * Shortcut for common use case 2008-04-19 13:51:01 +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
Aryeh Gregor
d168c31923 Use the standard we've agreed upon for class names: prefixed with "mw-", words separated by hyphens. 2008-04-13 14:18:22 +00:00
Aaron Schulz
2bd9444a30 Add class 2008-04-12 05:17:07 +00:00
Brion Vibber
1b72addea7 Cleanup for r30216:
* Don't triple-escape HTML in drop-down lists :)
* Don't include empty attributes for missing optional parameters
* Use content language, not UI language, for loading predefined reasons
2008-01-28 20:27:15 +00:00
Huji
da4897cf6d * Renaming Xml::reasonDropDown to Xml::listDropDown to make sure it doesn't imply a special usage.
* Adding support for custom name and id, custom class, and custom tabindex to Xml::listDropDown
* Changing the order of parameters Xml::listDropDown accepts.
* Updating ipblock, file deletion and page deletion forms so they all use this new Xml element rather than holding three copies of similar code.
* Removing variables which are no more used in the three above forms.
* Renaming a few variables to follow the coding style of MediaWiki.
2008-01-28 12:57:02 +00:00
Huji
433bb02da8 Introducing Xml::reasonDropDown
* Generates a drop-down box given the required information
* Supports marking the approrpiate option as pre-selected
* Shall be used on deletion and protection pages, where a dropdown is used to select the appropriate reason for the action
2008-01-25 11:28:45 +00:00
Brion Vibber
83ece527d7 * (bug 12588) Fix selection in namespace selector on Special:Newpages
Godawful hack... we'll be frequently passed selected namespaces as strings since PHP is such a shithole.
But we also don't want blanks and nulls and "all"s matching 0, so let's convert *just* string ints to clean ints.
2008-01-11 21:10:51 +00:00
Andrew Garrett
9b0e230fcd Allow an element name to be specified in Xml::namespaceSelector. 2007-09-01 12:38:54 +00:00
Brion Vibber
07aeee4da8 aaand restore behavior from prior to r24882 on expected input 2007-08-20 13:46:08 +00:00
Brion Vibber
f5ee414cad Throw an exception for invalid data in expandAttributes() so we get a backtrace and can beat the shit out of whoever did us wrong instead of just seeing a useless PHP warning message or worse yet silently going through without even knowing we probably lost the data we wanted somewhere else in our output 2007-08-20 13:43:14 +00:00
Rob Church
818756ede2 Make Xml::expandAttributes() a bit more robust against non-array arguments; people keep passing it things it doesn't like :( 2007-08-17 17:06:33 +00:00
Rob Church
82b0e618bd Revert r24574 and r24667 per Brion on bug 10798 2007-08-08 17:46:43 +00:00
Rob Church
2552ae0528 Rewrite Xml::namespaceSelector() before it drives me to totemize somebody. 2007-08-04 12:50:43 +00:00
Rob Church
05ea81fa00 * (bug 10798) Exclude MediaWiki namespace from filtering options on Special:Protectedpages (implicit protection, doesn't make sense to have it)
* Introduce a fourth evil parameter to Xml::namespaceSelector() to exclude namespaces. Pure coincidence, not at all related to the above...
2007-08-04 12:20:41 +00:00
Brion Vibber
c17e2e91db case change for aesthetic purposes 2007-07-07 06:52:59 +00:00
Brion Vibber
676409012b * (bug 10477) Fix AJAX watch for Farsi on Firefox: JavaScript encoding tweak 2007-07-07 06:47:07 +00:00
Aaron Schulz
f7f2b225d1 *Re-add contribs year/month filter. Now it simply jumps to a certain offset. 2007-07-06 22:05:29 +00:00
Tim Starling
e1a8b177c1 gen=js has the wrong cache properties for language-dependent text. Moved wgAjaxWatch initialisation to makeGlobalVariablesScript(). Added associative array capability to Xml::encodeJsVar(). 2007-07-05 13:57:54 +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
Brion Vibber
1a9f23e73c Stripping out the year/month filter on contribs for the moment, since there's disagreement over how it should work.
Rather than annoy everyone by having it one way and changing it, we'll put it back when it's changed.
2007-06-27 20:36:03 +00:00
Rob Church
b48153b986 Xml::monthSelector() -> Allow callers to override the "id" attribute 2007-06-25 20:53:40 +00:00
Rob Church
510add5a5c Clean up the mess that is Xml::monthSelector()...
* Use accessors instead of direct access to static members
* Use existing XML functions to make life easier and guarantee clean XHTML
* Drop the useless class (use the ID in CSS)
2007-06-25 11:09:51 +00:00
Rotem Liss
3b5fa6f103 Fixing the month names - e.g. use 'january', not 'january-gen', in the months list. 2007-06-25 10:07:36 +00:00
Aaron Schulz
742f648d3b *Add year/month selector to user contribs (bug 516) 2007-06-23 17:27:39 +00:00
Rob Church
8ec0a2350e * (bug 9898) Allow viewing all namespaces in Special:Newpages
* Removed some bizarre behaviour in Xml::namespaceSelector() that stopped non-numeric indexes working for the "all namespace" option
2007-06-05 00:50:46 +00:00
Antoine Musso
84a27cc33e Some fixes to avoid Xml::element call with null content when we actually want
to open a XML element. It should help fix bug #5312 later on.

* XML attributes rendering now made by private Xml::expandAttributes() method
* Xml::openElement() and Xml::tags() no more rely on Xml::element() with
  a null content.
* Fix wfElement() call with null content when we actually open an element.
2007-05-10 20:51:15 +00:00
River Tarnell
49ebe3c5b7 (bug 9835) password input should be type="password" 2007-05-08 00:37:16 +00:00
Niklas Laxström
4ca6bed03a * Polishing and documentation 2007-05-06 20:52:03 +00:00
Niklas Laxström
abe117f8b2 * XMLify preferences a little with more clear look as side effect 2007-05-06 17:54:38 +00:00
Niklas Laxström
755d972b5c * New shortcut function 2007-04-02 14:04:29 +00:00
Nick Jenkins
61678d8a5d * Removing a handful of unused globals.
* $stack is not modified in Profiler::calltreeCount(), no need to pass-by-ref.
* Add FIXME marker to non-cross-platform line.
* A freshly created string does not need to be returned by reference. [Xml::namespaceSelector() and HTMLnamespaceselector() ].
2007-01-23 07:29:58 +00:00
Brion Vibber
d88bf87284 Apply most of the code tweaks from the live site:
* use configured cache servers for mctest.php
* bucket details in mcc.php
* fix input validation and remove debugging code in compressOld
* full ID range for moveToExternal
* fix resolveStubs.php for compatibility with older serialized data
* maximum line length for bar graphs in getLagTimes.php
* recognize specieswiki in rebuildInterwiki.inc
* --purge option to do additional parser-cache purging for purgeList.php
* default changed in MiniDonation extension
* profile unicode cleanup in Xml
* log slow parses in Article.php
* profile wfMsgReal
* log mkdir failures
* profile AutoLoader
* rebuild empty DjVu metadata containing ''
* security fix for DjVu metadata retrieval
2007-01-17 00:54:54 +00:00
Ævar Arnfjörð Bjarmason
42e34088f3 * Clarified function documentation 2006-12-31 09:53:21 +00:00
Antoine Musso
53a89fc564 * someone forgot to declare a method static
* compatibility issue in zhconvert
2006-12-14 20:47:19 +00:00
Brion Vibber
da2aa30f1d * Allow Xml::check() $attribs parameter to override 'value' attribute
PHP's array + operator doesn't overwrite items from the left side when
keys conflict. Switch to array_merge() here, which acts as expected.
2006-12-08 23:07:06 +00:00
Tim Starling
439f59fb7b * Added redirect to section feature. Use it wisely.
* Added a configuration variable allowing the "break out of framesets" feature to be switched on and off. Off by default -- there's all sorts of flashy frameset gadgets around, outright abuse is more rare, especially for small default installs.
* Refactored URL fragment handling.
* Made Title::secureAndSplit() slightly more legible.
* Refactored makeGlobalVariablesScript() -- it's not particularly convenient or maintainable to pass all global variables through the template array. The array is there for BC, not flexibility.
2006-12-08 06:09:15 +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
Tim Starling
2f12a58d93 * Introduced StringUtils.php, populated it with some generic string functions, both new and collected from various other files.
* Removed some backtracking regexes with an O(N^2) worst case, replaced with StringUtils::delimiterReplace(). There is a beneficial functional difference: /*/ is no longer considered to be a complete CSS comment.
* Changed the parser strip state from an array to an object. This should hopefully avoid the PHP bugs with array references. StripState uses the new ReplacementArray to do the replacements, thereby supporting FSS. 
* Removed DatabaseFunctions.php from the default startup sequence. Moved wfGetDB() to GlobalFunctions.php.
* Introduced the SiteStats class, with a collection of cached site stats accessor functions.
* Removed all global functions from Parser.php, they don't belong there.
* Made LanguageConverter use the new ReplacementArray class instead of managing its own FSS objects.
2006-11-21 09:53:45 +00:00
Brion Vibber
ce7a9631d7 * Set default disabled values for DjVu render options
* Added Xml::option() for generating <option>s easily
* Localized page numbers in drop-down for DjVu page selection
* Fixed linktrail for vi
2006-09-06 08:53:02 +00:00
Rotem Liss
679f587f24 EOL fixes. 2006-08-31 11:20:43 +00:00
Daniel Kinzler
584c456a94 Adding various global JS variables, fixing bug 6030 completely and 6806 mostly. 2006-07-28 19:05:27 +00:00
Antoine Musso
3ba69de714 Indent the namespace selector 2006-07-11 12:21:39 +00:00
Antoine Musso
89d2c02702 Adding some more static statements 2006-07-10 18:53:15 +00:00
Antoine Musso
fd912a148b A lot more of static issues when using E_STRICT from the commandline. 2006-07-10 15:41:30 +00:00
Brion Vibber
0a41a6a1c3 Use Sanitizer::encodeAttribute instead of raw htmlspecialchars for encoding attributes in Xml::element. This does two things:
* Preserves tabs and newlines as given (they would otherwise be normalized to spaces by the XML input processor)
* When generating output back to wiki text, this avoids line-based block parsing breakage. (bug 6577)
2006-07-07 04:45:19 +00:00