Commit graph

825 commits

Author SHA1 Message Date
umherirrender
49de213dc1 deprecate make(Known?)LinkObj methods
Restore deprecation warnings from 1.16. The methods Linker::makeLinkObj
and Linker::makeKnownLinkObj should be replaced by calls to link().

Change-Id: I658289ac2b52a193b76edd946368e228cfa389cb
2012-10-25 10:33:57 +02:00
Liangent
7323171000 Localize parentheses in Linker::formatTemplates()
Change-Id: I27c4c26206ba1e9c27a5c120a95491eb30e55522
2012-10-23 21:32:41 +08:00
umherirrender
9d19d7342a Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I7db616db8c969567d420c0161fa207b366e292b6
2012-10-19 22:03:05 +02:00
Siebrand
7d4c391e25 Merge "Deprecate static User::edits() in favour of User::getEditCount()" 2012-10-18 00:00:11 +00:00
Marius Hoch
63ed4ac0e4 Deprecate static User::edits() in favour of User::getEditCount()
Moved the logic from the old static User::edits() into
User::getEditCount() and deprecated User::edits() as it's
not following the class hierarchy.

Change-Id: Id2b939ffb903accb8f4dc132a6ac6b6576f81beb
2012-10-18 01:41:00 +02:00
Brion Vibber
966cda2f80 Initial stab at responsive images for screen densities.
* adds $wgResponsiveImages setting, defaulting to true, to enable the feature
* adds 'srcset' attribute with 1.5x and 2x URLs to image links and image thumbs
* adds jquery.hidpi plugin to check pixel density and implement partial 'srcset' polyfill
** $.devicePixelRatio() returns window.devicePixelRatio, with compat fallback for IE 10
** $().hidpi() performs a 'srcset' polyfill for browsers with no native 'srcset' support
* adds mediawiki.hidpi RL script to trigger hidpi loads after main images load

Note that this is a work in progress. There will be places where this doesn't yet work which output their imgs differently. If moving from a low to high-DPI screen on a MacBook Pro Retina display, you won't see images load until you reload.

Confirmed basic images and thumbs in wikitext appear to work in Safari 6, Chrome 21, Firefox 18 nightly on MacBook Pro Retina display, and IE 10 in Windows 8 at 150% zoom, 200% zoom, and 140% and 180%-ratio Metro tablet sizes.

Internally this is still a bit of a hack; Linker::makeImageLink and Linker::makeThumbLink explicitly ask for 1.5x and 2x scaled versions and insert their URLs, if different, into the original thumbnail object which (in default handler) outputs the srcset. This means that a number of places that handle images differently won't see the higher-resolution versions, such as <gallery> and the large thumbnail on the File: description page.

At some point we may wish to redo some of how the MediaHandler stuff works so that requesting a single thumbnail automatically produces the extra sizes in all circumstances. We might also consider outputting a 'srcset' or multiple src sizes in 'imageinfo' API requests, which would make ApiForeignRepo/InstantCommons more efficient. (Currently it has to make three requests for each image to get the three sizes.)

Change-Id: Id80ebd07a1a9f401a2c2bfeb21aae987e5aa863b
2012-10-11 10:54:21 -07:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Tyler Anthony Romeo
0a1e291036 Added protocol option to Linker and OutputPage::addReturnTo.
Added new argument to the Linker options array to allow
the forcing of an HTTP or HTTPS protocol. In order to facilitate
this, a protocol argument was added to Title::getLinkURL.

Also, an options argument was added to OutputPage::addReturnTo
so that options can be passed to the linker and so that the
returnto URL can be forced to a certain protocol.

Change-Id: Ia9cc11e310ad6ef23c221bdba3a4834e7c5556e7
2012-09-27 13:47:42 -04:00
csteipp
21971b28bc (bug 39700) Add htmlspecialchars encoding to label
Adds htmlspecialchars encoding to the link label, passed
into Linker::makeBrokenImageLinkObj.

This fixes a stored XSS (HTML injection) vulnerability.

* Released as part of 1.20wmf10, 1.19.2, 1.18.5

Change-Id: I0e5f9eeb1f3561b1354aecced74f68ae2fa20dfa
2012-08-31 14:51:25 -07:00
Platonides
0168a529a9 Remove a couple of unused globals
Change-Id: I173334c43e1bc2ed5f404f82e770d3e20fa65914
2012-08-27 22:31:01 +02:00
Catrope
873ac24d32 Document Linker::tocList()'s $lang parameter correctly
Change-Id: I6982dc30a0ceeedc8e549ee3bdaa5bc139d6364c
2012-08-22 12:49:39 -07:00
Siebrand Mazeland
3ff6874d2f Follow up I66fb2d11: use wfGetLangObj() instead
Change-Id: I333021ee4edc7481b664986c27e12fbcac9d0d08
2012-08-22 21:31:05 +02:00
Catrope
f80b212aa2 Fix tocList() breakage in 6fe1f050
The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.

Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b
2012-08-22 12:21:59 -07:00
tpt
2b9c22deb3 (bug 23226) Add |class= parameter to image links in order to add class(es) to HTML img tag.
Change-Id: If58802ad2c513c1db7bc3488daf4e078b8694b02
2012-08-21 17:25:42 -07:00
Siebrand Mazeland
6fe1f0509b Replace deprecated wfMsg* calls with Message class calls.
Doing this in steps of roughly 100 changes per commit, so that it remains reviewable.

Change-Id: Ib15e670badd3f6aecae8b60e2f9129a31341ce16
2012-08-21 18:38:44 +02:00
Catrope
9846b1c1e9 Merge "(bug 24437) Add nofollow to image link" 2012-08-15 01:37:24 +00:00
Alexandre Emsenhuber
e08852997a Follow-up I47412b67: pass an array of query parameters to Linker::link()
Change-Id: I3cdc0a57a9cda740c482addd2c9c833a70897381
2012-08-14 13:27:54 +02:00
Alexandre Emsenhuber
419129ae67 Follow-up I47412b67 (dde8471): convert string query to array
If we detect and warn that the $query parameter is in an incorrect
format, we may as well convert it to the correct one.

Change-Id: Ief137ab758c65ec562c2a523f76b1a4f8c2617b5
2012-08-14 11:51:26 +02:00
Aaron Schulz
eeb7300f60 Merge "Linker::link() prints deprecated warning if $query is a string" 2012-08-07 19:31:42 +00:00
csteipp
79b4f79434 (bug 24437) Add nofollow to image link
Add Parser's extLinkAttribs attributes when an image has a link
parameter, when generating the html. Currently, these may include
rel="nofollow" and the target attribute.

This will correctly add rel="nofollow", respecting $wgNoFollowLinks,
$wgNoFollowDomainExceptions, and $wgNoFollowNsExceptions settings.

Updated parser tests for expected results, added new tests for
$wgNoFollowLinks and $wgNoFollowDomainExceptions exceptions.

