Commit graph

202 commits

Author SHA1 Message Date
Kevin Israel
b9f291e8cd Make MagicWordArray compatible with PCRE 8.34+
In PCRE 8.34, a subpattern's name must not start with a digit; work around
this by replacing digits in the synonym's index with letters. Amazingly,
this part of the name seems to have the sole purpose of ensuring uniqueness;
none of the matching functions actually use it for anything.

Adding a single-letter prefix was considered, though it would risk breaking
extension code that may have used 29- or 30- character magic word IDs.
(PCRE limits subpattern names to 32 characters.) Likewise, moving the magic
word's ID to the front would not work if it were to start with a digit.

Bug: 58640
Change-Id: Ic69f9000addbf18c4747105187e6f13191828fbb
2013-12-31 05:28:23 +00:00
umherirrender
35065c9db5 Added {{REVISIONSIZE}} variable to get the current size of a revision.
This avoids giving the own page name to {{PAGESIZE:}} and allows
PAGESIZE on subst: to give the size before save.

Viewing a oldid page will give the corresponding size to that revision.
(Like REVISIONUSER or REVISIONTIMESTAMP)

This partially reverts Idfac13de37d05317f65e4131534543e66cf74873
because there is no need to let PAGESIZE handle extra, when the given
title is the own page.

Change-Id: If9e608d54904c21ac6b095e91ff6e0a15da0fb4c
2013-09-21 03:49:35 +01:00
MatmaRex
eb542c80c6 MagicWord: Remove some commented-out code
Change-Id: I62014cd09b4033be0c958da2527911368fff141a
2013-07-01 00:55:41 +02:00
umherirrender
15ff79312d Fixed spacing and removed unneeded parenthesis
Added spaces after/before parenthesis
Removed unneeded parenthesis around some statements
Broke a long line

Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
2013-05-17 16:12:08 +00:00
blotmandroid
d197fbd349 Introducing a new variable {{ROOTPAGENAME}}
Introduced a new variable ROOTPAGENAME which has similar
content like BASEPAGENAME.
ROOTPAGENAME only contains the name of the topmost page without namespace, e.g.
for "User:Name/Article/Subarticle" it should be "Name".
BASEPAGENAME would be "Name/Article" here.

Update : fixed indentation in maintenance/fuzz-tester.php

Added to RELEASE-NOTES-1.2.2

Bug: 6747
Change-Id: I71ef0a15c95c9145462f3aa7fdb3ed11dac79265
2013-04-24 02:13:25 +05:30
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
97234cc884 Added spaces before and removed spaces after 'array'
Fix some other spacing while at it

Change-Id: I13f81533eaf40e06c13cf377c0f08ef5cef01d00
2013-04-14 21:57:46 +02:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
Kaldari
4fd26bdd02 Creating new GetDoubleUnderscoreIDs hook
Creating a new hook so that doubleunderscore (behaviour switch) magic
words can be defined from Extensions (so that I can solve bug 6754
from an extension rather than from core, as requested).

Change-Id: I734a4a1639be61052924838b19ed9db93a28e50b
2012-12-25 15:29:43 -08:00
Antoine Musso
cb60d72be1 misc style fix
* makes booleans lower case
* add spaces before open braces

Change-Id: Id88884e08bc23d7730361ee91646f54f5e16920b
2012-12-20 16:09:25 +01:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
Reedy
ecea5fe7b0 Add a MagicWordArray::getNames() function
Minor documentation fixes too

Change-Id: Iabf858c30d45073cb82da398d6f9e6f5bb310b34
2012-08-08 16:14:05 +01:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
Waldir Pimenta
0a7cf03e75 (bug 23427) PAGEID magic word
Please note on preview of a new page, this magic word will return 0 so
we have to set the vary-revision flag.

Change-Id: I11d42ca773ad84b73cc84f2c7dd2d09f1982d97a
2012-06-22 10:56:01 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Reedy
73bbe9f3a2 Forward port of https://www.mediawiki.org/wiki/Special:Code/MediaWiki/105964
"Temporary workaround for bug 31576. The logs show that once every hour or so, a job runner somewhere in the cluster somehow loses all its magic words and starts hitting this case. Throwing an exception should kill the job runner before it does too much damage."

Currently keeps being re-imported into deployment branches...

Change-Id: I9d6ef2f4e0755a86476388508a8c08266fc94a9f
2012-05-28 15:43:06 +01:00
Alexandre Emsenhuber
a682b7335a Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I0db3461139284edcb6ac02923eb83d54e6756ffb
2012-05-12 22:33:51 +02:00
Catrope
1c7997de85 Revert "Forward port of https://www.mediawiki.org/wiki/Special:Code/MediaWiki/105964"
Oops, this should have gone into 1.20wmf2 instead.