Change-Id: Ib4677760ec78a3f0c4ba781d893e0484cc8db3ed
2012-08-07 09:14:28 -07:00
Daniel Werner
dde847152a Linker::link() prints deprecated warning if $query is a string
Change-Id: I47412b67b964ff0d868f181903628de3fd41365a
2012-08-07 12:50:05 +02:00
robin
e4b4bfdf9b (bug 38351) Image alignment should follow the page content language
The alignment of image thumbs should follow the page content language instead of the wiki content language.
For this it needs the parser context, and because it makes sense to have it as first parameter, I renamed makeImageLink2() to makeImageLink(), the 2 seemed to be redundant anyway.
The old function name keeps the old behaviour, but can be removed quite soon since almost no extension is using it.

Change-Id: I0c35b06a85528dcc43fdd0578dc9b327c495cf4a
2012-08-03 00:48:06 +02:00
jan
5184c95cb7 Add feature to disable rollback edit count
This change replaces I85f480726b41871cdf5349a19e3f650285d1dda6 (includes
the change of Catrope).

Add a feature to disable the rollback edit count (change
9bae2198c9) on special pages. Default it
will be disabled on Recentchanges and Watchlist.

Change-Id: Ifbbf802472ce678694b2b3ba4ef441344cc1d572
2012-08-02 09:12:42 +02:00
jan
9bae2198c9 (bug 18834) Add an edit count to rollback link
Add an edit count to rollback link to show how many edits will be
rollbacked. When the count is over 10 the text "more than 10 edits" will
be outputed.

Change-Id: I5c4050e0a9197d4c505e85685a9780c97138d427
2012-07-31 22:46:37 +02:00
Alexandre Emsenhuber
df8c25e288 Do checks in the correct order in Linker::getLinkColour().
There's no point doing potentially expensive checks (exists() and
getLength()) if the page is simply not in a content namespace.

Change-Id: I86a2b3a36071cf508b8e99ef20bdf3e0e20f3c82
2012-07-25 09:50:58 +02:00
Aaron Schulz
00be71361c Merge "cleanup callback in usort call" 2012-07-13 17:24:57 +00:00
Antoine Musso
d5737f8f17 update @param @return doc in several files
Change-Id: I0e23227330f90dc4121fd2a313d2e9a33c3c97a7
2012-07-10 17:08:52 +02:00
umherirrender
56d6199bd0 cleanup callback in usort call
Change-Id: Iac42074d46cf9185339596cff167d72b0a8704b4
2012-07-08 11:40:50 +02:00
Alexandre Emsenhuber
026e8534c6 Add a context parameter to Liker::generateRollback() and Linker::buildRollbackLink() and updated callers.
This allows both methods to not always rely on global object, but also to use the local context when possible.

Change-Id: Id10f55ed9b18c889afd8d9937d9f35acb376cce4
2012-07-05 23:10:03 +02:00
Alexandre Emsenhuber
547b24f781 Fix parameter name: $displayText does not exist, but $altUserName does.
Change-Id: Ic901d6a74701eb8c1802ac7a28c479b253353a14
2012-07-05 20:01:10 +02:00
jeblad
631e79d556 Added a hook for formatting autocomments
Removed some spurious whitespace

Changed how wfRunHooks are used, and also the test for default formatting

Change-Id: I4c3fc1080f83166d7b89aeb9a1487e173e9ccb65
2012-06-15 13:25:31 +02:00
Liangent
e7ddfcf22e replace whitespace with 'word-separator' message
Change-Id: I34e099af74196579f20685e45d81b00ed8f76461
2012-06-11 19:59:45 +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
Liangent
8c65834425 Add new message 'brackets' and use it to kill some hardcoded []s.
Change-Id: Idae8d9201d1c291316ab520d204ae8c5cde2d890
2012-05-30 14:40:11 +08: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
Alexandre Emsenhuber
d3fecf5ac6 Added Linker::getInvalidTitleDescription() to display invalid title entries in various places.
This method will use two new messages 'invalidtitle-knownnamespace' and 'invalidtitle-unknownnamespace' depending on the fact that the given namespace number exists or not.
I did put that method in Linker because I plan to use it in various places, notably in other QueryPage and Pager subclasses.

Change-Id: I13e7cdc2c0a8e86dc5e4b144b6012f3864d2ec06
2012-05-07 18:25:52 +02:00
Amir E. Aharoni
4b439bb6ad Bug 35034 - moved autocomment-prefix between the prefix and the arrow. Follow up to r109086. 2012-03-13 23:09:06 +00:00
Siebrand Mazeland
481943429e (bug 34702) More localised parentheses. Patch contributed by Yusuke Matsubara. 2012-02-28 11:56:59 +00:00
Siebrand Mazeland
fa53862b3f Wow. Messy. Follow-up r112426, r112424: Fix incorrect calls. Should have been escaped() instead of escape(). 2012-02-26 12:11:35 +00:00
Siebrand Mazeland
7e7079374f Follow-up r112424: Per IAlex on IRC: Use escape() instead of plain() for improved security. 2012-02-26 12:07:21 +00:00
Siebrand Mazeland
fbe974a6f8 Follow-up r112410, r112412: Cheaper processing using plain(). 2012-02-26 11:49:01 +00:00
Siebrand Mazeland
50eabdff63 Follow-up r112410: (bug 34702) Use localised parentheses for comment, too. 2012-02-25 20:53:54 +00:00
Siebrand Mazeland
68643f5079 (bug 34702) Use localised parentheses in Special:Contributions. 2012-02-25 20:42:08 +00:00
Andrew Garrett
a548e4b595 Revert r97042, causes bug 34432 2012-02-17 22:15:17 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 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 19:29:36 +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
Amir E. Aharoni
9691721f65 Follow up to r105855 - now with updated phpunit tests. 2012-01-17 00:17:55 +00:00
Sam Reed
d580226891 Revert out r108882 2012-01-14 00:25:26 +00:00
Sam Reed
a8c1d130d9 Recommitting r108367 to break unit tests as phpunit on ubuntu seems FUBAR'd again
Will revert after
2012-01-14 00:09:58 +00:00
Antoine Musso
f3a96d17ac revert r108367 : breaks tests
When doing a change that break tests, update the tests in the same
commit. That makes the change more obvious and let us merge in
another branch easily.
2012-01-09 08:41:25 +00:00
Amir E. Aharoni
43c511f07f Fix the regression pointed out by Robin in r105855. 2012-01-08 21:07:27 +00:00
Siebrand Mazeland
449864b782 Add additional parameter $altUserName to Linker::userLink to make it possible to override the displayed user name.
Renamed $userText to $userName following Nikerabbit's advice.
2012-01-05 09:33:46 +00:00
Brion Vibber
344319f428 Revert r107773 - increases parsercache fragmentation without clear benefit 2012-01-03 21:20:35 +00:00
Alexandre Emsenhuber
9dbf69692c * (bug 32686) Tooltip on links to non-existing pages are now always in user's language
Fixed this by "abusing" of the $options parameter of Linker::link() to pass the Language object (as we did for wfMsgExt()), has the two following advantages:
* The tooltip is displayed in the requested language instead of depending on $wgLang
* The usage of the Language object is detected in the ParserOptions, thus the parser cache key will not have "*" for the language
2012-01-01 14:01:49 +00:00
Alexandre Emsenhuber
585141ece9 * Use Linker::getRevDeleteLink() where possible to remove code duplication
* Pass the User object to Revision::userCan() in Linker::getRevDeleteLink()
* Return the result Linker::revDeleteLinkDisabled() in Linker::getRevDeleteLink() instead of storing it in a variable that will not be used
2011-12-28 18:41:36 +00:00
Jeroen De Dauw
d117ac68d5 make docs more clear, method can only be used as is since 1.18, not 1.16 2011-12-13 20:45:35 +00:00
Raimond Spekking
1d1656de12 Partly revert r105985 for now: Flooding of translatewiki.net log/channel:
PHP Notice: Use of Linker::makeLinkObj was deprecated in MediaWiki 1.16. [Called from call_user_func_array in (internal function)] in /www/w/includes/GlobalFunctions.php on line 3520
PHP Notice: Use of Linker::makeKnownLinkObj was deprecated in MediaWiki 1.16. [Called from call_user_func_array in (internal function)] in /www/w/includes/GlobalFunctions.php on line 3520
2011-12-13 10:36:16 +00:00
Antoine Musso
bf006dd4f3 bring back Linker::tooltip()
Was marked deprecated with r42702 although that helper makes code a bit
nicer:

 Linker::tooltip( 'message' );
 
 Xml::expandAttributes( array(
	'title' => Linker::titleAttrib( 'message' )
 ) );

(the later would give you 'title=""' when 'tooltip-message' message does
not exist.
2011-12-13 09:52:39 +00:00
Jeroen De Dauw
cb1f9b80d0 since tag++ 2011-12-13 05:25:06 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Amir E. Aharoni
739d6c48fe Replaced the core message 'sectionlink' with getArrow, which is cleaner and does the right thing in mixed RTL/LTR environment. Removed the message from the messages files, because it doesn't seem to be used elsewhere. 2011-12-12 06:40:40 +00:00
Sam Reed
8e9b597894 * (bug 24765) User tool links edit hook
Original patch by "biolizard", updated to not use $this in static, and added relevant documentation
2011-11-20 15:16:54 +00:00
Antoine Musso
65c6f8c19a Bug 32238 - phaseout wgEnableTooltipsAndAccesskeys 2011-11-19 16:40:23 +00:00
John Du Hart
93e50f7eed Following r100264, update usages in core 2011-11-16 04:37:17 +00:00
Daniel Friesen
32b4dd8a77 Refactor core from Title::getLinkUrl to Title::getLinkURL to match Title's getLocalURL and getFullURL.
This shouldn't cause any back or forward compat issues since php treats method names as case-insensitive. So this change shouldn't break any old extensions, and extensions are free to start using getLinkURL and won't have any issue breaking with old versions of MediaWiki.
2011-11-10 03:27:55 +00:00
Aaron Schulz
6c4360c951 Make use of Title::isSpecialPage() in various places 2011-11-02 20:55:08 +00:00
Sam Reed
9ceb44a598 Fixup some assignments in conditionals
Add/normalise some more return statements
2011-10-16 03:27:12 +00:00
Alexandre Emsenhuber
632bb29658 Fix usage example of Linker::specialLink() 2011-10-11 13:00:17 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Sam Reed
0afa5cd5a3 Guard against
PHP fatal error in /home/wikipedia/common/php-1.18/includes/Linker.php line 831: 
Argument 1 passed to Linker::makeMediaLinkObj() must be an instance of Title, null given, called in /home/wikipedia/common/php-1.18/includes/Linker.php on line 1221 and defined
2011-09-22 15:08:32 +00:00
Sam Reed
8b44f9032c Fix single character access 2011-09-22 14:57:08 +00:00
Alexandre Emsenhuber
35d5bbc9f7 * Removed useless isset() check
* Added two spaces
2011-09-19 18:38:38 +00:00
Niklas Laxström
c4bf5b40ed Chrome seems to already support dir=auto, and I see no downsides using it for user comments.
Amir said that it is good.
2011-09-14 08:32:52 +00:00
Alexandre Emsenhuber
623d78b1c5 Added visibility markers to some Linker methods 2011-09-12 09:25:00 +00:00
Alexandre Emsenhuber
e3e5f0771f * Follow-up r96420: don't show e-mail links to anon users
* Fix for r24612 (!) spotted while fixing the above: parenthesis arround the bitwise check are needed since ! operator has higher precedence than &
2011-09-11 08:14:46 +00:00
Siebrand Mazeland
8680d82503 Mark userLink, userTalkLink, blockLink() and emailLink() as public static per CR comment on r96420 by Nikerabbit.
He suggested protected, because of the @private comment, but as we have made  more methods public static in the Linker class recently, this seems appropriate.
2011-09-07 17:00:46 +00:00
Siebrand Mazeland
8a170cd8ae Follow-up r96420: correct casing for special page to prevent "PHP Notice: Found alias defined for Emailuser when searching for special page aliases for EmailUser. Case mismatch?". 2011-09-07 13:35:01 +00:00
Siebrand Mazeland
0c12790089 Add constant Linker::TOOL_LINKS_EMAIL to allow adding a "send e-mail" link from Linker::
Add "send e-mail" link in user tools for developer details (Special:Code/Project/author/authorname) in CodeReview.
2011-09-07 12:12:24 +00:00
Daniel Friesen
a36ac512e6 Crack down on arguments inside the Linker that call themselves $text but in reality are unescaped html. 2011-09-03 13:46:56 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Aaron Schulz
ed425dfeda * Refactored SpecialUndelete::revDeleteLink into a Linker::getRevDeleteLink function
* (bug 21279) Updated DeletedContributions to use type=revision when possible (ar_rev_id exists)
2011-08-03 22:37:20 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Brion Vibber
3cdc9cfa0c Provisional revert of r93319 -- change to TOC styles without coordinated cache updates.
Definitely shows different padding with the old cached markup and new styles in FF 5 though it's not a huge difference. Haven't tested in other browsers; IE needs testing in particular as it has funky special style bits.

Recommend:
* old markup should work uncahnged with the new styles -- this avoids any transition problems
* secondarily, consider updating parser cache version to force updates .... but you'd still want to do the above for pages that have been HTTP-cached!
* test all these renderings in all supported browsers and confirm that all is well with old & new markup
2011-07-28 22:00:09 +00:00
Brion Vibber
a33c5fffec Revert r93386 -- PLEASE STOP COMMITTING THESE THINGS WITHOUT CONFIRMING THAT THEY DO WHAT NEEDS TO BE DONE, THAT THEY DON'T CAUSE PROBLEMS, AND THAT THEY WON'T JUST GET REVERTED FOR THE FOURTH OR FIFTH TIME. THANK YOU. 2011-07-28 21:41:41 +00:00
Leo Koppelkamm
0b182044d7 Redo r93284 ( Make editsection link more understandable by positioning it directly left ( RTL: right ) of the title ) in a more simple way and also include parserTests and release notes this time 2011-07-28 12:26:04 +00:00
Leo Koppelkamm
60d879b52b Recommit r93264 ( Remove semantically incorrect wrapper table from toc and replace it with an inline-blocked diff. Update some skin css, since we don't have the implicit table padding anymore and need to increase to padding to maintain the current look. ) with parser tests and release notes 2011-07-27 21:53:28 +00:00
Antoine Musso
2d55b1670f revert r93284 and follow up r93285
breaks parser tests. Please update the parser tests and reapply.
2011-07-27 19:24:43 +00:00
Antoine Musso
04d3db27c9 revert r93264 : breaks ton of parser tests.
Please update the parser tests and reapply.
2011-07-27 19:20:06 +00:00
Leo Koppelkamm
4fc85ff098 Fix Bug 11270 & Bug 11555 : Make editsection link more understandable by positioning it directly left ( RTL: right ) of the title.
Patch by Aryeh Gregor, updated by Roan Kattouw, and updated again by me. I also fixed one bug with modern.css.
Tested in IE6,7,8, Chrome & FF in all skins and both LTR and RTL contexts. I tested with floating images above and below the headers and couldn't find regressions.
2011-07-27 16:43:04 +00:00
Leo Koppelkamm
195ed61a82 Remove semantically incorrect wrapper table from toc and replace it with an inline-blocked diff. Update some skin css, since we don't have the implicit table padding anymore and need to increase to padding to maintain the current look. Bug 13766 2011-07-27 13:24:19 +00:00
Jeroen De Dauw
713446e29f fix doc 2011-07-23 20:58:18 +00:00
Robin Pepermans
56b2da7efb $wgUploadNavigationUrl should be used for file redlinks if $wgUploadMissingFileUrl is not set. The first was used for this until the second was introduced in r69997 (1.17). According to the comments there it was broken in 1.16 but as far as I tested it worked in 1.16. In any case, the old behavior should be restored as most WMF wikis have set wgUploadNavigationUrl but not wgUploadMissingFileUrl. 2011-07-19 23:09:55 +00:00
Sam Reed
ead9055a62 Update code comments that point to 1.18 to point to 1.19 2011-07-18 23:01:08 +00:00
Aaron Schulz
868cbaf5ee Reverted r91195, this isn't needed ;) 2011-06-30 18:45:48 +00:00
Aaron Schulz
5164d135f0 Added normalizeSubpageLink() to DummyLinker. __call doesn't handle static function call attempts, __callStatic__ is PHP >= 5.3, and both clobber references anyway. Just added a wrapper function instead. 2011-06-30 18:38:32 +00:00
Platonides
f1cebbd579 Linker::titleAttrib() didn't obey $wgEnableTooltipsAndAccesskeys 2011-06-30 18:21:05 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Brion Vibber
87786e84dd Revert r86764, r89134, r86827 -- added a second opaque boolean parameter to Linker::commentBlock() which appeared to mostly just turn it into Linker::formatComment().
commentBlock() exists for the sole purpose of embedding a comment into parentheses if it exists so you can append it to a line of text -- if you're not putting stuff in parentheses, don't use commentBlock() because you're not generating a parenthesized comment block.
Opaque boolean parameters are also very poor form, especially when tacking on multiple ones. There was already a nasty optional '$local' boolean param, forcing all uses of this other parameter to add *two* parameters, making illegible stuff like 'false, false'.
2011-06-14 23:50:40 +00:00
Jeroen De Dauw
5e3b5c0f54 added @ßince tag 2011-06-02 14:38:14 +00:00
Aaron Schulz
314e0a99ee Add back space between size and comment in history pages (fix for r86764) 2011-05-29 20:33:26 +00:00
Sam Reed
527e85fa9f More documentation in various files 2011-05-29 14:01:47 +00:00
Sam Reed
296f3d3f4f And even more documentation 2011-05-28 18:59:42 +00:00
Sam Reed
0d47a2ae90 More parameter documentation!! 2011-05-28 14:52:55 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Platonides
a344ffed30 Perform an early exit 2011-05-15 12:34:00 +00:00
Brian Wolff
cde9145e66 (bug 28940) When making a thumb of an SVG, and only specifying the height
make the width be the max SVG size, not the natrual width of the SVG.

Some of the linker code here should perhaps be moved. See comments on bug 28940
2011-05-14 23:48:59 +00:00
Daniel Friesen
104016401c Change $text to $html. This has been bothering me for awhile. It's stupid, counterintuitive, we call it text making people think of it as text then note (oh, this isn't text, it's html, you'd better escape it yourself or you'll screw yourself over with an XSS vector). 2011-05-08 00:10:31 +00:00
Niklas Laxström
4e8caae0bb Followup r87578:
PHP Notice:  Use of Linker::makeLinkObj is deprecated. [Called from call_user_func_array in (internal function)] for /w/i.php?title=Special:RecentChanges&translations=filter<ul>
<li>- line - calls Linker::makeLinkObj()</li>
<li>Skin.php line 1552 calls call_user_func_array()</li>
<li>- line - calls Skin::__call()</li>
<li>Renameuser.php line 58 calls SkinVector::makeLinkObj()</li>
<li>- line - calls wfRenameUserLogActionText()</li>
2011-05-07 17:04:00 +00:00
Sam Reed
45abb05da3 Remove another unused deprecated function
Update 1 inbound caller
2011-05-06 23:31:59 +00:00
Sam Reed
bc829f4372 Remove addExtraSQL 2011-05-06 23:07:20 +00:00
Sam Reed
46d4f5625e Documentation
Remove some deprecated in 1.16 functions with no callers
2011-05-06 22:53:59 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Sam Reed
8c1c535466 Remove some stuff marked as deprecated <= 1.16 unused
Stuff still used left for the moment

Added some since to @deprecated

Added wfDeprecated( __METHOD__ ); in one case
2011-05-06 20:59:58 +00:00
Sam Reed
5203c8dabc Couple more deprecated things removed 2011-05-06 20:50:16 +00:00
Daniel Friesen
8ae8bd5a98 Use a reversed magnify image for framed image thumbnails when on a RTL wiki. 2011-04-30 12:04:00 +00:00
Mark A. Hershberger
cbcc75067a revert r76127, r76129, and r83535 b/c I'm backing out the fix for bug #542. Fixing ancient bugs causes grief for many people. 2011-04-27 19:13:34 +00:00
Raimond Spekking
3d113bcf25 Followup r86764: don't parse the comment. Spotted by SPQRobin@Translatewiki and fixed the help of Ialex 2011-04-24 17:58:56 +00:00
Raimond Spekking
629df89813 Embrace comment with () only when really needed. In Special:ListFiles and ImagePage the comment is shown alone in a table cell -> no () needed 2011-04-23 13:23:08 +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
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Niklas Laxström
07c98fb98e Removed unmatched wfProfileOut 2011-04-14 16:09:07 +00:00
Brion Vibber
fcbd1134c6 * (bug 27473) Fix regression: bold, italic no longer interfere with linktrail for ca, kaa
Patch to ca, kaa linktrails to exclude multiple apostrophes by Platonides: https://bugzilla.wikimedia.org/attachment.cgi?id=8337

Added parser test cases to confirm that the linktrail apostrophe works on those languages, and to confirm that the bug where a link is surrounded by bold or italics is resolved.

Tweaked Linker::splitTrail() to keep it from permanently caching $wgContLang's linktrail; when we change content languages during a script run as we do with parser tests, that was leaving us stuck forever on English's linktrail.
This may slightly slow down that path, since it'll have to make a couple brief function calls into the Language object and its data cache.
2011-04-06 21:11:49 +00:00
Daniel Friesen
e844afb09c Followup r85244; Define all methods as static, implement a DummyLinker to forward calls for passing to hooks and finish off anything in the way. 2011-04-03 12:04:04 +00:00
Daniel Friesen
c817a24081 Drop connetion between Skin and Linker and turn Linker into a staticly usable class. 2011-04-03 11:44:11 +00:00
Aaron Schulz
d5460bce86 * Made BeforeParserMakeImageLinkObj/BeforeGalleryFindFile let hooks set sha1 parameter
* Made FlaggedRevs specify files by sha1,timestamp to handle renames with no redirects. This makes them handled as well as templates in this regard. (bug 27836) 
* Moved BeforeGalleryFindFile hook to proper place (don't trigger for non-NS_FILE titles)
* Removed unused mRevisionId field from ImageGallery
* Removed old hotfix from makeMediaLinkObj(); all the current callers would crash beforehand if the title was null anyway
* Updated hook docs (some prior params were missing)
* Broke some long lines and cleaned up some whitespace
* TODO: track file info in core rather than fr_fileSHA1Keys and ugly, duplicated, queries. This should be easy to do now.
2011-03-23 03:13:37 +00:00
Aaron Schulz
08e7c491bc Broke some of the more annoying lines 2011-03-21 16:15:56 +00:00
Happy-melon
b2d91f90e4 Follow-up r83786: update references in SpecialPage::getTitleFor() and friends to point to 'Block' rather than 'Blockip'; should fix errors on translatewiki. 2011-03-12 23:22:34 +00:00
Happy-melon
3d161feebf Follow-up r83755: @deprecated @since is wrong, doesn't have the expected semantic meaning. 2011-03-12 18:14:33 +00:00
Happy-melon
f516eaefb6 Deprecate $wgSysopUserBans and $wgSysopRangeBans, both of which are pre-1.2, and totally antiquated. Can't think of any reason why a modern wiki might want to make blocks IP-only; syadmins can still disable rangeblocks by setting $wgBlockCIDRLimit to the maximum for each IP mode (32 for IP4, 128 for IP6). 2011-03-12 12:13:22 +00:00
Mark A. Hershberger
9488bbc6f2 * Followup r76127 and r83521 by adding parsertests and using caseFold 2011-03-08 18:09:34 +00:00
Ilmari Karonen
0bcd541e55 revert r83521; this needs to be fixed better, but fixing the crash is first priority 2011-03-08 15:54:28 +00:00
Mark A. Hershberger
2405b4252e followup r76127 — use language-aware comparison between link text and possible title attribute 2011-03-08 14:38:26 +00:00
Sam Reed
5c51397edb fix typo from r83073 2011-03-02 10:59:30 +00:00
Sam Reed
b54f839885 Documentation, braces, "and" -> "&&" 2011-03-02 10:57:55 +00:00
Bryan Tong Minh
bf067d3395 (bug 27679) Broken embedded files with special characters are no longer double HTML escaped
Was a double escape in Linker::makeBrokenImageLinkObj. I checked the callers and other usages in the function and $prefix and $inside appear to be assumed HTML fragments
Added parser tests: Passed 622 of 624 tests (99.68%)... 2 tests failed! Those two tests already failed for me before this patch
2011-02-26 12:08:59 +00:00
Mark A. Hershberger
fcf56ed2f3 (Bug #27634) TOC title appears in wrong language
Patch from P.Copp
2011-02-23 20:32:57 +00:00
Platonides
81f8704c56 Fix the wrong merge of r81894 after r81893 2011-02-10 16:47:19 +00:00
Platonides
aeb547b465 Adding more wfProfileOut() 2011-02-10 16:11:34 +00:00
Niklas Laxström
30534ae136 Fix profiling 2011-02-10 16:08:44 +00:00
Daniel Friesen
1455b81f0c Kill off Linker::getExternalLinkAttributes. 2011-02-05 23:06:36 +00:00
Sean Colombo
5645b7594a A wfProfileOut was missing (which messed up profiling sometimes). Thanks to Owen Davis for finding this. 2011-01-11 22:20:56 +00:00
Happy-melon
90f4db8144 More ancient deprecated functions:
* Linker::postParseLinkColour() - 1.5 (r8662)
* Linker::editSectionLink() and editSectionLinkForOther() - 1.14 (r38161)

Linker::tooltip() and Linker::tooltipWithAccessKey() are old, but still used all over the place.
2011-01-06 18:53:53 +00:00
Niklas Laxström
690b0e131f Same for the tooltip, don't call twice 2010-12-25 12:33:17 +00:00
Niklas Laxström
5b6beefd39 Don't load the same accesskey message four times (in the worst case) 2010-12-25 12:24:18 +00:00
Brian Wolff
ff5394caed (Bug 26410) In an internal link, a plus sign is treated as a space if the link
has a % sign in it, but interperted as a + if no % sign is present.

This changes how the parser interperts links slightly. However:
*I can't imagine anyone is relying on this behaviour
*Things should be consistent. a + sign shouldn't magically change meaning
if there is a % sign somewhere else in the link.
*Pages are allowed to contain % signs in their title, and + signs,
you should be able to link to such pages just by typing there name without
resorting to %2B.
*If you have a page named foo%+ having [[{{PAGENAME}}]] link to a different
page seems inherently wrong.
*The previous behaviour seemed accidental.
2010-12-24 09:53:08 +00:00
Happy-melon
6b5d1c1c0e Revert rollback implementation of r78585, r78599. The way the API is set up, it's not possible to have some tokens on the new system and some on the old. 2010-12-20 19:03:00 +00:00
Happy-melon
ff2f6606b0 Follow-up r78585: Make Token::PERSISTENT the default, so no need to specify it. That will be more usual, I expect. 2010-12-19 15:23:22 +00:00
Happy-melon
e0bec9555e Merge in Token class from my branch; would like some second opinions on the concept. This seeks to replace the much-abused $wgUser->editToken() token generator, 90% of the uses of which are not for editing but rather general actions.
Implemented for rollback mainly as a proof-of-concept; obvious further targets are patrol links and HTMLForm.
2010-12-18 23:07:30 +00:00
Tim Starling
a7f71290d8 Cleaned up r70342 and r70343: removed commented-out code. 2010-12-14 11:11:38 +00:00
Tim Starling
36d43eabc0 Fixed comments and indenting style from r68491. 2010-12-14 09:01:48 +00:00
Alexandre Emsenhuber
1a4957e0b4 * (bug 21364) External links using link= attribute on images now respect $wgExternalLinkTarget 2010-11-09 12:25:57 +00:00
Alexandre Emsenhuber
32d087efd6 * (bug 25843) Links to special pages using link= attribute on images are now normalised like normal links to special pages 2010-11-09 12:00:53 +00:00
Mark A. Hershberger
3e42e050df followup #76127 - fix a space inserted where it shouldn'tve been. 2010-11-05 19:36:51 +00:00
Mark A. Hershberger
7ba628bf78 Resolves Bug#542 by removing the link title from in-wiki links where
the title just duplicates the link text.
2010-11-05 19:06:12 +00:00
Derk-Jan Hartman
9142fbfb03 Follow up r75749. Fixes a case with a linked thumbnail of a non-existant image.
Apparently makeThumbLink2() does handle non-existing files.
2010-11-01 19:36:29 +00:00
Sam Reed
3cfa08995d Update a few deprecated method calls 2010-10-31 23:46:35 +00:00
Derk-Jan Hartman
6e522d63e6 Upscale thumbnails of SVGs if the nominal size of the SVG is smaller than the thumbnail size.
Fixes bug 19633. Requires r75748
2010-10-31 21:53:29 +00:00
Platonides
76167d9f27 Follow up r74725. Also add $lang parameter to EditSectionLink.
Document the changes in hooks.txt
2010-10-14 22:13:43 +00:00
Jack D. Pond
12dda96c6e Added $lang parameter to DoEditSectionLink hook. Allows extensions that add or modify links to use wfMsgExt to build those links consistent with parent function doEditSectionLink. 2010-10-13 18:45:43 +00:00
Platonides
4018ed0da7 Follow up r70940. This call should use the hook $result. 2010-10-12 23:20:12 +00:00
Aryeh Gregor
388e4425bf Fix double-escaping for section edit link tooltips
Bug 25462.
2010-10-08 18:52:23 +00:00
Platonides
8f3a851aa2 Remove usage of deprecated makeKnownLinkObj().
Added a parserTest for each call of the old makeKnownLinkObj (and checked that they pass now with linkKnown).
2010-09-04 22:25:59 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Platonides
4bd9946ef5 Follow-up r72319. Use linkKnown() and skip a few parameters. 2010-09-03 22:10:07 +00:00
Platonides
2e42f9613e Remove call to deprecated function Linker::makeKnownLink from function specialLink. 2010-09-03 21:53:02 +00:00
Aryeh Gregor
17aabb2d00 Style fixes for Linker.php
Mostly stylize.php, some manual.  As usual, if you're seeing this in a
blame, use "svn blame -x -w" or "git blame -w", as appropriate.
2010-08-26 19:40:29 +00:00
Sam Reed
721ecb6d2d Remove some more unused variables
Remove srvus() from Parser, unused, and calling testSrvus wrongly
2010-08-19 11:21:14 +00:00
Aryeh Gregor
985ec50104 Avoid spurious paragraph with new heading id's
Bug 24835.  The use of <a> made the parser put <p> around the tag, so
use <div> instead.  (Something was also adding a name="" attribute, but
I'm not sure what.  That should be killed.)
2010-08-17 21:55:21 +00:00
Platonides
5de0fbd0de No need for $wgUser since r70653 2010-08-12 14:00:10 +00:00
Platonides
69ad72018b Followup r70783. Give doEditSectionLink an extra parameter with the language to use for the editsection. 2010-08-12 12:30:47 +00:00
Platonides
6d20e79faf Make thumbsize option go through ParserOptions.
Yet another parameter for makeImageLink2...
2010-08-07 22:35:23 +00:00
Niklas Laxström
c975214f7f Refactor so that tooltipAndAccesskeyAttribs does not cause 6 message cause hits if tooltip and accesskey don't even exists 2010-08-05 16:22:42 +00:00
Platonides
121bb4f03e http://www.mediawiki.org/wiki/User:Catrope/Stub_threshold shows us people setting it to insanely large values trying to disable it.
r70433 addressed the UI. Here we proxy its access via a new method getStubThreshold() that disables it if a page of such size cannot be 
created (by an user), so we can serve them parser cached articles again.
2010-08-03 22:32:09 +00:00
Siebrand Mazeland
ba734f62e3 More message spewing reduction from r70337. 2010-08-02 17:46:38 +00:00
Siebrand Mazeland
9965c23930 Partially revert r70337. Let's not deprecate methods that are not even removed completely from core (!!!) 2010-08-02 17:44:31 +00:00
Platonides
eee4d13325 Check the link color (stub, redirect) on just one place.
Deprecate makeSizeLinkObj. The only usage is in CategoryPage, which we can change to link() without penalty, since the created Title is already loaded with its length.
2010-08-02 15:53:22 +00:00
Bryan Tong Minh
c8623eae26 Fixes for (bug 18885), r60593, r60979: The upload link for missing files can now be set separately from the navigation link with $wgUploadMissingFileUrl. 2010-07-27 10:31:30 +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
Tim Starling
ce448d5d7a * Fixed "link" parameter in image links with "thumb" parameter, previously the link parameter was just ignored. The fix required the relevant code to be factored out so both makeImageLink2() and makeThumbLink2() could use it.
* Fixed the coding style and escaping of some nearby code. The lack of escaping on $url would have caused invalid HTML (bare ampersand) if ugly URLs were combined with page parameters.
2010-07-20 10:28:00 +00:00
Platonides
e7d06d4aff Disable pretty italics inside links. Now the italics inside a link alternate text will be handled on its own scope but if they come from the page title, they won't be parsed at all. This is a middle way solution to bug 4598. Now all bug 4598 tests pass.
Pretty italics mean that italics go across links: ''Some [[Link|pretty ''italics'' and stuff]]! -> ''Some [[Link|pretty ''italics'' and stuff]]! -> <i>Some <a>pretty <i>italics</i> and stuff</a>!</i>

This also fixes bug 24093, where interface messages saying '''[[$1]]''' has been deleted/renamed/links here were being bitten by this feature.

The best resolution would be to make pretty italics still work inside alternates, feel free to do so, but doesn't seem worth at this point. The right solution should be to rewrite the quotes handling so it takes its scope into account.
2010-06-23 23:29:54 +00:00
Conrad Irwin
eb41544de5 (bug 22784) Fix normalization of whitespace in autocomment links
put this specific normalisation into Sanitizer::normalizeSectionNameWhitespace
instead of repeating it three times.
2010-06-21 01:17:36 +00:00
Derk-Jan Hartman
bb3f79ab40 The rendering of autosummary in History and Diff pages did not properly escape the URI fragment before creating the link.
This was causing inconsistencies between anchors in editsummaries and those actually used in pages.
See also bug 18431
2010-06-19 13:40:05 +00:00
Platonides
3b150034a0 (bug 8689) Use strict php comparison, so that inserting a long numeric line doesn't produce a fatal error when php tries to convert it to a number. 2010-05-28 14:16:46 +00:00
Alexandre Emsenhuber
51a2eba1ce Fixed some doxygen warnings 2010-05-20 20:36:12 +00:00
Derk-Jan Hartman
f054c4e58f Repair makeThumbLink2() getUnscaledThumb() to pass along the handlerparams to transform()
Fixes bug 23577
2010-05-19 00:40:48 +00:00
Alexandre Emsenhuber
de0af00d47 Fix for r65579: removed "!" that should really not be there... 2010-04-27 18:15:55 +00:00
Alexandre Emsenhuber
3b0758d869 * (bug 23298) Interwiki links with prefix only in log summaries now link to the correct link 2010-04-27 18:09:37 +00:00
Conrad Irwin
2b64de575d Fix OggHandler/Mp3Handler etc. after r61912 r61918 2010-04-09 16:58:42 +00:00
Tim Starling
f5b882aadc Moving Conrad's recent parser work out to a branch. Reverted r62434, r62416, r62150, r62111, r62085, r62081, r62080, r62077, r62076, r62069, r62049, r62035. 2010-02-19 05:19:32 +00:00
Conrad Irwin
76d285dc36 More sensible semantics for pipe trick with section links after r62076
[[hello#world|]] -> [[hello#world|world]] (not [[hello#world]])
2010-02-09 01:05:49 +00:00
Aryeh Gregor
7021df418c Whitespace 2010-02-08 20:05:06 +00:00
Aryeh Gregor
2936105241 Use consistent case when calling functions 2010-02-08 18:54:08 +00:00
Conrad Irwin
fe91f53371 Fix bug 20339 allow pipe-trick in log reasons
follows on from r62069 moving logic from Parser into Linker 
(copying brion's technique for dealing with subpages)
2010-02-07 14:50:55 +00:00
OverlordQ
e4a73a9eb0 Followup to r61912, make sure hight is actually given, also dont ignore if upright is specified 2010-02-03 08:53:43 +00:00
OverlordQ
0071dd7375 Fix for not being able to override thumbnail height 2010-02-03 06:21:25 +00:00
Tim Starling
4438c46cf3 Revert r56514 and r60421 per CR. 2010-02-03 04:54:20 +00:00
Conrad Irwin
472c3267fe Bug 18784 - Internal links like [[File:Foo|caption]] should read 'caption', not 'File:Foo' when Foo is not an image 2010-02-01 20:43:24 +00:00
Bryan Tong Minh
e72c96772d Fix regression from r60593: The title attribute for links to NS_MEDIA titles no longer contains the namespace as before.
Passed 559 of 559 tests (100%)... ALL TESTS PASSED!
2010-01-12 19:43:03 +00:00
Mark A. Hershberger
add6090790 Make LTR wgLang do the right thing on RTL wgContLang wikis. See bug 6100 and dupes like bug 4047, bug 19228, bug 9137, etc. 2010-01-07 09:32:09 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Bryan Tong Minh
1f12cbc8ed (bug 18885) Red links for media files do not support shared repositories
$wgUploadNavigationUrl now also affects images inline images that do not
exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to
it as appropriate.
2010-01-03 22:45:34 +00:00
Alexandre Emsenhuber
c3ec19debc Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme command 2009-12-15 21:26:58 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Daniel Kinzler
52f05fd8fa adding support for <a> tags as a parser tag hook, in order to support rdfa output 2009-11-07 16:46:34 +00:00
Aaron Schulz
90dcb3c1f2 * bug 21267 change "show/hide" to "show", if user cannot submit Special:Revisiondelete
* Added revDeleteLinkDisabled() function
2009-10-30 02:14:22 +00:00
Chad Horohoe
f01eb6c10b (bug 21280) Document Linker.php 2009-10-26 14:25:48 +00:00
Bryan Tong Minh
918171cef4 Update HTMLForm for upcoming Special:Upload rewrite.
* Add support for edittools
* Add support for multipart/form-data
* Set id for wpEditToken
* Add support for tooltip and accesskey
* Allow setting a name for the submit button
* Give sections an id
2009-10-18 19:29:35 +00:00
Alexandre Emsenhuber
3bd4424b23 * (bug 21116) MediaWiki:Templatesused, MediaWiki:Templatesusedpreview and MediaWiki:Templatesusedsection now support plural
* break lines a 80 chars in RELEASE-NOTES
2009-10-15 19:10:52 +00:00
Roan Kattouw
b4044991f6 Followup to r56174: tooltipAndAccesskey also returns a string 2009-09-17 14:22:31 +00:00
Alexandre Emsenhuber
b87c11ed37 Fixes for r56068 and r55984:
* missing "!" for the check $wgEnableTooltipsAndAccesskeys
* Linker::tooltip() return a string, no an array
* spacing fixes
2009-09-11 10:59:15 +00:00
Brion Vibber
4b06ec132a Cleanup r55984: rename new $wgDisableTooltipsAndAccesskeys to $wgEnableTooltipsAndAccesskeys and swap value.
'enable' settings are less confusing than 'disable' settings. :)
2009-09-08 20:59:44 +00:00
Domas Mituzas
2196f00313 features time - a feature that allows to disable a feature!
(rationale: allows turning off relatively expensive code that generates invisible stuff :)
2009-09-07 18:38:40 +00:00
Domas Mituzas
7b0ff4c549 don't lookup any classes for 'known' links - fixes excessive queries caused by links in footer 2009-09-07 18:20:32 +00:00
Chad Horohoe
75cd6a9069 Revert r53534 (bug 15745, Make the edit summary link parser detect links more like the real parser). Causes preg_replace_callback bug in 5.2.8 and below, crashes lots of things. See bug 19845 and http://bugs.php.net/bug.php?id=48501 2009-08-27 22:27:42 +00:00
Brion Vibber
71432fb487 Pet peeve time: reduce clutter from common $wgContLang->isRTL() ? 'x' : 'y' pattern. :)
Introduced helpers:
  $lang->getDir() returns 'ltr' or 'rtl' for HTML 'dir' attrib
  $lang->alignStart() returns 'left' or 'right' for HTML 'align' attrib or CSS 'text-align' property
  $lang->alignEnd() returns 'right' or 'left'

And cleaned up a couple arrays of icons to just reverse the order of items rather than repeating the items twice for each possibility.
2009-08-22 01:24:04 +00:00
Aryeh Gregor
aece69bc89 Switch from Xml:: to Html:: in a few places
These should all theoretically be covered by the parser tests.  All
tests pass, the only change needed was to account for less overescaping
in Html::expandAttributes().  There's no reason to escape <>' in
"-quoted attributes, unless I'm mistaken and have just added some XSS.
2009-08-21 20:39:35 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
Aryeh Gregor
7aa4a8f90c For HTML 5, drop type="" attributes for CSS/JS
This time done in a nice, centralized fashion, reducing LOC for callers
even if HTML 5 is disabled.  The implementation is a new Html class,
similar to Xml but intended to be HTML-specific from the beginning
instead of half-heartedly attempting to provide generic XML services but
actually with lots of HTML-specific stuff tacked on.

As part of the new Html class, a global config option $wgWellFormedXml
is added.  It's set to true by default, but if set to false, the Html
class will drop some things that HTML 5 doesn't require, like
self-closing " />" syntax and attribute quotation marks (sometimes).
2009-08-11 00:09:24 +00:00
Aryeh Gregor
6babcbbeeb Don't use summary attribute in TOCs
The summary attribute is obsolete in HTML 5.  It wasn't serving any
useful purpose anyway, since it duplicated the h2 inside the table.  (Of
course, we should really stop using <table> for TOCs altogether!)
2009-08-10 01:42:45 +00:00
Brion Vibber
369f767c01 Cleanup for r53518 (subpage support for edit comments)
Reported bug: PHP Notice: Undefined variable: thelink in /var/www/w/includes/Linker.php on line 1090 on hitting http://translatewiki.net/w/i.php?title=Special:Log&dir=prev&user=Siebrand
Weren't properly checking for the case where we end up with an invalid link at the end.
2009-07-21 17:07:56 +00:00
Remember the dot
f35c56e72a Follow-up to r52963: Moved ID attributes on header elements to the spans within the headers to avoid breaking things, at least until we can decide what the best way to handle these IDs is. 2009-07-21 04:19:34 +00:00
Alex Z
3de7d6f25c (bug 15745) Make the edit summary link parser detect links more like the real parser, added a parser test for it 2009-07-20 06:29:46 +00:00
Brion Vibber
a721830762 Also treat [[#section]] links as expected with the 'local' param for diff view vs RC/history view. 2009-07-20 02:26:37 +00:00
Brion Vibber
43bf053fd0 * (bug 14080) Short notation links to subpages didn't work in edit summaries
Moved Parser::maybeDoSubpage guts to Linker to call from both locations.
Added some parser test cases.
Note that this might not behave exactly like the main parser in cases where the link text would get altered, but the links are functional. Yay!
2009-07-20 02:07:56 +00:00
Roan Kattouw
b18ec94952 * Fix typo in Linker.php
* Only call ParserOutput::setTOCHTML() if a TOC was really generated
2009-07-14 13:35:07 +00:00
Remember the dot
a70213071d Removed repetition of URIs in the title attributes (tooltips) of external links. Web browsers typically display the target URIs of links in the status bar, making repeating the URIs in tooltips redundant. Some browsers, like Opera, can be configured to display the URIs in tooltips instead of the status bar without the web page having to supply title attributes at all.
As part of this process, I refactored some of Linker.php and removed an unused parameter from getExternalLinkAttributes.
2009-07-12 23:32:16 +00:00
Remember the dot
b7f4c5612e Updated parser tests for r52726. Also fixed some corner cases and updated the parser test for PMID links. 2009-07-11 04:47:12 +00:00
Remember the dot
9fae5055fa Removed redundant anchors from headings as suggested by Aryeh Gregor on wikitech-l. Even IE6 supports jumping to elements by ID using URLs, so there is no need to make this any more complicated than it has to be. 2009-07-09 03:50:49 +00:00
Remember the dot
05978d7cf3 Title attributes are now always blank on framed and thumbnailed images, and default to blank on inline images instead of defaulting to the image's filename. Additionally, the alt attribute now defaults to the filename on framed and thumbnailed images if no caption or alt attribute is specified.
I was unable to run the parser test suite ("MediaWiki internal error"), so the test suite may need to be updated to reflect these changes.
2009-07-03 05:13:58 +00:00
Roan Kattouw
4a71b9a810 Revert r52410 (Put the [edit] link after the section header instead of before, and don't right-float it anymore) for now because of unresolved issues 2009-06-25 21:10:10 +00:00
Roan Kattouw
9fbe8ba6af (bug 11270) Put the [edit] link after the section header instead of before, and don't right-float it anymore 2009-06-25 20:00:56 +00:00
Roan Kattouw
82022f21bc Core changes for NavigableTOC extension:
* Always generate the section tree, even when we're not generating a TOC
* Add Parser::mergeSectionTrees() to merge two section trees into one
* Add Linker::generateTOC() to generate the HTML for a TOC from a section tree, and add the section anchor to the section tree to facilitate this. This adds the ability to generate TOCs in extensions; haven't converted Parser.php to use it (yet?). As a side effect, this fixes API bug 18720
2009-06-25 11:05:22 +00:00
Roan Kattouw
ae130186e8 Core changes for NavigableTOC extension:
* Add TOC HTML to ParserOutput
* Add class tocsection-$section to <li> elements in the TOC representing sections in the current page (as opposed to transcluded sections)
2009-06-20 21:47:10 +00:00
Siebrand Mazeland
74e9732dae * deprecated makeMediaLink() to makeMediaLinkObj
* add FIXME where I was not able to replace a deprecated method
* add doxygen @deprecated where wfDeprecated() was present, but not the doc

Should conclude replacing or tagging remaining deprecated Linker::make*Link*() in core. Linking to r51559 for code review
2009-06-13 13:41:48 +00:00
Siebrand Mazeland
9b923334c7 Move deprecated methods to the bottom of the class. 2009-06-08 22:33:37 +00:00
Siebrand Mazeland
cf8c96d06c Follow-up to r51543: fix syntax error in Linker.php 2009-06-06 17:04:07 +00:00
Siebrand Mazeland
0d3a39aec4 * replace use of deprecated makeLink() by link() in core
* replace other deprecated Linker::*link*() methods in special pages
2009-06-06 17:00:20 +00:00
Siebrand Mazeland
055fcbd7cb * replace use of deprecated makeLinkObj() by link() in core
* add FIXME where makeLinkObj was used in documentation
2009-06-06 15:45:43 +00:00
Niklas Laxström
d3b61fea7c Escaping fixes 2009-05-22 09:35:48 +00:00
Aaron Schulz
d9c3c58e21 Fixed bug in r49227; use raw function now 2009-05-18 22:15:12 +00:00
Brion Vibber
cccbd370d4 Revert r50721 "(bug 18834) Commit Patch from User Joshua C. Lerner <jlerner@gmail.com> for include/Linker.php"
* Fails to explain purpose of patch
* use of SQL variable interpolation without using standard encoded variable naming convention; looks unsafe and makes review harder
* Code has issues already noted; follow-up code was also reverted.
Code needs a little more cooking I think. :)
2009-05-18 18:52:53 +00:00
Brion Vibber
04b62f23df Revert r50727 "* (bug 18834) Show how many edits will rollback if $wgShowRollbackEditCount is set true in LocalSettings.php, bugfixes for r50721"
* Seems to combine unrelated changes, which complicates code review and management
* Patch is incomplete, missing default settings etc.
2009-05-18 18:48:36 +00:00
Jan Luca Naumann
05fa159917 * (bug 18834) Show how many edits will rollback if $wgShowRollbackEditCount is set true in LocalSettings.php, bugfixes for r50721 2009-05-18 18:25:06 +00:00
Jan Luca Naumann
4a04bbca9a (bug 18834) Commit Patch from User Joshua C. Lerner <jlerner@gmail.com> for include/Linker.php 2009-05-18 14:20:46 +00:00
Roan Kattouw
4706355c07 Efficiency fix: don't call Title::isRedirect() on titles known not to exist; eliminates a lot of LinkCache::addLinkObj() queries for titles fed to Linker::makeBrokenLinkObj() 2009-05-09 20:52:52 +00:00