This reverts commit 2531715b9d
2012-04-30 19:20:23 +00:00
Reedy
2531715b9d Forward port of https://www.mediawiki.org/wiki/Special:Code/MediaWiki/105964
"Temporary workaround for bug 31576. The logs show that once every hour or so, a job runner somewhere in the cluster somehow loses all its magic words and starts hitting this case. Throwing an exception should kill the job runner before it does too much damage."

Change-Id: I229e87a5bd323dbc97b85ae470474cc97243c7af
2012-04-30 12:13:27 -07:00
umherirrender
b5511c68c3 (bug 34355) add a variable and parser function for the namespace number
Change-Id: Ie162cfda7ddd38d4278ceee5fd23f5a4e579cb96
2012-04-03 13:25:06 -07:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Siebrand Mazeland
ef9293b1b7 Remove support for the deprecated and no longer used in trunk hook MagicWordMagicWords. 2012-01-18 18:20:50 +00:00
Siebrand Mazeland
dc37af3507 Update documentation as LanguageGetMagic hook is deprecated. 2012-01-18 17:43:08 +00:00
Antoine Musso
f6df3e972d revert r107006
(bug 23427) Introduced {{PAGEID}} variable to expose page.page_id
[patch by Waldir]
2012-01-04 09:08:16 +00:00
Danny B
ff2ef8285a * (bug 23427) Introduced {{PAGEID}} variable to expose page.page_id [patch by Waldir] 2011-12-21 23:19:24 +00:00
Sam Reed
78f05f39e1 Partial revert to r101244 due to next() weirdness 2011-11-05 14:10:50 +00:00
Sam Reed
2f23e71490 arrray -> array
Whitespace

Other documentation improvements

Comment out some unused code (which has a fixme left with it already)
2011-11-01 23:48:09 +00:00
Sam Reed
c8e89896f7 Remove more assignments in conditionals (while each to foreach) 2011-10-29 02:04:27 +00:00
Sam Reed
ad39f2da86 Trim trailing whitespace
Add/tweak/update documentation

Simplify some boolean returns
2011-09-04 21:40:17 +00:00
Tim Starling
67099169ad * Use Preprocessor_Hash by default in compiled mode, it is faster
* Don't profile MagicWord::get(), it is very fast and the profiling overhead was excessive. Profile MagicWord::load() instead.
2011-05-31 06:10:23 +00:00
Sam Reed
ebef5e723b More documentation tweaks/additions 2011-05-26 19:52:56 +00:00
Sam Reed
8d1f5525e3 Lots more documentation lines to MagicWord 2011-05-21 19:55:05 +00:00
Leo Koppelkamm
a4296effc7 Add |alt= option for galleries ( Bug 18682 ). Recommit of r86749, with nested |alt= now fixed. Patch by Jan Paul Posma 2011-04-25 13:51:54 +00:00
Chad Horohoe
783d4e0862 Remove @static from all over the place. That's what the static keyword is for, this being PHP5 and all 2011-04-21 00:07:09 +00:00
Alexandre Emsenhuber
e364a689bc Moved constant initialisation to class definition instead of constructor 2011-04-01 09:35:39 +00:00
Alexandre Emsenhuber
4d8e5e0ec9 Changes default value so that it's not converted to array( 0 => '' ) by the (array) cast a few lines below.
This was breaking the check whether the magic word was found by Language::getMagic() or not.
2011-03-25 11:07:59 +00:00
Tim Starling
3bc410efa7 * Fix for r81960: List the local magic word synonyms first, so that they will be returned by $magic->getSynonym( 0 ). Apply array_values() to fix up the keys, potentially corrupted by array_unique().
* In MagicWord::initRegex(), put the longest synonyms first in the alternation. This means that when one synonym is an initial substring of another, the longest one will match in precedence, which is generally in line with user expectations.
2011-02-16 07:24:36 +00:00
Sam Reed
da3b3fbae4 More return type documentation 2011-02-08 23:18:13 +00:00
Sam Reed
e76775e06f More unused variables 2010-11-30 18:44:50 +00:00
Sam Reed
8a01281913 Remove some unreachable code (usually returns after throwing exceptions)
Fixup call of method after return in DatabaseMssql by using a temp
2010-08-24 22:03:18 +00:00
Alexandre Emsenhuber
5be509b0c1 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-08 14:23:14 +00:00
Sam Reed
5582aca1ed * (bug 23848) Add {{ARTICLEPATH}} Magic Word
Apply my patch, as it seems to be working when I tried it this time
2010-08-05 15:21:15 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Matěj Grabovský
449b936efd (bug 23426) The {{REVISIONMONTH}} variable is now zero-padded and added new variable {{REVISIONMONTH1}} when unpadded version is needed. 2010-05-11 16:24:14 +00:00