summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-04-01 06:11:44 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-04-01 06:11:44 +0200
commit14f74d141ab5580688bfd46d2f74c026e43ed967 (patch)
tree081b7cbfc4d246ecc42831978d080331267cf57c
parent4a953b6bfda28604979feb9cfbb58974d13b84bb (diff)
Update to MediaWiki 1.24.2
-rw-r--r--Gruntfile.js119
-rw-r--r--RELEASE-NOTES-1.2423
-rw-r--r--docs/kss/package.json13
-rw-r--r--extensions/ConfirmEdit/Asirra.class.php55
-rw-r--r--extensions/ConfirmEdit/Asirra.php43
-rw-r--r--extensions/ConfirmEdit/README4
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ast.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/be-tarask.json19
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/br.json13
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ca.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/cs.json8
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/de-formal.json13
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/de.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/diq.json8
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/en.json14
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/es.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/fa.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/fi.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/fr.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/gl.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/he.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/hsb.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ia.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/it.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ja.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ko.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ksh.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/lb.json13
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/mk.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ms.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/mt.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/nb.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/nl-informal.json8
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/nl.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/oc.json9
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/pl.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/pms.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/pt.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/qqq.json19
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/roa-tara.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/ru.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/si.json9
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/sv.json20
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/tl.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/uk.json17
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/wa.json16
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/zh-hans.json18
-rw-r--r--extensions/ConfirmEdit/i18n/asirra/zh-hant.json17
-rw-r--r--extensions/ConfirmEdit/resources/ext.confirmEdit.asirra.js54
-rw-r--r--extensions/Gadgets/tests/GadgetTest.php63
-rw-r--r--extensions/LocalisationUpdate/tests/phpunit/Makefile12
-rw-r--r--extensions/LocalisationUpdate/tests/phpunit/UpdaterTest.php80
-rw-r--r--extensions/LocalisationUpdate/tests/phpunit/finder/FinderTest.php70
-rw-r--r--extensions/LocalisationUpdate/tests/phpunit/reader/JSONReaderTest.php37
-rw-r--r--extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php38
-rw-r--r--extensions/ParserFunctions/tests/ExpressionTest.php76
-rw-r--r--extensions/PdfHandler/COPYING339
-rw-r--r--extensions/PdfHandler/CreatePdfThumbnailsJob.class.php126
-rw-r--r--extensions/PdfHandler/PdfHandler.i18n.php (renamed from extensions/ConfirmEdit/Asirra.i18n.php)8
-rw-r--r--extensions/PdfHandler/PdfHandler.image.php309
-rw-r--r--extensions/PdfHandler/PdfHandler.php66
-rw-r--r--extensions/PdfHandler/PdfHandler_body.php386
-rw-r--r--extensions/PdfHandler/i18n/af.json11
-rw-r--r--extensions/PdfHandler/i18n/aln.json10
-rw-r--r--extensions/PdfHandler/i18n/an.json10
-rw-r--r--extensions/PdfHandler/i18n/ar.json16
-rw-r--r--extensions/PdfHandler/i18n/arz.json10
-rw-r--r--extensions/PdfHandler/i18n/as.json13
-rw-r--r--extensions/PdfHandler/i18n/ast.json14
-rw-r--r--extensions/PdfHandler/i18n/azb.json8
-rw-r--r--extensions/PdfHandler/i18n/ba.json10
-rw-r--r--extensions/PdfHandler/i18n/bcl.json14
-rw-r--r--extensions/PdfHandler/i18n/be-tarask.json16
-rw-r--r--extensions/PdfHandler/i18n/bg.json13
-rw-r--r--extensions/PdfHandler/i18n/bn.json11
-rw-r--r--extensions/PdfHandler/i18n/br.json15
-rw-r--r--extensions/PdfHandler/i18n/bs.json10
-rw-r--r--extensions/PdfHandler/i18n/ca.json10
-rw-r--r--extensions/PdfHandler/i18n/ce.json12
-rw-r--r--extensions/PdfHandler/i18n/ckb.json8
-rw-r--r--extensions/PdfHandler/i18n/cs.json15
-rw-r--r--extensions/PdfHandler/i18n/cy.json14
-rw-r--r--extensions/PdfHandler/i18n/da.json14
-rw-r--r--extensions/PdfHandler/i18n/de-ch.json8
-rw-r--r--extensions/PdfHandler/i18n/de.json16
-rw-r--r--extensions/PdfHandler/i18n/diq.json16
-rw-r--r--extensions/PdfHandler/i18n/dsb.json14
-rw-r--r--extensions/PdfHandler/i18n/el.json10
-rw-r--r--extensions/PdfHandler/i18n/en-gb.json8
-rw-r--r--extensions/PdfHandler/i18n/en.json12
-rw-r--r--extensions/PdfHandler/i18n/eo.json13
-rw-r--r--extensions/PdfHandler/i18n/es.json15
-rw-r--r--extensions/PdfHandler/i18n/et.json15
-rw-r--r--extensions/PdfHandler/i18n/fa.json18
-rw-r--r--extensions/PdfHandler/i18n/fi.json18
-rw-r--r--extensions/PdfHandler/i18n/fr.json17
-rw-r--r--extensions/PdfHandler/i18n/frp.json10
-rw-r--r--extensions/PdfHandler/i18n/gl.json15
-rw-r--r--extensions/PdfHandler/i18n/grc.json9
-rw-r--r--extensions/PdfHandler/i18n/gsw.json14
-rw-r--r--extensions/PdfHandler/i18n/gu.json11
-rw-r--r--extensions/PdfHandler/i18n/he.json16
-rw-r--r--extensions/PdfHandler/i18n/hi.json10
-rw-r--r--extensions/PdfHandler/i18n/hr.json10
-rw-r--r--extensions/PdfHandler/i18n/hsb.json14
-rw-r--r--extensions/PdfHandler/i18n/hu.json15
-rw-r--r--extensions/PdfHandler/i18n/ia.json14
-rw-r--r--extensions/PdfHandler/i18n/id.json10
-rw-r--r--extensions/PdfHandler/i18n/ilo.json14
-rw-r--r--extensions/PdfHandler/i18n/it.json15
-rw-r--r--extensions/PdfHandler/i18n/ja.json15
-rw-r--r--extensions/PdfHandler/i18n/jv.json11
-rw-r--r--extensions/PdfHandler/i18n/ka.json15
-rw-r--r--extensions/PdfHandler/i18n/km.json13
-rw-r--r--extensions/PdfHandler/i18n/kn.json8
-rw-r--r--extensions/PdfHandler/i18n/ko.json15
-rw-r--r--extensions/PdfHandler/i18n/ksh.json14
-rw-r--r--extensions/PdfHandler/i18n/ky.json9
-rw-r--r--extensions/PdfHandler/i18n/lb.json14
-rw-r--r--extensions/PdfHandler/i18n/li.json10
-rw-r--r--extensions/PdfHandler/i18n/lrc.json8
-rw-r--r--extensions/PdfHandler/i18n/lt.json10
-rw-r--r--extensions/PdfHandler/i18n/mk.json15
-rw-r--r--extensions/PdfHandler/i18n/ml.json15
-rw-r--r--extensions/PdfHandler/i18n/mr.json12
-rw-r--r--extensions/PdfHandler/i18n/ms.json14
-rw-r--r--extensions/PdfHandler/i18n/mt.json8
-rw-r--r--extensions/PdfHandler/i18n/nb.json14
-rw-r--r--extensions/PdfHandler/i18n/nl.json15
-rw-r--r--extensions/PdfHandler/i18n/nn.json11
-rw-r--r--extensions/PdfHandler/i18n/oc.json14
-rw-r--r--extensions/PdfHandler/i18n/or.json15
-rw-r--r--extensions/PdfHandler/i18n/pdc.json8
-rw-r--r--extensions/PdfHandler/i18n/pl.json16
-rw-r--r--extensions/PdfHandler/i18n/pms.json15
-rw-r--r--extensions/PdfHandler/i18n/pnb.json10
-rw-r--r--extensions/PdfHandler/i18n/pt-br.json15
-rw-r--r--extensions/PdfHandler/i18n/pt.json16
-rw-r--r--extensions/PdfHandler/i18n/qqq.json16
-rw-r--r--extensions/PdfHandler/i18n/ro.json11
-rw-r--r--extensions/PdfHandler/i18n/roa-tara.json14
-rw-r--r--extensions/PdfHandler/i18n/ru.json15
-rw-r--r--extensions/PdfHandler/i18n/rue.json10
-rw-r--r--extensions/PdfHandler/i18n/sa.json10
-rw-r--r--extensions/PdfHandler/i18n/sah.json10
-rw-r--r--extensions/PdfHandler/i18n/si.json15
-rw-r--r--extensions/PdfHandler/i18n/sk.json10
-rw-r--r--extensions/PdfHandler/i18n/sl.json14
-rw-r--r--extensions/PdfHandler/i18n/sq.json10
-rw-r--r--extensions/PdfHandler/i18n/sr-ec.json11
-rw-r--r--extensions/PdfHandler/i18n/sr-el.json10
-rw-r--r--extensions/PdfHandler/i18n/stq.json10
-rw-r--r--extensions/PdfHandler/i18n/sv.json15
-rw-r--r--extensions/PdfHandler/i18n/ta.json14
-rw-r--r--extensions/PdfHandler/i18n/te.json8
-rw-r--r--extensions/PdfHandler/i18n/tk.json10
-rw-r--r--extensions/PdfHandler/i18n/tl.json10
-rw-r--r--extensions/PdfHandler/i18n/tr.json10
-rw-r--r--extensions/PdfHandler/i18n/ug-arab.json9
-rw-r--r--extensions/PdfHandler/i18n/uk.json15
-rw-r--r--extensions/PdfHandler/i18n/ur.json8
-rw-r--r--extensions/PdfHandler/i18n/vec.json15
-rw-r--r--extensions/PdfHandler/i18n/vi.json15
-rw-r--r--extensions/PdfHandler/i18n/yo.json8
-rw-r--r--extensions/PdfHandler/i18n/yue.json6
-rw-r--r--extensions/PdfHandler/i18n/zh-hans.json15
-rw-r--r--extensions/PdfHandler/i18n/zh-hant.json17
-rw-r--r--extensions/PdfHandler/tests/browser/Gemfile.lock62
-rw-r--r--extensions/PdfHandler/tests/browser/features/pdf.feature22
-rw-r--r--extensions/PdfHandler/tests/browser/features/step_definitions/pdf_steps.rb20
-rw-r--r--extensions/PdfHandler/tests/browser/features/support/env.rb12
-rw-r--r--extensions/PdfHandler/tests/browser/features/support/pages/random_page.rb17
-rw-r--r--extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php12
-rw-r--r--extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php6
-rw-r--r--extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php132
-rw-r--r--extensions/TitleBlacklist/tests/testSource5
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php67
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php295
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiEditorConstants.php84
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php24
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php32
-rw-r--r--includes/DefaultSettings.php14
-rw-r--r--includes/EditPage.php26
-rw-r--r--includes/Html.php7
-rw-r--r--includes/OutputPage.php8
-rw-r--r--includes/User.php40
-rw-r--r--includes/Xml.php4
-rw-r--r--includes/api/ApiFormatWddx.php48
-rw-r--r--includes/installer/PostgresUpdater.php24
-rw-r--r--includes/libs/XmlTypeCheck.php251
-rw-r--r--includes/media/BitmapMetadataHandler.php6
-rw-r--r--includes/media/JpegMetadataExtractor.php2
-rw-r--r--includes/media/XMP.php96
-rw-r--r--includes/specialpage/SpecialPageFactory.php4
-rw-r--r--includes/specials/SpecialActiveusers.php8
-rw-r--r--includes/specials/SpecialJavaScriptTest.php248
-rw-r--r--includes/specials/SpecialUserlogin.php13
-rw-r--r--includes/upload/UploadBase.php33
-rw-r--r--jsduck.json40
-rw-r--r--languages/i18n/en.json5
-rw-r--r--languages/i18n/qqq.json5
-rw-r--r--maintenance/jsduck/config.json40
-rw-r--r--maintenance/mwjsduck-gen25
-rw-r--r--maintenance/postgres/tables.sql2
-rw-r--r--resources/Resources.php4
-rw-r--r--resources/lib/jquery/jquery.js188
-rw-r--r--resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js5
-rw-r--r--skins/CologneBlue/SkinCologneBlue.php3
-rw-r--r--skins/MonoBook/MonoBookTemplate.php3
-rw-r--r--skins/Vector/SkinVector.php4
-rw-r--r--skins/Vector/Vector.php8
-rw-r--r--skins/Vector/VectorTemplate.php3
-rw-r--r--skins/Vector/skinStyles/jquery.ui/PATCHES25
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-anim_basic_16x16.gifbin1553 -> 0 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_100_000000_40x100.pngbin0 -> 205 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_15_cd0a0a_40x100.pngbin87 -> 206 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_70_000000_40x100.pngbin87 -> 205 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_100_f2f5f7_1x100.pngbin97 -> 332 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_80_d7ebf9_1x100.pngbin104 -> 331 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_e4f1fb_1x100.pngbin106 -> 362 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_ffffff_1x100.pngbin80 -> 203 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_25_ffef8f_1x100.pngbin152 -> 309 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-bg_inset-hard_100_f0f0f0_1x100.pngbin89 -> 253 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-icons_2694e8_256x240.pngbin3702 -> 4549 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-icons_3d80b3_256x240.pngbin3702 -> 4549 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-icons_666666_256x240.pngbin3702 -> 6988 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-icons_72a7cf_256x240.pngbin3702 -> 4549 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/images/ui-icons_ffffff_256x240.pngbin3702 -> 6299 bytes
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.autocomplete.css53
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.button.css78
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.datepicker.css20
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.dialog.css27
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.menu.css30
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.resizable.css14
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.spinner.css23
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.theme.css73
-rw-r--r--skins/Vector/skinStyles/jquery.ui/jquery.ui.tooltip.css21
-rw-r--r--tests/.htaccess1
-rw-r--r--tests/TestsAutoLoader.php115
-rw-r--r--tests/browser/Gemfile.lock82
-rw-r--r--tests/browser/README.mediawiki64
-rw-r--r--tests/browser/environment_variables5
-rw-r--r--tests/browser/features/create_account.feature12
-rw-r--r--tests/browser/features/create_and_follow_wiki_link.feature9
-rw-r--r--tests/browser/features/edit_page.feature11
-rw-r--r--tests/browser/features/file.feature23
-rw-r--r--tests/browser/features/login.feature42
-rw-r--r--tests/browser/features/main_page_links.feature19
-rw-r--r--tests/browser/features/preferences.feature60
-rw-r--r--tests/browser/features/step_definitions/create_account_steps.rb18
-rw-r--r--tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb28
-rw-r--r--tests/browser/features/step_definitions/edit_page_steps.rb24
-rw-r--r--tests/browser/features/step_definitions/file_steps.rb18
-rw-r--r--tests/browser/features/step_definitions/login_steps.rb65
-rw-r--r--tests/browser/features/step_definitions/main_page_links_steps.rb47
-rw-r--r--tests/browser/features/step_definitions/preferences_appearance_steps.rb85
-rw-r--r--tests/browser/features/step_definitions/preferences_editing_steps.rb54
-rw-r--r--tests/browser/features/step_definitions/preferences_user_profile_steps.rb43
-rw-r--r--tests/browser/features/step_definitions/view_history_steps.rb8
-rw-r--r--tests/browser/features/support/env.rb2
-rw-r--r--tests/browser/features/support/hooks.rb2
-rw-r--r--tests/browser/features/support/modules/url_module.rb10
-rw-r--r--tests/browser/features/support/pages/create_account_page.rb19
-rw-r--r--tests/browser/features/support/pages/edit_page.rb8
-rw-r--r--tests/browser/features/support/pages/file_does_not_exist_page.rb19
-rw-r--r--tests/browser/features/support/pages/login_error_page.rb5
-rw-r--r--tests/browser/features/support/pages/main_page.rb19
-rw-r--r--tests/browser/features/support/pages/preferences_appearance_page.rb41
-rw-r--r--tests/browser/features/support/pages/preferences_editing_page.rb28
-rw-r--r--tests/browser/features/support/pages/preferences_page.rb22
-rw-r--r--tests/browser/features/support/pages/preferences_user_profile_page.rb28
-rw-r--r--tests/browser/features/support/pages/view_history_page.rb7
-rw-r--r--tests/browser/features/support/pages/ztargetpage.rb7
-rw-r--r--tests/browser/features/view_history.feature11
-rw-r--r--tests/parser/ParserTestResult.php45
-rw-r--r--tests/parser/README8
-rw-r--r--tests/parser/extraParserTests.txtbin0 -> 1261 bytes
-rw-r--r--tests/parser/parserTest.inc1655
-rw-r--r--tests/parser/parserTests.txt21904
-rw-r--r--tests/parser/parserTestsParserHook.php66
-rw-r--r--tests/parser/preprocess/All_system_messages.expected5625
-rw-r--r--tests/parser/preprocess/All_system_messages.txt5624
-rw-r--r--tests/parser/preprocess/Factorial.expected17
-rw-r--r--tests/parser/preprocess/Factorial.txt16
-rw-r--r--tests/parser/preprocess/Fundraising.expected18
-rw-r--r--tests/parser/preprocess/Fundraising.txt17
-rw-r--r--tests/parser/preprocess/NestedTemplates.expected90
-rw-r--r--tests/parser/preprocess/NestedTemplates.txt89
-rw-r--r--tests/parser/preprocess/QuoteQuran.expected140
-rw-r--r--tests/parser/preprocess/QuoteQuran.txt139
-rw-r--r--tests/parserTests.php95
-rw-r--r--tests/phpunit/LessFileCompilationTest.php60
-rw-r--r--tests/phpunit/Makefile91
-rw-r--r--tests/phpunit/MediaWikiLangTestCase.php32
-rw-r--r--tests/phpunit/MediaWikiPHPUnitTestListener.php129
-rw-r--r--tests/phpunit/MediaWikiTestCase.php1141
-rw-r--r--tests/phpunit/README53
-rw-r--r--tests/phpunit/ResourceLoaderTestCase.php95
-rw-r--r--tests/phpunit/TODO20
-rw-r--r--tests/phpunit/bootstrap.php36
-rw-r--r--tests/phpunit/data/autoloader/TestAutoloadedCamlClass.php4
-rw-r--r--tests/phpunit/data/autoloader/TestAutoloadedClass.php4
-rw-r--r--tests/phpunit/data/autoloader/TestAutoloadedLocalClass.php4
-rw-r--r--tests/phpunit/data/autoloader/TestAutoloadedSerializedClass.php4
-rw-r--r--tests/phpunit/data/css/expected.css11
-rw-r--r--tests/phpunit/data/css/simple-ltr.gifbin0 -> 35 bytes
-rw-r--r--tests/phpunit/data/css/simple-rtl.gifbin0 -> 35 bytes
-rw-r--r--tests/phpunit/data/css/test.css11
-rw-r--r--tests/phpunit/data/cssmin/green.gifbin0 -> 35 bytes
-rw-r--r--tests/phpunit/data/cssmin/large.pngbin0 -> 36462 bytes
-rw-r--r--tests/phpunit/data/cssmin/red.gifbin0 -> 35 bytes
-rw-r--r--tests/phpunit/data/db/mysql/functions.sql12
-rw-r--r--tests/phpunit/data/db/postgres/functions.sql12
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.13.sql342
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.15.sql454
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.16.sql478
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.17.sql511
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.18.sql530
-rw-r--r--tests/phpunit/data/filerepo/video.pngbin0 -> 116 bytes
-rw-r--r--tests/phpunit/data/filerepo/wiki.pngbin0 -> 22589 bytes
-rw-r--r--tests/phpunit/data/gitinfo/info-testValidJsonData.json1
-rw-r--r--tests/phpunit/data/less/common/test.common.mixins.less5
-rw-r--r--tests/phpunit/data/less/module/dependency.less3
-rw-r--r--tests/phpunit/data/less/module/styles.css6
-rw-r--r--tests/phpunit/data/less/module/styles.less6
-rw-r--r--tests/phpunit/data/localisationcache/en.json5
-rw-r--r--tests/phpunit/data/localisationcache/ru.json4
-rw-r--r--tests/phpunit/data/localisationcache/uk.json3
-rw-r--r--tests/phpunit/data/media/1bit-png.pngbin0 -> 167 bytes
-rw-r--r--tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.pngbin0 -> 72209 bytes
-rw-r--r--tests/phpunit/data/media/Bishzilla_blink.gifbin0 -> 39057 bytes
-rw-r--r--tests/phpunit/data/media/Gtk-media-play-ltr.svg35
-rw-r--r--tests/phpunit/data/media/LoremIpsum.djvubin0 -> 3249 bytes
-rw-r--r--tests/phpunit/data/media/Png-native-test.pngbin0 -> 4665 bytes
-rw-r--r--tests/phpunit/data/media/QA_icon.svg77
-rw-r--r--tests/phpunit/data/media/README61
-rw-r--r--tests/phpunit/data/media/Soccer_ball_animated.svg55
-rw-r--r--tests/phpunit/data/media/Speech_bubbles.svg14
-rw-r--r--tests/phpunit/data/media/Toll_Texas_1.svg150
-rw-r--r--tests/phpunit/data/media/Tux.svg902
-rw-r--r--tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg248
-rw-r--r--tests/phpunit/data/media/Wikimedia-logo.svg14
-rw-r--r--tests/phpunit/data/media/Xmp-exif-multilingual_test.jpgbin0 -> 12544 bytes
-rw-r--r--tests/phpunit/data/media/animated-xmp.gifbin0 -> 3864 bytes
-rw-r--r--tests/phpunit/data/media/animated.gifbin0 -> 497 bytes
-rw-r--r--tests/phpunit/data/media/broken_exif_date.jpgbin0 -> 3233 bytes
-rw-r--r--tests/phpunit/data/media/exif-gps.jpgbin0 -> 665 bytes
-rw-r--r--tests/phpunit/data/media/exif-user-comment.jpgbin0 -> 484 bytes
-rw-r--r--tests/phpunit/data/media/greyscale-na-png.pngbin0 -> 365 bytes
-rw-r--r--tests/phpunit/data/media/greyscale-png.pngbin0 -> 415 bytes
-rw-r--r--tests/phpunit/data/media/iptc-invalid-psir.jpgbin0 -> 9574 bytes
-rw-r--r--tests/phpunit/data/media/iptc-timetest-invalid.jpgbin0 -> 9573 bytes
-rw-r--r--tests/phpunit/data/media/iptc-timetest.jpgbin0 -> 9573 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-comment-binary.jpgbin0 -> 448 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-comment-iso8859-1.jpgbin0 -> 447 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-comment-multiple.jpgbin0 -> 431 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-comment-utf.jpgbin0 -> 445 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-iptc-bad-hash.jpgbin0 -> 499 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-iptc-good-hash.jpgbin0 -> 499 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-padding-even.jpgbin0 -> 450 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-padding-odd.jpgbin0 -> 451 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-xmp-alt.jpgbin0 -> 3255 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-xmp-psir.jpgbin0 -> 3308 bytes
-rw-r--r--tests/phpunit/data/media/jpeg-xmp-psir.xmp35
-rw-r--r--tests/phpunit/data/media/landscape-plain.jpgbin0 -> 38771 bytes
-rw-r--r--tests/phpunit/data/media/nonanimated.gifbin0 -> 200 bytes
-rw-r--r--tests/phpunit/data/media/portrait-rotated.jpgbin0 -> 38577 bytes
-rw-r--r--tests/phpunit/data/media/rgb-na-png.pngbin0 -> 593 bytes
-rw-r--r--tests/phpunit/data/media/rgb-png.pngbin0 -> 663 bytes
-rw-r--r--tests/phpunit/data/media/say-test.oggbin0 -> 5132 bytes
-rw-r--r--tests/phpunit/data/media/test.jpgbin0 -> 437 bytes
-rw-r--r--tests/phpunit/data/media/test.tiffbin0 -> 566 bytes
-rw-r--r--tests/phpunit/data/media/xmp.pngbin0 -> 582 bytes
-rw-r--r--tests/phpunit/data/parser/LoremIpsum.djvubin0 -> 3249 bytes
-rw-r--r--tests/phpunit/data/parser/headbg.jpgbin0 -> 7881 bytes
-rw-r--r--tests/phpunit/data/parser/wiki.pngbin0 -> 22589 bytes
-rw-r--r--tests/phpunit/data/upload/headbg.jpgbin0 -> 7881 bytes
-rw-r--r--tests/phpunit/data/xmp/1.result.php8
-rw-r--r--tests/phpunit/data/xmp/1.xmp11
-rw-r--r--tests/phpunit/data/xmp/2.result.php8
-rw-r--r--tests/phpunit/data/xmp/2.xmp12
-rw-r--r--tests/phpunit/data/xmp/3-invalid.result.php7
-rw-r--r--tests/phpunit/data/xmp/3-invalid.xmp31
-rw-r--r--tests/phpunit/data/xmp/3.result.php8
-rw-r--r--tests/phpunit/data/xmp/3.xmp29
-rw-r--r--tests/phpunit/data/xmp/4.result.php7
-rw-r--r--tests/phpunit/data/xmp/4.xmp22
-rw-r--r--tests/phpunit/data/xmp/5.result.php7
-rw-r--r--tests/phpunit/data/xmp/5.xmp16
-rw-r--r--tests/phpunit/data/xmp/6.result.php8
-rw-r--r--tests/phpunit/data/xmp/6.xmp18
-rw-r--r--tests/phpunit/data/xmp/7.result.php52
-rw-r--r--tests/phpunit/data/xmp/7.xmp67
-rw-r--r--tests/phpunit/data/xmp/README3
-rw-r--r--tests/phpunit/data/xmp/bag-for-seq.result.php10
-rw-r--r--tests/phpunit/data/xmp/bag-for-seq.xmp1
-rw-r--r--tests/phpunit/data/xmp/doctype-included.result.php3
-rw-r--r--tests/phpunit/data/xmp/doctype-included.xmp12
-rw-r--r--tests/phpunit/data/xmp/doctype-not-included.xmp11
-rw-r--r--tests/phpunit/data/xmp/flash.result.php8
-rw-r--r--tests/phpunit/data/xmp/flash.xmp11
-rw-r--r--tests/phpunit/data/xmp/gps.result.php11
-rw-r--r--tests/phpunit/data/xmp/gps.xmp17
-rw-r--r--tests/phpunit/data/xmp/invalid-child-not-struct.result.php7
-rw-r--r--tests/phpunit/data/xmp/invalid-child-not-struct.xmp12
-rw-r--r--tests/phpunit/data/xmp/no-namespace.result.php7
-rw-r--r--tests/phpunit/data/xmp/no-namespace.xmp11
-rw-r--r--tests/phpunit/data/xmp/no-recognized-props.result.php2
-rw-r--r--tests/phpunit/data/xmp/no-recognized-props.xmp8
-rw-r--r--tests/phpunit/data/xmp/utf16BE.result.php12
-rw-r--r--tests/phpunit/data/xmp/utf16BE.xmpbin0 -> 930 bytes
-rw-r--r--tests/phpunit/data/xmp/utf16LE.result.php12
-rw-r--r--tests/phpunit/data/xmp/utf16LE.xmpbin0 -> 930 bytes
-rw-r--r--tests/phpunit/data/xmp/utf32BE.result.php12
-rw-r--r--tests/phpunit/data/xmp/utf32BE.xmpbin0 -> 1856 bytes
-rw-r--r--tests/phpunit/data/xmp/utf32LE.result.php12
-rw-r--r--tests/phpunit/data/xmp/utf32LE.xmpbin0 -> 1856 bytes
-rw-r--r--tests/phpunit/data/xmp/xmpExt.result.php8
-rw-r--r--tests/phpunit/data/xmp/xmpExt.xmp13
-rw-r--r--tests/phpunit/data/xmp/xmpExt2.xmp8
-rw-r--r--tests/phpunit/data/zip/cd-gap.zipbin0 -> 182 bytes
-rw-r--r--tests/phpunit/data/zip/cd-truncated.zipbin0 -> 171 bytes
-rw-r--r--tests/phpunit/data/zip/class-trailing-null.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/class-trailing-slash.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/class.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/empty.zipbin0 -> 22 bytes
-rw-r--r--tests/phpunit/data/zip/looks-like-zip64.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/nosig.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/split.zipbin0 -> 196 bytes
-rw-r--r--tests/phpunit/data/zip/trail.zipbin0 -> 181 bytes
-rw-r--r--tests/phpunit/data/zip/wrong-cd-start-disk.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/data/zip/wrong-central-entry-sig.zipbin0 -> 173 bytes
-rw-r--r--tests/phpunit/docs/ExportDemoTest.php31
-rw-r--r--tests/phpunit/includes/ArrayUtilsTest.php311
-rw-r--r--tests/phpunit/includes/ArticleTablesTest.php53
-rw-r--r--tests/phpunit/includes/ArticleTest.php95
-rw-r--r--tests/phpunit/includes/BlockTest.php368
-rw-r--r--tests/phpunit/includes/CollationTest.php117
-rw-r--r--tests/phpunit/includes/DiffHistoryBlobTest.php40
-rw-r--r--tests/phpunit/includes/EditPageTest.php499
-rw-r--r--tests/phpunit/includes/ExternalStoreTest.php87
-rw-r--r--tests/phpunit/includes/ExtraParserTest.php218
-rw-r--r--tests/phpunit/includes/FallbackTest.php72
-rw-r--r--tests/phpunit/includes/FauxRequestTest.php18
-rw-r--r--tests/phpunit/includes/FauxResponseTest.php118
-rw-r--r--tests/phpunit/includes/FormOptionsInitializationTest.php89
-rw-r--r--tests/phpunit/includes/FormOptionsTest.php103
-rw-r--r--tests/phpunit/includes/GitInfoTest.php42
-rw-r--r--tests/phpunit/includes/GlobalFunctions/GlobalTest.php745
-rw-r--r--tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php32
-rw-r--r--tests/phpunit/includes/GlobalFunctions/README2
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php112
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php121
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php195
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php40
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php117
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php46
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php157
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php93
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfShellExecTest.php20
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php31
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php196
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php124
-rw-r--r--tests/phpunit/includes/HooksTest.php202
-rw-r--r--tests/phpunit/includes/HtmlFormatterTest.php127
-rw-r--r--tests/phpunit/includes/HtmlTest.php773
-rw-r--r--tests/phpunit/includes/HttpTest.php216
-rw-r--r--tests/phpunit/includes/ImagePage404Test.php53
-rw-r--r--tests/phpunit/includes/ImagePageTest.php90
-rw-r--r--tests/phpunit/includes/ImportTest.php101
-rw-r--r--tests/phpunit/includes/LanguageConverterTest.php187
-rw-r--r--tests/phpunit/includes/LicensesTest.php25
-rw-r--r--tests/phpunit/includes/LinkFilterTest.php274
-rw-r--r--tests/phpunit/includes/LinkerTest.php192
-rw-r--r--tests/phpunit/includes/LinksUpdateTest.php266
-rw-r--r--tests/phpunit/includes/LocalFileTest.php184
-rw-r--r--tests/phpunit/includes/MWFunctionTest.php33
-rw-r--r--tests/phpunit/includes/MWNamespaceTest.php612
-rw-r--r--tests/phpunit/includes/MWTimestampTest.php342
-rw-r--r--tests/phpunit/includes/MediaWikiVersionFetcherTest.php21
-rw-r--r--tests/phpunit/includes/MessageTest.php368
-rw-r--r--tests/phpunit/includes/MimeMagicTest.php49
-rw-r--r--tests/phpunit/includes/OutputPageTest.php273
-rw-r--r--tests/phpunit/includes/PasswordTest.php33
-rw-r--r--tests/phpunit/includes/PathRouterTest.php264
-rw-r--r--tests/phpunit/includes/PreferencesTest.php91
-rw-r--r--tests/phpunit/includes/RequestContextTest.php96
-rw-r--r--tests/phpunit/includes/RevisionStorageTest.php574
-rw-r--r--tests/phpunit/includes/RevisionStorageTestContentHandlerUseDB.php89
-rw-r--r--tests/phpunit/includes/RevisionTest.php506
-rw-r--r--tests/phpunit/includes/SampleTest.php108
-rw-r--r--tests/phpunit/includes/SanitizerTest.php349
-rw-r--r--tests/phpunit/includes/SanitizerValidateEmailTest.php103
-rw-r--r--tests/phpunit/includes/SiteConfigurationTest.php363
-rw-r--r--tests/phpunit/includes/SpecialPageTest.php105
-rw-r--r--tests/phpunit/includes/StatusTest.php573
-rw-r--r--tests/phpunit/includes/TemplateCategoriesTest.php96
-rw-r--r--tests/phpunit/includes/TestUser.php62
-rw-r--r--tests/phpunit/includes/TimeAdjustTest.php39
-rw-r--r--tests/phpunit/includes/TitleArrayFromResultTest.php119
-rw-r--r--tests/phpunit/includes/TitleMethodsTest.php300
-rw-r--r--tests/phpunit/includes/TitlePermissionTest.php770
-rw-r--r--tests/phpunit/includes/TitleTest.php650
-rw-r--r--tests/phpunit/includes/UserArrayFromResultTest.php114
-rw-r--r--tests/phpunit/includes/UserTest.php369
-rw-r--r--tests/phpunit/includes/WebRequestTest.php358
-rw-r--r--tests/phpunit/includes/WikiPageTest.php1301
-rw-r--r--tests/phpunit/includes/WikiPageTestContentHandlerUseDB.php61
-rw-r--r--tests/phpunit/includes/XmlJsTest.php24
-rw-r--r--tests/phpunit/includes/XmlSelectTest.php185
-rw-r--r--tests/phpunit/includes/XmlTest.php411
-rw-r--r--tests/phpunit/includes/XmlTypeCheckTest.php49
-rw-r--r--tests/phpunit/includes/actions/ActionTest.php199
-rw-r--r--tests/phpunit/includes/api/ApiBaseTest.php46
-rw-r--r--tests/phpunit/includes/api/ApiBlockTest.php83
-rw-r--r--tests/phpunit/includes/api/ApiCreateAccountTest.php161
-rw-r--r--tests/phpunit/includes/api/ApiEditPageTest.php496
-rw-r--r--tests/phpunit/includes/api/ApiLoginTest.php181
-rw-r--r--tests/phpunit/includes/api/ApiMainTest.php72
-rw-r--r--tests/phpunit/includes/api/ApiModuleManagerTest.php318
-rw-r--r--tests/phpunit/includes/api/ApiOptionsTest.php459
-rw-r--r--tests/phpunit/includes/api/ApiParseTest.php35
-rw-r--r--tests/phpunit/includes/api/ApiPurgeTest.php45
-rw-r--r--tests/phpunit/includes/api/ApiQueryAllPagesTest.php34
-rw-r--r--tests/phpunit/includes/api/ApiRevisionDeleteTest.php114
-rw-r--r--tests/phpunit/includes/api/ApiTestCase.php196
-rw-r--r--tests/phpunit/includes/api/ApiTestCaseUpload.php171
-rw-r--r--tests/phpunit/includes/api/ApiTestContext.php21
-rw-r--r--tests/phpunit/includes/api/ApiTokensTest.php40
-rw-r--r--tests/phpunit/includes/api/ApiUnblockTest.php31
-rw-r--r--tests/phpunit/includes/api/ApiUploadTest.php572
-rw-r--r--tests/phpunit/includes/api/ApiWatchTest.php157
-rw-r--r--tests/phpunit/includes/api/MockApi.php20
-rw-r--r--tests/phpunit/includes/api/MockApiQueryBase.php11
-rw-r--r--tests/phpunit/includes/api/PrefixUniquenessTest.php30
-rw-r--r--tests/phpunit/includes/api/RandomImageGenerator.php496
-rw-r--r--tests/phpunit/includes/api/UserWrapper.php25
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatJsonTest.php22
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatNoneTest.php16
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatPhpTest.php17
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatTestBase.php32
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatWddxTest.php20
-rw-r--r--tests/phpunit/includes/api/generateRandomImages.php46
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryBasicTest.php353
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinue2Test.php71
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinueTest.php316
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php218
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php40
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryTest.php130
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryTestBase.php148
-rw-r--r--tests/phpunit/includes/api/words.txt1000
-rw-r--r--tests/phpunit/includes/cache/GenderCacheTest.php104
-rw-r--r--tests/phpunit/includes/cache/LocalisationCacheTest.php91
-rw-r--r--tests/phpunit/includes/cache/MessageCacheTest.php128
-rw-r--r--tests/phpunit/includes/cache/RedisBloomCacheTest.php71
-rw-r--r--tests/phpunit/includes/changes/EnhancedChangesListTest.php132
-rw-r--r--tests/phpunit/includes/changes/OldChangesListTest.php187
-rw-r--r--tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php331
-rw-r--r--tests/phpunit/includes/changes/RecentChangeTest.php286
-rw-r--r--tests/phpunit/includes/changes/TestRecentChangesHelper.php137
-rw-r--r--tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php161
-rw-r--r--tests/phpunit/includes/config/ConfigFactoryTest.php70
-rw-r--r--tests/phpunit/includes/config/GlobalVarConfigTest.php120
-rw-r--r--tests/phpunit/includes/config/HashConfigTest.php63
-rw-r--r--tests/phpunit/includes/config/MultiConfigTest.php38
-rw-r--r--tests/phpunit/includes/content/ContentHandlerTest.php525
-rw-r--r--tests/phpunit/includes/content/CssContentTest.php87
-rw-r--r--tests/phpunit/includes/content/JavaScriptContentTest.php293
-rw-r--r--tests/phpunit/includes/content/JsonContentTest.php114
-rw-r--r--tests/phpunit/includes/content/TextContentTest.php490
-rw-r--r--tests/phpunit/includes/content/WikitextContentHandlerTest.php241
-rw-r--r--tests/phpunit/includes/content/WikitextContentTest.php433
-rw-r--r--tests/phpunit/includes/db/DatabaseMysqlBaseTest.php247
-rw-r--r--tests/phpunit/includes/db/DatabaseSQLTest.php725
-rw-r--r--tests/phpunit/includes/db/DatabaseSqliteTest.php455
-rw-r--r--tests/phpunit/includes/db/DatabaseTest.php237
-rw-r--r--tests/phpunit/includes/db/DatabaseTestHelper.php170
-rw-r--r--tests/phpunit/includes/db/LBFactoryTest.php61
-rw-r--r--tests/phpunit/includes/db/ORMRowTest.php226
-rw-r--r--tests/phpunit/includes/db/ORMTableTest.php150
-rw-r--r--tests/phpunit/includes/db/TestORMRowTest.php218
-rw-r--r--tests/phpunit/includes/debug/MWDebugTest.php141
-rw-r--r--tests/phpunit/includes/deferred/DeferredUpdatesTest.php38
-rw-r--r--tests/phpunit/includes/diff/ArrayDiffFormatterTest.php135
-rw-r--r--tests/phpunit/includes/diff/DiffOpTest.php73
-rw-r--r--tests/phpunit/includes/diff/DiffTest.php20
-rw-r--r--tests/phpunit/includes/diff/DifferenceEngineTest.php121
-rw-r--r--tests/phpunit/includes/diff/FakeDiffOp.php11
-rw-r--r--tests/phpunit/includes/exception/BadTitleErrorTest.php43
-rw-r--r--tests/phpunit/includes/exception/ErrorPageErrorTest.php67
-rw-r--r--tests/phpunit/includes/exception/MWExceptionHandlerTest.php74
-rw-r--r--tests/phpunit/includes/exception/MWExceptionTest.php241
-rw-r--r--tests/phpunit/includes/exception/ReadOnlyErrorTest.php16
-rw-r--r--tests/phpunit/includes/exception/ThrottledErrorTest.php44
-rw-r--r--tests/phpunit/includes/exception/UserNotLoggedInTest.php16
-rw-r--r--tests/phpunit/includes/filebackend/FileBackendTest.php2472
-rw-r--r--tests/phpunit/includes/filerepo/FileRepoTest.php55
-rw-r--r--tests/phpunit/includes/filerepo/RepoGroupTest.php59
-rw-r--r--tests/phpunit/includes/filerepo/StoreBatchTest.php146
-rw-r--r--tests/phpunit/includes/filerepo/file/FileTest.php386
-rw-r--r--tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php68
-rw-r--r--tests/phpunit/includes/htmlform/HTMLCheckMatrixTest.php105
-rw-r--r--tests/phpunit/includes/installer/InstallDocFormatterTest.php72
-rw-r--r--tests/phpunit/includes/installer/OracleInstallerTest.php52
-rw-r--r--tests/phpunit/includes/jobqueue/JobQueueTest.php344
-rw-r--r--tests/phpunit/includes/jobqueue/RefreshLinksPartitionTest.php112
-rw-r--r--tests/phpunit/includes/json/FormatJsonTest.php279
-rw-r--r--tests/phpunit/includes/libs/CSSMinTest.php401
-rw-r--r--tests/phpunit/includes/libs/GenericArrayObjectTest.php280
-rw-r--r--tests/phpunit/includes/libs/HashRingTest.php56
-rw-r--r--tests/phpunit/includes/libs/IEUrlExtensionTest.php173
-rw-r--r--tests/phpunit/includes/libs/IPSetTest.php252
-rw-r--r--tests/phpunit/includes/libs/JavaScriptMinifierTest.php204
-rw-r--r--tests/phpunit/includes/libs/MWMessagePackTest.php75
-rw-r--r--tests/phpunit/includes/libs/ProcessCacheLRUTest.php237
-rw-r--r--tests/phpunit/includes/libs/RunningStatTest.php79
-rw-r--r--tests/phpunit/includes/logging/LogFormatterTest.php242
-rw-r--r--tests/phpunit/includes/logging/LogTests.i18n.php15
-rw-r--r--tests/phpunit/includes/mail/MailAddressTest.php63
-rw-r--r--tests/phpunit/includes/mail/UserMailerTest.php14
-rw-r--r--tests/phpunit/includes/media/BitmapMetadataHandlerTest.php167
-rw-r--r--tests/phpunit/includes/media/BitmapScalingTest.php140
-rw-r--r--tests/phpunit/includes/media/DjVuTest.php69
-rw-r--r--tests/phpunit/includes/media/ExifBitmapTest.php146
-rw-r--r--tests/phpunit/includes/media/ExifRotationTest.php280
-rw-r--r--tests/phpunit/includes/media/ExifTest.php47
-rw-r--r--tests/phpunit/includes/media/FakeDimensionFile.php31
-rw-r--r--tests/phpunit/includes/media/FormatMetadataTest.php71
-rw-r--r--tests/phpunit/includes/media/GIFMetadataExtractorTest.php111
-rw-r--r--tests/phpunit/includes/media/GIFTest.php142
-rw-r--r--tests/phpunit/includes/media/IPTCTest.php85
-rw-r--r--tests/phpunit/includes/media/JpegMetadataExtractorTest.php111
-rw-r--r--tests/phpunit/includes/media/JpegTest.php54
-rw-r--r--tests/phpunit/includes/media/MediaHandlerTest.php56
-rw-r--r--tests/phpunit/includes/media/MediaWikiMediaTestCase.php86
-rw-r--r--tests/phpunit/includes/media/PNGMetadataExtractorTest.php155
-rw-r--r--tests/phpunit/includes/media/PNGTest.php131
-rw-r--r--tests/phpunit/includes/media/SVGMetadataExtractorTest.php160
-rw-r--r--tests/phpunit/includes/media/SVGTest.php41
-rw-r--r--tests/phpunit/includes/media/TiffTest.php45
-rw-r--r--tests/phpunit/includes/media/XCFTest.php78
-rw-r--r--tests/phpunit/includes/media/XMPTest.php223
-rw-r--r--tests/phpunit/includes/media/XMPValidateTest.php50
-rw-r--r--tests/phpunit/includes/normal/CleanUpTest.php409
-rw-r--r--tests/phpunit/includes/objectcache/BagOStuffTest.php147
-rw-r--r--tests/phpunit/includes/parser/MagicVariableTest.php229
-rw-r--r--tests/phpunit/includes/parser/MediaWikiParserTest.php134
-rw-r--r--tests/phpunit/includes/parser/NewParserTest.php1091
-rw-r--r--tests/phpunit/includes/parser/ParserMethodsTest.php187
-rw-r--r--tests/phpunit/includes/parser/ParserOutputTest.php87
-rw-r--r--tests/phpunit/includes/parser/ParserPreloadTest.php80
-rw-r--r--tests/phpunit/includes/parser/PreprocessorTest.php247
-rw-r--r--tests/phpunit/includes/parser/TagHooksTest.php108
-rw-r--r--tests/phpunit/includes/parser/TidyTest.php64
-rw-r--r--tests/phpunit/includes/password/BcryptPasswordTest.php40
-rw-r--r--tests/phpunit/includes/password/LayeredParameterizedPasswordTest.php51
-rw-r--r--tests/phpunit/includes/password/PasswordTestCase.php88
-rw-r--r--tests/phpunit/includes/password/Pbkdf2PasswordTest.php24
-rw-r--r--tests/phpunit/includes/poolcounter/PoolCounterTest.php72
-rw-r--r--tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php132
-rw-r--r--tests/phpunit/includes/resourceloader/ResourceLoaderStartupModuleTest.php388
-rw-r--r--tests/phpunit/includes/resourceloader/ResourceLoaderTest.php249
-rw-r--r--tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php67
-rw-r--r--tests/phpunit/includes/search/SearchEngineTest.php187
-rw-r--r--tests/phpunit/includes/search/SearchUpdateTest.php81
-rw-r--r--tests/phpunit/includes/site/MediaWikiSiteTest.php109
-rw-r--r--tests/phpunit/includes/site/SiteListTest.php240
-rw-r--r--tests/phpunit/includes/site/SiteSQLStoreTest.php134
-rw-r--r--tests/phpunit/includes/site/SiteTest.php296
-rw-r--r--tests/phpunit/includes/site/TestSites.php115
-rw-r--r--tests/phpunit/includes/skins/SkinFactoryTest.php70
-rw-r--r--tests/phpunit/includes/skins/SkinTemplateTest.php43
-rw-r--r--tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php225
-rw-r--r--tests/phpunit/includes/specials/ImageListPagerTest.php22
-rw-r--r--tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php74
-rw-r--r--tests/phpunit/includes/specials/SpecialMIMESearchTest.php48
-rw-r--r--tests/phpunit/includes/specials/SpecialMyLanguageTest.php65
-rw-r--r--tests/phpunit/includes/specials/SpecialPreferencesTest.php57
-rw-r--r--tests/phpunit/includes/specials/SpecialRecentchangesTest.php123
-rw-r--r--tests/phpunit/includes/specials/SpecialSearchTest.php144
-rw-r--r--tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php169
-rw-r--r--tests/phpunit/includes/title/MediaWikiTitleCodecTest.php384
-rw-r--r--tests/phpunit/includes/title/TitleValueTest.php100
-rw-r--r--tests/phpunit/includes/upload/UploadBaseTest.php427
-rw-r--r--tests/phpunit/includes/upload/UploadFromUrlTest.php328
-rw-r--r--tests/phpunit/includes/upload/UploadStashTest.php107
-rw-r--r--tests/phpunit/includes/utils/CdbTest.php90
-rw-r--r--tests/phpunit/includes/utils/IPTest.php580
-rw-r--r--tests/phpunit/includes/utils/MWCryptHKDFTest.php89
-rw-r--r--tests/phpunit/includes/utils/StringUtilsTest.php149
-rw-r--r--tests/phpunit/includes/utils/UIDGeneratorTest.php129
-rw-r--r--tests/phpunit/includes/utils/ZipDirectoryReaderTest.php84
-rw-r--r--tests/phpunit/install-phpunit.sh38
-rw-r--r--tests/phpunit/languages/LanguageAmTest.php35
-rw-r--r--tests/phpunit/languages/LanguageArTest.php87
-rw-r--r--tests/phpunit/languages/LanguageArqTest.php26
-rw-r--r--tests/phpunit/languages/LanguageBeTest.php42
-rw-r--r--tests/phpunit/languages/LanguageBe_taraskTest.php97
-rw-r--r--tests/phpunit/languages/LanguageBhoTest.php35
-rw-r--r--tests/phpunit/languages/LanguageBsTest.php42
-rw-r--r--tests/phpunit/languages/LanguageClassesTestCase.php74
-rw-r--r--tests/phpunit/languages/LanguageCsTest.php41
-rw-r--r--tests/phpunit/languages/LanguageCuTest.php42
-rw-r--r--tests/phpunit/languages/LanguageCyTest.php43
-rw-r--r--tests/phpunit/languages/LanguageDsbTest.php41
-rw-r--r--tests/phpunit/languages/LanguageFrTest.php35
-rw-r--r--tests/phpunit/languages/LanguageGaTest.php35
-rw-r--r--tests/phpunit/languages/LanguageGdTest.php53
-rw-r--r--tests/phpunit/languages/LanguageGvTest.php44
-rw-r--r--tests/phpunit/languages/LanguageHeTest.php132
-rw-r--r--tests/phpunit/languages/LanguageHiTest.php35
-rw-r--r--tests/phpunit/languages/LanguageHrTest.php42
-rw-r--r--tests/phpunit/languages/LanguageHsbTest.php41
-rw-r--r--tests/phpunit/languages/LanguageHuTest.php35
-rw-r--r--tests/phpunit/languages/LanguageHyTest.php35
-rw-r--r--tests/phpunit/languages/LanguageKshTest.php35
-rw-r--r--tests/phpunit/languages/LanguageLnTest.php35
-rw-r--r--tests/phpunit/languages/LanguageLtTest.php63
-rw-r--r--tests/phpunit/languages/LanguageLvTest.php44
-rw-r--r--tests/phpunit/languages/LanguageMgTest.php36
-rw-r--r--tests/phpunit/languages/LanguageMkTest.php40
-rw-r--r--tests/phpunit/languages/LanguageMlTest.php38
-rw-r--r--tests/phpunit/languages/LanguageMoTest.php45
-rw-r--r--tests/phpunit/languages/LanguageMtTest.php77
-rw-r--r--tests/phpunit/languages/LanguageNlTest.php24
-rw-r--r--tests/phpunit/languages/LanguageNsoTest.php34
-rw-r--r--tests/phpunit/languages/LanguagePlTest.php77
-rw-r--r--tests/phpunit/languages/LanguageRoTest.php45
-rw-r--r--tests/phpunit/languages/LanguageRuTest.php115
-rw-r--r--tests/phpunit/languages/LanguageSeTest.php53
-rw-r--r--tests/phpunit/languages/LanguageSgsTest.php71
-rw-r--r--tests/phpunit/languages/LanguageShTest.php42
-rw-r--r--tests/phpunit/languages/LanguageSkTest.php42
-rw-r--r--tests/phpunit/languages/LanguageSlTest.php44
-rw-r--r--tests/phpunit/languages/LanguageSmaTest.php53
-rw-r--r--tests/phpunit/languages/LanguageSrTest.php249
-rw-r--r--tests/phpunit/languages/LanguageTest.php1635
-rw-r--r--tests/phpunit/languages/LanguageTiTest.php34
-rw-r--r--tests/phpunit/languages/LanguageTlTest.php34
-rw-r--r--tests/phpunit/languages/LanguageTrTest.php61
-rw-r--r--tests/phpunit/languages/LanguageUkTest.php72
-rw-r--r--tests/phpunit/languages/LanguageUzTest.php124
-rw-r--r--tests/phpunit/languages/LanguageWaTest.php34
-rw-r--r--tests/phpunit/languages/SpecialPageAliasTest.php63
-rw-r--r--tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php151
-rw-r--r--tests/phpunit/maintenance/DumpTestCase.php386
-rw-r--r--tests/phpunit/maintenance/MaintenanceTest.php830
-rw-r--r--tests/phpunit/maintenance/backupPrefetchTest.php277
-rw-r--r--tests/phpunit/maintenance/backupTextPassTest.php584
-rw-r--r--tests/phpunit/maintenance/backup_LogTest.php225
-rw-r--r--tests/phpunit/maintenance/backup_PageTest.php428
-rw-r--r--tests/phpunit/maintenance/fetchTextTest.php261
-rw-r--r--tests/phpunit/mocks/filebackend/MockFSFile.php69
-rw-r--r--tests/phpunit/mocks/filebackend/MockFileBackend.php39
-rw-r--r--tests/phpunit/mocks/media/MockBitmapHandler.php32
-rw-r--r--tests/phpunit/mocks/media/MockDjVuHandler.php49
-rw-r--r--tests/phpunit/mocks/media/MockImageHandler.php86
-rw-r--r--tests/phpunit/mocks/media/MockSvgHandler.php28
-rw-r--r--tests/phpunit/phpunit.php233
-rw-r--r--tests/phpunit/run-tests.bat1
-rw-r--r--tests/phpunit/skins/SideBarTest.php219
-rw-r--r--tests/phpunit/structure/AutoLoaderTest.php135
-rw-r--r--tests/phpunit/structure/ResourcesTest.php269
-rw-r--r--tests/phpunit/structure/StructureTest.php67
-rw-r--r--tests/phpunit/suite.xml64
-rw-r--r--tests/phpunit/suites/ExtensionsParserTestSuite.php8
-rw-r--r--tests/phpunit/suites/ExtensionsTestSuite.php47
-rw-r--r--tests/phpunit/suites/LessTestSuite.php34
-rw-r--r--tests/phpunit/suites/UploadFromUrlTestSuite.php207
-rw-r--r--tests/phpunit/tests/MediaWikiTestCaseTest.php77
-rw-r--r--tests/qunit/.htaccess1
-rw-r--r--tests/qunit/QUnitTestResources.php117
-rw-r--r--tests/qunit/data/callMwLoaderTestCallback.js1
-rw-r--r--tests/qunit/data/generateJqueryMsgData.php149
-rw-r--r--tests/qunit/data/load.mock.php74
-rw-r--r--tests/qunit/data/mediawiki.jqueryMsg.data.js491
-rw-r--r--tests/qunit/data/qunitOkCall.js2
-rw-r--r--tests/qunit/data/styleTest.css.php61
-rw-r--r--tests/qunit/data/testrunner.js547
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js108
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js53
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.byteLength.test.js37
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js252
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.client.test.js638
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.color.test.js18
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js63
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js13
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.hidpi.test.js22
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.highlightText.test.js235
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.localize.test.js135
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js339
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js55
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.placeholder.test.js145
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js35
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js1327
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.textSelection.test.js273
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.category.test.js30
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js25
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js312
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.watch.test.js46
-rw-r--r--tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js63
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js650
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js434
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js81
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.cookie.test.js172
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js798
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js70
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js475
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.test.js985
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js40
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js54
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js343
-rw-r--r--tests/qunit/suites/resources/startup.test.js143
-rw-r--r--tests/testHelpers.inc832
814 files changed, 115837 insertions, 1353 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 00000000..f8177807
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,119 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+ grunt.loadNpmTasks( 'grunt-contrib-copy' );
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-contrib-watch' );
+ grunt.loadNpmTasks( 'grunt-banana-checker' );
+ grunt.loadNpmTasks( 'grunt-jscs' );
+ grunt.loadNpmTasks( 'grunt-jsonlint' );
+ grunt.loadNpmTasks( 'grunt-karma' );
+
+ var wgServer = process.env.MW_SERVER,
+ wgScriptPath = process.env.MW_SCRIPT_PATH,
+ karmaProxy = {};
+
+ karmaProxy[wgScriptPath] = wgServer + wgScriptPath;
+
+ grunt.initConfig( {
+ pkg: grunt.file.readJSON( 'package.json' ),
+ jshint: {
+ options: {
+ jshintrc: true
+ },
+ all: [
+ '*.js',
+ '{includes,languages,resources,tests}/**/*.js'
+ ]
+ },
+ jscs: {
+ all: [
+ '<%= jshint.all %>',
+ // Auto-generated file with JSON (double quotes)
+ '!tests/qunit/data/mediawiki.jqueryMsg.data.js',
+ // Skip functions are stored as script files but wrapped in a function when
+ // executed. node-jscs trips on the would-be "Illegal return statement".
+ '!resources/src/*-skip.js'
+
+ // Exclude all files ignored by jshint
+ ].concat( grunt.file.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns, pattern ) {
+ // Filter out empty lines
+ if ( pattern.length && pattern[0] !== '#' ) {
+ patterns.push( '!' + pattern );
+ }
+ return patterns;
+ }, [] ) )
+ },
+ jsonlint: {
+ all: [
+ '.jscsrc',
+ '{languages,maintenance,resources}/**/*.json',
+ 'package.json'
+ ]
+ },
+ banana: {
+ core: 'languages/i18n/',
+ installer: 'includes/installer/i18n/'
+ },
+ watch: {
+ files: [
+ '<%= jscs.all %>',
+ '<%= jsonlint.all %>',
+ '.jshintignore',
+ '.jshintrc'
+ ],
+ tasks: 'test'
+ },
+ karma: {
+ options: {
+ proxies: karmaProxy,
+ files: [ {
+ pattern: wgServer + wgScriptPath + '/index.php?title=Special:JavaScriptTest/qunit/export',
+ watched: false,
+ included: true,
+ served: false
+ } ],
+ frameworks: [ 'qunit' ],
+ reporters: [ 'dots' ],
+ singleRun: true,
+ autoWatch: false,
+ // Some tests in extensions don't yield for more than the default 10s (T89075)
+ browserNoActivityTimeout: 60 * 1000
+ },
+ main: {
+ browsers: [ 'Chrome' ]
+ },
+ more: {
+ browsers: [ 'Chrome', 'Firefox' ]
+ }
+ },
+ copy: {
+ jsduck: {
+ src: 'resources/**/*',
+ dest: 'docs/js/modules',
+ expand: true,
+ rename: function ( dest, src ) {
+ return require( 'path' ).join( dest, src.replace( 'resources/', '' ) );
+ }
+ }
+ }
+ } );
+
+ grunt.registerTask( 'assert-mw-env', function () {
+ if ( !process.env.MW_SERVER ) {
+ grunt.log.error( 'Environment variable MW_SERVER must be set.\n' +
+ 'Set this like $wgServer, e.g. "http://localhost"'
+ );
+ }
+ if ( !process.env.MW_SCRIPT_PATH ) {
+ grunt.log.error( 'Environment variable MW_SCRIPT_PATH must be set.\n' +
+ 'Set this like $wgScriptPath, e.g. "/w"');
+ }
+ return !!( process.env.MW_SERVER && process.env.MW_SCRIPT_PATH );
+ } );
+
+ grunt.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] );
+ grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] );
+
+ grunt.registerTask( 'test', ['lint'] );
+ grunt.registerTask( 'default', 'test' );
+};
diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24
index 62e0c328..43ba2876 100644
--- a/RELEASE-NOTES-1.24
+++ b/RELEASE-NOTES-1.24
@@ -1,6 +1,29 @@
Security reminder: If you have PHP's register_globals option set, you must
turn it off. MediaWiki will no longer work with it enabled.
+== MediaWiki 1.24.2 ==
+
+This is a security and maintenance release of the MediaWiki 1.24 branch.
+
+== Changes since 1.24.1 ==
+
+* (T85848, T71210) SECURITY: Don't parse XMP blocks that contain XML entities,
+ to prevent various DoS attacks.
+* (T85848) SECURITY: Don't allow directly calling Xml::isWellFormed, to reduce
+ likelihood of DoS.
+* (T88310) SECURITY: Always expand xml entities when checking SVG's.
+* (T73394) SECURITY: Escape > in Html::expandAttributes to prevent XSS.
+* (T85855) SECURITY: Don't execute another user's CSS or JS on preview.
+* (T64685) SECURITY: Allow setting maximal password length to prevent DoS when
+ using PBKDF2.
+* (T85349, T85850, T86711) SECURITY: Multiple issues fixed in SVG filtering to
+ prevent XSS and protect viewer's privacy.
+* Fix case of SpecialAllPages/SpecialAllMessages in SpecialPageFactory to fix
+ loading these special pages when $wgAutoloadAttemptLowercase is false.
+* (bug T70087) Fix Special:ActiveUsers page for installations using
+ PostgreSQL.
+* (bug T76254) Fix deleting of pages with PostgreSQL. Requires a schema change
+ and running update.php to fix.
== MediaWiki 1.24.1 ==
diff --git a/docs/kss/package.json b/docs/kss/package.json
deleted file mode 100644
index 70cebd2c..00000000
--- a/docs/kss/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "mediawiki-ui-dependencies",
- "description": "Node.js dependencies used for KSS generation",
- "version": "0.0.1",
- "dependencies": {
- "kss": ">=0.3.7"
- },
- "repository" : {
- "type" : "git",
- "url" : "https://gerrit.wikimedia.org/r/p/mediawiki/core.git"
- }
-
-}
diff --git a/extensions/ConfirmEdit/Asirra.class.php b/extensions/ConfirmEdit/Asirra.class.php
deleted file mode 100644
index ae1178a1..00000000
--- a/extensions/ConfirmEdit/Asirra.class.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * @author Bachsau
- * @author Niklas Laxström
- */
-
-class Asirra extends SimpleCaptcha {
- public $asirra_clientscript = '//challenge.asirra.com/js/AsirraClientSide.js';
-
- // As we don't have to store anything but some other things to do,
- // we're going to replace that constructor completely.
- function __construct() {
- global $wgExtensionAssetsPath;
- $this->asirra_localpath = "$wgExtensionAssetsPath/ConfirmEdit";
- }
-
- function getForm() {
- global $wgOut;
-
- $wgOut->addModules( 'ext.confirmEdit.asirra' );
- $js = Html::linkedScript( $this->asirra_clientscript );
-
- $message = Xml::encodeJsVar( wfMessage( 'asirra-createaccount-fail' )->plain() );
- $js .= Html::inlineScript( <<<JAVASCRIPT
-var asirra_js_failed = '$message';
-JAVASCRIPT
- );
- $js .= '<noscript>' . wfMessage( 'asirra-nojs' )->parse() . '</noscript>';
- return $js;
- }
-
- function getMessage( $action ) {
- $name = 'asirra-' . $action;
- $text = wfMessage( $name )->text();
- # Obtain a more tailored message, if possible, otherwise, fall
- # back to the default for edits
- return wfMessage( $name, $text )->isDisabled() ? wfMessage( 'asirra-edit' )->text() : $text;
- }
-
- function passCaptcha() {
- global $wgRequest;
-
- $ticket = $wgRequest->getVal( 'Asirra_Ticket' );
- $api = 'http://challenge.asirra.com/cgi/Asirra?';
- $params = array(
- 'action' => 'ValidateTicket',
- 'ticket' => $ticket,
- );
-
- $response = Http::get( $api . wfArrayToCgi( $params ) );
- $xml = simplexml_load_string( $response );
- $result = $xml->xpath( '/AsirraValidation/Result' );
- return strval( $result[0] ) === 'Pass';
- }
-}
diff --git a/extensions/ConfirmEdit/Asirra.php b/extensions/ConfirmEdit/Asirra.php
deleted file mode 100644
index a5d5012f..00000000
--- a/extensions/ConfirmEdit/Asirra.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Asirra CAPTCHA module for the ConfirmEdit MediaWiki extension.
- * @author Bachsau
- * @author Niklas Laxström
- *
- * Makes use of the Asirra (Animal Species Image Recognition for
- * Restricting Access) CAPTCHA service, developed by John Douceur, Jeremy
- * Elson and Jon Howell at Microsoft Research.
- *
- * Asirra uses a large set of images from http://petfinder.com.
- *
- * For more information about Asirra, see:
- * http://research.microsoft.com/en-us/um/redmond/projects/asirra/
- *
- * This MediaWiki code is released into the public domain, without any
- * warranty. YOU CAN DO WITH IT WHATEVER YOU LIKE!
- *
- * @file
- * @ingroup Extensions
- */
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- exit;
-}
-
-$dir = __DIR__;
-require_once( $dir . '/ConfirmEdit.php' );
-
-$wgCaptchaClass = 'Asirra';
-$wgMessagesDirs['Asirra'] = __DIR__ . '/i18n/asirra';
-$wgExtensionMessagesFiles['Asirra'] = $dir . '/Asirra.i18n.php';
-$wgAutoloadClasses['Asirra'] = $dir . '/Asirra.class.php';
-
-$wgResourceModules['ext.confirmEdit.asirra'] = array(
- 'localBasePath' => $dir . '/resources',
- 'remoteExtPath' => 'ConfirmEdit/resources',
- 'scripts' => 'ext.confirmEdit.asirra.js',
- 'messages' => array(
- 'asirra-failed',
- ),
-);
-
diff --git a/extensions/ConfirmEdit/README b/extensions/ConfirmEdit/README
index acfe481a..7a331e6b 100644
--- a/extensions/ConfirmEdit/README
+++ b/extensions/ConfirmEdit/README
@@ -19,8 +19,6 @@ in a stylized way
questions defined by the administrator(s)
* ReCaptcha - users have to identify a series of characters, either
visually or audially, from a widget provided by the reCAPTCHA service
-* Asirra - users have to identify the cats in a set of photos of cats
-and dogs, from a widget provided by the Microsoft Asirra service
== License ==
@@ -37,8 +35,6 @@ The QuestyCaptcha module was written by Benjamin Lees.
The reCAPTCHA module was written by Mike Crawford and Ben Maurer.
-The Asirra module was written by Bachsau.
-
Additional maintenance work was done by Yaron Koren.
== Changelog ==
diff --git a/extensions/ConfirmEdit/i18n/asirra/ast.json b/extensions/ConfirmEdit/i18n/asirra/ast.json
deleted file mode 100644
index 626c4896..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ast.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Xuacu"
- ]
- },
- "asirra-desc": "Módulu Asirra pa ConfirmEdit",
- "asirra-edit": "Pa protexer la wiki escontra'l spam d'edición automáticu, pidimos-y qu'esbille namái les fotos de gatos del cuadru d'abaxo:",
- "asirra-addurl": "La so edición incluye enllaces esternos nuevos. Pa protexer la wiki escontra'l spam automáticu, pidimos-y qu'esbille namái les fotos de gatos del cuadru d'abaxo:",
- "asirra-badlogin": "Pa protexer la wiki escontra'l frayamientu de claves automáticu, pidimos-y qu'esbille namái les fotos de gatos del cuadru d'abaxo:",
- "asirra-createaccount": "Pa protexer la wiki escontra la creación de cuentes automática, pidimos-y qu'esbille namái les fotos de gatos del cuadru d'abaxo:",
- "asirra-createaccount-fail": "Identifique correutamente los gatos.",
- "asirra-create": "Pa protexer la wiki escontra la creación de páxines automática, pidimos-y qu'esbille namái les fotos de gatos del cuadru d'abaxo:",
- "asirra-nojs": "'''Por favor active JavaScript y vuelva a unviar la páxina.'''",
- "asirra-failed": "Identifique toles imaxes de gatos"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/be-tarask.json b/extensions/ConfirmEdit/i18n/asirra/be-tarask.json
deleted file mode 100644
index c829700e..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/be-tarask.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "EugeneZelenko",
- "Jim-by",
- "Wizardist",
- "Red Winged Duck"
- ]
- },
- "asirra-desc": "Модуль Asirra для ConfirmEdit",
- "asirra-edit": "Для абароны вікі ад аўтаматычнага спаму ў праўках, просім вас выбраць толькі фотаздымкі з катом у полі ніжэй:",
- "asirra-addurl": "Вашае рэдагаваньне ўтрымлівае новыя вонкавыя спасылкі. Для абароны вікі ад аўтаматычнага спаму ў праўках, мы просім вас выбраць толькі фотаздымкі катоў у полі ніжэй:",
- "asirra-badlogin": "Для абароны вікі ад аўтаматычнага падбору паролю, просім вас выбраць толькі фотаздымкі катоў у полі ніжэй:",
- "asirra-createaccount": "Для абароны вікі ад аўтаматычнага стварэньня рахункаў, просім вас выбраць толькі фотаздымкі катоў у полі ніжэй:",
- "asirra-createaccount-fail": "Калі ласка, слушна выберыце катоў.",
- "asirra-create": "Для абароны вікі ад аўтаматычнага стварэньня старонак, просім вас выбраць толькі фотаздымкі катоў у полі ніжэй:",
- "asirra-nojs": "'''Калі ласка, дазвольце JavaScript і дашліце старонку зноў.'''",
- "asirra-failed": "Калі ласка, вызначце ўсе выявы з катамі"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/br.json b/extensions/ConfirmEdit/i18n/asirra/br.json
deleted file mode 100644
index 4b5d3c6d..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/br.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Fohanno"
- ]
- },
- "asirra-desc": "Modulenn Asirra evit ConfirmEdit",
- "asirra-edit": "Evit sikour da wareziñ ar wiki diouzh ar stroboù emgefre, diuzit ar skeudennoù kizhier er voest dindan :",
- "asirra-createaccount-fail": "Diuzit ar c'hizhier, mar plij.",
- "asirra-create": "Evit gwareziñ ar wiki diouzh ar c'hrouiñ pajennoù emgefre, diuzit ar skeudennoù kizhier er voest dindan :",
- "asirra-nojs": "'''Gweredekait JavaScript, mar plij, hag adkasit ar bajenn.'''",
- "asirra-failed": "Diuzit an holl skeudennoù kizhier, mar plij"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ca.json b/extensions/ConfirmEdit/i18n/asirra/ca.json
deleted file mode 100644
index 9119f0fa..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ca.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Toniher"
- ]
- },
- "asirra-desc": "Mòdul Asirra de ConfirmEdit",
- "asirra-edit": "Per tal de protegir el wiki contra les edicions brosses, us demanem que seleccioneu només les fotos de gats del requadre a continuació:",
- "asirra-addurl": "La modificació inclou nous enllaços externs. Per tal de protegir el wiki davant d'edicions brossa, us demanem que seleccioneu només les fotos de gots del requadre a continuació:",
- "asirra-badlogin": "Per tal de protegir el wiki contra els intents de trencament de contrasenyes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:",
- "asirra-createaccount": "Per tal de protegir el wiki contra la creació automatitzada de comptes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:",
- "asirra-createaccount-fail": "Identifiqueu correctament els gats.",
- "asirra-create": "Per tal de protegir el wiki contra la creació automàtica de pàgines, us demanem que seleccioneu només les fotos de gats del requadre a continuació:",
- "asirra-nojs": "'''Habilitieu el JavaScript i torneu a enviar la pàgina.'''",
- "asirra-failed": "Identifiqueu totes les imatges de gats"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/cs.json b/extensions/ConfirmEdit/i18n/asirra/cs.json
deleted file mode 100644
index df7cccbf..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/cs.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Vks"
- ]
- },
- "asirra-createaccount-fail": "Prosíme, správně identifikujte kočky."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/de-formal.json b/extensions/ConfirmEdit/i18n/asirra/de-formal.json
deleted file mode 100644
index 87f8f119..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/de-formal.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Kghbln"
- ]
- },
- "asirra-addurl": "Ihre Bearbeitung enthält neue externe Links. Zum Schutz vor automatisiertem Spam bitten wir Sie, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-badlogin": "Zum Schutz gegen automatisiertes Knacken von Passwörtern bitten wir Sie, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-createaccount": "Zum Schutz gegen automatisiertes Erstellen von Benutzerkonten bitten wir Sie, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-createaccount-fail": "Bitte wählen Sie nur die Fotos mit Katzen aus.",
- "asirra-create": "Zum Schutz gegen automatisiertes Erstellen von Seiten bitten wir Sie, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-failed": "Bitte wählen Sie nur die Fotos mit Katzen aus."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/de.json b/extensions/ConfirmEdit/i18n/asirra/de.json
deleted file mode 100644
index be745a09..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/de.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Kghbln",
- "Metalhead64"
- ]
- },
- "asirra-desc": "Ermöglicht die Nutzung des Anti-Spam-Moduls Asirra",
- "asirra-edit": "Zum Schutz des Wikis vor automatisiertem Spam bitten wir dich, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-addurl": "Deine Bearbeitung enthält neue externe Links. Zum Schutz des Wikis vor automatisiertem Spam bitten wir dich, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-badlogin": "Zum Schutz des Wikis gegen automatisiertes Knacken von Passwörtern bitten wir dich, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-createaccount": "Zum Schutz des Wikis gegen automatisiertes Erstellen von Benutzerkonten bitten wir dich, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-createaccount-fail": "Bitte wähle nur die Fotos mit Katzen aus.",
- "asirra-create": "Zum Schutz des Wikis gegen automatisiertes Erstellen von Seiten bitten wir dich, nur die Fotos mit Katzen im untenstehenden Feld auszuwählen:",
- "asirra-nojs": "'''Bitte JavaScript aktivieren und die Seiten nochmals Speichern.'''",
- "asirra-failed": "Bitte wähle nur die Fotos mit Katzen aus."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/diq.json b/extensions/ConfirmEdit/i18n/asirra/diq.json
deleted file mode 100644
index 09196703..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/diq.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Erdemaslancan"
- ]
- },
- "asirra-desc": "Qandê Asirra modulê RaştkerdenVurnen"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/en.json b/extensions/ConfirmEdit/i18n/asirra/en.json
deleted file mode 100644
index 9c98683b..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/en.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "@metadata": {
- "authors": []
- },
- "asirra-desc": "Asirra module for ConfirmEdit",
- "asirra-edit": "To protect the wiki against automated edit spam, we kindly ask you to select just the cat photos in the box below:",
- "asirra-addurl": "Your edit includes new external links. To protect the wiki against automated edit spam, we kindly ask you to select just the cat photos in the box below:",
- "asirra-badlogin": "To protect the wiki against automated password cracking, we kindly ask you to select just the cat photos in the box below:",
- "asirra-createaccount": "To protect the wiki against automated account creation, we kindly ask you to select just the cat photos in the box below:",
- "asirra-createaccount-fail": "Please correctly identify the cats.",
- "asirra-create": "To protect the wiki against automated page creation, we kindly ask you to select just the cat photos in the box below:",
- "asirra-nojs": "'''Please enable JavaScript and resubmit the page.'''",
- "asirra-failed": "Please identify all cat images"
-} \ No newline at end of file
diff --git a/extensions/ConfirmEdit/i18n/asirra/es.json b/extensions/ConfirmEdit/i18n/asirra/es.json
deleted file mode 100644
index 875912d8..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/es.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Armando-Martin",
- "Carlosz22",
- "Ciencia Al Poder"
- ]
- },
- "asirra-desc": "Módulo de Asirra para ConfirmEdit",
- "asirra-edit": "Para ayudar a protegernos contra el spam de ediciones automáticas, seleccione sólo las fotos de gatos en el cuadro siguiente:",
- "asirra-addurl": "Tu edición incluye nuevos enlaces externos. Para proteger el wiki contra el spam automatizado, por favor, te pedimos que selecciones solo las fotos de gatos en el cuadro siguiente:",
- "asirra-badlogin": "Para proteger el wiki contra el robo automatizado de contraseñas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:",
- "asirra-createaccount": "Para proteger el wiki contra la creación automatizada de cuentas de usuario, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:",
- "asirra-createaccount-fail": "Identifique correctamente los gatos.",
- "asirra-create": "Para proteger el wiki contra la creación automatizada de páginas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:",
- "asirra-nojs": "'''Por favor active JavaScript y vuelva a la página.'''",
- "asirra-failed": "Identifique todas las imágenes de gatos"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/fa.json b/extensions/ConfirmEdit/i18n/asirra/fa.json
deleted file mode 100644
index b06627b9..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/fa.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Armin1392",
- "Ebraminio",
- "Alirezaaa"
- ]
- },
- "asirra-desc": "بخش آسیرا برای تأیید ویرایش",
- "asirra-edit": " برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:",
- "asirra-addurl": "ویرایش شما شامل پیوندهای خارجی تازه است. برای محافظت ویکی دربرابر ویرایش خودکار هرزنگاری، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:",
- "asirra-badlogin": "برای محافظت ویکی دربرابر رخنه به رمز‌ عبور به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:",
- "asirra-createaccount": "برای محافظت ویکی دربرابر ایجاد حساب به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:",
- "asirra-createaccount-fail": "لطفاً این گربه‌ها را به درستی شناسایی کنید.",
- "asirra-create": "برای محافظت ویکی دربرابر ایجاد صفحه به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:",
- "asirra-nojs": "'''لطفاً جاوااسکریپت را فعال کنید و صفحه را دوباره ارائه کنید.'''",
- "asirra-failed": "لطفاً همهٔ عکس‌های گربه را شناسایی کنید"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/fi.json b/extensions/ConfirmEdit/i18n/asirra/fi.json
deleted file mode 100644
index bf3bfe3d..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/fi.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "VezonThunder",
- "Nedergard"
- ]
- },
- "asirra-desc": "Asirra-moduuli muokkauksen varmennukseen",
- "asirra-edit": "Suojana automaattisia roskamuokkauksia vastaan sinun on valittava kissan kuvat laatikosta alla:",
- "asirra-addurl": "Muokkauksesi sisältää uusia ulkoisia linkkejä. Suojana automaattista roskapostia vastaan sinun on valittava kissan kuvat laatikosta alla:",
- "asirra-badlogin": "Suojana automaattisia salasanamurtoja vastaan sinun on valittava kissan kuvat laatikosta alla:",
- "asirra-createaccount": "Suojana automaattista tunnusten luontia vastaan sinun on valittava kissan kuvat laatikosta alla:",
- "asirra-createaccount-fail": "Tunnista kissat.",
- "asirra-create": "Suojana automaattista sivujen luontia vastaan sinun on valittava kissojen kuvat alta:",
- "asirra-nojs": "'''Salli JavaScript ja lähetä uudelleen.'''",
- "asirra-failed": "Tunnista kaikki kissan kuvat"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/fr.json b/extensions/ConfirmEdit/i18n/asirra/fr.json
deleted file mode 100644
index e9c0d73d..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/fr.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Gomoko",
- "Nicolas NALLET",
- "Seb35"
- ]
- },
- "asirra-desc": "Module Asirra pour ConfirmEdit",
- "asirra-edit": "Pour protéger le wiki contre le spam d’édition automatique, nous vous demandons de bien vouloir sélectionner uniquement les photos de chats dans la boîte ci-dessous :",
- "asirra-addurl": "Votre édition contient des liens externes. Pour protéger le wiki contre le spam de modification automatique, nous vous demandons de bien vouloir sélectionner uniquement les photos de chats dans la boîte ci-dessous :",
- "asirra-badlogin": "Pour protéger le wiki des essais automatiques de cassage de mot de passe, nous vous demandons de bien vouloir sélectionner uniquement les photos de chats dans la boîte ci-dessous :",
- "asirra-createaccount": "Pour protéger le wiki contre la création automatique de comptes, nous vous demandons de bien vouloir sélectionner uniquement les photos de chats dans la boîte ci-dessous :",
- "asirra-createaccount-fail": "Veuillez identifier correctement les chats.",
- "asirra-create": "Pour protéger le wiki contre la création automatique de pages, nous vous demandons de bien vouloir sélectionner uniquement les photos de chats dans la boîte ci-dessous :",
- "asirra-nojs": "'''Veuillez activer le JavaScript et re-soumettre la page.'''",
- "asirra-failed": "Veuillez identifier toutes les images de chat"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/gl.json b/extensions/ConfirmEdit/i18n/asirra/gl.json
deleted file mode 100644
index e5f33605..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/gl.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Toliño"
- ]
- },
- "asirra-desc": "Módulo Asirra para ConfirmEdit",
- "asirra-edit": "Para protexer o wiki contra o spam automático, seleccione só as fotos de gatos na caixa:",
- "asirra-addurl": "A súa edición inclúe novas ligazóns externas. Para protexer o wiki contra o spam automático, seleccione só as fotos de gatos na caixa:",
- "asirra-badlogin": "Para protexer o wiki contra o roubo de contrasinais, seleccione só as fotos de gatos na caixa:",
- "asirra-createaccount": "Para protexer o wiki contra a creación automática de contas, seleccione só as fotos de gatos na caixa:",
- "asirra-createaccount-fail": "Identifique correctamente os gatos.",
- "asirra-create": "Para protexer o wiki contra a creación automática de páxinas, seleccione só as fotos de gatos na caixa:",
- "asirra-nojs": "'''Active o JavaScript e volva enviar a páxina.'''",
- "asirra-failed": "Identifique todas as fotos de gatos"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/he.json b/extensions/ConfirmEdit/i18n/asirra/he.json
deleted file mode 100644
index 7288819a..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/he.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Yona b",
- "ערן"
- ]
- },
- "asirra-desc": "מודול Asirra לאישור עריכה (ConfirmEdit)",
- "asirra-edit": "כדי להגן על הוויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:",
- "asirra-addurl": "העריכה שלך כוללת קישורים חיצוניים חדשים. כדי להגן על הויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:",
- "asirra-badlogin": "כדי להגן על הוויקי מפיצוח אוטומטי של סיסמאות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:",
- "asirra-createaccount": "כדי להגן על הוויקי מפני יצירה אוטומטית של חשבונות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:",
- "asirra-createaccount-fail": "יש לזהות כראוי את החתולים.",
- "asirra-create": "כדי להגן על הוויקי מפני יצירה אוטומטית של דפים, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:",
- "asirra-nojs": "'''יש לאפשר JavaScript ולשלוח מחדש את הדף.'''",
- "asirra-failed": "יש לזהות את כל תמונות החתולים"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/hsb.json b/extensions/ConfirmEdit/i18n/asirra/hsb.json
deleted file mode 100644
index 264d31e3..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/hsb.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Michawiki"
- ]
- },
- "asirra-desc": "Modul Asirra za ConfirmEdit",
- "asirra-edit": "Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:",
- "asirra-addurl": "Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:",
- "asirra-badlogin": "Za škit přećiwo awtomatizowanemu złamanju hesłow, prošu wubjer jenož fota kóčkow w slědowacym polu:",
- "asirra-createaccount": "Za škit přećiwo awtomatiskemu wutworjenju konta, prošu wubjer jenož fota kóčkow w slědowacym polu:",
- "asirra-createaccount-fail": "Prošu identifikuj kóčki.",
- "asirra-create": "Za škit přećiwo awtomatiskemu wutworjenju strony, prošu wubjer jenož fota kóčkow w slědowacym polu:",
- "asirra-nojs": "'''Prošu zmóžń JavaScript a składuj stronu hišće raz.'''",
- "asirra-failed": "Prošu identifikuj wšě wobrazy z kóčkami"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ia.json b/extensions/ConfirmEdit/i18n/asirra/ia.json
deleted file mode 100644
index ef2a783b..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ia.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "McDutchie"
- ]
- },
- "asirra-desc": "Modulo de Asirra pro ConfirmEdit",
- "asirra-edit": "Pro adjutar a proteger le wiki contra le spam automatisate, per favor selige solmente le photos de cattos in le quadro sequente:",
- "asirra-addurl": "Iste modification include nove ligamines externe. Pro adjutar a proteger le wiki contra le spam automatisate, per favor selige solmente le photos de cattos in le quadro sequente:",
- "asirra-badlogin": "Pro adjutar a proteger le wiki contra le furto automatisate de contrasignos, per favor selige solmente le photos de cattos in le quadro sequente:",
- "asirra-createaccount": "Pro adjutar a proteger le wiki contra le creation automatisate de contos, per favor selige solmente le photos de cattos in le quadro sequente:",
- "asirra-createaccount-fail": "Per favor identifica correctemente le cattos.",
- "asirra-create": "Pro adjutar a proteger le wiki contra le creation automatisate de paginas, per favor selige solmente le photos de cattos in le quadro sequente:",
- "asirra-nojs": "'''Per favor activa JavaScript e resubmitte le pagina.'''",
- "asirra-failed": "Per favor identifica tote le imagines de cattos"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/it.json b/extensions/ConfirmEdit/i18n/asirra/it.json
deleted file mode 100644
index d70b715f..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/it.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Beta16"
- ]
- },
- "asirra-desc": "Modulo ASIRRA per ConfirmEdit",
- "asirra-edit": "Per proteggere il wiki dalle modifiche automatiche che aggiungono spam, ti chiediamo gentilmente di selezionare solo le foto di gatti nel riquadro sottostante:",
- "asirra-addurl": "La tua modifica aggiunge qualche nuovo collegamento esterno. Per proteggere il wiki dallo spam automatico, ti chiediamo gentilmente di selezionare solo le foto di gatti nel riquadro sottostante:",
- "asirra-badlogin": "Per proteggere il wiki dalla forzatura automatica delle password, ti chiediamo gentilmente di selezionare solo le foto di gatti nel riquadro sottostante:",
- "asirra-createaccount": "Per proteggere il wiki dalla creazione automatica di nuovi accessi, ti chiediamo gentilmente di selezionare solo le foto di gatti nel riquadro sottostante:",
- "asirra-createaccount-fail": "Identifica correttamente i gatti.",
- "asirra-create": "Per proteggere il wiki dalla creazione automatica di pagine, ti chiediamo gentilmente di selezionare solo le foto di gatti nel riquadro sottostante:",
- "asirra-nojs": "'''Attiva JavaScript ed invia di nuovo la pagina.'''",
- "asirra-failed": "Identifica tutte le immagini di gatti"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ja.json b/extensions/ConfirmEdit/i18n/asirra/ja.json
deleted file mode 100644
index 7c920716..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ja.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "2nd-player",
- "Shirayuki"
- ]
- },
- "asirra-desc": "ConfirmEdit 用 Asirra モジュール",
- "asirra-edit": "ウィキでの自動編集のスパム攻撃を防ぐため、お手数をおかけしますが猫が写っている画像を以下から選択してください:",
- "asirra-addurl": "あなたは新しい外部リンクを追加しようとしています。ウィキへの自動スパム攻撃を防ぐため、お手数をおかけしますが猫が写っている画像を以下から選択してください:",
- "asirra-badlogin": "ウィキへの自動パスワードクラック攻撃を防ぐため、お手数をおかけしますが猫が写っている画像を以下から選択してください:",
- "asirra-createaccount": "ウィキでのアカウント自動作成を防ぐため、お手数をおかけしますが猫が写っている画像を以下から選択してください:",
- "asirra-createaccount-fail": "猫を正しく選択してください。",
- "asirra-create": "ウィキでのページ自動作成を防ぐため、お手数をおかけしますが猫が写っている画像を以下から選択してください:",
- "asirra-nojs": "'''JavaScript を有効にしてページを再読込してください。'''",
- "asirra-failed": "猫が写っている画像をすべて選択してください"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ko.json b/extensions/ConfirmEdit/i18n/asirra/ko.json
deleted file mode 100644
index 2c4057c9..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ko.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Hym411",
- "아라"
- ]
- },
- "asirra-desc": "ConfirmEdit에 대한 Asirra 모듈",
- "asirra-edit": "자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:",
- "asirra-addurl": "편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:",
- "asirra-badlogin": "자동화된 비밀번호 크래킹으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:",
- "asirra-createaccount": "자동화된 계정 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:",
- "asirra-createaccount-fail": "고양이를 올바르게 선택하세요.",
- "asirra-create": "자동화된 문서 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:",
- "asirra-nojs": "'''자바스크립트를 활성화하고 문서를 다시 제출하세요.'''",
- "asirra-failed": "고양이 그림을 모두 선택하세요"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ksh.json b/extensions/ConfirmEdit/i18n/asirra/ksh.json
deleted file mode 100644
index be35837d..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ksh.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Purodha"
- ]
- },
- "asirra-desc": "Dä Zohsaz <i lang=\"en\">Asirra</i> för et Zohsazprojramm <i lang=\"en\">ConfirmEdit</i>.",
- "asirra-edit": "Heh dat Wiki well sesch jääje <i lang=\"en\">SPAM</i> schöze. Dröm moß mer beim Ändere noch en Prööfong aflääje, dat mer ene Minsch un kei Projramm es. Söhk bloß de Katzebelder em Kaßte us:",
- "asirra-addurl": "Heh dat Wiki well sesch jääje <i lang=\"en\">SPAM</i> schöze. Dröm moß mer, wam_mer lengks noh ußerhallef enfööje well, noch en Prööfong aflääje, dat mer ene Minsch un kei Projramm es. Söhk bloß de Katzebelder em Kaßte us:",
- "asirra-badlogin": "Heh dat Wiki well sesch jääje et automattesche Paßwoot_Knacke schöze. Dröm moß mer heh nor_en Prööfong aflääje, dat mer ene Minsch un kei Projramm es. Söhk bloß de Katzebelder em Kaßte us:",
- "asirra-createaccount": "Heh dat Wiki well sesch jääje automattesch aanjelaate „Metmaacher“ schöze. Dröm moß mer heh nor_en Prööfong aflääje, dat mer ene Minsch un kei Projramm es. Söhk bloß de Katzebelder em Kaßte us:",
- "asirra-createaccount-fail": "Bes esu jood un don de Kazebelder ußwähle.",
- "asirra-create": "Heh dat Wiki well sesch jääje automattesch neu aanjelaate Sigge schöze. Dröm moß mer heh nor_en Prööfong aflääje, dat mer ene Minsch un kei Projramm es. Söhk bloß de Katzebelder em Kaßte us:",
- "asirra-nojs": "'''Bes esu jood un donn JavaSkrep en Dingem Brauser aanschallde un scheck heh di Sigg norr_ens af.'''",
- "asirra-failed": "Bes esu jood un don all de Kazebelder ußwähle."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/lb.json b/extensions/ConfirmEdit/i18n/asirra/lb.json
deleted file mode 100644
index 42d266b8..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/lb.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Robby"
- ]
- },
- "asirra-desc": "Asirra-Modul fir ConfirmEdit",
- "asirra-edit": "Fir d'Wiki géint automatiséierte Spam ze schützen froe mir Iech just d'Fotoe mat Kazen, déi Dir an der Këscht ënnendrënner gesitt, erauszesichen:",
- "asirra-addurl": "An Ärer Ännerung sinn nei extern Linken. Fir d'Wiki géint automatiséierte Spam ze schützen, froe mir Iech d'Kategorie vun de Fotoen an der Këscht ënnendrënner erauszesichen:",
- "asirra-createaccount-fail": "Identifizéiert d'Kaze w.e.g. richteg.",
- "asirra-nojs": "'''Aktivéiert w.e.g. JavaScript a schéckt d'Säit nachemol.'''",
- "asirra-failed": "Identifizéiert w.e.g. all Biller wou Kazen drop sinn"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/mk.json b/extensions/ConfirmEdit/i18n/asirra/mk.json
deleted file mode 100644
index fe6c6a8e..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/mk.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Bjankuloski06"
- ]
- },
- "asirra-desc": "Asirra-модул за ПотврдиУредување",
- "asirra-edit": "Како заштитна мерка против автоматизиран спам, би ве замолиле да ги изберете само сликите со мачка прикажани во полето:",
- "asirra-addurl": "Во вашите измени има нови надворешни врски. Како заштитна мерка против автоматизиран спам, би ве замолиле да ги изберете само сликите со мачка прикажани во полето:",
- "asirra-badlogin": "Како заштитна мерка против автоматизирано провалување на лозинки, би ве замолиле да ги изберете само сликите со мачка прикажани во полето:",
- "asirra-createaccount": "Како заштитна мерка против автоматизирано создавање на сметки, би ве замолиле да ги изберете само сликите со мачка прикажани во полето:",
- "asirra-createaccount-fail": "Посочете кои од следниве се мачки.",
- "asirra-create": "Како заштитна мерка против автоматизирано создавање на страници, би ве замолиле да ги изберете само сликите со мачка прикажани во полето:",
- "asirra-nojs": "'''Овозможете JavaScript и поднесете ја страницата повторно.'''",
- "asirra-failed": "Изберете ги сликите што имаат мачка"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ms.json b/extensions/ConfirmEdit/i18n/asirra/ms.json
deleted file mode 100644
index 71afc754..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ms.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Anakmalaysia"
- ]
- },
- "asirra-desc": "Modul Asirra untuk ConfirmEdit",
- "asirra-edit": "Untuk mencegah suntingan spam automatik, sila pilih gambar-gambar kucing sahaja dalam petak di bawah:",
- "asirra-addurl": "Suntingan anda mengandungi pautan luar yang baru. Untuk mencegah spam janaan automatik, sila pilih gambar-gambar kucing sahaja dalam petak di bawah:",
- "asirra-badlogin": "Untuk mencegah pemecahan kata laluan automatik, sila pilih gambar-gambar kucing sahaja dalam petak di bawah:",
- "asirra-createaccount": "Untuk mencegah pembukaan akaun automatik, sila pilih gambar-gambar kucing sahaja dalam petak di bawah:",
- "asirra-createaccount-fail": "Sila kenal pasti kucing-kucing dengan betul.",
- "asirra-create": "Untuk mencegah pembukaan halaman automatik, sila pilih gambar-gambar kucing sahaja dalam petak di bawah:",
- "asirra-nojs": "'''Sila hidupkan JavaScript dan hantar semula halaman ini.'''",
- "asirra-failed": "Sila kenal pasti semua gambar kucing"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/mt.json b/extensions/ConfirmEdit/i18n/asirra/mt.json
deleted file mode 100644
index d57a1350..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/mt.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Chrisportelli"
- ]
- },
- "asirra-desc": "Modulu ASIRRA għal ConfirmEdit",
- "asirra-edit": "Sabiex tgħinna nipproteġu kontra l-modifiki li jżidu spam, jekk jogħġbok agħżel ir-ritratti tal-qtates fil-kaxxa t'hawn taħt:",
- "asirra-addurl": "Il-modifika tiegħek tinkludi ħoloq esterni ġodda. Sabiex tipproteġi kontra spam awtomatiku, jekk jogħġbok agħżel ir-ritratti tal-qtates fil-kaxxa t'hawn taħt:",
- "asirra-badlogin": "Sabiex tgħinna nipproteġu kontra l-infurzar awtomatiku tal-passwords, jekk jogħġbok agħżel ir-ritratti tal-qtates fil-kaxxa t'hawn taħt:",
- "asirra-createaccount": "Sabiex tgħinna nipproteġu kontra l-ħolqien awtomatiku ta' kontijiet ġodda, jekk jogħġbok agħżel ir-ritratti tal-qtates fil-kaxxa t'hawn taħt:",
- "asirra-createaccount-fail": "Sib il-qtates.",
- "asirra-create": "Sabiex tgħinna nipproteġu kontra l-ħolqien awtomatiku ta' paġni, jekk jogħġbok agħżel ir-ritratti tal-qtates fil-kaxxa t'hawn taħt:",
- "asirra-nojs": "'''Jekk jogħġbok attiva l-JavaScript u erġa' ibgħat din il-paġna.'''",
- "asirra-failed": "Sib l-istampi kollha tal-qtates"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/nb.json b/extensions/ConfirmEdit/i18n/asirra/nb.json
deleted file mode 100644
index ba30c700..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/nb.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Event"
- ]
- },
- "asirra-desc": "Assirra-modulen for ConfirmEdit",
- "asirra-edit": "Som beskyttelse mot automatisk redigert spam, vennligst velg kun kattebildene i boksen under:",
- "asirra-addurl": "Din redigering inneholder nye eksterne lenker. Som beskyttelse mot automatisk redigert spam, vennligst velg kun kattebildene i boksen under:",
- "asirra-badlogin": "Som beskyttelse mot automatisk passordknekking, vennligst velg kun kattebildene i boksen under:",
- "asirra-createaccount": "Som beskyttelse mot automatisk opprettelse av brukerkonto, vennligst velg kun kattebildene i boksen under:",
- "asirra-createaccount-fail": "Vennligst angi hva som er katter.",
- "asirra-create": "Som beskyttelse mot automatisk opprettelse av sider, vennligst velg kun kattebildene i boksen under:",
- "asirra-nojs": "'''Vennligst åpne for JavaScript og lagre siden en gang til.'''",
- "asirra-failed": "Vennligst merk alle kattebilder"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/nl-informal.json b/extensions/ConfirmEdit/i18n/asirra/nl-informal.json
deleted file mode 100644
index c3888b03..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/nl-informal.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Siebrand"
- ]
- },
- "asirra-addurl": "Je bewerking bevat nieuwe externe koppelingen. Selecteer de foto's van katten in het vak hieronder om te helpen beschermen tegen geautomatiseerde spam:"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/nl.json b/extensions/ConfirmEdit/i18n/asirra/nl.json
deleted file mode 100644
index ca9b5b04..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/nl.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "HanV",
- "SPQRobin",
- "Siebrand"
- ]
- },
- "asirra-desc": "Asirra-module voor ConfirmEdit",
- "asirra-edit": "Kies ter bescherming tegen geautomatiseerde spam de afbeeldingen met een poes in het onderstaande venster:",
- "asirra-addurl": "Uw bewerking bevat nieuwe externe koppelingen. Selecteer de foto's van katten in het vak hieronder om de wiki te beschermen tegen geautomatiseerde spam:",
- "asirra-badlogin": "Kies ter bescherming tegen het automatisch kraken van wachtwoorden de afbeeldingen met een poes in het onderstaande venster:",
- "asirra-createaccount": "Kies om het automatisch aanmaken van gebruikers tegen te gaan de afbeeldingen met een poes in het onderstaande venster:",
- "asirra-createaccount-fail": "Identificeer de katten juist.",
- "asirra-create": "Kies om het automatisch aanmaken van een pagina tegen te gaan de afbeeldingen met een poes in het onderstaande venster:",
- "asirra-nojs": "'''Schakel JavaScript in en probeer de pagina opnieuw op te slaan.'''",
- "asirra-failed": "Identificeer alle afbeeldingen van katten."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/oc.json b/extensions/ConfirmEdit/i18n/asirra/oc.json
deleted file mode 100644
index 807ef432..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/oc.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Cedric31"
- ]
- },
- "asirra-desc": "Modul Asirra per ConfirmEdit",
- "asirra-createaccount-fail": "Identificatz corrèctament los gats."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/pl.json b/extensions/ConfirmEdit/i18n/asirra/pl.json
deleted file mode 100644
index 9590fd84..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/pl.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "BeginaFelicysym",
- "WTM"
- ]
- },
- "asirra-desc": "Moduł Asirra dla ConfirmEdit",
- "asirra-edit": "W celu ochrony przed zautomatyzowanym spamem, proszę wybrać tylko zdjęcia kotów w poniższym polu:",
- "asirra-addurl": "Wprowadzony przez ciebie tekst zawiera nowe linki zewnętrzne. W celu ochrony przed zautomatyzowanym spamem, proszę wskazać tylko zdjęcia kotów w poniższym polu:",
- "asirra-badlogin": "W celu ochrony przed zautomatyzowanym łamaniem haseł, proszę wybrać tylko zdjęcia kotów w poniższym polu:",
- "asirra-createaccount": "W celu ochrony przed zautomatyzowanym tworzeniem kont, proszę wybrać tylko zdjęcia kotów w poniższym polu:",
- "asirra-createaccount-fail": "Prosimy prawidłowo zidentyfikować koty.",
- "asirra-create": "W celu ochrony przed przed automatycznym tworzeniem stron, proszę wybrać tylko zdjęcia kotów w poniższym polu:",
- "asirra-nojs": "'''Prosimy włączyć obsługę języka JavaScript i ponowne przesłanie strony.'''",
- "asirra-failed": "Prosimy wskazać wszystkie obrazy kotów"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/pms.json b/extensions/ConfirmEdit/i18n/asirra/pms.json
deleted file mode 100644
index 6440c6ec..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/pms.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Borichèt",
- "Dragonòt"
- ]
- },
- "asirra-desc": "Mòdul Asirra për ConfirmEdit",
- "asirra-edit": "Për giuté a protege contra la rumenta dle modìfiche automàtiche, për piasì ch'a selession-a mach le fòto ëd gat ant ël quàder sì-sota:",
- "asirra-addurl": "Soa modìfica a conten dle liure esterne neuve. Për giuté a protege contra la rumenta dle modìfiche automàtiche, për piasì ch'a selession-a mach le fòto ëd gat ant ël quàder sì-sota:",
- "asirra-badlogin": "Për giuté a protege contra la forsadura automatisà ëd le ciav, për piasì ch'a selession-a mach la fòto dël gat ant ël quàder sì-sota:",
- "asirra-createaccount": "Për giuté a protege contra la creassion automatisà ëd cont, për piasì ch'a selession-a mach la fòto dël gat ant ël quàder sì-sota:",
- "asirra-createaccount-fail": "Për piasì identifica coretament ij gat.",
- "asirra-create": "Për giuté a protege contra la creassion automatisà ëd pàgine, për piasì ch'a selession-a mach le fòto ëd gat ant ël quàder sì-sota:",
- "asirra-nojs": "'''Për piasì, ch'a abìlita JavaScript e ch'a spedissa torna la pàgina.'''",
- "asirra-failed": "Për piasì identìfica tute le figure ëd gat"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/pt.json b/extensions/ConfirmEdit/i18n/asirra/pt.json
deleted file mode 100644
index 75c660d4..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/pt.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Hamilton Abreu",
- "Luckas"
- ]
- },
- "asirra-desc": "Módulo Asirra para o ConfirmEdit",
- "asirra-edit": "Para proteger a wiki contra sistemas automatizados de inserção de ''spam'', pedimos que selecione só as fotografias de gatos na caixa abaixo:",
- "asirra-addurl": "A sua edição contém links externos novos. Para proteger a wiki contra sistemas automatizados de inserção de ''spam'', pedimos que selecione só as fotografias de gatos na caixa abaixo:",
- "asirra-badlogin": "Para proteger a wiki contra sistemas automatizados de descoberta de palavras-chave, pedimos que selecione só as fotografias de gatos na caixa abaixo:",
- "asirra-createaccount": "Para proteger a wiki contra sistemas automatizados de criação de contas, pedimos que selecione só as fotografias de gatos na caixa abaixo:",
- "asirra-createaccount-fail": "Identifique corretamente os gatos, por favor.",
- "asirra-create": "Para proteger a wiki contra sistemas automatizados de criação de páginas, pedimos que selecione só as fotografias de gatos na caixa abaixo:",
- "asirra-nojs": "'''Possibilite o uso de JavaScript e reenvie a página, por favor.'''",
- "asirra-failed": "Identifique todas as imagens de gatos, por favor"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/qqq.json b/extensions/ConfirmEdit/i18n/asirra/qqq.json
deleted file mode 100644
index 4cb78990..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/qqq.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "2nd-player",
- "Beta16",
- "Raymond",
- "Shirayuki"
- ]
- },
- "asirra-desc": "{{desc|name=Asirra|url=http://www.mediawiki.org/wiki/Extension:Asirra}}",
- "asirra-edit": "{{Related|ConfirmEdit-edit}}",
- "asirra-addurl": "{{Related|ConfirmEdit-addurl}}",
- "asirra-badlogin": "{{Related|ConfirmEdit-badlogin}}",
- "asirra-createaccount": "{{Related|ConfirmEdit-createaccount}}",
- "asirra-createaccount-fail": "Used as failure message in JavaScript code.\n{{Related|ConfirmEdit-createaccount-fail}}",
- "asirra-create": "{{Related|ConfirmEdit-create}}",
- "asirra-nojs": "Used in HTML <code><nowiki><noscript></nowiki></code> tag.",
- "asirra-failed": "Used as alert message in JavaScript code."
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/roa-tara.json b/extensions/ConfirmEdit/i18n/asirra/roa-tara.json
deleted file mode 100644
index e55f55ec..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/roa-tara.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Joetaras"
- ]
- },
- "asirra-desc": "Module Asirra pe confermà le cangiaminde",
- "asirra-edit": "Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:",
- "asirra-addurl": "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije d'a fote 'ndruche jndr'à buatte aqquà sotte:",
- "asirra-badlogin": "Pe proteggere condre le futteminde automatece de le passuord, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:",
- "asirra-createaccount": "Pe proteggere condre le ccrejaziune automatece de le cunde, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:",
- "asirra-createaccount-fail": "Pe piacere idendifiche correttamende le categorije.",
- "asirra-create": "Pe proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:",
- "asirra-nojs": "'''Pe piacere abbilite JavaScript e conferme arrete 'a pàgene.'''",
- "asirra-failed": "Pe piacere idendifiche tutte le categorije de le immaggine"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/ru.json b/extensions/ConfirmEdit/i18n/asirra/ru.json
deleted file mode 100644
index d628aec8..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/ru.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "DCamer",
- "Lockal",
- "Okras"
- ]
- },
- "asirra-desc": "Модуль Asirra для ConfirmEdit",
- "asirra-edit": "В целях защиты проекта от автоматического спама в правках, просим вас выбрать среди нижеприведённых изображений только фотографии кошек:",
- "asirra-addurl": "Ваша правка содержит новые внешние ссылки. В целях защиты проекта от автоматического спама в правках просим вас выбрать среди нижеприведённых изображений только фотографии кошек:",
- "asirra-badlogin": "В целях защиты от автоматического подбора пароля просим вас выбрать среди нижеприведённых изображений только фотографии кошек:",
- "asirra-createaccount": "В целях защиты от автоматического создания учётных записей просим вас выбрать среди нижеприведённых изображений только фотографии кошек:",
- "asirra-createaccount-fail": "Пожалуйста правильно идентифицируйте котов.",
- "asirra-create": "В целях защиты от автоматического создания страниц просим вас выбрать среди нижеприведённых изображений только фотографии кошек:",
- "asirra-nojs": "'''Пожалуйста, включите JavaScript и обновите страницу.'''",
- "asirra-failed": "Пожалуйста, идентифицируйте все фотографии кота"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/si.json b/extensions/ConfirmEdit/i18n/asirra/si.json
deleted file mode 100644
index bd853b93..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/si.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "පසිඳු කාවින්ද"
- ]
- },
- "asirra-desc": "ConfirmEdit සඳහා Asirra මොඩියුලය",
- "asirra-failed": "කරුණාකර සියලුම cat පින්තූරයන් හඳුනාගන්න"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/sv.json b/extensions/ConfirmEdit/i18n/asirra/sv.json
deleted file mode 100644
index a99278b2..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/sv.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Jopparn",
- "Rotsee",
- "Tobulos1",
- "WikiPhoenix",
- "Lokal Profil"
- ]
- },
- "asirra-desc": "Asirra-modul för ConfirmEdit",
- "asirra-edit": "För att skydda wikin mot spam ber vi dig att markera de fotografier som föreställer katter i rutan nedan:",
- "asirra-addurl": "Din redigering innehåller nya externa länkar. För att skydda wikin mot automatiserat redigerings-spam ber vi dig att endast markera fotografierna på katter i rutan nedan:",
- "asirra-badlogin": "För att skydda wikin mot automatiserade försök att knäcka lösenord ber vi dig att endast markera fotografierna på katter i rutan nedan:",
- "asirra-createaccount": "För att skydda wikin mot automatiserat kontoskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:",
- "asirra-createaccount-fail": "Vänligen identifiera katterna korrekt.",
- "asirra-create": "För att skydda wikin mot automatiserat sidskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:",
- "asirra-nojs": "'''Var god aktivera JavaScript och hämta sidan igen.'''",
- "asirra-failed": "Var god identifiera alla kattbilder"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/tl.json b/extensions/ConfirmEdit/i18n/asirra/tl.json
deleted file mode 100644
index 9f0bb4bd..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/tl.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "AnakngAraw"
- ]
- },
- "asirra-desc": "Modyul ng Asirra para sa ConfirmEdit",
- "asirra-edit": "Upang makatulong sa pagprutekta laban sa kusang basurang pamamatnugot, paki piliin iyong mga litrato lamang ng pusa na nasa loob ng kahong nasa ibaba:",
- "asirra-addurl": "Ang pagbabago mo ay nagsasama ng bagong panlabas na mga kawing. Upang makatulong sa pagprutekta laban sa kusang paglusob ng basurang-liham, paki piliin iyong mga litrato lamang ng pusa na nasa loob ng kahong nasa ibaba:",
- "asirra-badlogin": "Upang makatulong sa pagprutekta laban sa kusang pag-alam ng hudyat, paki piliin lamang iyong mga litrato ng pusa na nasa loob ng kahong nasa ibaba:",
- "asirra-createaccount": "Upang makatulong sa pagprutekta laban sa kusang paglikha ng akawnt, paki piliin lamang iyong mga litrato ng pusa na nasa loob ng kahong nasa ibaba:",
- "asirra-createaccount-fail": "Paki kilalanin ng tama ang mga pusa.",
- "asirra-create": "Upang makatulong sa pagprutekta laban sa kusang paglikha ng pahina, paki piliin lamang iyong mga litrato ng pusa na nasa loob ng kahong nasa ibaba:",
- "asirra-nojs": "'''Paki paganahin ang JavaScript at muling ipasa ang pahina.'''",
- "asirra-failed": "Paki kilalanin ang lahat ng mga imahe ng pusa"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/uk.json b/extensions/ConfirmEdit/i18n/asirra/uk.json
deleted file mode 100644
index 6438a504..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/uk.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Andriykopanytsia",
- "Base"
- ]
- },
- "asirra-desc": "Модуль Asirra для ConfirmEdit",
- "asirra-edit": "З метою захисту вікі від автоматичного спаму у статтях, просимо вас обрати фотографії кота, у блоці нижче:",
- "asirra-addurl": "Ваше повідомлення включає нові зовнішні посилання. З метою захисту вікі проти автоматичного спаму у статтях, просимо вас обрати фотографії кота, у блоці нижче:",
- "asirra-badlogin": "З метою захисту вікі проти автоматичного підбору паролю, просимо вас обрати фотографії кота у блоці нижче:",
- "asirra-createaccount": "З метою захисту вікі проти автоматичного створення облікових записів просимо вас обрати фотографії кота у блоці нижче:",
- "asirra-createaccount-fail": "Будь ласка, правильно ідентифікуйте котів.",
- "asirra-create": "З метою захисту вікі проти автоматичного створення статей просимо вас обрати фотографії кота у блоці нижче:",
- "asirra-nojs": "'''Будь ласка увімкніть JavaScript і оновіть сторінку.'''",
- "asirra-failed": "Будь ласка, ідентифікуйте усі фотографії кота"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/wa.json b/extensions/ConfirmEdit/i18n/asirra/wa.json
deleted file mode 100644
index 6dc5a815..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/wa.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Srtxg"
- ]
- },
- "asirra-desc": "Module Asirra pol passete d' acertinaedje des candjmints (ConfirmEdit)",
- "asirra-edit": "Po s' mete a houte des des robots di spam, nos vs dimandans d' acertiner ki vos estoz bén ene djin, po çoula tchoezixhoz seulmint les imådjes avou des tchets e l' boesse chal pa dzo:",
- "asirra-addurl": "Dins vos candjmints i gn a des dfoûtrinnès hårdêyes (URL).\nPo s' mete a houte des des robots di spam, nos vs dimandans d' acertiner ki vos estoz bén ene djin, po çoula tchoezixhoz seulmint les imådjes avou des tchets e l' boesse chal pa dzo:",
- "asirra-badlogin": "Po s' mete a houte des des robots ki sayèt d' adviner les screts, nos vs dimandans d' acertiner ki vos estoz bén ene djin, po çoula tchoezixhoz seulmint les imådjes avou des tchets e l' boesse chal pa dzo:",
- "asirra-createaccount": "Po s' mete a houte des des robots k' ahivèt des contes otomaticmint, nos vs dimandans d' acertiner ki vos estoz bén ene djin, po çoula tchoezixhoz seulmint les imådjes avou des tchets e l' boesse chal pa dzo:",
- "asirra-createaccount-fail": "Tchoezixhoz comifåt les tchets (les biesses ki gnawèt).",
- "asirra-create": "Po s' mete a houte des des robots k' ahivèt des pådjes otomaticmint, nos vs dimandans d' acertiner ki vos estoz bén ene djin, po çoula tchoezixhoz seulmint les imådjes avou des tchets e l' boesse chal pa dzo:",
- "asirra-nojs": "'''Metoz s' i vs plait en alaedje li JavaScrit et s' revoyî l' pådje.'''",
- "asirra-failed": "Idintifyî totes les imådjes avou des tchets"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/zh-hans.json b/extensions/ConfirmEdit/i18n/asirra/zh-hans.json
deleted file mode 100644
index 1675e6ae..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/zh-hans.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Fantasticfears",
- "Hzy980512",
- "Mywood"
- ]
- },
- "asirra-desc": "用于确认编辑的Asirra模块",
- "asirra-edit": "为保护本wiki免受自动垃圾程序的破坏,我们恳请你在下面的方框中选出猫的图片:",
- "asirra-addurl": "你的编辑包含新的外部链接。为保护本wiki免受自动垃圾程序的破坏,我们恳请你在下面的方框中选出猫的图片:",
- "asirra-badlogin": "为保护本wiki免受自动密码破解的破坏,我们恳请你在下面的方框中选出猫的图片:",
- "asirra-createaccount": "为保护本wiki免受自动账户创建的破坏,我们恳请你在下面的方框中选出猫的图片:",
- "asirra-createaccount-fail": "请选出正确的猫的图片。",
- "asirra-create": "为保护本wiki免受自动页面创建的破坏,我们恳请你在下面的方框中选出猫的图片:",
- "asirra-nojs": "'''请启用JavaScript并重新提交页面。'''",
- "asirra-failed": "请选出所有猫的图片"
-}
diff --git a/extensions/ConfirmEdit/i18n/asirra/zh-hant.json b/extensions/ConfirmEdit/i18n/asirra/zh-hant.json
deleted file mode 100644
index 39bbdf63..00000000
--- a/extensions/ConfirmEdit/i18n/asirra/zh-hant.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Justincheng12345",
- "Cwlin0416"
- ]
- },
- "asirra-desc": "ConfirmEdit 的 Asirra 模組",
- "asirra-edit": "為了防止垃圾編輯程式,我們要麻煩您在下面的方框中選出貓的圖片:",
- "asirra-addurl": "您的編輯使用了新的外部連結。為了防止垃圾編輯程式,我們要麻煩您在下面的方框中選出貓的圖片:",
- "asirra-badlogin": "為了防止密碼破解程式,我們要麻煩您在下面的方框中選出貓的圖片:",
- "asirra-createaccount": "為了防止自動註冊程式,我們要麻煩您在下面的方框中選出貓的圖片:",
- "asirra-createaccount-fail": "請再正確選擇貓的圖片。",
- "asirra-create": "為了防止自動建立頁面程式,我們要麻煩您在下面的方框中選出貓的圖片:",
- "asirra-nojs": "'''請開啟 JavaScript 並重新送出頁面。'''",
- "asirra-failed": "請選出所有貓的圖片"
-}
diff --git a/extensions/ConfirmEdit/resources/ext.confirmEdit.asirra.js b/extensions/ConfirmEdit/resources/ext.confirmEdit.asirra.js
deleted file mode 100644
index 34296d03..00000000
--- a/extensions/ConfirmEdit/resources/ext.confirmEdit.asirra.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*======================================================================*\
-|| #################################################################### ||
-|| # Asirra module for ConfirmEdit by Bachsau # ||
-|| # ---------------------------------------------------------------- # ||
-|| # This code is released into public domain, in the hope that it # ||
-|| # will be useful, but without any warranty. # ||
-|| # ------------ YOU CAN DO WITH IT WHATEVER YOU LIKE! ------------- # ||
-|| #################################################################### ||
-\*======================================================================*/
-
-jQuery( function( $ ) {
- // Selectors for create account, login, and page edit forms.
- var asirraform = $( 'form#userlogin2, #userloginForm form, form#editform' );
- var submitButtonClicked = document.createElement("input");
- var passThroughFormSubmit = false;
-
- function PrepareSubmit() {
- submitButtonClicked.type = "hidden";
- var inputFields = asirraform.find( "input" );
- for (var i=0; i<inputFields.length; i++) {
- if (inputFields[i].type === "submit") {
- inputFields[i].onclick = function(event) {
- submitButtonClicked.name = this.name;
- submitButtonClicked.value = this.value;
- }
- }
- }
-
- asirraform.submit( function() {
- return MySubmitForm();
- } );
- }
-
- function MySubmitForm() {
- if (passThroughFormSubmit) {
- return true;
- }
- Asirra_CheckIfHuman(HumanCheckComplete);
- return false;
- }
-
- function HumanCheckComplete(isHuman) {
- if (!isHuman) {
- window.alert( mediaWiki.msg( 'asirra-failed' ) );
- } else {
- asirraform.append(submitButtonClicked);
- passThroughFormSubmit = true;
- asirraform.submit();
- }
- }
-
- PrepareSubmit();
-
-} );
diff --git a/extensions/Gadgets/tests/GadgetTest.php b/extensions/Gadgets/tests/GadgetTest.php
new file mode 100644
index 00000000..8fd09295
--- /dev/null
+++ b/extensions/Gadgets/tests/GadgetTest.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * @group Gadgets
+ */
+
+class GadgetsTest extends MediaWikiTestCase {
+ private function create( $line ) {
+ $g = Gadget::newFromDefinition( $line );
+ $this->assertInstanceOf( 'Gadget', $g );
+
+ return $g;
+ }
+
+ function testInvalidLines() {
+ $this->assertFalse( Gadget::newFromDefinition( '' ) );
+ $this->assertFalse( Gadget::newFromDefinition( '<foo|bar>' ) );
+ }
+
+ function testSimpleCases() {
+ $g = $this->create( '* foo bar| foo.css|foo.js|foo.bar' );
+ $this->assertEquals( 'foo_bar', $g->getName() );
+ $this->assertEquals( 'ext.gadget.foo_bar', $g->getModuleName() );
+ $this->assertEquals( array( 'Gadget-foo.js' ), $g->getScripts() );
+ $this->assertEquals( array( 'Gadget-foo.css' ), $g->getStyles() );
+ $this->assertEquals( array( 'Gadget-foo.js', 'Gadget-foo.css' ),
+ $g->getScriptsAndStyles() );
+ $this->assertEquals( array( 'Gadget-foo.js' ), $g->getLegacyScripts() );
+ $this->assertFalse( $g->supportsResourceLoader() );
+ $this->assertTrue( $g->hasModule() );
+ }
+
+ function testRLtag() {
+ $g = $this->create( '*foo [ResourceLoader]|foo.js|foo.css' );
+ $this->assertEquals( 'foo', $g->getName() );
+ $this->assertTrue( $g->supportsResourceLoader() );
+ $this->assertEquals( 0, count( $g->getLegacyScripts() ) );
+ }
+
+ function testDependencies() {
+ $g = $this->create( '* foo[ResourceLoader|dependencies=jquery.ui]|bar.js' );
+ $this->assertEquals( array( 'Gadget-bar.js' ), $g->getScripts() );
+ $this->assertTrue( $g->supportsResourceLoader() );
+ $this->assertEquals( array( 'jquery.ui' ), $g->getDependencies() );
+ }
+
+ function testPreferences() {
+ $prefs = array();
+
+ Gadget::loadStructuredList( '* foo | foo.js
+==keep-section1==
+* bar| bar.js
+==remove-section==
+* baz [rights=embezzle] |baz.js
+==keep-section2==
+* quux [rights=read] | quux.js' );
+ $this->assertTrue( GadgetHooks::getPreferences( new User, $prefs ), 'GetPrefences hook should return true' );
+
+ $options = $prefs['gadgets']['options'];
+ $this->assertFalse( isset( $options['&lt;gadget-section-remove-section&gt;'] ), 'Must not show empty sections' );
+ $this->assertTrue( isset( $options['&lt;gadget-section-keep-section1&gt;'] ) );
+ $this->assertTrue( isset( $options['&lt;gadget-section-keep-section2&gt;'] ) );
+ }
+}
diff --git a/extensions/LocalisationUpdate/tests/phpunit/Makefile b/extensions/LocalisationUpdate/tests/phpunit/Makefile
new file mode 100644
index 00000000..e98c12ca
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/phpunit/Makefile
@@ -0,0 +1,12 @@
+ifndef MW_INSTALL_PATH
+ MW_INSTALL_PATH=../../../..
+endif
+
+DIRS=reader
+
+default:
+ php ${MW_INSTALL_PATH}/tests/phpunit/phpunit.php .
+
+.PHONY: *Test.php $(DIRS)
+*Test.php $(DIRS):
+ php ${MW_INSTALL_PATH}/tests/phpunit/phpunit.php $@
diff --git a/extensions/LocalisationUpdate/tests/phpunit/UpdaterTest.php b/extensions/LocalisationUpdate/tests/phpunit/UpdaterTest.php
new file mode 100644
index 00000000..ce742cba
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/phpunit/UpdaterTest.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class LU_UpdaterTest extends MediaWikiTestCase {
+ public function testIsDirectory() {
+ $updater = new LU_Updater();
+
+ $this->assertTrue(
+ $updater->isDirectory( '/IP/extensions/Translate/i18n/*.json' ),
+ 'Extension json files are a file pattern'
+ );
+
+ $this->assertFalse(
+ $updater->isDirectory( '/IP/extensions/Translate/Translate.i18n.php' ),
+ 'Extension php file is not a pattern'
+ );
+ }
+
+ public function testExpandRemotePath() {
+ $updater = new LU_Updater();
+ $repos = array( 'main' => 'file:///repos/%NAME%/%SOME-VAR%' );
+
+ $info = array(
+ 'repo' => 'main',
+ 'name' => 'product',
+ 'some-var' => 'file',
+ );
+ $this->assertEquals(
+ 'file:///repos/product/file',
+ $updater->expandRemotePath( $info, $repos ),
+ 'Variables are expanded correctly'
+ );
+ }
+
+ public function testReadMessages() {
+ $updater = $updater = new LU_Updater();
+
+ $input = array( 'file' => 'Hello World!' );
+ $output = array( 'en' => array( 'key' => $input['file'] ) );
+
+ $reader = $this->getMock( 'LU_Reader' );
+ $reader
+ ->expects( $this->once() )
+ ->method( 'parse' )
+ ->will( $this->returnValue( $output ) );
+
+ $factory = $this->getMock( 'LU_ReaderFactory' );
+ $factory
+ ->expects( $this->once() )
+ ->method( 'getReader' )
+ ->will( $this->returnValue( $reader ) );
+
+ $observed = $updater->readMessages( $factory, $input );
+ $this->assertEquals( $output, $observed, 'Tries to parse given file' );
+ }
+
+ public function testFindChangedTranslations() {
+ $updater = $updater = new LU_Updater();
+
+ $origin = array(
+ 'A' => '1',
+ 'C' => '3',
+ 'D' => '4',
+ );
+ $remote = array(
+ 'A' => '1', // No change key
+ 'B' => '2', // New key
+ 'C' => '33', // Changed key
+ 'D' => '44', // Blacklisted key
+ );
+ $blacklist = array( 'D' => 0 );
+ $expected = array( 'B' => '2', 'C' => '33' );
+ $observed = $updater->findChangedTranslations( $origin, $remote, $blacklist );
+ $this->assertEquals( $expected, $observed, 'Changed and new keys returned' );
+ }
+}
diff --git a/extensions/LocalisationUpdate/tests/phpunit/finder/FinderTest.php b/extensions/LocalisationUpdate/tests/phpunit/finder/FinderTest.php
new file mode 100644
index 00000000..8cc0f7d7
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/phpunit/finder/FinderTest.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class LU_FinderTest extends MediaWikiTestCase {
+ public function testGetComponents() {
+ $finder = new LU_Finder(
+ array(
+ 'TranslateSearch' => '/IP/extensions/Translate/TranslateSearch.i18n.php',
+ 'Babel' => '/IP/extensions/Babel/Babel.i18n.php',
+ ),
+ array(
+ 'Babel' => '/IP/extensions/Babel/i18n',
+ 'Door' => array(
+ 'core' => '/IP/extensions/Door/i18n/core',
+ 'extra' => '/IP/extensions/Door/i18n/extra',
+ ),
+ ),
+ '/IP'
+ );
+ $observed = $finder->getComponents();
+
+ $expected = array(
+ 'repo' => 'mediawiki',
+ 'orig' => "file:///IP/languages/messages/Messages*.php",
+ 'path' => 'languages/messages/Messages*.php',
+ );
+ $this->assertArrayHasKey( 'core', $observed );
+ $this->assertSame( $expected, $observed['core'], 'Core php file' );
+
+ $expected = array(
+ 'repo' => 'extension',
+ 'name' => 'Translate',
+ 'orig' => 'file:///IP/extensions/Translate/TranslateSearch.i18n.php',
+ 'path' => 'TranslateSearch.i18n.php'
+ );
+ $this->assertArrayHasKey( 'TranslateSearch', $observed );
+ $this->assertSame( $expected, $observed['TranslateSearch'], 'PHP only extension' );
+
+ $expected = array(
+ 'repo' => 'extension',
+ 'name' => 'Babel',
+ 'orig' => 'file:///IP/extensions/Babel/i18n/*.json',
+ 'path' => 'i18n/*.json'
+ );
+ $this->assertArrayHasKey( 'Babel-0', $observed );
+ $this->assertSame( $expected, $observed['Babel-0'], 'PHP&JSON extension' );
+
+ $expected = array(
+ 'repo' => 'extension',
+ 'name' => 'Door',
+ 'orig' => 'file:///IP/extensions/Door/i18n/core/*.json',
+ 'path' => 'i18n/core/*.json'
+ );
+ $this->assertArrayHasKey( 'Door-core', $observed );
+ $this->assertSame( $expected, $observed['Door-core'], 'Multidir json extension' );
+
+ $expected = array(
+ 'repo' => 'extension',
+ 'name' => 'Door',
+ 'orig' => 'file:///IP/extensions/Door/i18n/extra/*.json',
+ 'path' => 'i18n/extra/*.json'
+ );
+ $this->assertArrayHasKey( 'Door-extra', $observed );
+ $this->assertSame( $expected, $observed['Door-extra'], 'Multidir json extension' );
+ }
+}
diff --git a/extensions/LocalisationUpdate/tests/phpunit/reader/JSONReaderTest.php b/extensions/LocalisationUpdate/tests/phpunit/reader/JSONReaderTest.php
new file mode 100644
index 00000000..4bb53af9
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/phpunit/reader/JSONReaderTest.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class LU_JSONReaderTest extends MediaWikiTestCase {
+ /**
+ * @dataProvider parseProvider
+ */
+ public function testParse( $input, $expected, $comment ) {
+ $reader = new LU_JSONReader( 'xx' );
+ $observed = $reader->parse( $input );
+ $this->assertEquals( $expected, $observed['xx'], $comment );
+ }
+
+ public function parseProvider() {
+ return array(
+ array(
+ '{}',
+ array(),
+ 'empty file',
+ ),
+ array(
+ '{"key":"value"}',
+ array( 'key' => 'value' ),
+ 'file with one string',
+ ),
+ array(
+ '{"@metadata":{"authors":["Nike"]},"key":"value2"}',
+ array( 'key' => 'value2' ),
+ '@metadata is ignored',
+ )
+ );
+ }
+}
diff --git a/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php b/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php
new file mode 100644
index 00000000..ee155b3a
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/phpunit/reader/ReaderFactoryTest.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * @file
+ * @author Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+class LU_ReaderFactoryTest extends MediaWikiTestCase {
+ /**
+ * @dataProvider getReaderProvider
+ */
+ public function testGetReader( $input, $expected, $comment ) {
+ $factory = new LU_ReaderFactory();
+ $reader = $factory->getReader( $input );
+ $observed = get_class( $reader );
+ $this->assertEquals( $expected, $observed, $comment );
+ }
+
+ public function getReaderProvider() {
+ return array(
+ array(
+ 'languages/messages/MessagesFi.php',
+ 'LU_PHPReader',
+ 'core php file',
+ ),
+ array(
+ 'extensions/Translate/Translate.i18n.php',
+ 'LU_PHPReader',
+ 'extension php file',
+ ),
+ array(
+ 'extension/Translate/i18n/core/de.json',
+ 'LU_JSONReader',
+ 'extension json file',
+ ),
+ );
+ }
+}
diff --git a/extensions/ParserFunctions/tests/ExpressionTest.php b/extensions/ParserFunctions/tests/ExpressionTest.php
new file mode 100644
index 00000000..169a9cb4
--- /dev/null
+++ b/extensions/ParserFunctions/tests/ExpressionTest.php
@@ -0,0 +1,76 @@
+<?php
+class ExpressionTest extends MediaWikiTestCase {
+
+ /**
+ * @var ExprParser
+ */
+ protected $parser;
+
+ protected function setUp() {
+ parent::setUp();
+ $this->parser = new ExprParser();
+ }
+
+ /**
+ * @dataProvider provideExpressions
+ */
+ function testExpression( $input, $expected ) {
+ $this->assertEquals(
+ $expected,
+ $this->parser->doExpression( $input )
+ );
+ }
+
+ function provideExpressions() {
+ return array(
+ array( '1 or 0', '1' ),
+ array( 'not (1 and 0)', '1' ),
+ array( 'not 0', '1' ),
+ array( '4 < 5', '1' ),
+ array( '-5 < 2', '1' ),
+ array( '-2 <= -2', '1' ),
+ array( '4 > 3', '1' ),
+ array( '4 > -3', '1' ),
+ array( '5 >= 2', '1' ),
+ array( '2 >= 2', '1' ),
+ array( '1 != 2', '1' ),
+ array( '-4 * -4 = 4 * 4', '1' ),
+ array( 'not (1 != 1)', '1' ),
+ array( '1 + 1', '2' ),
+ array( '-1 + 1', '0' ),
+ array( '+1 + 1', '2' ),
+ array( '4 * 4', '16' ),
+ array( '(1/3) * 3', '1' ),
+ array( '3 / 1.5', '2' ),
+ array( '3 / 0.2', '15' ),
+ array( '3 / ( 2.0 * 0.1 )', '15' ),
+ array( '3 / ( 2.0 / 10 )', '15' ),
+ array( '3 / (- 0.2 )', '-15' ),
+ array( '3 / abs( 0.2 )', '15' ),
+ array( '3 mod 2', '1' ),
+ array( '1e4', '10000' ),
+ array( '1e-2', '0.01' ),
+ array( '4.0 round 0', '4' ),
+ array( 'ceil 4', '4' ),
+ array( 'floor 4', '4' ),
+ array( '4.5 round 0', '5' ),
+ array( '4.2 round 0', '4' ),
+ array( '-4.2 round 0', '-4' ),
+ array( '-4.5 round 0', '-5' ),
+ array( '-2.0 round 0', '-2' ),
+ array( 'ceil -3', '-3' ),
+ array( 'floor -6.0', '-6' ),
+ array( 'ceil 4.2', '5' ),
+ array( 'ceil -4.5', '-4' ),
+ array( 'floor -4.5', '-5' ),
+ array( 'abs(-2)', '2' ),
+ array( 'ln(exp(1))', '1' ),
+ array( 'trunc(4.5)', '4' ),
+ array( 'trunc(-4.5)', '-4' ),
+ array( '123 fmod (2^64-1)', '123' ),
+ array( '5.7 mod 1.3', '0' ),
+ array( '5.7 fmod 1.3', '0.5' ),
+ );
+ }
+}
+
diff --git a/extensions/PdfHandler/COPYING b/extensions/PdfHandler/COPYING
new file mode 100644
index 00000000..d159169d
--- /dev/null
+++ b/extensions/PdfHandler/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php b/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php
new file mode 100644
index 00000000..aba204f2
--- /dev/null
+++ b/extensions/PdfHandler/CreatePdfThumbnailsJob.class.php
@@ -0,0 +1,126 @@
+<?php
+
+class CreatePdfThumbnailsJob extends Job {
+ /**
+ * Flags for thumbnail jobs
+ */
+ const BIG_THUMB = 1;
+ const SMALL_THUMB = 2;
+
+ /**
+ * Construct a thumbnail job
+ *
+ * @param $title Title Title object
+ * @param $params array Associative array of options:
+ * page: page number for which the thumbnail will be created
+ * jobtype: CreatePDFThumbnailsJob::BIG_THUMB or CreatePDFThumbnailsJob::SMALL_THUMB
+ * BIG_THUMB will create a thumbnail visible for full thumbnail view,
+ * SMALL_THUMB will create a thumbnail shown in "previous page"/"next page" boxes
+ *
+ */
+ public function __construct( $title, $params ) {
+ parent::__construct( 'createPdfThumbnailsJob', $title, $params );
+ }
+
+ /**
+ * Run a thumbnail job on a given PDF file.
+ * @return bool true
+ */
+ public function run() {
+ if ( !isset( $this->params['page'] ) ) {
+ wfDebugLog('thumbnails', 'A page for thumbnails job of ' . $this->title->getText() . ' was not specified! That should never happen!');
+ return true; // no page set? that should never happen
+ }
+
+ $file = wfLocalFile( $this->title ); // we just want a local file
+ if ( !$file ) {
+ return true; // Just silently fail, perhaps the file was already deleted, don't bother
+ }
+
+ switch ($this->params['jobtype']) {
+ case self::BIG_THUMB:
+ global $wgImageLimits;
+ // Ignore user preferences, do default thumbnails
+ // everything here shamelessy copied and reused from includes/ImagePage.php
+ $sizeSel = User::getDefaultOption( 'imagesize' );
+
+ // The user offset might still be incorrect, specially if
+ // $wgImageLimits got changed (see bug #8858).
+ if ( !isset( $wgImageLimits[$sizeSel] ) ) {
+ // Default to the first offset in $wgImageLimits
+ $sizeSel = 0;
+ }
+ $max = $wgImageLimits[$sizeSel];
+ $maxWidth = $max[0];
+ $maxHeight = $max[1];
+
+ $width_orig = $file->getWidth( $this->params['page'] );
+ $width = $width_orig;
+ $height_orig = $file->getHeight( $this->params['page'] );
+ $height = $height_orig;
+ if ( $width > $maxWidth || $height > $maxHeight ) {
+ # Calculate the thumbnail size.
+ # First case, the limiting factor is the width, not the height.
+ if ( $width / $height >= $maxWidth / $maxHeight ) {
+ //$height = round( $height * $maxWidth / $width );
+ $width = $maxWidth;
+ # Note that $height <= $maxHeight now.
+ } else {
+ $newwidth = floor( $width * $maxHeight / $height );
+ //$height = round( $height * $newwidth / $width );
+ $width = $newwidth;
+ # Note that $height <= $maxHeight now, but might not be identical
+ # because of rounding.
+ }
+ $transformParams = array( 'page' => $this->params['page'], 'width' => $width );
+ $file->transform( $transformParams );
+ }
+ break;
+
+ case self::SMALL_THUMB:
+ Linker::makeThumbLinkObj( $this->title, $file, '', '', 'none', array( 'page' => $this->params['page'] ) );
+ break;
+ }
+
+ return true;
+ }
+
+ /**
+ * @param $upload UploadBase
+ * @param $mime
+ * @param $error
+ * @return bool
+ */
+ public static function insertJobs( $upload, $mime, &$error ) {
+ global $wgPdfCreateThumbnailsInJobQueue;
+ if ( !$wgPdfCreateThumbnailsInJobQueue ) {
+ return true;
+ }
+ if (!MimeMagic::singleton()->isMatchingExtension('pdf', $mime)) {
+ return true; // not a PDF, abort
+ }
+
+ $title = $upload->getTitle();
+ $uploadFile = $upload->getLocalFile();
+ if ( is_null( $uploadFile ) ) {
+ wfDebugLog('thumbnails', '$uploadFile seems to be null, should never happen...');
+ return true; // should never happen, but it's better to be secure
+ }
+
+ $metadata = $uploadFile->getMetadata();
+ $unserialized = unserialize( $metadata );
+ $pages = intval( $unserialized['Pages'] );
+
+ $jobs = array();
+ for ( $i = 1; $i <= $pages; $i++ ) {
+ $jobs[] = new CreatePdfThumbnailsJob( $title,
+ array( 'page' => $i, 'jobtype' => self::BIG_THUMB )
+ );
+ $jobs[] = new CreatePdfThumbnailsJob( $title,
+ array( 'page' => $i, 'jobtype' => self::SMALL_THUMB )
+ );
+ }
+ Job::batchInsert( $jobs );
+ return true;
+ }
+}
diff --git a/extensions/ConfirmEdit/Asirra.i18n.php b/extensions/PdfHandler/PdfHandler.i18n.php
index eb2d8fe3..46a34a6c 100644
--- a/extensions/ConfirmEdit/Asirra.i18n.php
+++ b/extensions/PdfHandler/PdfHandler.i18n.php
@@ -11,11 +11,11 @@
* This shim maintains compatibility back to MediaWiki 1.17.
*/
$messages = array();
-if ( !function_exists( 'wfJsonI18nShimc0e16a38c3b0633f' ) ) {
- function wfJsonI18nShimc0e16a38c3b0633f( $cache, $code, &$cachedData ) {
+if ( !function_exists( 'wfJsonI18nShim88f78f66a49810c2' ) ) {
+ function wfJsonI18nShim88f78f66a49810c2( $cache, $code, &$cachedData ) {
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] );
foreach ( $codeSequence as $csCode ) {
- $fileName = dirname( __FILE__ ) . "/i18n/asirra/$csCode.json";
+ $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
if ( is_readable( $fileName ) ) {
$data = FormatJson::decode( file_get_contents( $fileName ), true );
foreach ( array_keys( $data ) as $key ) {
@@ -31,5 +31,5 @@ if ( !function_exists( 'wfJsonI18nShimc0e16a38c3b0633f' ) ) {
return true;
}
- $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimc0e16a38c3b0633f';
+ $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim88f78f66a49810c2';
}
diff --git a/extensions/PdfHandler/PdfHandler.image.php b/extensions/PdfHandler/PdfHandler.image.php
new file mode 100644
index 00000000..49da7f4e
--- /dev/null
+++ b/extensions/PdfHandler/PdfHandler.image.php
@@ -0,0 +1,309 @@
+<?php
+/**
+ *
+ * Copyright © 2007 Xarax <jodeldi@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * inspired by djvuimage from Brion Vibber
+ * modified and written by xarax
+ */
+
+class PdfImage {
+
+ /**
+ * @param $filename
+ */
+ function __construct( $filename ) {
+ $this->mFilename = $filename;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isValid() {
+ return true;
+ }
+
+ /**
+ * @return array|bool
+ */
+ public function getImageSize() {
+ $data = $this->retrieveMetadata();
+ $size = self::getPageSize( $data, 1 );
+
+ if( $size ) {
+ $width = $size['width'];
+ $height = $size['height'];
+ return array( $width, $height, 'Pdf',
+ "width=\"$width\" height=\"$height\"" );
+ }
+ return false;
+ }
+
+ /**
+ * @param $data array
+ * @param $page
+ * @return array|bool
+ */
+ public static function getPageSize( $data, $page ) {
+ global $wgPdfHandlerDpi;
+
+ if( isset( $data['pages'][$page]['Page size'] ) ) {
+ $o = $data['pages'][$page]['Page size'];
+ } elseif( isset( $data['Page size'] ) ) {
+ $o = $data['Page size'];
+ } else {
+ $o = false;
+ }
+
+ if ( $o ) {
+ if( isset( $data['pages'][$page]['Page rot'] ) ) {
+ $r = $data['pages'][$page]['Page rot'];
+ } elseif( isset( $data['Page rot'] ) ) {
+ $r = $data['Page rot'];
+ } else {
+ $r = 0;
+ }
+ $size = explode( 'x', $o, 2 );
+
+ if ( $size ) {
+ $width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
+ $height = explode( ' ', trim( $size[1] ), 2 );
+ $height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
+ if ( ( $r/90 ) & 1 ) {
+ // Swap width and height for landscape pages
+ $t = $width;
+ $width = $height;
+ $height = $t;
+ }
+
+ return array(
+ 'width' => $width,
+ 'height' => $height
+ );
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @return array|bool|null
+ */
+ public function retrieveMetaData() {
+ global $wgPdfInfo, $wgPdftoText;
+
+ if ( $wgPdfInfo ) {
+ wfProfileIn( 'pdfinfo' );
+ $cmd = wfEscapeShellArg( $wgPdfInfo ) .
+ " -enc UTF-8 " . # Report metadata as UTF-8 text...
+ " -l 9999999 " . # Report page sizes for all pages
+ " -meta " . # Report XMP metadata
+ wfEscapeShellArg( $this->mFilename );
+ $retval = '';
+ $dump = wfShellExec( $cmd, $retval );
+ $data = $this->convertDumpToArray( $dump );
+ wfProfileOut( 'pdfinfo' );
+ } else {
+ $data = null;
+ }
+
+ # Read text layer
+ if ( isset( $wgPdftoText ) ) {
+ wfProfileIn( 'pdftotext' );
+ $cmd = wfEscapeShellArg( $wgPdftoText ) . ' '. wfEscapeShellArg( $this->mFilename ) . ' - ';
+ wfDebug( __METHOD__.": $cmd\n" );
+ $retval = '';
+ $txt = wfShellExec( $cmd, $retval );
+ wfProfileOut( 'pdftotext' );
+ if( $retval == 0 ) {
+ $txt = str_replace( "\r\n", "\n", $txt );
+ $pages = explode( "\f", $txt );
+ foreach( $pages as $page => $pageText ) {
+ # Get rid of invalid UTF-8, strip control characters
+ # Note we need to do this per page, as \f page feed would be stripped.
+ $pages[$page] = UtfNormal::cleanUp( $pageText );
+ }
+ $data['text'] = $pages;
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * @param $dump string
+ * @return array|bool
+ */
+ protected function convertDumpToArray( $dump ) {
+ if ( strval( $dump ) == '' ) {
+ return false;
+ }
+
+ $lines = explode( "\n", $dump );
+ $data = array();
+
+ // Metadata is always the last item, and spans multiple lines.
+ $inMetadata = false;
+
+ // Basically this loop will go through each line, splitting key value
+ // pairs on the colon, until it gets to a "Metadata:\n" at which point
+ // it will gather all remaining lines into the xmp key.
+ foreach( $lines as $line ) {
+ if ( $inMetadata ) {
+ # Handle XMP differently due to diffence in line break
+ $data['xmp'] .= "\n$line";
+ continue;
+ }
+ $bits = explode( ':', $line, 2 );
+ if( count( $bits ) > 1 ) {
+ $key = trim( $bits[0] );
+ if ( $key === 'Metadata' ) {
+ $inMetadata = true;
+ $data['xmp'] = '';
+ continue;
+ }
+ $value = trim( $bits[1] );
+ $matches = array();
+ // "Page xx rot" will be in poppler 0.20's pdfinfo output
+ // See https://bugs.freedesktop.org/show_bug.cgi?id=41867
+ if( preg_match( '/^Page +(\d+) (size|rot)$/', $key, $matches ) ) {
+ $data['pages'][$matches[1]][$matches[2] == 'size' ? 'Page size' : 'Page rot'] = $value;
+ } else {
+ $data[$key] = $value;
+ }
+ }
+ }
+ $data = $this->postProcessDump( $data );
+ return $data;
+ }
+
+ /**
+ * Postprocess the metadata (convert xmp into useful form, etc)
+ *
+ * This is used to generate the metadata table at the bottom
+ * of the image description page.
+ *
+ * @param $data Array metadata
+ * @return Array post-processed metadata
+ */
+ protected function postProcessDump( array $data ) {
+
+ $meta = new BitmapMetadataHandler();
+ $items = array();
+ foreach( $data as $key => $val ) {
+ switch ( $key ) {
+ case 'Title':
+ $items['ObjectName'] = $val;
+ break;
+ case 'Subject':
+ $items['ImageDescription'] = $val;
+ break;
+ case 'Keywords':
+ // Sometimes we have empty keywords. This seems
+ // to be a product of how pdfinfo deals with keywords
+ // with spaces in them. Filter such empty keywords
+ $keyList = array_filter( explode( ' ', $val ) );
+ if ( count( $keyList ) > 0 ) {
+ $items['Keywords'] = $keyList;
+ }
+ break;
+ case 'Author':
+ $items['Artist'] = $val;
+ break;
+ case 'Creator':
+ // Program used to create file.
+ // Different from program used to convert to pdf.
+ $items['Software'] = $val;
+ break;
+ case 'Producer':
+ // Conversion program
+ $items['pdf-Producer'] = $val;
+ break;
+ case 'ModTime':
+ $timestamp = wfTimestamp( TS_EXIF, $val );
+ if ( $timestamp ) {
+ // 'if' is just paranoia
+ $items['DateTime'] = $timestamp;
+ }
+ break;
+ case 'CreationTime':
+ $timestamp = wfTimestamp( TS_EXIF, $val );
+ if ( $timestamp ) {
+ $items['DateTimeDigitized'] = $timestamp;
+ }
+ break;
+ // These last two (version and encryption) I was unsure
+ // if we should include in the table, since they aren't
+ // all that useful to editors. I leaned on the side
+ // of including. However not including if file
+ // is optimized/linearized since that is really useless
+ // to an editor.
+ case 'PDF version':
+ $items['pdf-Version'] = $val;
+ break;
+ case 'Encrypted':
+ // @todo: The value isn't i18n-ised. The appropriate
+ // place to do that is in FormatMetadata.php
+ // should add a hook a there.
+ // For reference, if encrypted this fields value looks like:
+ // "yes (print:yes copy:no change:no addNotes:no)"
+ $items['pdf-Encrypted'] = $val;
+ break;
+ // Note 'pages' and 'Pages' are different keys (!)
+ case 'pages':
+ // A pdf document can have multiple sized pages in it.
+ // (However 95% of the time, all pages are the same size)
+ // get a list of all the unique page sizes in document.
+ // This doesn't do anything with rotation as of yet,
+ // mostly because I am unsure of what a good way to
+ // present that information to the user would be.
+ $pageSizes = array();
+ foreach( $val as $page ) {
+ if( isset( $page['Page size'] ) ) {
+ $pageSizes[ $page['Page size'] ] = true;
+ }
+ }
+
+ $pageSizeArray = array_keys( $pageSizes );
+ if ( count( $pageSizeArray ) > 0 ) {
+ $items['pdf-PageSize'] = $pageSizeArray;
+ }
+ break;
+ }
+
+ }
+ $meta->addMetadata( $items, 'native' );
+
+ if ( isset( $data['xmp'] ) && function_exists( 'xml_parser_create_ns' ) ) {
+ // func exists verifies that the xml extension required for XMPReader
+ // is present (Almost always is present)
+ // @todo: This only handles generic xmp properties. Would be improved
+ // by handling pdf xmp properties (pdf and pdfx) via XMPInfo hook.
+ $xmp = new XMPReader();
+ $xmp->parse( $data['xmp'] );
+ $xmpRes = $xmp->getResults();
+ foreach ( $xmpRes as $type => $xmpSection ) {
+ $meta->addMetadata( $xmpSection, $type );
+ }
+ }
+ unset( $data['xmp'] );
+ $data['mergedMetadata'] = $meta->getMetadataArray();
+ return $data;
+ }
+}
diff --git a/extensions/PdfHandler/PdfHandler.php b/extensions/PdfHandler/PdfHandler.php
new file mode 100644
index 00000000..f4e15657
--- /dev/null
+++ b/extensions/PdfHandler/PdfHandler.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * PDF Handler extension -- handler for viewing PDF files in image mode.
+ *
+ * @file
+ * @ingroup Extensions
+ * @author Martin Seidel (Xarax) <jodeldi@gmx.de>
+ * @copyright Copyright © 2007 Martin Seidel (Xarax) <jodeldi@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+# Not a valid entry point, skip unless MEDIAWIKI is defined
+if ( !defined( 'MEDIAWIKI' ) ) {
+ echo 'PdfHandler extension';
+ exit( 1 );
+}
+
+$wgExtensionCredits['media'][] = array(
+ 'path' => __FILE__,
+ 'name' => 'PDF Handler',
+ 'author' => array( 'Martin Seidel', 'Mike Połtyn' ),
+ 'descriptionmsg' => 'pdf-desc',
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:PdfHandler',
+);
+
+// External program requirements...
+$wgPdfProcessor = 'gs';
+$wgPdfPostProcessor = 'convert';
+$wgPdfInfo = 'pdfinfo';
+$wgPdftoText = 'pdftotext';
+
+$wgPdfOutputExtension = 'jpg';
+$wgPdfHandlerDpi = 150;
+$wgPdfHandlerJpegQuality = 95;
+
+// This setting, if enabled, will put creating thumbnails into a job queue,
+// so they do not have to be created on-the-fly,
+// but rather inconspicuously during normal wiki browsing
+$wgPdfCreateThumbnailsInJobQueue = false;
+
+// To upload new PDF files you'll need to do this too:
+// $wgFileExtensions[] = 'pdf';
+
+$dir = __DIR__ . '/';
+$wgMessagesDirs['PdfHandler'] = __DIR__ . '/i18n';
+$wgExtensionMessagesFiles['PdfHandler'] = $dir . 'PdfHandler.i18n.php';
+$wgAutoloadClasses['PdfImage'] = $dir . 'PdfHandler.image.php';
+$wgAutoloadClasses['PdfHandler'] = $dir . 'PdfHandler_body.php';
+$wgAutoloadClasses['CreatePdfThumbnailsJob'] = $dir . 'CreatePdfThumbnailsJob.class.php';
+$wgMediaHandlers['application/pdf'] = 'PdfHandler';
+$wgJobClasses['createPdfThumbnailsJob'] = 'CreatePdfThumbnailsJob';
+$wgHooks['UploadVerifyFile'][] = 'CreatePdfThumbnailsJob::insertJobs';
diff --git a/extensions/PdfHandler/PdfHandler_body.php b/extensions/PdfHandler/PdfHandler_body.php
new file mode 100644
index 00000000..2a08a95b
--- /dev/null
+++ b/extensions/PdfHandler/PdfHandler_body.php
@@ -0,0 +1,386 @@
+<?php
+/**
+ * Copyright © 2007 Martin Seidel (Xarax) <jodeldi@gmx.de>
+ *
+ * Inspired by djvuhandler from Tim Starling
+ * Modified and written by Xarax
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+class PdfHandler extends ImageHandler {
+
+ /**
+ * @return bool
+ */
+ function isEnabled() {
+ global $wgPdfProcessor, $wgPdfPostProcessor, $wgPdfInfo;
+
+ if ( !isset( $wgPdfProcessor ) || !isset( $wgPdfPostProcessor ) || !isset( $wgPdfInfo ) ) {
+ wfDebug( "PdfHandler is disabled, please set the following\n" );
+ wfDebug( "variables in LocalSettings.php:\n" );
+ wfDebug( "\$wgPdfProcessor, \$wgPdfPostProcessor, \$wgPdfInfo\n" );
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param $file
+ * @return bool
+ */
+ function mustRender( $file ) {
+ return true;
+ }
+
+ /**
+ * @param $file
+ * @return bool
+ */
+ function isMultiPage( $file ) {
+ return true;
+ }
+
+ /**
+ * @param $name
+ * @param $value
+ * @return bool
+ */
+ function validateParam( $name, $value ) {
+ if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) {
+ // Extra junk on the end of page, probably actually a caption
+ // e.g. [[File:Foo.pdf|thumb|Page 3 of the document shows foo]]
+ return false;
+ }
+ if ( in_array( $name, array( 'width', 'height', 'page' ) ) ) {
+ return ( $value > 0 );
+ }
+ return false;
+ }
+
+ /**
+ * @param $params array
+ * @return bool|string
+ */
+ function makeParamString( $params ) {
+ $page = isset( $params['page'] ) ? $params['page'] : 1;
+ if ( !isset( $params['width'] ) ) {
+ return false;
+ }
+ return "page{$page}-{$params['width']}px";
+ }
+
+ /**
+ * @param $str string
+ * @return array|bool
+ */
+ function parseParamString( $str ) {
+ $m = false;
+
+ if ( preg_match( '/^page(\d+)-(\d+)px$/', $str, $m ) ) {
+ return array( 'width' => $m[2], 'page' => $m[1] );
+ }
+
+ return false;
+ }
+
+ /**
+ * @param $params array
+ * @return array
+ */
+ function getScriptParams( $params ) {
+ return array(
+ 'width' => $params['width'],
+ 'page' => $params['page'],
+ );
+ }
+
+ /**
+ * @return array
+ */
+ function getParamMap() {
+ return array(
+ 'img_width' => 'width',
+ 'img_page' => 'page',
+ );
+ }
+
+ /**
+ * @param $width
+ * @param $height
+ * @param $msg
+ * @return MediaTransformError
+ */
+ protected function doThumbError( $width, $height, $msg ) {
+ return new MediaTransformError( 'thumbnail_error',
+ $width, $height, wfMessage( $msg )->inContentLanguage()->text() );
+ }
+
+ /**
+ * @param $image File
+ * @param $dstPath string
+ * @param $dstUrl string
+ * @param $params array
+ * @param $flags int
+ * @return MediaTransformError|MediaTransformOutput|ThumbnailImage|TransformParameterError
+ */
+ function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
+ global $wgPdfProcessor, $wgPdfPostProcessor, $wgPdfHandlerDpi, $wgPdfHandlerJpegQuality;
+
+ $metadata = $image->getMetadata();
+
+ if ( !$metadata ) {
+ return $this->doThumbError(
+ isset( $params['width'] ) ? $params['width'] : null,
+ isset( $params['height'] ) ? $params['height'] : null,
+ 'pdf_no_metadata'
+ );
+ }
+
+ if ( !$this->normaliseParams( $image, $params ) ) {
+ return new TransformParameterError( $params );
+ }
+
+ $width = $params['width'];
+ $height = $params['height'];
+ $page = $params['page'];
+
+ if ( $page > $this->pageCount( $image ) ) {
+ return $this->doThumbError( $width, $height, 'pdf_page_error' );
+ }
+
+ if ( $flags & self::TRANSFORM_LATER ) {
+ return new ThumbnailImage( $image, $dstUrl, $width, $height, false, $page );
+ }
+
+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
+ return $this->doThumbError( $width, $height, 'thumbnail_dest_directory' );
+ }
+
+ // Thumbnail extraction is very inefficient for large files.
+ // Provide a way to pool count limit the number of downloaders.
+ if ( $image->getSize() >= 1e7 ) { // 10MB
+ $work = new PoolCounterWorkViaCallback( 'GetLocalFileCopy', sha1( $image->getName() ),
+ array(
+ 'doWork' => function() use ( $image ) {
+ return $image->getLocalRefPath();
+ }
+ )
+ );
+ $srcPath = $work->execute();
+ } else {
+ $srcPath = $image->getLocalRefPath();
+ }
+
+ if ( $srcPath === false ) { // could not download original
+ return $this->doThumbError( $width, $height, 'filemissing' );
+ }
+
+ $cmd = '(' . wfEscapeShellArg(
+ $wgPdfProcessor,
+ "-sDEVICE=jpeg",
+ "-sOutputFile=-",
+ "-dFirstPage={$page}",
+ "-dLastPage={$page}",
+ "-r{$wgPdfHandlerDpi}",
+ "-dBATCH",
+ "-dNOPAUSE",
+ "-q",
+ $srcPath
+ );
+ $cmd .= " | " . wfEscapeShellArg(
+ $wgPdfPostProcessor,
+ "-depth",
+ "8",
+ "-quality",
+ $wgPdfHandlerJpegQuality,
+ "-resize",
+ $width,
+ "-",
+ $dstPath
+ );
+ $cmd .= ")";
+
+ wfProfileIn( 'PdfHandler' );
+ wfDebug( __METHOD__ . ": $cmd\n" );
+ $retval = '';
+ $err = wfShellExecWithStderr( $cmd, $retval );
+ wfProfileOut( 'PdfHandler' );
+
+ $removed = $this->removeBadFile( $dstPath, $retval );
+
+ if ( $retval != 0 || $removed ) {
+ wfDebugLog( 'thumbnail',
+ sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
+ wfHostname(), $retval, trim( $err ), $cmd ) );
+ return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
+ } else {
+ return new ThumbnailImage( $image, $dstUrl, $width, $height, $dstPath, $page );
+ }
+ }
+
+ /**
+ * @param $image File
+ * @param $path string
+ * @return PdfImage
+ */
+ function getPdfImage( $image, $path ) {
+ if ( !$image ) {
+ $pdfimg = new PdfImage( $path );
+ } elseif ( !isset( $image->pdfImage ) ) {
+ $pdfimg = $image->pdfImage = new PdfImage( $path );
+ } else {
+ $pdfimg = $image->pdfImage;
+ }
+
+ return $pdfimg;
+ }
+
+ /**
+ * @param $image File
+ * @return bool
+ */
+ function getMetaArray( $image ) {
+ if ( isset( $image->pdfMetaArray ) ) {
+ return $image->pdfMetaArray;
+ }
+
+ $metadata = $image->getMetadata();
+
+ if ( !$this->isMetadataValid( $image, $metadata ) ) {
+ wfDebug( "Pdf metadata is invalid or missing, should have been fixed in upgradeRow\n" );
+ return false;
+ }
+
+ wfProfileIn( __METHOD__ );
+ wfSuppressWarnings();
+ $image->pdfMetaArray = unserialize( $metadata );
+ wfRestoreWarnings();
+ wfProfileOut( __METHOD__ );
+
+ return $image->pdfMetaArray;
+ }
+
+ /**
+ * @param $image File
+ * @param $path string
+ * @return array|bool
+ */
+ function getImageSize( $image, $path ) {
+ return $this->getPdfImage( $image, $path )->getImageSize();
+ }
+
+ /**
+ * @param $ext
+ * @param $mime string
+ * @param $params null
+ * @return array
+ */
+ function getThumbType( $ext, $mime, $params = null ) {
+ global $wgPdfOutputExtension;
+ static $mime;
+
+ if ( !isset( $mime ) ) {
+ $magic = MimeMagic::singleton();
+ $mime = $magic->guessTypesForExtension( $wgPdfOutputExtension );
+ }
+ return array( $wgPdfOutputExtension, $mime );
+ }
+
+ /**
+ * @param $image File
+ * @param $path string
+ * @return string
+ */
+ function getMetadata( $image, $path ) {
+ return serialize( $this->getPdfImage( $image, $path )->retrieveMetaData() );
+ }
+
+ /**
+ * @param $image File
+ * @param $metadata string
+ * @return bool
+ */
+ function isMetadataValid( $image, $metadata ) {
+ if ( !$metadata || $metadata === serialize(array()) ) {
+ return self::METADATA_BAD;
+ } elseif ( strpos( $metadata, 'mergedMetadata' ) === false ) {
+ return self::METADATA_COMPATIBLE;
+ }
+ return self::METADATA_GOOD;
+ }
+
+ /**
+ * @param $image File
+ * @return bool|int
+ */
+ function formatMetadata( $image ) {
+ $meta = $image->getMetadata();
+
+ if ( !$meta ) {
+ return false;
+ }
+ wfSuppressWarnings();
+ $meta = unserialize( $meta );
+ wfRestoreWarnings();
+
+ if ( !isset( $meta['mergedMetadata'] )
+ || !is_array( $meta['mergedMetadata'] )
+ || count( $meta['mergedMetadata'] ) < 1
+ ) {
+ return false;
+ }
+
+ // Inherited from MediaHandler.
+ return $this->formatMetadataHelper( $meta['mergedMetadata'] );
+ }
+
+ /**
+ * @param $image
+ * @return bool|int
+ */
+ function pageCount( $image ) {
+ $data = $this->getMetaArray( $image );
+ if ( !$data || !isset( $data['Pages'] ) ) {
+ return false;
+ }
+ return intval( $data['Pages'] );
+ }
+
+ /**
+ * @param $image File
+ * @param $page int
+ * @return array|bool
+ */
+ function getPageDimensions( $image, $page ) {
+ $data = $this->getMetaArray( $image );
+ return PdfImage::getPageSize( $data, $page );
+ }
+
+ /**
+ * @param $image File
+ * @param $page int
+ * @return bool
+ */
+ function getPageText( $image, $page ) {
+ $data = $this->getMetaArray( $image, true );
+ if ( !$data || !isset( $data['text'] ) || !isset( $data['text'][$page - 1] ) ) {
+ return false;
+ }
+ return $data['text'][$page - 1];
+ }
+
+}
diff --git a/extensions/PdfHandler/i18n/af.json b/extensions/PdfHandler/i18n/af.json
new file mode 100644
index 00000000..0bb386a2
--- /dev/null
+++ b/extensions/PdfHandler/i18n/af.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Naudefj",
+ "පසිඳු කාවින්ද"
+ ]
+ },
+ "pdf-desc": "Handler vir die lees van PDF-lêers in beeld af",
+ "pdf_no_metadata": "Kan nie metadata uit PDF kry nie",
+ "pdf_page_error": "Bladsynommer kom nie in dokument voor nie"
+}
diff --git a/extensions/PdfHandler/i18n/aln.json b/extensions/PdfHandler/i18n/aln.json
new file mode 100644
index 00000000..38372cdb
--- /dev/null
+++ b/extensions/PdfHandler/i18n/aln.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Mdupont"
+ ]
+ },
+ "pdf-desc": "Mbajtës për shikimin PDF files në imazh mode",
+ "pdf_no_metadata": "Nuk mund të merrni nga metadata PDF",
+ "pdf_page_error": "numrin e faqes nuk është në varg"
+}
diff --git a/extensions/PdfHandler/i18n/an.json b/extensions/PdfHandler/i18n/an.json
new file mode 100644
index 00000000..ed321d67
--- /dev/null
+++ b/extensions/PdfHandler/i18n/an.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Juanpabl"
+ ]
+ },
+ "pdf-desc": "Maneyador ta veyer fichers PDF en modo imachen",
+ "pdf_no_metadata": "No s'obtenioron metadatos d'o PDF",
+ "pdf_page_error": "Numero de pachina difuera de rango"
+}
diff --git a/extensions/PdfHandler/i18n/ar.json b/extensions/PdfHandler/i18n/ar.json
new file mode 100644
index 00000000..6bd54a16
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ar.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Meno25",
+ "Mido",
+ "أحمد"
+ ]
+ },
+ "pdf-desc": "معالج عرض ملفات PDF في طور الصور",
+ "pdf_no_metadata": "تعذّر استخراج البيانات الفوقية من ملف PDF",
+ "pdf_page_error": "رقم الصفحة خارج عن النطاق",
+ "exif-pdf-producer": "برمجية التحويل",
+ "exif-pdf-version": "إصدارة صيغة PDF",
+ "exif-pdf-encrypted": "مُعمّى",
+ "exif-pdf-pagesize": "حجم الصفحة"
+}
diff --git a/extensions/PdfHandler/i18n/arz.json b/extensions/PdfHandler/i18n/arz.json
new file mode 100644
index 00000000..16b3a730
--- /dev/null
+++ b/extensions/PdfHandler/i18n/arz.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Meno25"
+ ]
+ },
+ "pdf-desc": "متحكم لرؤية ملفات PDF فى نمط صورة",
+ "pdf_no_metadata": "لم يمكن أخذ معلومات ميتا من PDF",
+ "pdf_page_error": "رقم الصفحة ليس فى النطاق"
+}
diff --git a/extensions/PdfHandler/i18n/as.json b/extensions/PdfHandler/i18n/as.json
new file mode 100644
index 00000000..bcd58e33
--- /dev/null
+++ b/extensions/PdfHandler/i18n/as.json
@@ -0,0 +1,13 @@
+{
+ "@metadata": {
+ "authors": [
+ "Bishnu Saikia"
+ ]
+ },
+ "pdf-desc": "পিডিএফ ফাইল ছবি হিচাপে ব্যৱহাৰৰ পদ্ধতি",
+ "pdf_no_metadata": "পি.ডি.এফ.ৰ পৰা মেটাডাটা উপলদ্ধ নহয়",
+ "pdf_page_error": "পৃষ্ঠাৰ নম্বৰ সীমাৰ ভিতৰত নাই",
+ "exif-pdf-producer": "ৰূপান্তৰক প্ৰগ্ৰাম",
+ "exif-pdf-version": "পি.ডি.এফ. ৰূপত সংস্কৰণ",
+ "exif-pdf-pagesize": "পৃষ্ঠাৰ আকাৰ"
+}
diff --git a/extensions/PdfHandler/i18n/ast.json b/extensions/PdfHandler/i18n/ast.json
new file mode 100644
index 00000000..b2ad9d48
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ast.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Xuacu"
+ ]
+ },
+ "pdf-desc": "Xestor pa ver los ficheros PDF en mou d'imaxe",
+ "pdf_no_metadata": "Nun se pudieron sacar los metadatos del PDF",
+ "pdf_page_error": "El númberu de la páxina nun ta nel rangu",
+ "exif-pdf-producer": "Programa de conversión",
+ "exif-pdf-version": "Versión del formatu PDF",
+ "exif-pdf-encrypted": "Cifráu",
+ "exif-pdf-pagesize": "Tamañu de la páxina"
+}
diff --git a/extensions/PdfHandler/i18n/azb.json b/extensions/PdfHandler/i18n/azb.json
new file mode 100644
index 00000000..d947868b
--- /dev/null
+++ b/extensions/PdfHandler/i18n/azb.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Amir a57"
+ ]
+ },
+ "exif-pdf-pagesize": "صحیفه اولچوسو"
+}
diff --git a/extensions/PdfHandler/i18n/ba.json b/extensions/PdfHandler/i18n/ba.json
new file mode 100644
index 00000000..451d0637
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ba.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Assele"
+ ]
+ },
+ "pdf-desc": "PDF файлдарҙы рәсемдәр рәүешендә ҡарау өсөн эшкәртеүсе ҡорал",
+ "pdf_no_metadata": "PDF-тан мета-мәғлүмәтте алыу мөмкин түгел",
+ "pdf_page_error": "Бит һаны биттәр һанынан ашҡан"
+}
diff --git a/extensions/PdfHandler/i18n/bcl.json b/extensions/PdfHandler/i18n/bcl.json
new file mode 100644
index 00000000..3614c142
--- /dev/null
+++ b/extensions/PdfHandler/i18n/bcl.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Geopoet"
+ ]
+ },
+ "pdf-desc": "An tagapagkapot para sa pagtatanaw kan PDF na mga sagunson na yaon sa moda nin imahe.",
+ "pdf_no_metadata": "Dae makakakua nin datos na meta gikan sa PDF.",
+ "pdf_page_error": "An numero kan pahina dae tabi abot.",
+ "exif-pdf-producer": "Programa nin kombersyon",
+ "exif-pdf-version": "Bersyon kan PDF pormat",
+ "exif-pdf-encrypted": "Enkriptado",
+ "exif-pdf-pagesize": "Sukol kan pahina"
+}
diff --git a/extensions/PdfHandler/i18n/be-tarask.json b/extensions/PdfHandler/i18n/be-tarask.json
new file mode 100644
index 00000000..95401de0
--- /dev/null
+++ b/extensions/PdfHandler/i18n/be-tarask.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "EugeneZelenko",
+ "Jim-by",
+ "Wizardist"
+ ]
+ },
+ "pdf-desc": "Апрацоўшчык для прагляду PDF-файлаў у выглядзе выяваў",
+ "pdf_no_metadata": "Немагчыма атрымаць мэта-зьвесткі з PDF-файла",
+ "pdf_page_error": "Нумар старонкі паза дыяпазонам",
+ "exif-pdf-producer": "Праграма канвэртацыі",
+ "exif-pdf-version": "Вэрсія фармату PDF",
+ "exif-pdf-encrypted": "Зашыфравана",
+ "exif-pdf-pagesize": "Памер старонкі"
+}
diff --git a/extensions/PdfHandler/i18n/bg.json b/extensions/PdfHandler/i18n/bg.json
new file mode 100644
index 00000000..e04fd36b
--- /dev/null
+++ b/extensions/PdfHandler/i18n/bg.json
@@ -0,0 +1,13 @@
+{
+ "@metadata": {
+ "authors": [
+ "DCLXVI",
+ "Stanqo",
+ "Turin"
+ ]
+ },
+ "pdf_no_metadata": "невъзможно е да бъдат извлечени метаданни от PDF",
+ "pdf_page_error": "Номерът на страница е извън обхвата",
+ "exif-pdf-encrypted": "Криптиране",
+ "exif-pdf-pagesize": "Размер на страницата"
+}
diff --git a/extensions/PdfHandler/i18n/bn.json b/extensions/PdfHandler/i18n/bn.json
new file mode 100644
index 00000000..661fffe7
--- /dev/null
+++ b/extensions/PdfHandler/i18n/bn.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Nasir8891",
+ "Wikitanvir"
+ ]
+ },
+ "pdf-desc": "পিডিএফ ফাইল ছবি হিসাবে ব্যবহারের পদ্ধতি",
+ "pdf_no_metadata": "পিডিএফ থেকে মেটাডেটা পাওয়া যায়নি",
+ "pdf_page_error": "পাতার নম্বর সীমার মধ্যে নেই"
+}
diff --git a/extensions/PdfHandler/i18n/br.json b/extensions/PdfHandler/i18n/br.json
new file mode 100644
index 00000000..5b9f8a82
--- /dev/null
+++ b/extensions/PdfHandler/i18n/br.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Fohanno",
+ "Fulup"
+ ]
+ },
+ "pdf-desc": "Maveg evit gwelet ar restroù PDF e mod skeudenn",
+ "pdf_no_metadata": "Dibosupl tapout meta-roadennoù digant ar restr PDF",
+ "pdf_page_error": "N'emañ ket niverenn ar bajenn er skeuliad",
+ "exif-pdf-producer": "Program amdreiñ",
+ "exif-pdf-version": "Stumm ar furmad PDF",
+ "exif-pdf-encrypted": "Sifret",
+ "exif-pdf-pagesize": "Ment ar bajenn"
+}
diff --git a/extensions/PdfHandler/i18n/bs.json b/extensions/PdfHandler/i18n/bs.json
new file mode 100644
index 00000000..7085dad0
--- /dev/null
+++ b/extensions/PdfHandler/i18n/bs.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "CERminator"
+ ]
+ },
+ "pdf-desc": "Uređivač za pregled PDF datoteka u modu za slike",
+ "pdf_no_metadata": "Ne mogu se naći metapodaci u PDFu",
+ "pdf_page_error": "Broj stranice nije u rasponu"
+}
diff --git a/extensions/PdfHandler/i18n/ca.json b/extensions/PdfHandler/i18n/ca.json
new file mode 100644
index 00000000..6bf49e64
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ca.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Aleator"
+ ]
+ },
+ "pdf-desc": "Gestor per a visualitzar arxius PDF en mode imatge",
+ "pdf_no_metadata": "No s'han pogut obtenir metadades del PDF",
+ "pdf_page_error": "Número de pàgina fora d'abast"
+}
diff --git a/extensions/PdfHandler/i18n/ce.json b/extensions/PdfHandler/i18n/ce.json
new file mode 100644
index 00000000..906c8510
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ce.json
@@ -0,0 +1,12 @@
+{
+ "@metadata": {
+ "authors": [
+ "Sasan700",
+ "Умар"
+ ]
+ },
+ "pdf-desc": "Хьажа аттон кечйо PDF-файлаш суьрта куьцехь",
+ "pdf_no_metadata": "схьацаэцало чура бух оцу PDF",
+ "pdf_page_error": "Агlон терахь дозан чулацамца дац",
+ "exif-pdf-pagesize": "АгӀона барам"
+}
diff --git a/extensions/PdfHandler/i18n/ckb.json b/extensions/PdfHandler/i18n/ckb.json
new file mode 100644
index 00000000..756f3c59
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ckb.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Calak"
+ ]
+ },
+ "exif-pdf-pagesize": "قەبارەی پەڕە"
+}
diff --git a/extensions/PdfHandler/i18n/cs.json b/extensions/PdfHandler/i18n/cs.json
new file mode 100644
index 00000000..204a5374
--- /dev/null
+++ b/extensions/PdfHandler/i18n/cs.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Matěj Grabovský",
+ "Mormegil"
+ ]
+ },
+ "pdf-desc": "Ovladač pro prohlížení PDF souborů jako obrázků",
+ "pdf_no_metadata": "Z PDF se nepodařilo získat metadata",
+ "pdf_page_error": "Číslo stránky mimo rozsah",
+ "exif-pdf-producer": "Konverzní program",
+ "exif-pdf-version": "Verze formátu PDF",
+ "exif-pdf-encrypted": "Šifrovaný",
+ "exif-pdf-pagesize": "Velikost stránky"
+}
diff --git a/extensions/PdfHandler/i18n/cy.json b/extensions/PdfHandler/i18n/cy.json
new file mode 100644
index 00000000..bdaa8abc
--- /dev/null
+++ b/extensions/PdfHandler/i18n/cy.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Lloffiwr"
+ ]
+ },
+ "pdf-desc": "Teclyn i weld ffeiliau PDF ar lun delwedd",
+ "pdf_no_metadata": "Yn methu cael y metadata o'r PDF",
+ "pdf_page_error": "Nid yw'r rhif hwn oddi mewn i ystod rhifau'r tudalennau",
+ "exif-pdf-producer": "Rhaglen trosi",
+ "exif-pdf-version": "Fersiwn y fformat PDF",
+ "exif-pdf-encrypted": "Amgriptiwyd",
+ "exif-pdf-pagesize": "Maint y dudalen"
+}
diff --git a/extensions/PdfHandler/i18n/da.json b/extensions/PdfHandler/i18n/da.json
new file mode 100644
index 00000000..06a9b63e
--- /dev/null
+++ b/extensions/PdfHandler/i18n/da.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Peter Alberti"
+ ]
+ },
+ "pdf-desc": "Håndtering af PDF-visning i billedtilstand",
+ "pdf_no_metadata": "Kan ikke hente metadata fra PDF",
+ "pdf_page_error": "Sidetallet er større end antallet af sider i dokumentet",
+ "exif-pdf-producer": "Konverteringsprogram",
+ "exif-pdf-version": "Version af PDF-format",
+ "exif-pdf-encrypted": "Krypteret",
+ "exif-pdf-pagesize": "Sidestørrelse"
+}
diff --git a/extensions/PdfHandler/i18n/de-ch.json b/extensions/PdfHandler/i18n/de-ch.json
new file mode 100644
index 00000000..1e9af268
--- /dev/null
+++ b/extensions/PdfHandler/i18n/de-ch.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Geitost"
+ ]
+ },
+ "pdf_page_error": "Seitenzahl ausserhalb des Dokumentes."
+}
diff --git a/extensions/PdfHandler/i18n/de.json b/extensions/PdfHandler/i18n/de.json
new file mode 100644
index 00000000..ea9c169d
--- /dev/null
+++ b/extensions/PdfHandler/i18n/de.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Kghbln",
+ "Metalhead64",
+ "Raimond Spekking"
+ ]
+ },
+ "pdf-desc": "Stellt eine Schnittstelle zur Ansicht von PDF-Dateien im Bildermodus bereit",
+ "pdf_no_metadata": "Keine Metadaten im PDF vorhanden.",
+ "pdf_page_error": "Seitenzahl außerhalb des Dokumentes.",
+ "exif-pdf-producer": "Umwandlungsprogramm",
+ "exif-pdf-version": "Version des PDF-Formats",
+ "exif-pdf-encrypted": "Verschlüsselt",
+ "exif-pdf-pagesize": "Seitengröße"
+}
diff --git a/extensions/PdfHandler/i18n/diq.json b/extensions/PdfHandler/i18n/diq.json
new file mode 100644
index 00000000..5978d419
--- /dev/null
+++ b/extensions/PdfHandler/i18n/diq.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Aspar",
+ "Erdemaslancan",
+ "Mirzali"
+ ]
+ },
+ "pdf-desc": "şuxulnayoxo ke dosyayê PDFyan modê mocnayiş de mocneno",
+ "pdf_no_metadata": "PDF ra metadata nêgeriyeno",
+ "pdf_page_error": "numreyê peli benate de niyo",
+ "exif-pdf-producer": "Programa çerxiney",
+ "exif-pdf-version": "Versiyona babet da PDF",
+ "exif-pdf-encrypted": "Kodıno",
+ "exif-pdf-pagesize": "Ebadê pele"
+}
diff --git a/extensions/PdfHandler/i18n/dsb.json b/extensions/PdfHandler/i18n/dsb.json
new file mode 100644
index 00000000..ec2ec39d
--- /dev/null
+++ b/extensions/PdfHandler/i18n/dsb.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Michawiki"
+ ]
+ },
+ "pdf-desc": "Źěłowy rěd za woglědowanje PDF-datajow we wobrazowem modusu",
+ "pdf_no_metadata": "Metadaty njedaju se z PDF dobyś",
+ "pdf_page_error": "Bokowe cysło zwenka wobcerka",
+ "exif-pdf-producer": "Konwertěrowański program",
+ "exif-pdf-version": "Wersija PDF-formata",
+ "exif-pdf-encrypted": "Skoděrowany",
+ "exif-pdf-pagesize": "Wjelikosć boka"
+}
diff --git a/extensions/PdfHandler/i18n/el.json b/extensions/PdfHandler/i18n/el.json
new file mode 100644
index 00000000..f835d016
--- /dev/null
+++ b/extensions/PdfHandler/i18n/el.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Omnipaedista"
+ ]
+ },
+ "pdf-desc": "Διαχειριστής για την εμφάνιση αρχείων PDF σε μορφή εικόνας",
+ "pdf_no_metadata": "Αδύνατη η απόκτηση μεταδεδομένων από PDF",
+ "pdf_page_error": "Αριθμός σελίδας εκτός ορίου"
+}
diff --git a/extensions/PdfHandler/i18n/en-gb.json b/extensions/PdfHandler/i18n/en-gb.json
new file mode 100644
index 00000000..e7f8ae14
--- /dev/null
+++ b/extensions/PdfHandler/i18n/en-gb.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Shirayuki"
+ ]
+ },
+ "exif-pdf-producer": "Conversion programme"
+}
diff --git a/extensions/PdfHandler/i18n/en.json b/extensions/PdfHandler/i18n/en.json
new file mode 100644
index 00000000..18bdff89
--- /dev/null
+++ b/extensions/PdfHandler/i18n/en.json
@@ -0,0 +1,12 @@
+{
+ "@metadata": {
+ "authors": []
+ },
+ "pdf-desc": "Handler for viewing PDF files in image mode.",
+ "pdf_no_metadata": "Cannot get metadata from PDF.",
+ "pdf_page_error": "Page number not in range.",
+ "exif-pdf-producer": "Conversion program",
+ "exif-pdf-version": "Version of PDF format",
+ "exif-pdf-encrypted": "Encrypted",
+ "exif-pdf-pagesize": "Page size"
+} \ No newline at end of file
diff --git a/extensions/PdfHandler/i18n/eo.json b/extensions/PdfHandler/i18n/eo.json
new file mode 100644
index 00000000..0f74f7c4
--- /dev/null
+++ b/extensions/PdfHandler/i18n/eo.json
@@ -0,0 +1,13 @@
+{
+ "@metadata": {
+ "authors": [
+ "Yekrats"
+ ]
+ },
+ "pdf-desc": "Ilo por vidi PDF-dosierojn en bilda reĝimo",
+ "pdf_no_metadata": "Ne povas preni metadatenon el PDF",
+ "pdf_page_error": "Paĝnombro ekster valida intervalo",
+ "exif-pdf-version": "Versio de PDF-formato",
+ "exif-pdf-encrypted": "Ĉifrita",
+ "exif-pdf-pagesize": "Grandeco de paĝo"
+}
diff --git a/extensions/PdfHandler/i18n/es.json b/extensions/PdfHandler/i18n/es.json
new file mode 100644
index 00000000..c658bf30
--- /dev/null
+++ b/extensions/PdfHandler/i18n/es.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Armando-Martin",
+ "Sanbec"
+ ]
+ },
+ "pdf-desc": "Manejador para ver archivos PDF en modo imagen",
+ "pdf_no_metadata": "No se obtuvieron metadatos del PDF",
+ "pdf_page_error": "Número de página fuera de rango",
+ "exif-pdf-producer": "Programa de conversión",
+ "exif-pdf-version": "Versión del formato PDF",
+ "exif-pdf-encrypted": "Cifrado",
+ "exif-pdf-pagesize": "Tamaño de página"
+}
diff --git a/extensions/PdfHandler/i18n/et.json b/extensions/PdfHandler/i18n/et.json
new file mode 100644
index 00000000..7cebfda7
--- /dev/null
+++ b/extensions/PdfHandler/i18n/et.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Avjoska",
+ "Pikne"
+ ]
+ },
+ "pdf-desc": "Töötleja PDF-failide piltidena kuvamiseks",
+ "pdf_no_metadata": "Ei õnnestu PDF-faili meta-andmeid saada",
+ "pdf_page_error": "Leheküljenumber pole vahemikus.",
+ "exif-pdf-producer": "Teisendusprogramm",
+ "exif-pdf-version": "PDF-vormingu versioon",
+ "exif-pdf-encrypted": "Krüptitud",
+ "exif-pdf-pagesize": "Lehe suurus"
+}
diff --git a/extensions/PdfHandler/i18n/fa.json b/extensions/PdfHandler/i18n/fa.json
new file mode 100644
index 00000000..2ceeac1c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/fa.json
@@ -0,0 +1,18 @@
+{
+ "@metadata": {
+ "authors": [
+ "Ebraminio",
+ "Huji",
+ "Reza1615",
+ "Sahim",
+ "Wayiran"
+ ]
+ },
+ "pdf-desc": "گرداننده‌ای برای مشاهدهٔ پرونده‌های پی‌دی‌اف در حالت تصویر",
+ "pdf_no_metadata": "نمی‌توان فراداده‌ها را از پی‌دی‌اف گرفت",
+ "pdf_page_error": "شماره صفحه در محدوده نیست",
+ "exif-pdf-producer": "برنامهٔ مبدل",
+ "exif-pdf-version": "نسخهٔ قالب پی‌دی‌اف",
+ "exif-pdf-encrypted": "رمز شده",
+ "exif-pdf-pagesize": "حجم صفحه"
+}
diff --git a/extensions/PdfHandler/i18n/fi.json b/extensions/PdfHandler/i18n/fi.json
new file mode 100644
index 00000000..7dd03d03
--- /dev/null
+++ b/extensions/PdfHandler/i18n/fi.json
@@ -0,0 +1,18 @@
+{
+ "@metadata": {
+ "authors": [
+ "Crt",
+ "Kulmalukko",
+ "Nike",
+ "VezonThunder",
+ "Vililikku"
+ ]
+ },
+ "pdf-desc": "Käsittelijä PDF-tiedostojen katsomiseen kuvatilassa.",
+ "pdf_no_metadata": "Metatietojen hakeminen PDF-tiedostosta epäonnistui",
+ "pdf_page_error": "Sivunumero ei ole alueella.",
+ "exif-pdf-producer": "Muunto-ohjelma",
+ "exif-pdf-version": "PDF-muodon versio",
+ "exif-pdf-encrypted": "Salattu",
+ "exif-pdf-pagesize": "Sivun koko"
+}
diff --git a/extensions/PdfHandler/i18n/fr.json b/extensions/PdfHandler/i18n/fr.json
new file mode 100644
index 00000000..9970cb21
--- /dev/null
+++ b/extensions/PdfHandler/i18n/fr.json
@@ -0,0 +1,17 @@
+{
+ "@metadata": {
+ "authors": [
+ "Crochet.david",
+ "Gomoko",
+ "Grondin",
+ "Verdy p"
+ ]
+ },
+ "pdf-desc": "Gestionnaire permettant de visualiser les fichiers PDF en mode image",
+ "pdf_no_metadata": "Impossible d’obtenir les métadonnées du fichier PDF",
+ "pdf_page_error": "Le numéro de page est hors de l’étendue.",
+ "exif-pdf-producer": "Programme de conversion",
+ "exif-pdf-version": "Version du format PDF",
+ "exif-pdf-encrypted": "Crypté",
+ "exif-pdf-pagesize": "Taille de la page"
+}
diff --git a/extensions/PdfHandler/i18n/frp.json b/extensions/PdfHandler/i18n/frp.json
new file mode 100644
index 00000000..256d38a1
--- /dev/null
+++ b/extensions/PdfHandler/i18n/frp.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "ChrisPtDe"
+ ]
+ },
+ "pdf-desc": "Utilitèro por vêre los fichiérs PDF en fôrma émâge.",
+ "pdf_no_metadata": "Pôt pas avêr les mètabalyês du fichiér PDF.",
+ "pdf_page_error": "Lo numerô de pâge est en defôr de la portâ."
+}
diff --git a/extensions/PdfHandler/i18n/gl.json b/extensions/PdfHandler/i18n/gl.json
new file mode 100644
index 00000000..06c708a4
--- /dev/null
+++ b/extensions/PdfHandler/i18n/gl.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Alma",
+ "Toliño"
+ ]
+ },
+ "pdf-desc": "Manipulador para ver ficheiros PDF no modo de imaxe",
+ "pdf_no_metadata": "Non se puideron obter os metadatos do PDF.",
+ "pdf_page_error": "O número da páxina non está no rango.",
+ "exif-pdf-producer": "Programa de conversión",
+ "exif-pdf-version": "Versión en formato PDF",
+ "exif-pdf-encrypted": "Cifrado",
+ "exif-pdf-pagesize": "Tamaño da páxina"
+}
diff --git a/extensions/PdfHandler/i18n/grc.json b/extensions/PdfHandler/i18n/grc.json
new file mode 100644
index 00000000..fd2249ab
--- /dev/null
+++ b/extensions/PdfHandler/i18n/grc.json
@@ -0,0 +1,9 @@
+{
+ "@metadata": {
+ "authors": [
+ "Omnipaedista"
+ ]
+ },
+ "pdf_no_metadata": "Ἀδύνατον τὸ ἀποκομίζειν μεταδεδομένα ἐκ PDF",
+ "pdf_page_error": "Ἀριθμὸς δέλτου ἐκτὸς ἐμβελείας"
+}
diff --git a/extensions/PdfHandler/i18n/gsw.json b/extensions/PdfHandler/i18n/gsw.json
new file mode 100644
index 00000000..7dc1324e
--- /dev/null
+++ b/extensions/PdfHandler/i18n/gsw.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Als-Holder"
+ ]
+ },
+ "pdf-desc": "Schnittstell fir d Aasicht vu PDF-Dateien im Bilder-Modus",
+ "pdf_no_metadata": "Kei Metadate im PDF vorhande.",
+ "pdf_page_error": "Sytezahl usserhalb vum Dokumänt.",
+ "exif-pdf-producer": "Umwandligsprogramm",
+ "exif-pdf-version": "Version vum PDF-Format",
+ "exif-pdf-encrypted": "Verschlisslet",
+ "exif-pdf-pagesize": "Sytegreßi"
+}
diff --git a/extensions/PdfHandler/i18n/gu.json b/extensions/PdfHandler/i18n/gu.json
new file mode 100644
index 00000000..1605e38a
--- /dev/null
+++ b/extensions/PdfHandler/i18n/gu.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "KartikMistry",
+ "Sushant savla"
+ ]
+ },
+ "pdf-desc": "PDF ફાઈલોને ચિત્ર સ્વરૂપે જોવાનું સાધન",
+ "pdf_no_metadata": "PDFમાંથી મેટા ડાટા ન મેળવી શકાયો",
+ "pdf_page_error": "પાનાં ક્રમાંક અવધિમાં નથી"
+}
diff --git a/extensions/PdfHandler/i18n/he.json b/extensions/PdfHandler/i18n/he.json
new file mode 100644
index 00000000..1569df31
--- /dev/null
+++ b/extensions/PdfHandler/i18n/he.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Amire80",
+ "Rotemliss",
+ "YaronSh"
+ ]
+ },
+ "pdf-desc": "טיפול בצפייה בקובצי PDF במצב תמונה",
+ "pdf_no_metadata": "לא ניתן לאחזר את נתוני המסמך מה־PDF",
+ "pdf_page_error": "מספר הדף אינו בטווח",
+ "exif-pdf-producer": "תוכנת המרה",
+ "exif-pdf-version": "הגרסה של תסדיר PDF",
+ "exif-pdf-encrypted": "מוצפן",
+ "exif-pdf-pagesize": "גודל דף"
+}
diff --git a/extensions/PdfHandler/i18n/hi.json b/extensions/PdfHandler/i18n/hi.json
new file mode 100644
index 00000000..e904654e
--- /dev/null
+++ b/extensions/PdfHandler/i18n/hi.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Kaustubh"
+ ]
+ },
+ "pdf-desc": "चित्र मोड में पीडीएफ फ़ाईल देखनेके लिये आवश्यक प्रणाली",
+ "pdf_no_metadata": "पीडीएफ से मेटाडाटा ले नहीं पायें",
+ "pdf_page_error": "पन्ने का क्रमांक सीमामें नहीं हैं"
+}
diff --git a/extensions/PdfHandler/i18n/hr.json b/extensions/PdfHandler/i18n/hr.json
new file mode 100644
index 00000000..af9859c4
--- /dev/null
+++ b/extensions/PdfHandler/i18n/hr.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Ex13"
+ ]
+ },
+ "pdf-desc": "Program za gledanje PDF datoteka u slikovnom modu",
+ "pdf_no_metadata": "Nije moguće dobiti metapodatke iz PDF",
+ "pdf_page_error": "Broj stranice nije u opsegu"
+}
diff --git a/extensions/PdfHandler/i18n/hsb.json b/extensions/PdfHandler/i18n/hsb.json
new file mode 100644
index 00000000..917cf858
--- /dev/null
+++ b/extensions/PdfHandler/i18n/hsb.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Michawiki"
+ ]
+ },
+ "pdf-desc": "Program za wobhladowanje datajow PDF we wobrazowym modusu",
+ "pdf_no_metadata": "W PDF žane metadaty njejsu.",
+ "pdf_page_error": "Ličba strony zwonka dokumenta.",
+ "exif-pdf-producer": "Konwertowanski program",
+ "exif-pdf-version": "Wersija PDF-formata",
+ "exif-pdf-encrypted": "Zaklučowany",
+ "exif-pdf-pagesize": "Wulkosć strony"
+}
diff --git a/extensions/PdfHandler/i18n/hu.json b/extensions/PdfHandler/i18n/hu.json
new file mode 100644
index 00000000..425a4474
--- /dev/null
+++ b/extensions/PdfHandler/i18n/hu.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Dani",
+ "Dj"
+ ]
+ },
+ "pdf-desc": "PDF fájlok megjelenítse képként",
+ "pdf_no_metadata": "nem sikerült lekérni a PDF metaadatait",
+ "pdf_page_error": "Az oldalszám a tartományon kívül esik",
+ "exif-pdf-producer": "Konvertáló program",
+ "exif-pdf-version": "PDF formátum verziója",
+ "exif-pdf-encrypted": "Titkosított",
+ "exif-pdf-pagesize": "Lapméret"
+}
diff --git a/extensions/PdfHandler/i18n/ia.json b/extensions/PdfHandler/i18n/ia.json
new file mode 100644
index 00000000..66550a72
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ia.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "McDutchie"
+ ]
+ },
+ "pdf-desc": "Gestor pro visualisar files PDF in modo de imagine",
+ "pdf_no_metadata": "Non pote obtener metadatos ab PDF",
+ "pdf_page_error": "Numero de pagina foras del intervallo",
+ "exif-pdf-producer": "Programma de conversion",
+ "exif-pdf-version": "Version del formato PDF",
+ "exif-pdf-encrypted": "Cryptate",
+ "exif-pdf-pagesize": "Dimension del pagina"
+}
diff --git a/extensions/PdfHandler/i18n/id.json b/extensions/PdfHandler/i18n/id.json
new file mode 100644
index 00000000..fddfc094
--- /dev/null
+++ b/extensions/PdfHandler/i18n/id.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Bennylin"
+ ]
+ },
+ "pdf-desc": "Yang menangani tampilan berkas PDF dalam mode gambar",
+ "pdf_no_metadata": "Tidak dapat membaca metadata dari PDF",
+ "pdf_page_error": "Nomor halaman di luar batas"
+}
diff --git a/extensions/PdfHandler/i18n/ilo.json b/extensions/PdfHandler/i18n/ilo.json
new file mode 100644
index 00000000..2939be6d
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ilo.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Lam-ang"
+ ]
+ },
+ "pdf-desc": "Panagtengngel para iti panagkita kadagiti PDF a papeles iti moda a ladawan",
+ "pdf_no_metadata": "Saan a makaala ti metadata manipud idiay PDF.",
+ "pdf_page_error": "Saan a masakupan ti numero ti panid.",
+ "exif-pdf-producer": "Konbersion a programa",
+ "exif-pdf-version": "Bersion iti PDF a pormat",
+ "exif-pdf-encrypted": "Naenkripto",
+ "exif-pdf-pagesize": "Kadakkel ti panid"
+}
diff --git a/extensions/PdfHandler/i18n/it.json b/extensions/PdfHandler/i18n/it.json
new file mode 100644
index 00000000..5d4ae85a
--- /dev/null
+++ b/extensions/PdfHandler/i18n/it.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Beta16",
+ "Darth Kule"
+ ]
+ },
+ "pdf-desc": "Gestore per la visualizzazione di file PDF in modalità immagine",
+ "pdf_no_metadata": "Impossibile ottenere i metadati da PDF",
+ "pdf_page_error": "Numero di pagina non compreso nell'intervallo",
+ "exif-pdf-producer": "Programma di conversione",
+ "exif-pdf-version": "Versione del formato PDF",
+ "exif-pdf-encrypted": "Crittografato",
+ "exif-pdf-pagesize": "Dimensioni pagina"
+}
diff --git a/extensions/PdfHandler/i18n/ja.json b/extensions/PdfHandler/i18n/ja.json
new file mode 100644
index 00000000..0bbffde3
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ja.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Fryed-peach",
+ "Shirayuki"
+ ]
+ },
+ "pdf-desc": "画像モードで PDF ファイルを表示するためのハンドラー",
+ "pdf_no_metadata": "PDF ファイルからメタデータを取得できません",
+ "pdf_page_error": "ページ番号が正しい範囲内にありません。",
+ "exif-pdf-producer": "変換プログラム",
+ "exif-pdf-version": "PDF 形式のバージョン",
+ "exif-pdf-encrypted": "暗号化済み",
+ "exif-pdf-pagesize": "ページのサイズ"
+}
diff --git a/extensions/PdfHandler/i18n/jv.json b/extensions/PdfHandler/i18n/jv.json
new file mode 100644
index 00000000..a9a25b2e
--- /dev/null
+++ b/extensions/PdfHandler/i18n/jv.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Meursault2004",
+ "NoiX180"
+ ]
+ },
+ "pdf-desc": "Sing nadhangi kanggo ndelok berkas PDF mawa modé gambar",
+ "pdf_no_metadata": "Ora bisa olèh metadata saka PDF",
+ "pdf_page_error": "Nomèr kaca nèng njaba wates"
+}
diff --git a/extensions/PdfHandler/i18n/ka.json b/extensions/PdfHandler/i18n/ka.json
new file mode 100644
index 00000000..34a327ad
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ka.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "BRUTE",
+ "David1010"
+ ]
+ },
+ "pdf-desc": "დამამუშავებელი PDF-ფაილების სურათების სახით დასათვალიერებლად",
+ "pdf_no_metadata": "შეუძლებელია PDF-დან მეტამონაცემების მიღება",
+ "pdf_page_error": "გვერდის ნომერი არ არის დიაპაზონში",
+ "exif-pdf-producer": "პროგრამის გარდაქმნა",
+ "exif-pdf-version": "ვერსია PDF ფორმატში",
+ "exif-pdf-encrypted": "დაშიფრული",
+ "exif-pdf-pagesize": "გვერდის ზომა"
+}
diff --git a/extensions/PdfHandler/i18n/km.json b/extensions/PdfHandler/i18n/km.json
new file mode 100644
index 00000000..db8ec3e2
--- /dev/null
+++ b/extensions/PdfHandler/i18n/km.json
@@ -0,0 +1,13 @@
+{
+ "@metadata": {
+ "authors": [
+ "Chhorran",
+ "Lovekhmer",
+ "Thearith",
+ "គីមស៊្រុន"
+ ]
+ },
+ "pdf-desc": "កម្មវិធីសំរាប់បើកមើលឯកសារ PDF ជាទំរង់រូបភាព",
+ "pdf_no_metadata": "មិនអាចទទួលយកទិន្នន័យមេតាពី PDF បានទេ",
+ "pdf_page_error": "គ្មានលេខទំព័រ ក្នុងដែនកំណត់"
+}
diff --git a/extensions/PdfHandler/i18n/kn.json b/extensions/PdfHandler/i18n/kn.json
new file mode 100644
index 00000000..a0587589
--- /dev/null
+++ b/extensions/PdfHandler/i18n/kn.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "VASANTH S.N."
+ ]
+ },
+ "exif-pdf-pagesize": "ಪುಟದ ಗಾತ್ರ"
+}
diff --git a/extensions/PdfHandler/i18n/ko.json b/extensions/PdfHandler/i18n/ko.json
new file mode 100644
index 00000000..d8bc29c9
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ko.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Kwj2772",
+ "아라"
+ ]
+ },
+ "pdf-desc": "PDF 파일을 이미지 방식으로 볼 수 있게 하는 핸들러",
+ "pdf_no_metadata": "PDF 파일에서 메타데이터를 추출할 수 없습니다.",
+ "pdf_page_error": "쪽수가 범위 안에 있지 않습니다.",
+ "exif-pdf-producer": "변환 프로그램",
+ "exif-pdf-version": "PDF 형식 버전",
+ "exif-pdf-encrypted": "암호화함",
+ "exif-pdf-pagesize": "페이지 크기"
+}
diff --git a/extensions/PdfHandler/i18n/ksh.json b/extensions/PdfHandler/i18n/ksh.json
new file mode 100644
index 00000000..75347d70
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ksh.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Purodha"
+ ]
+ },
+ "pdf-desc": "Määd et möjjelesch, PDF-Dateie wie Bellder ze beloore.",
+ "pdf_no_metadata": "Kann de Metta-Date nit fun dä PDF-Datei holle.",
+ "pdf_page_error": "En Sigge-Nommer es ußerhallef",
+ "exif-pdf-producer": "Ömwandelongsprojramm",
+ "exif-pdf-version": "PDF-Fommaat-Version",
+ "exif-pdf-encrypted": "Verschlößelt",
+ "exif-pdf-pagesize": "Dä Sigg(e) ier Jrüüße"
+}
diff --git a/extensions/PdfHandler/i18n/ky.json b/extensions/PdfHandler/i18n/ky.json
new file mode 100644
index 00000000..7df1c9c4
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ky.json
@@ -0,0 +1,9 @@
+{
+ "@metadata": {
+ "authors": [
+ "Chorobek"
+ ]
+ },
+ "pdf-desc": "PDF файлдарды сүрөт түрүндө көрсөткүч",
+ "pdf_no_metadata": "PDF-тин метамаалыматтарын алуу мүмкүн эмес"
+}
diff --git a/extensions/PdfHandler/i18n/lb.json b/extensions/PdfHandler/i18n/lb.json
new file mode 100644
index 00000000..36a9a88f
--- /dev/null
+++ b/extensions/PdfHandler/i18n/lb.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Robby"
+ ]
+ },
+ "pdf-desc": "\"Programm\" den et erméiglecht PDF-Fichieren als Bild ze kucken",
+ "pdf_no_metadata": "Meta-Informatiounen aus dem PDF Dokument kënnen net gelies ginn",
+ "pdf_page_error": "D'Säitenzuel ass net an dem Beräich.",
+ "exif-pdf-producer": "Ëmwandlungsprogramm",
+ "exif-pdf-version": "Versioun vum PDF-Format",
+ "exif-pdf-encrypted": "Verschlësselt",
+ "exif-pdf-pagesize": "Gréisst vun der Säit"
+}
diff --git a/extensions/PdfHandler/i18n/li.json b/extensions/PdfHandler/i18n/li.json
new file mode 100644
index 00000000..6cb890bf
--- /dev/null
+++ b/extensions/PdfHandler/i18n/li.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Ooswesthoesbes"
+ ]
+ },
+ "pdf-desc": "Hanjeltj PDF-bestenj aaf en maak 't meugelik die es aafbeildjing te zeen",
+ "pdf_no_metadata": "Kèn gein metadata vanne PDF kriege",
+ "pdf_page_error": "paginanómmer besteit neet"
+}
diff --git a/extensions/PdfHandler/i18n/lrc.json b/extensions/PdfHandler/i18n/lrc.json
new file mode 100644
index 00000000..b0f7f5ef
--- /dev/null
+++ b/extensions/PdfHandler/i18n/lrc.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Mogoeilor"
+ ]
+ },
+ "exif-pdf-pagesize": "انازه بلگه"
+}
diff --git a/extensions/PdfHandler/i18n/lt.json b/extensions/PdfHandler/i18n/lt.json
new file mode 100644
index 00000000..6d1315c6
--- /dev/null
+++ b/extensions/PdfHandler/i18n/lt.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Matasg"
+ ]
+ },
+ "pdf-desc": "Įrankis PDF failų peržiūrai vaizdo režime",
+ "pdf_no_metadata": "Nepavyko gauti metaduomenų iš PDF",
+ "pdf_page_error": "Puslapis numeris nėra diapazone"
+}
diff --git a/extensions/PdfHandler/i18n/mk.json b/extensions/PdfHandler/i18n/mk.json
new file mode 100644
index 00000000..30232e1f
--- /dev/null
+++ b/extensions/PdfHandler/i18n/mk.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Bjankuloski06",
+ "Brest"
+ ]
+ },
+ "pdf-desc": "Ракувач за прегледување PDF податотеки во сликовен режим",
+ "pdf_no_metadata": "Не може да се земат метаподатоци од PDF",
+ "pdf_page_error": "Бројот на страница е надвор од опсег",
+ "exif-pdf-producer": "Програм за претворање",
+ "exif-pdf-version": "Верзија на PDF-форматот",
+ "exif-pdf-encrypted": "Шифрирано",
+ "exif-pdf-pagesize": "Големина на страницата"
+}
diff --git a/extensions/PdfHandler/i18n/ml.json b/extensions/PdfHandler/i18n/ml.json
new file mode 100644
index 00000000..7c75a12b
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ml.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Praveenp",
+ "Shijualex"
+ ]
+ },
+ "pdf-desc": "പി.ഡി.എഫ്. പ്രമാണങ്ങൾ ചിത്രരൂപത്തിൽ കാണുന്നതിനുള്ള കൈകാര്യോപകരണം",
+ "pdf_no_metadata": "PDF-ൽ നിന്നു മെറ്റാഡാറ്റ ലഭിച്ചില്ല",
+ "pdf_page_error": "താളിന്റെ ക്രമസംഖ്യ പരിധിയിലധികമാണ്",
+ "exif-pdf-producer": "പരിവർത്തന പ്രോഗ്രാം",
+ "exif-pdf-version": "പി.ഡി.എഫ്. തരത്തിന്റെ പതിപ്പ്",
+ "exif-pdf-encrypted": "നിഗൂഢീകരിക്കപ്പെട്ടത്",
+ "exif-pdf-pagesize": "താളിന്റെ വലിപ്പം"
+}
diff --git a/extensions/PdfHandler/i18n/mr.json b/extensions/PdfHandler/i18n/mr.json
new file mode 100644
index 00000000..dfc9894c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/mr.json
@@ -0,0 +1,12 @@
+{
+ "@metadata": {
+ "authors": [
+ "Kaustubh",
+ "Sankalpdravid",
+ "V.narsikar"
+ ]
+ },
+ "pdf-desc": "चित्र मोडमध्ये पीडीएफ संचिका पाहण्यासाठी आवश्यक प्रणाली",
+ "pdf_no_metadata": "पीडीएफमधून मेटाडाटा घेऊ शकत नाही",
+ "pdf_page_error": "पान क्रमांक आवाक्यात नाही"
+}
diff --git a/extensions/PdfHandler/i18n/ms.json b/extensions/PdfHandler/i18n/ms.json
new file mode 100644
index 00000000..843b160d
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ms.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Anakmalaysia"
+ ]
+ },
+ "pdf-desc": "Pengendali untuk melihat fail PDF dalam mod imej",
+ "pdf_no_metadata": "Metadata tidak boleh diperoleh dari PDF",
+ "pdf_page_error": "Nombor halaman tiada dalam julat",
+ "exif-pdf-producer": "Program penukaran",
+ "exif-pdf-version": "Versi format PDF",
+ "exif-pdf-encrypted": "Disulitkan",
+ "exif-pdf-pagesize": "Saiz halaman"
+}
diff --git a/extensions/PdfHandler/i18n/mt.json b/extensions/PdfHandler/i18n/mt.json
new file mode 100644
index 00000000..1f707e8a
--- /dev/null
+++ b/extensions/PdfHandler/i18n/mt.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Chrisportelli"
+ ]
+ },
+ "pdf_page_error": "In-numru tal-paġna ma jinsabx fl-intervall"
+}
diff --git a/extensions/PdfHandler/i18n/nb.json b/extensions/PdfHandler/i18n/nb.json
new file mode 100644
index 00000000..8f18d2da
--- /dev/null
+++ b/extensions/PdfHandler/i18n/nb.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Jsoby"
+ ]
+ },
+ "pdf-desc": "Håndtering av PDF-visning i bildemodus",
+ "pdf_no_metadata": "kan ikke hente metadata fra PDF",
+ "pdf_page_error": "Sidenummer overstiger antall sider i dokumentet",
+ "exif-pdf-producer": "Koverteringsprogram",
+ "exif-pdf-version": "Versjon av PDF-format",
+ "exif-pdf-encrypted": "Kryptert",
+ "exif-pdf-pagesize": "Sidestørrelse"
+}
diff --git a/extensions/PdfHandler/i18n/nl.json b/extensions/PdfHandler/i18n/nl.json
new file mode 100644
index 00000000..f019d3e9
--- /dev/null
+++ b/extensions/PdfHandler/i18n/nl.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Siebrand",
+ "Wiki13"
+ ]
+ },
+ "pdf-desc": "Handelt pdfbestanden af en maakt het mogelijk ze als afbeeldingen te bekijken",
+ "pdf_no_metadata": "De metadata van het pdfbestand kan niet uitgelezen worden",
+ "pdf_page_error": "Het paginanummer ligt niet binnen het bereik",
+ "exif-pdf-producer": "Conversieprogramma",
+ "exif-pdf-version": "Versie van pdfopmaak",
+ "exif-pdf-encrypted": "Versleuteld",
+ "exif-pdf-pagesize": "Papierformaat"
+}
diff --git a/extensions/PdfHandler/i18n/nn.json b/extensions/PdfHandler/i18n/nn.json
new file mode 100644
index 00000000..19f20f46
--- /dev/null
+++ b/extensions/PdfHandler/i18n/nn.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Harald Khan",
+ "Njardarlogar"
+ ]
+ },
+ "pdf-desc": "Handering av PDF-vising i biletmodus",
+ "pdf_no_metadata": "Kan ikkje henta metadata frå PDF",
+ "pdf_page_error": "Sidenummer overstig talet på sider i dokumentet"
+}
diff --git a/extensions/PdfHandler/i18n/oc.json b/extensions/PdfHandler/i18n/oc.json
new file mode 100644
index 00000000..618cfebe
--- /dev/null
+++ b/extensions/PdfHandler/i18n/oc.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Cedric31"
+ ]
+ },
+ "pdf-desc": "Utilitari per visualizar los fichièrs PDF en mòde imatge",
+ "pdf_no_metadata": "Pòt pas obténer las metadonadas del fichièr PDF",
+ "pdf_page_error": "Lo numèro de pagina es pas dins la gama.",
+ "exif-pdf-producer": "Programa de conversion",
+ "exif-pdf-version": "Version del format PDF",
+ "exif-pdf-encrypted": "Chifrat",
+ "exif-pdf-pagesize": "Talha de la pagina"
+}
diff --git a/extensions/PdfHandler/i18n/or.json b/extensions/PdfHandler/i18n/or.json
new file mode 100644
index 00000000..c11db2ef
--- /dev/null
+++ b/extensions/PdfHandler/i18n/or.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Jnanaranjan Sahu",
+ "Psubhashish"
+ ]
+ },
+ "pdf-desc": "PDF ଫାଇଲକୁ ଛବି ମୋଡ଼ରେ ଦେଖିବାର ପରିଚାଳକ",
+ "pdf_no_metadata": "ପି.ଡ଼ି.ଏଫ.ରୁ ମେଟାଡାଟା ବାହାର କରିପାରିଲୁଁ ନାହିଁ",
+ "pdf_page_error": "ପୃଷ୍ଠା ସଂଖ୍ୟା ସୀମା ଭିତରେ ନାହିଁ",
+ "exif-pdf-producer": "ରୂପାନ୍ତର କାମ",
+ "exif-pdf-version": "PDF ପ୍ରକାରର ସଂସ୍କରଣ",
+ "exif-pdf-encrypted": "ଏନକ୍ରିପ୍ଟ ହୋଇଥିବା",
+ "exif-pdf-pagesize": "ପୃଷ୍ଠା ଆକାର"
+}
diff --git a/extensions/PdfHandler/i18n/pdc.json b/extensions/PdfHandler/i18n/pdc.json
new file mode 100644
index 00000000..1d7798c2
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pdc.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Xqt"
+ ]
+ },
+ "pdf_no_metadata": "Keene Meta-Daade im PDF"
+}
diff --git a/extensions/PdfHandler/i18n/pl.json b/extensions/PdfHandler/i18n/pl.json
new file mode 100644
index 00000000..1eed58a3
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pl.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Holek",
+ "Matma Rex",
+ "Sp5uhe"
+ ]
+ },
+ "pdf-desc": "Konwerter graficznego podglądu plików PDF",
+ "pdf_no_metadata": "nie można pobrać metadanych z pliku PDF",
+ "pdf_page_error": "Numer strony poza zakresem",
+ "exif-pdf-producer": "Program użyty do konwersji",
+ "exif-pdf-version": "Wersja formatu PDF",
+ "exif-pdf-encrypted": "Zaszyfrowany",
+ "exif-pdf-pagesize": "Wymiary strony"
+}
diff --git a/extensions/PdfHandler/i18n/pms.json b/extensions/PdfHandler/i18n/pms.json
new file mode 100644
index 00000000..4ec09417
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pms.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Borichèt",
+ "Dragonòt"
+ ]
+ },
+ "pdf-desc": "Ël gestor për vëdde ij file PDF an manera image",
+ "pdf_no_metadata": "as peulo nen pijesse ij metadat dal PDF",
+ "pdf_page_error": "Ël nùmer ëd pàgina a l'é pa ant ël range",
+ "exif-pdf-producer": "Programa ëd conversion",
+ "exif-pdf-version": "Version dël formà PDF",
+ "exif-pdf-encrypted": "Criptà",
+ "exif-pdf-pagesize": "Dimension dla pàgina"
+}
diff --git a/extensions/PdfHandler/i18n/pnb.json b/extensions/PdfHandler/i18n/pnb.json
new file mode 100644
index 00000000..c239b8b3
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pnb.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Khalid Mahmood"
+ ]
+ },
+ "pdf-desc": "پی ڈی ایف فائلاں امیج موڈ چ ویکھن لئی ہینڈلر",
+ "pdf_no_metadata": "پی ڈی ایف توں میٹاڈیٹا نئیں مل سکیا۔",
+ "pdf_page_error": "صفہ نمبر ولگن چ نئیں۔"
+}
diff --git a/extensions/PdfHandler/i18n/pt-br.json b/extensions/PdfHandler/i18n/pt-br.json
new file mode 100644
index 00000000..38947a35
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pt-br.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Eduardo.mps",
+ "555"
+ ]
+ },
+ "pdf-desc": "Ferramenta de visualização de arquivos PDF em modo de imagem",
+ "pdf_no_metadata": "Não foi possível obter os metadados do PDF",
+ "pdf_page_error": "Número de página fora do intervalo",
+ "exif-pdf-producer": "Programa de conversão",
+ "exif-pdf-version": "Versão do formato PDF",
+ "exif-pdf-encrypted": "Criptografado",
+ "exif-pdf-pagesize": "Tamanho da página"
+}
diff --git a/extensions/PdfHandler/i18n/pt.json b/extensions/PdfHandler/i18n/pt.json
new file mode 100644
index 00000000..35d892f8
--- /dev/null
+++ b/extensions/PdfHandler/i18n/pt.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Hamilton Abreu",
+ "Malafaya",
+ "Vitorvicentevalente"
+ ]
+ },
+ "pdf-desc": "Manuseador de visionamento de ficheiros PDF em modo de imagem",
+ "pdf_no_metadata": "não foi possível obter os metadados do PDF",
+ "pdf_page_error": "Número de página fora do intervalo",
+ "exif-pdf-producer": "Programa de conversão",
+ "exif-pdf-version": "Versão do formato PDF",
+ "exif-pdf-encrypted": "Criptografado",
+ "exif-pdf-pagesize": "Tamanho da página"
+}
diff --git a/extensions/PdfHandler/i18n/qqq.json b/extensions/PdfHandler/i18n/qqq.json
new file mode 100644
index 00000000..0d657592
--- /dev/null
+++ b/extensions/PdfHandler/i18n/qqq.json
@@ -0,0 +1,16 @@
+{
+ "@metadata": {
+ "authors": [
+ "Purodha",
+ "Shirayuki",
+ "The Evil IP address"
+ ]
+ },
+ "pdf-desc": "{{desc|name=Pdf Handler|url=http://www.mediawiki.org/wiki/Extension:PdfHandler}}",
+ "pdf_no_metadata": "Error message given when metadata cannot be retrieved from a PDF file",
+ "pdf_page_error": "Error message given when a PDF does not have the requested page number",
+ "exif-pdf-producer": "The label used in the metadata table at the bottom of the file description page for the program used to convert this PDF file into a PDF.\n\nThis is separate from the program used to create the original file (Which is labeled by {{msg-mw|Exif-software}}).",
+ "exif-pdf-version": "Label for the version of the pdf file format in the metadata table at the bottom of an image description page. Usually a number between 1.2 and 1.6",
+ "exif-pdf-encrypted": "Label for field in metadata table at bottom of an image description page to denote if the PDF file is encrypted. The value of the field this references is either \"no\" (most common) or something like \"yes (print:yes copy:no change:no addNotes:no)\"",
+ "exif-pdf-pagesize": "Label for the field in the metadata table at the bottom of an image description page to denote the size of the pages in the pdf. If there is more than one size of page used in this document, each size is listed once.\n{{Identical|Page size}}"
+}
diff --git a/extensions/PdfHandler/i18n/ro.json b/extensions/PdfHandler/i18n/ro.json
new file mode 100644
index 00000000..8d576489
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ro.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Stelistcristi"
+ ]
+ },
+ "pdf-desc": "Operator pentru vizualizarea fișierelor PDF în modul de imagine",
+ "pdf_no_metadata": "Nu se poate obține metadate din PDF",
+ "pdf_page_error": "Numărul paginii nu e în șir",
+ "exif-pdf-pagesize": "Dimensiunea paginii"
+}
diff --git a/extensions/PdfHandler/i18n/roa-tara.json b/extensions/PdfHandler/i18n/roa-tara.json
new file mode 100644
index 00000000..e7a5d949
--- /dev/null
+++ b/extensions/PdfHandler/i18n/roa-tara.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Joetaras"
+ ]
+ },
+ "pdf-desc": "Gestore pe vedè le file PDF in mode immaggine",
+ "pdf_no_metadata": "Non ge pozze pigghià le metadata da 'u PDF",
+ "pdf_page_error": "Numere de pàgene fore da l'indervalle",
+ "exif-pdf-producer": "Programme de conversione",
+ "exif-pdf-version": "Versione d'u formate PDF",
+ "exif-pdf-encrypted": "Criptate",
+ "exif-pdf-pagesize": "Dimenzione d'a pàgene"
+}
diff --git a/extensions/PdfHandler/i18n/ru.json b/extensions/PdfHandler/i18n/ru.json
new file mode 100644
index 00000000..e97ec2ad
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ru.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "DCamer",
+ "Александр Сигачёв"
+ ]
+ },
+ "pdf-desc": "Обработчик для просмотра PDF-файлов в виде изображений",
+ "pdf_no_metadata": "невозможно получить метаданные из PDF",
+ "pdf_page_error": "Номер страницы вне диапазона",
+ "exif-pdf-producer": "Программа преобразования",
+ "exif-pdf-version": "Версия в формате PDF",
+ "exif-pdf-encrypted": "Шифрование",
+ "exif-pdf-pagesize": "Размер страницы"
+}
diff --git a/extensions/PdfHandler/i18n/rue.json b/extensions/PdfHandler/i18n/rue.json
new file mode 100644
index 00000000..44ad4d71
--- /dev/null
+++ b/extensions/PdfHandler/i18n/rue.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Gazeb"
+ ]
+ },
+ "pdf-desc": "Овладач про перегляд PDF файлів як образків",
+ "pdf_no_metadata": "Не годен обтримати метадата з PDF",
+ "pdf_page_error": "Чісло сторінкы не є в россягу"
+}
diff --git a/extensions/PdfHandler/i18n/sa.json b/extensions/PdfHandler/i18n/sa.json
new file mode 100644
index 00000000..50a61c1e
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sa.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Shubha"
+ ]
+ },
+ "pdf-desc": "सुलेख(PDF)सञ्चिकाः चित्रदशायां दर्शनाय अपेक्षिता प्रणाली",
+ "pdf_no_metadata": "सुलेखात् मेटादत्तांशः प्राप्तुम् अशक्यः",
+ "pdf_page_error": "पृष्ठक्रमाङ्कः सीमायां न विद्यते"
+}
diff --git a/extensions/PdfHandler/i18n/sah.json b/extensions/PdfHandler/i18n/sah.json
new file mode 100644
index 00000000..e893873b
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sah.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "HalanTul"
+ ]
+ },
+ "pdf-desc": "PDF билэлэри ойуу курдук көрдөрөөччү",
+ "pdf_no_metadata": "PDF-тан мета дааннайдарын ылар кыах суох",
+ "pdf_page_error": "Сирэй нүөмэрэ диапазоҥҥа киирбэт"
+}
diff --git a/extensions/PdfHandler/i18n/si.json b/extensions/PdfHandler/i18n/si.json
new file mode 100644
index 00000000..aae61f8c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/si.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Budhajeewa",
+ "පසිඳු කාවින්ද"
+ ]
+ },
+ "pdf-desc": "PDF ගොනු රූප මාදිලියෙන් හසුරුවනය",
+ "pdf_no_metadata": "PDF ගොනුවෙන් මෙටාදත්ත ගත නොහැක",
+ "pdf_page_error": "පිටු අංකය නිවැරදි පරාසයේ නොමැත",
+ "exif-pdf-producer": "හැරවුම් වැඩසටහන",
+ "exif-pdf-version": "PDF ආකෘතියේ අනුවාදය",
+ "exif-pdf-encrypted": "ගුප්තකේතීකරණය වූ",
+ "exif-pdf-pagesize": "පිටු ප්‍රමාණය"
+}
diff --git a/extensions/PdfHandler/i18n/sk.json b/extensions/PdfHandler/i18n/sk.json
new file mode 100644
index 00000000..b0e0a59c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sk.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Helix84"
+ ]
+ },
+ "pdf-desc": "Obsluha zobrazovania PDF súborov v režime obrázkov",
+ "pdf_no_metadata": "nie je možné získať metadáta z PDF",
+ "pdf_page_error": "Číslo stránky nie je v intervale"
+}
diff --git a/extensions/PdfHandler/i18n/sl.json b/extensions/PdfHandler/i18n/sl.json
new file mode 100644
index 00000000..bb355a3c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sl.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Dbc334"
+ ]
+ },
+ "pdf-desc": "Upravljavec ogledovanja datotek PDF v slikovnem načinu",
+ "pdf_no_metadata": "Ne morem pridobiti metapodatkov iz PDF",
+ "pdf_page_error": "Številka strani ni v dosegu",
+ "exif-pdf-producer": "Pretvorbeni program",
+ "exif-pdf-version": "Različica oblike PDF",
+ "exif-pdf-encrypted": "Šifrirano",
+ "exif-pdf-pagesize": "Velikost strani"
+}
diff --git a/extensions/PdfHandler/i18n/sq.json b/extensions/PdfHandler/i18n/sq.json
new file mode 100644
index 00000000..3ade0ae6
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sq.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Olsi"
+ ]
+ },
+ "pdf-desc": "Mbajtës për pamjen e skedave PDF në mënyrën e figurave",
+ "pdf_no_metadata": "Nuk mund të merren metadata nga PDF",
+ "pdf_page_error": "Numri i faqes nuk është në varg"
+}
diff --git a/extensions/PdfHandler/i18n/sr-ec.json b/extensions/PdfHandler/i18n/sr-ec.json
new file mode 100644
index 00000000..81e69443
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sr-ec.json
@@ -0,0 +1,11 @@
+{
+ "@metadata": {
+ "authors": [
+ "Rancher",
+ "Михајло Анђелковић"
+ ]
+ },
+ "pdf-desc": "Програм за прегледање PDF докумената у сликовном режиму",
+ "pdf_no_metadata": "Не могу да преузмем метаподатке из PDF-а",
+ "pdf_page_error": "Број страница ван опсега"
+}
diff --git a/extensions/PdfHandler/i18n/sr-el.json b/extensions/PdfHandler/i18n/sr-el.json
new file mode 100644
index 00000000..68f497ef
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sr-el.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Michaello"
+ ]
+ },
+ "pdf-desc": "Handler za pregled PDF fajlova kao slika",
+ "pdf_no_metadata": "Ne mogu se dobiti meta-podaci iz PDF-a",
+ "pdf_page_error": "Broj strane izlazi van opsega"
+}
diff --git a/extensions/PdfHandler/i18n/stq.json b/extensions/PdfHandler/i18n/stq.json
new file mode 100644
index 00000000..d4cfc773
--- /dev/null
+++ b/extensions/PdfHandler/i18n/stq.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Pyt"
+ ]
+ },
+ "pdf-desc": "Snitsteede foar dät Bekiekjen fon PDF-Doatäie in dän Bielde-Modus",
+ "pdf_no_metadata": "Neen Metadoaten in dät PDF deer.",
+ "pdf_page_error": "Siedentaal buute Riege."
+}
diff --git a/extensions/PdfHandler/i18n/sv.json b/extensions/PdfHandler/i18n/sv.json
new file mode 100644
index 00000000..2ba54aea
--- /dev/null
+++ b/extensions/PdfHandler/i18n/sv.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Ainali",
+ "M.M.S."
+ ]
+ },
+ "pdf-desc": "Hantering av PDF-visning i bildläge",
+ "pdf_no_metadata": "Kan inte hämta metadata från PDF",
+ "pdf_page_error": "Sidnummer överstiger antal sidor i dokumentet",
+ "exif-pdf-producer": "Konverteringsprogram",
+ "exif-pdf-version": "Version av PDF-format",
+ "exif-pdf-encrypted": "Krypterad",
+ "exif-pdf-pagesize": "Sidstorlek"
+}
diff --git a/extensions/PdfHandler/i18n/ta.json b/extensions/PdfHandler/i18n/ta.json
new file mode 100644
index 00000000..9bd5a2f8
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ta.json
@@ -0,0 +1,14 @@
+{
+ "@metadata": {
+ "authors": [
+ "Shanmugamp7",
+ "TRYPPN",
+ "மதனாஹரன்"
+ ]
+ },
+ "pdf-desc": "PDF கோப்புகளை உருவ முறையில் பார்க்க கையாளுனர்",
+ "pdf_no_metadata": "PDF இருந்து மேல்தரவை பெற இயலவில்லை",
+ "pdf_page_error": "பக்கத்தின் எண் குறிப்பிட்ட வரையறையில் இல்லை",
+ "exif-pdf-producer": "மாற்றனிரல்",
+ "exif-pdf-pagesize": "பக்க அளவு"
+}
diff --git a/extensions/PdfHandler/i18n/te.json b/extensions/PdfHandler/i18n/te.json
new file mode 100644
index 00000000..e40216f3
--- /dev/null
+++ b/extensions/PdfHandler/i18n/te.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Veeven"
+ ]
+ },
+ "pdf_page_error": "పుట సంఖ్య అవధిలో లేదు"
+}
diff --git a/extensions/PdfHandler/i18n/tk.json b/extensions/PdfHandler/i18n/tk.json
new file mode 100644
index 00000000..ada6e7f5
--- /dev/null
+++ b/extensions/PdfHandler/i18n/tk.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Hanberke"
+ ]
+ },
+ "pdf-desc": "PDF faýllaryny görkeziş režiminde görkezmek üçin işleýji",
+ "pdf_no_metadata": "PDF-den meta-maglumat alyp bolanok",
+ "pdf_page_error": "Sahypa belgisi diapazonda däl"
+}
diff --git a/extensions/PdfHandler/i18n/tl.json b/extensions/PdfHandler/i18n/tl.json
new file mode 100644
index 00000000..d736043b
--- /dev/null
+++ b/extensions/PdfHandler/i18n/tl.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "AnakngAraw"
+ ]
+ },
+ "pdf-desc": "Tagapaghawak para sa pagtanaw ng mga talaksang PDF na nasa modalidad na panglarawan",
+ "pdf_no_metadata": "Hindi makuha ang dato ng meta mula sa PDF",
+ "pdf_page_error": "Wala sa sakop ang bilang ng pahina"
+}
diff --git a/extensions/PdfHandler/i18n/tr.json b/extensions/PdfHandler/i18n/tr.json
new file mode 100644
index 00000000..75a6e1a2
--- /dev/null
+++ b/extensions/PdfHandler/i18n/tr.json
@@ -0,0 +1,10 @@
+{
+ "@metadata": {
+ "authors": [
+ "Joseph"
+ ]
+ },
+ "pdf-desc": "PDF dosyalarını görüntü modunda görüntülemek için işleyici",
+ "pdf_no_metadata": "PDF'den metadata alınamıyor",
+ "pdf_page_error": "Sayfa numarası aralıkta değil"
+}
diff --git a/extensions/PdfHandler/i18n/ug-arab.json b/extensions/PdfHandler/i18n/ug-arab.json
new file mode 100644
index 00000000..4010aca1
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ug-arab.json
@@ -0,0 +1,9 @@
+{
+ "@metadata": {
+ "authors": [
+ "Sahran"
+ ]
+ },
+ "exif-pdf-encrypted": "شىفىرلانغان",
+ "exif-pdf-pagesize": "بەت چوڭلۇقى"
+}
diff --git a/extensions/PdfHandler/i18n/uk.json b/extensions/PdfHandler/i18n/uk.json
new file mode 100644
index 00000000..d5af168c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/uk.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Base",
+ "Prima klasy4na"
+ ]
+ },
+ "pdf-desc": "Оброблювач для перегляду PDF-файлів в режимі зображень",
+ "pdf_no_metadata": "Не виходить отримати метадані з PDF",
+ "pdf_page_error": "Номер сторінки не в діапазоні",
+ "exif-pdf-producer": "програма конвертації",
+ "exif-pdf-version": "Версія формату PDF",
+ "exif-pdf-encrypted": "Зашифровано",
+ "exif-pdf-pagesize": "Розмір сторінки"
+}
diff --git a/extensions/PdfHandler/i18n/ur.json b/extensions/PdfHandler/i18n/ur.json
new file mode 100644
index 00000000..7c3c6392
--- /dev/null
+++ b/extensions/PdfHandler/i18n/ur.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "පසිඳු කාවින්ද"
+ ]
+ },
+ "pdf_page_error": "صفحہ نمبر رینج میں نہیں"
+}
diff --git a/extensions/PdfHandler/i18n/vec.json b/extensions/PdfHandler/i18n/vec.json
new file mode 100644
index 00000000..7345331d
--- /dev/null
+++ b/extensions/PdfHandler/i18n/vec.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Candalua",
+ "GatoSelvadego"
+ ]
+ },
+ "pdf-desc": "Handler par vardar i file PDF in modalità imagine",
+ "pdf_no_metadata": "No se riesse a recuperar i metadati dal PDF",
+ "pdf_page_error": "Nùmaro de pagina mia conpreso in te l'intervalo",
+ "exif-pdf-producer": "Programa de conversion",
+ "exif-pdf-version": "Version del formato PDF",
+ "exif-pdf-encrypted": "Critigrafà",
+ "exif-pdf-pagesize": "Dimension pàjina"
+}
diff --git a/extensions/PdfHandler/i18n/vi.json b/extensions/PdfHandler/i18n/vi.json
new file mode 100644
index 00000000..e4e50ac6
--- /dev/null
+++ b/extensions/PdfHandler/i18n/vi.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Minh Nguyen",
+ "Vinhtantran"
+ ]
+ },
+ "pdf-desc": "Bộ xử lý để xem tập tin PDF ở dạng hình ảnh",
+ "pdf_no_metadata": "Không thấy truy xuất siêu dữ liệu từ PDF",
+ "pdf_page_error": "Số trang không nằm trong giới hạn",
+ "exif-pdf-producer": "Chương trình chuyển đổi",
+ "exif-pdf-version": "Phiên bản định dạng PDF",
+ "exif-pdf-encrypted": "Mã hóa",
+ "exif-pdf-pagesize": "Kích thước trang"
+}
diff --git a/extensions/PdfHandler/i18n/yo.json b/extensions/PdfHandler/i18n/yo.json
new file mode 100644
index 00000000..52995a6a
--- /dev/null
+++ b/extensions/PdfHandler/i18n/yo.json
@@ -0,0 +1,8 @@
+{
+ "@metadata": {
+ "authors": [
+ "Demmy"
+ ]
+ },
+ "pdf_no_metadata": "Dátà-àtẹ̀yìnwá kó ṣe é mú láti inú PDF"
+}
diff --git a/extensions/PdfHandler/i18n/yue.json b/extensions/PdfHandler/i18n/yue.json
new file mode 100644
index 00000000..a5aa1050
--- /dev/null
+++ b/extensions/PdfHandler/i18n/yue.json
@@ -0,0 +1,6 @@
+{
+ "@metadata": [],
+ "pdf-desc": "響圖像模式睇PDF檔嘅處理器",
+ "pdf_no_metadata": "唔能夠響PDF度拎metadata",
+ "pdf_page_error": "頁數唔響範圍度"
+}
diff --git a/extensions/PdfHandler/i18n/zh-hans.json b/extensions/PdfHandler/i18n/zh-hans.json
new file mode 100644
index 00000000..3b789624
--- /dev/null
+++ b/extensions/PdfHandler/i18n/zh-hans.json
@@ -0,0 +1,15 @@
+{
+ "@metadata": {
+ "authors": [
+ "Shirayuki",
+ "Yfdyh000"
+ ]
+ },
+ "pdf-desc": "在图像模式中查看PDF文件的处理器。",
+ "pdf_no_metadata": "无法在PDF中获取元数据。",
+ "pdf_page_error": "页数不在范围内。",
+ "exif-pdf-producer": "转换程序",
+ "exif-pdf-version": "PDF格式的版本",
+ "exif-pdf-encrypted": "加密",
+ "exif-pdf-pagesize": "页面大小"
+}
diff --git a/extensions/PdfHandler/i18n/zh-hant.json b/extensions/PdfHandler/i18n/zh-hant.json
new file mode 100644
index 00000000..d18de97c
--- /dev/null
+++ b/extensions/PdfHandler/i18n/zh-hant.json
@@ -0,0 +1,17 @@
+{
+ "@metadata": {
+ "authors": [
+ "Justincheng12345",
+ "Mark85296341",
+ "Simon Shek",
+ "Cwlin0416"
+ ]
+ },
+ "pdf-desc": "使用圖片模式檢視 PDF 檔案的處理程式。",
+ "pdf_no_metadata": "無法在 PDF 中取得資料定義。",
+ "pdf_page_error": "頁數超出範圍。",
+ "exif-pdf-producer": "轉換程式",
+ "exif-pdf-version": "PDF 格式版本",
+ "exif-pdf-encrypted": "已加密",
+ "exif-pdf-pagesize": "頁面大小"
+}
diff --git a/extensions/PdfHandler/tests/browser/Gemfile.lock b/extensions/PdfHandler/tests/browser/Gemfile.lock
new file mode 100644
index 00000000..c48276e7
--- /dev/null
+++ b/extensions/PdfHandler/tests/browser/Gemfile.lock
@@ -0,0 +1,62 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ builder (3.2.2)
+ childprocess (0.5.3)
+ ffi (~> 1.0, >= 1.0.11)
+ cucumber (1.3.15)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.12)
+ multi_json (>= 1.7.5, < 2.0)
+ multi_test (>= 0.1.1)
+ data_magic (0.19)
+ faker (>= 1.1.2)
+ yml_reader (>= 0.3)
+ diff-lcs (1.2.5)
+ faker (1.3.0)
+ i18n (~> 0.5)
+ ffi (1.9.3)
+ gherkin (2.12.2)
+ multi_json (~> 1.3)
+ headless (1.0.2)
+ i18n (0.6.9)
+ json (1.8.1)
+ mediawiki_selenium (0.2.25)
+ cucumber (~> 1.3, >= 1.3.10)
+ headless (~> 1.0, >= 1.0.1)
+ json (~> 1.8, >= 1.8.1)
+ page-object (~> 1.0)
+ rest-client (~> 1.6, >= 1.6.7)
+ rspec-expectations (~> 2.14, >= 2.14.4)
+ syntax (~> 1.2, >= 1.2.0)
+ mime-types (2.3)
+ multi_json (1.10.1)
+ multi_test (0.1.1)
+ page-object (1.0)
+ page_navigation (>= 0.9)
+ selenium-webdriver (>= 2.42.0)
+ watir-webdriver (>= 0.6.9)
+ page_navigation (0.9)
+ data_magic (>= 0.14)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rspec-expectations (2.99.1)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rubyzip (1.1.4)
+ selenium-webdriver (2.42.0)
+ childprocess (>= 0.5.0)
+ multi_json (~> 1.0)
+ rubyzip (~> 1.0)
+ websocket (~> 1.0.4)
+ syntax (1.2.0)
+ watir-webdriver (0.6.10)
+ selenium-webdriver (>= 2.18.0)
+ websocket (1.0.7)
+ yml_reader (0.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ mediawiki_selenium
diff --git a/extensions/PdfHandler/tests/browser/features/pdf.feature b/extensions/PdfHandler/tests/browser/features/pdf.feature
new file mode 100644
index 00000000..f78dd1ca
--- /dev/null
+++ b/extensions/PdfHandler/tests/browser/features/pdf.feature
@@ -0,0 +1,22 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@chrome @firefox @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @phantomjs @test2.wikipedia.org
+Feature: PDF
+
+ Scenario: Check for Download as PDF link
+ Given I am at a random page
+ Then Download as PDF should be present
+
+ Scenario: Click on Download as PDF link
+ Given I am at a random page
+ When I click on Download as PDF
+ Then Download the file link should be present
diff --git a/extensions/PdfHandler/tests/browser/features/step_definitions/pdf_steps.rb b/extensions/PdfHandler/tests/browser/features/step_definitions/pdf_steps.rb
new file mode 100644
index 00000000..25cf8ef4
--- /dev/null
+++ b/extensions/PdfHandler/tests/browser/features/step_definitions/pdf_steps.rb
@@ -0,0 +1,20 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Then(/^Download as PDF should be present$/) do
+ on(PdfPage).download_as_pdf_element.should exist
+end
+When(/^I click on Download as PDF$/) do
+ on(PdfPage).download_as_pdf_element.when_present.click
+end
+Then(/^Download the file link should be present$/) do
+ on(PdfPage).download_the_file_element.when_present(30).should exist
+end
diff --git a/extensions/PdfHandler/tests/browser/features/support/env.rb b/extensions/PdfHandler/tests/browser/features/support/env.rb
new file mode 100644
index 00000000..515ff78a
--- /dev/null
+++ b/extensions/PdfHandler/tests/browser/features/support/env.rb
@@ -0,0 +1,12 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+require "mediawiki_selenium"
diff --git a/extensions/PdfHandler/tests/browser/features/support/pages/random_page.rb b/extensions/PdfHandler/tests/browser/features/support/pages/random_page.rb
new file mode 100644
index 00000000..8d77e976
--- /dev/null
+++ b/extensions/PdfHandler/tests/browser/features/support/pages/random_page.rb
@@ -0,0 +1,17 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class PdfPage
+ include PageObject
+
+ a(:download_as_pdf, text: "Download as PDF")
+ a(:download_the_file, text: "Download the file")
+end
diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
index 6d1f73c7..3580d013 100644
--- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
+++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -470,18 +470,6 @@ class SyntaxHighlight_GeSHi {
}
/**
- * Get the GeSHI's version information while Special:Version is read.
- * @param $extensionTypes
- * @return bool
- */
- public static function extensionTypes( &$extensionTypes ) {
- global $wgExtensionCredits;
- self::initialise();
- $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
- return true;
- }
-
- /**
* Register a ResourceLoader module providing styles for each supported language.
*
* @param ResourceLoader $resourceLoader
diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
index da33ebee..6820ae1e 100644
--- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
+++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
@@ -36,12 +36,15 @@ if( !defined( 'MEDIAWIKI' ) ) {
die();
}
-$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi'] = array(
+require_once __DIR__ . '/geshi/geshi.php';
+
+$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'SyntaxHighlight',
'author' => array( 'Brion Vibber', 'Tim Starling', 'Rob Church', 'Niklas Laxström' ),
'descriptionmsg' => 'syntaxhighlight-desc',
'url' => 'https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi',
+ 'version' => GESHI_VERSION,
);
// Change these in LocalSettings.php
@@ -56,7 +59,6 @@ $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.clas
$wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php';
$wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php';
-$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::extensionTypes';
$wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules';
$wgHooks['ContentGetParserOutput'][] = 'SyntaxHighlight_GeSHi::renderHook';
diff --git a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php
new file mode 100644
index 00000000..344e9996
--- /dev/null
+++ b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Test the TitleBlacklist API.
+ *
+ * This wants to run with phpunit.php, like so:
+ * cd $IP/tests/phpunit
+ * php phpunit.php ../../extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php
+ *
+ * The blacklist file is `testSource` and shared by all tests.
+ *
+ * Ian Baker <ian@wikimedia.org>
+ */
+
+ini_set( 'include_path', ini_get( 'include_path' ) . ':' . __DIR__ . '/../../../tests/phpunit/includes/api' );
+
+/**
+ * @group medium
+ **/
+class ApiQueryTitleBlacklistTest extends ApiTestCase {
+
+ function setUp() {
+ global $wgTitleBlacklistSources;
+ parent::setUp();
+ $this->doLogin();
+
+ $wgTitleBlacklistSources = array(
+ array(
+ 'type' => TBLSRC_FILE,
+ 'src' => __DIR__ . '/testSource',
+ ),
+ );
+ }
+
+ /**
+ * Verify we allow a title which is not blacklisted
+ */
+ function testCheckingUnlistedTitle() {
+ $unlisted = $this->doApiRequest( array(
+ 'action' => 'titleblacklist',
+ // evil_acc is blacklisted as <newaccountonly>
+ 'tbtitle' => 'evil_acc',
+ 'tbaction' => 'create',
+ 'tbnooverride' => true,
+ ) );
+
+ $this->assertEquals(
+ 'ok',
+ $unlisted[0]['titleblacklist']['result'],
+ 'Not blacklisted title returns ok'
+ );
+ }
+
+ /**
+ * Verify tboverride works
+ */
+ function testTboverride() {
+ global $wgGroupPermissions;
+
+ // Allow all users to override the titleblacklist
+ $wgGroupPermissions['*']['tboverride'] = true;
+
+ $unlisted = $this->doApiRequest( array(
+ 'action' => 'titleblacklist',
+ 'tbtitle' => 'bar',
+ 'tbaction' => 'create',
+ ) );
+
+ $this->assertEquals(
+ 'ok',
+ $unlisted[0]['titleblacklist']['result'],
+ 'Blacklisted title returns ok if the user is allowd to tboverride'
+ );
+ }
+
+ /**
+ * Verify a blacklisted title gives out an error.
+ */
+ function testCheckingBlackListedTitle() {
+ $listed = $this->doApiRequest( array(
+ 'action' => 'titleblacklist',
+ 'tbtitle' => 'bar',
+ 'tbaction' => 'create',
+ 'tbnooverride' => true,
+ ) );
+
+ $this->assertEquals(
+ 'blacklisted',
+ $listed[0]['titleblacklist']['result'],
+ 'Listed title returns error'
+ );
+ $this->assertEquals(
+ "The title \"bar\" has been banned from creation.\nIt matches the following blacklist entry: <code>[Bb]ar #example blacklist entry</code>",
+ $listed[0]['titleblacklist']['reason'],
+ 'Listed title error text is as expected'
+ );
+
+ $this->assertEquals(
+ "titleblacklist-forbidden-edit",
+ $listed[0]['titleblacklist']['message'],
+ 'Correct blacklist message name is returned'
+ );
+
+ $this->assertEquals(
+ "[Bb]ar #example blacklist entry",
+ $listed[0]['titleblacklist']['line'],
+ 'Correct blacklist line is returned'
+ );
+ }
+
+ /**
+ * Tests integration with the AntiSpoof extension
+ */
+ function testAntiSpoofIntegration() {
+ if ( !class_exists( 'AntiSpoof') ) {
+ $this->markTestSkipped( "This test requires the AntiSpoof extension" );
+ }
+
+ $listed = $this->doApiRequest( array(
+ 'action' => 'titleblacklist',
+ 'tbtitle' => 'AVVVV',
+ 'tbaction' => 'create',
+ 'tbnooverride' => true,
+ ) );
+
+ $this->assertEquals(
+ 'blacklisted',
+ $listed[0]['titleblacklist']['result'],
+ 'Spoofed title is blacklisted'
+ );
+
+ }
+}
diff --git a/extensions/TitleBlacklist/tests/testSource b/extensions/TitleBlacklist/tests/testSource
new file mode 100644
index 00000000..235cc671
--- /dev/null
+++ b/extensions/TitleBlacklist/tests/testSource
@@ -0,0 +1,5 @@
+[Bb]ar #example blacklist entry
+.*[Ff]ail.*
+.*[Nn]yancat.* <errmsg=blacklisted-nyancat>
+.*evil_acc.* <newaccountonly>
+AW{1,10} <antispoof>
diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php
new file mode 100644
index 00000000..7153f49f
--- /dev/null
+++ b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php
@@ -0,0 +1,67 @@
+<?php
+require_once 'WikiDialogs_Links_Setup.php';
+/**
+ * Description of WikiNewPageDialogs
+ *
+ * @author bhagyag, pdhanda
+ *
+ * This test case is part of the WikiEditorTestSuite.
+ * Configuration for these tests are dosumented as part of extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php
+ *
+ */
+class WikiDialogs_Links extends WikiDialogs_Links_Setup {
+ // Set up the testing environment
+ function setup() {
+ parent::setUp();
+ parent::doCreateInternalTestPageIfMissing();
+ }
+
+ function tearDown() {
+ parent::doLogout();
+ parent::tearDown();
+ }
+
+ // Create a new page temporary
+ function createNewPage() {
+ parent::doOpenLink();
+ parent::login();
+ parent::doCreateNewPageTemporary();
+ }
+
+ // Add a internal link and verify
+ function testInternalLink() {
+ $this->createNewPage();
+ parent::verifyInternalLink();
+ }
+
+ // Add a internal link with different display text and verify
+ function testInternalLinkWithDisplayText() {
+ $this->createNewPage();
+ parent::verifyInternalLinkWithDisplayText();
+ }
+
+ // Add a internal link with blank display text and verify
+ function testInternalLinkWithBlankDisplayText() {
+ $this->createNewPage();
+ parent::verifyInternalLinkWithBlankDisplayText();
+ }
+
+ // Add external link and verify
+ function testExternalLink() {
+ $this->createNewPage();
+ parent::verifyExternalLink();
+ }
+
+ // Add external link with different display text and verify
+ function testExternalLinkWithDisplayText( ) {
+ $this->createNewPage();
+ parent::verifyExternalLinkWithDisplayText();
+ }
+
+ // Add external link with Blank display text and verify
+ function testExternalLinkWithBlankDisplayText() {
+ $this->createNewPage();
+ parent::verifyExternalLinkWithBlankDisplayText();
+ }
+
+}
diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php
new file mode 100644
index 00000000..352ebec0
--- /dev/null
+++ b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php
@@ -0,0 +1,295 @@
+<?php
+include( "WikiEditorConstants.php" );
+/**
+ * This test case will be handling the Wiki Tool bar Dialog functions
+ * Date : Apr - 2010
+ * @author : BhagyaG - Calcey
+ */
+class WikiDialogs_Links_Setup extends SeleniumTestCase {
+
+ // Open the page.
+ function doOpenLink() {
+ $this->open( $this->getUrl() . '/index.php' );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ }
+
+ // Expand advance tool bar section if its not
+ function doExpandAdvanceSection() {
+ if ( !$this->isTextPresent( TEXT_HEADING ) ) {
+ $this->click( LINK_ADVANCED );
+ }
+ }
+
+ // Log out from the application
+ function doLogout() {
+ $this->open( $this->getUrl() . '/index.php' );
+ if ( $this->isTextPresent( TEXT_LOGOUT ) ) {
+ $this->click( LINK_LOGOUT );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ) );
+ $this->open( $this->getUrl() . '/index.php' );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ }
+ }
+
+ // Create a temporary fixture page
+ function doCreateInternalTestPageIfMissing() {
+ $this->type( INPUT_SEARCH_BOX, WIKI_INTERNAL_LINK );
+ $this->click( BUTTON_SEARCH );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->click( LINK_START . WIKI_INTERNAL_LINK );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $location = $this->getLocation() . "\n";
+ if ( strpos( $location, '&redlink=1' ) !== false ) {
+ $this->type( TEXT_EDITOR, "Test fixture page. No real content here" );
+ $this->click( BUTTON_SAVE_WATCH );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ),
+ $this->getText( TEXT_PAGE_HEADING ) );
+ }
+ }
+
+ // Create a temporary new page
+ function doCreateNewPageTemporary() {
+ $this->type( INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE );
+ $this->click( BUTTON_SEARCH );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->click( LINK_START . WIKI_TEMP_NEWPAGE );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ }
+
+ // Add a internal link and verify
+ function verifyInternalLink() {
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDLINK );
+ $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
+ $this->type( TEXT_LINKNAME, ( WIKI_INTERNAL_LINK ) );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ), 'Element ' . ICON_PAGEEXISTS . 'Not found' );
+ $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( ( WIKI_INTERNAL_LINK ), $this->getText( LINK_START . WIKI_INTERNAL_LINK ) );
+ $this->click( LINK_START . WIKI_INTERNAL_LINK );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) );
+ }
+
+ // Add a internal link with different display text and verify
+ function verifyInternalLinkWithDisplayText() {
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDLINK );
+ $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
+ $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK );
+ $this->type ( TEXT_LINKDISPLAYNAME, WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) );
+ $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT,
+ $this->getText( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ) );
+ $this->click( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) );
+
+ }
+
+ // Add a internal link with blank display text and verify
+ function verifyInternalLinkWithBlankDisplayText() {
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDLINK );
+ $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME );
+ $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK );
+ $this->type( TEXT_LINKDISPLAYNAME, "" );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) );
+ $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START . WIKI_INTERNAL_LINK ) );
+ $this->click( LINK_START . WIKI_INTERNAL_LINK );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( TEXT_PAGE_HEADING ) );
+
+ }
+
+ // Add external link and verify
+ function verifyExternalLink() {
+ $this->type( LINK_PREVIEW, "" );
+ $this->click( LINK_ADDLINK );
+ $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) );
+ $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_EXTERNAL_LINK, $this->getText( LINK_START . WIKI_EXTERNAL_LINK ) );
+
+ $this->click( LINK_START . WIKI_EXTERNAL_LINK );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() );
+ }
+
+ // Add external link with different display text and verify
+ function verifyExternalLinkWithDisplayText() {
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDLINK );
+ $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
+ $this->type( TEXT_LINKDISPLAYNAME, WIKI_EXTERNAL_LINK_TITLE );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) );
+ $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getText( LINK_START . WIKI_EXTERNAL_LINK_TITLE ) );
+ $this->click( LINK_START . ( WIKI_EXTERNAL_LINK_TITLE ) );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE , $this->getTitle() );
+ }
+
+ // Add external link with Blank display text and verify
+ function verifyExternalLinkWithBlankDisplayText() {
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDLINK );
+ $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK );
+ $this->type( TEXT_LINKDISPLAYNAME, "" );
+ $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) );
+ $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) );
+ $this->click( BUTTON_INSERTLINK );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( "[1]", $this->getText( LINK_START . "[1]" ) );
+ $this->click( LINK_START . "[1]" );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() );
+ }
+
+ // Add a table and verify
+ function verifyCreateTable() {
+ $WIKI_TABLE_ROW = 2;
+ $WIKI_TABLE_COL = "5";
+ $this->doExpandAdvanceSection();
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_SORT );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( CHK_SORT );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1;
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+ // Add a table and verify only with head row
+ function verifyCreateTableWithHeadRow() {
+ $WIKI_TABLE_ROW = 3;
+ $WIKI_TABLE_COL = "4";
+ $this->doExpandAdvanceSection();
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_BOARDER );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1;
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+ // Add a table and verify only with borders
+ function verifyCreateTableWithBorders() {
+ $WIKI_TABLE_ROW = "4";
+ $WIKI_TABLE_COL = "6";
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_HEADER );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( CHK_HEADER );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+ // Add a table and verify only with sort row
+ function verifyCreateTableWithSortRow() {
+ $WIKI_TABLE_ROW = "2";
+ $WIKI_TABLE_COL = "5";
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_HEADER );
+ $this->click( CHK_BOARDER );
+ $this->click( CHK_SORT );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( CHK_HEADER );
+ $this->click( CHK_BOARDER );
+ $this->click( CHK_SORT );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+ // Add a table without headers,borders and sort rows
+ function verifyCreateTableWithNoSpecialEffects() {
+ $WIKI_TABLE_ROW = "6";
+ $WIKI_TABLE_COL = "2";
+ $this->
+ $this->doExpandAdvanceSection();
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_BOARDER );
+ $this->click( CHK_HEADER );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( CHK_BOARDER );
+ $this->click( CHK_HEADER );
+ $this->click( INK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+ // Add a table with headers,borders and sort rows
+ function verifyCreateTableWithAllSpecialEffects() {
+ $WIKI_TABLE_ROW = 6;
+ $WIKI_TABLE_COL = "2";
+ $this->doExpandAdvanceSection();
+ $this->type( TEXT_EDITOR, "" );
+ $this->click( LINK_ADDTABLE );
+ $this->click( CHK_SORT );
+ $this->type( TEXT_ROW, $WIKI_TABLE_ROW );
+ $this->type( TEXT_COL, $WIKI_TABLE_COL );
+ $this->click( BUTTON_INSERTABLE );
+ $this->click( CHK_SORT );
+ $this->click( LINK_PREVIEW );
+ $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1;
+ $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES .
+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
+ TEXT_VALIDATE_TABLE_PART3 ) );
+ }
+
+}
diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php
new file mode 100644
index 00000000..090f96bf
--- /dev/null
+++ b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php
@@ -0,0 +1,84 @@
+<?php
+define ( 'WIKI_TEST_WAIT_TIME', "3000" ); // Waiting time
+
+// tool bar, buttons , links
+// commonly using links
+define ( 'LINK_MAIN_PAGE', "link=Main page" );
+define ( 'LINK_RANDOM_PAGE', "link=Random article" );
+define ( 'TEXT_PAGE_HEADING', "firstHeading" );
+define ( 'LINK_START', "link=" );
+define ( 'LINK_EDITPAGE', "//li[@id='ca-edit']/a/span" );
+define ( 'TEXT_EDITOR', "wpTextbox1" );
+define ( 'LINK_PREVIEW', "wpPreview" );
+
+define ( 'WIKI_SEARCH_PAGE', "Hair (musical)" ); // Page name to search
+define ( 'WIKI_TEXT_SEARCH', "TV" ); // Text to search
+define ( 'WIKI_INTERNAL_LINK', "Wikieditor-Fixture-Page" ); // Exisiting page name to add as an internal tag
+define ( 'WIKI_EXTERNAL_LINK', "www.google.com" ); // External web site name
+define ( 'WIKI_EXTERNAL_LINK_TITLE', "Google" ); // Page title of the external web site name
+define ( 'WIKI_CODE_PATH', getcwd() ); // get the current path of the program
+define ( 'WIKI_SCREENSHOTS_PATH', "screenshots" ); // the folder the error screen shots will be saved
+define ( 'WIKI_SCREENSHOTS_TYPE', "png" ); // screen print type
+define ( 'WIKI_TEMP_NEWPAGE', "TestWikiPage" ); // temporary creating new page name
+// for WikiCommonFunction_TC
+
+// for WikiSearch_TC
+define ( 'INPUT_SEARCH_BOX', "searchInput" );
+define ( 'BUTTON_SEARCH', "mw-searchButton" );
+define ( 'TEXT_SEARCH_RESULT_HEADING', " - Search results - Wikipedia, the free encyclopedia" );
+
+// for WikiWatchUnWatch_TC
+define ( 'LINK_WATCH_PAGE', "link=Watch" );
+define ( 'LINK_WATCH_LIST', "link=My watchlist" );
+define ( 'LINK_WATCH_EDIT', "link=View and edit watchlist" );
+define ( 'LINK_UNWATCH', "link=Unwatch" );
+define ( 'BUTTON_WATCH', "wpWatchthis" );
+define ( 'BUTTON_SAVE_WATCH', "wpSave" );
+define ( 'TEXT_WATCH', "Watch" );
+define ( 'TEXT_UNWATCH', "Unwatch" );
+
+// for WikiCommonFunction_TC
+define ( 'TEXT_LOGOUT', "Log out" );
+define ( 'LINK_LOGOUT', "link=Log out" );
+define ( 'LINK_LOGIN', "link=Log in / create account" );
+define ( 'TEXT_LOGOUT_CONFIRM', "Log in / create account" );
+define ( 'INPUT_USER_NAME', "wpName1" );
+define ( 'INPUT_PASSWD', "wpPassword1" );
+define ( 'BUTTON_LOGIN', "wpLoginAttempt" );
+define ( 'TEXT_HEADING', "Heading" );
+define ( 'LINK_ADVANCED', "link=Advanced" );
+
+// for WikiDialogs_TC
+define ( 'LINK_ADDLINK', "//div[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[2 ]" );
+define ( 'TEXT_LINKNAME', "wikieditor-toolbar-link-int-target" );
+define ( 'TEXT_LINKDISPLAYNAME', "wikieditor-toolbar-link-int-text" );
+define ( 'TEXT_LINKDISPLAYNAME_APPENDTEXT', " Test" );
+define ( 'ICON_PAGEEXISTS', "wikieditor-toolbar-link-int-target-status-exists" );
+define ( 'ICON_PAGEEXTERNAL', "wikieditor-toolbar-link-int-target-status-external" );
+define ( 'OPT_INTERNAL', "wikieditor-toolbar-link-type-int" );
+define ( 'OPT_EXTERNAL', "wikieditor-toolbar-link-type-ext" );
+define ( 'BUTTON_INSERTLINK', "//div[10]/div[11]/button[1]" );
+define ( 'LINK_ADDTABLE', "//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[4]/span[2]" );
+define ( 'CHK_HEADER', "wikieditor-toolbar-table-dimensions-header" );
+define ( 'CHK_BOARDER', "wikieditor-toolbar-table-wikitable" );
+define ( 'CHK_SORT', "wikieditor-toolbar-table-sortable" );
+define ( 'TEXT_ROW', "wikieditor-toolbar-table-dimensions-rows" );
+define ( 'TEXT_COL', "wikieditor-toolbar-table-dimensions-columns" );
+define ( 'BUTTON_INSERTABLE', "//div[3]/button[1]" );
+define ( 'TEXT_HEADTABLE_TEXT', "Header text" );
+define ( 'TEXT_TABLEID_WITHALLFEATURES', "//table[@id='sortable_table_id_0']/tbody/" );
+define ( 'TEXT_TABLEID_OTHER', "//div[@id='wikiPreview']/table/tbody/" );
+define ( 'TEXT_VALIDATE_TABLE_PART1', "tr[" );
+define ( 'TEXT_VALIDATE_TABLE_PART2', "]/td[" );
+define ( 'TEXT_VALIDATE_TABLE_PART3', "]" );
+define ( 'LINK_SEARCH', "//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[5]/span" );
+define ( 'INPUT_SEARCH', "wikieditor-toolbar-replace-search" );
+define ( 'INPUT_REPLACE', "wikieditor-toolbar-replace-replace" );
+define ( 'BUTTON_REPLACEALL', "//button[3]" );
+define ( 'BUTTON_REPLACENEXT', "//button[2]" );
+define ( 'BUTTON_CANCEL', "//button[4]" );
+define ( 'TEXT_PREVIEW_TEXT1', "//div[@id='wikiPreview']/p[1]" );
+define ( 'TEXT_PREVIEW_TEXT2', "//div[@id='wikiPreview']/p[2]" );
+define ( 'TEXT_PREVIEW_TEXT3', "//div[@id='wikiPreview']/p[3]" );
+
+
diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php b/extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php
new file mode 100644
index 00000000..137e67b0
--- /dev/null
+++ b/extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php
@@ -0,0 +1,24 @@
+<?php
+
+class WikiEditorSeleniumConfig {
+
+ public static function getSettings( &$includeFiles, &$globalConfigs ) {
+ $includes = array(
+ 'extensions/Vector/Vector.php',
+ 'extensions/WikiEditor/WikiEditor.php'
+ );
+ $configs = array(
+ 'wgDefaultSkin' => 'vector',
+ 'wgWikiEditorFeatures' => array(
+ 'toolbar' => array( 'global' => true, 'user' => true ),
+ 'dialogs' => array( 'global' => true, 'user' => true )
+ ),
+ 'wgVectorFeatures' => array(
+ 'editwarning' => array( 'global' => false, 'user' => false )
+ )
+ );
+ $includeFiles = array_merge( $includeFiles, $includes );
+ $globalConfigs = array_merge( $globalConfigs, $configs );
+ return true;
+ }
+}
diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php b/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php
new file mode 100644
index 00000000..14a8bf20
--- /dev/null
+++ b/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * To configure MW for these tests
+ * 1) If you are running multiple test suites, add the following in LocalSettings.php
+ * require_once("extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php");
+ * $wgSeleniumTestConfigs['WikiEditorTestSuite'] = 'WikiEditorSeleniumConfig::getSettings';
+ * OR
+ * 2) Add the following to your Localsettings.php
+ * require_once( "$IP/extensions/Vector/Vector.php" );
+ * require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
+ * $wgDefaultSkin = 'vector';
+ * $wgVectorFeatures['editwarning'] = array( 'global' => false, 'user' => false );
+ * $wgWikiEditorFeatures['toolbar'] = array( 'global' => true, 'user' => true );
+ * $wgWikiEditorFeatures['dialogs'] = array( 'global' => true, 'user' => true );
+ *
+ */
+class WikiEditorTestSuite extends SeleniumTestSuite
+{
+ public function setUp() {
+ $this->setLoginBeforeTests( false );
+ parent::setUp();
+ }
+ public function addTests() {
+ $testFiles = array(
+ 'extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php'
+ );
+ parent::addTestFiles( $testFiles );
+ }
+
+
+}
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 71268932..aad42aac 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@ $wgConfigRegistry = array(
* Using single quotes is, therefore, important here.
* @since 1.2
*/
-$wgVersion = '1.24.1';
+$wgVersion = '1.24.2';
/**
* Name of the site. It must be changed in LocalSettings.php
@@ -4146,6 +4146,18 @@ $wgPasswordSalt = true;
$wgMinimalPasswordLength = 1;
/**
+ * Specifies the maximal length of a user password (T64685).
+ *
+ * It is not recommended to make this greater than the default, as it can
+ * allow DoS attacks by users setting really long passwords. In addition,
+ * this should not be lowered too much, as it enforces weak passwords.
+ *
+ * @warning Unlike other password settings, user with passwords greater than
+ * the maximum will not be able to log in.
+ */
+$wgMaximalPasswordLength = 4096;
+
+/**
* Specifies if users should be sent to a password-reset form on login, if their
* password doesn't meet the requirements of User::isValidPassword().
* @since 1.23
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 128244a8..38c80ba8 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2654,19 +2654,21 @@ class EditPage {
array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() )
);
}
- if ( $this->formtype !== 'preview' ) {
- if ( $this->isCssSubpage && $wgAllowUserCss ) {
- $wgOut->wrapWikiMsg(
- "<div id='mw-usercssyoucanpreview'>\n$1\n</div>",
- array( 'usercssyoucanpreview' )
- );
- }
+ if ( $this->getTitle()->isSubpageOf( $wgUser->getUserPage() ) ) {
+ if ( $this->formtype !== 'preview' ) {
+ if ( $this->isCssSubpage && $wgAllowUserCss ) {
+ $wgOut->wrapWikiMsg(
+ "<div id='mw-usercssyoucanpreview'>\n$1\n</div>",
+ array( 'usercssyoucanpreview' )
+ );
+ }
- if ( $this->isJsSubpage && $wgAllowUserJs ) {
- $wgOut->wrapWikiMsg(
- "<div id='mw-userjsyoucanpreview'>\n$1\n</div>",
- array( 'userjsyoucanpreview' )
- );
+ if ( $this->isJsSubpage && $wgAllowUserJs ) {
+ $wgOut->wrapWikiMsg(
+ "<div id='mw-userjsyoucanpreview'>\n$1\n</div>",
+ array( 'userjsyoucanpreview' )
+ );
+ }
}
}
}
diff --git a/includes/Html.php b/includes/Html.php
index 1e16e394..2e148140 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -546,17 +546,20 @@ class Html {
} else {
// Apparently we need to entity-encode \n, \r, \t, although the
// spec doesn't mention that. Since we're doing strtr() anyway,
- // and we don't need <> escaped here, we may as well not call
- // htmlspecialchars().
+ // we may as well not call htmlspecialchars().
// @todo FIXME: Verify that we actually need to
// escape \n\r\t here, and explain why, exactly.
#
// We could call Sanitizer::encodeAttribute() for this, but we
// don't because we're stubborn and like our marginal savings on
// byte size from not having to encode unnecessary quotes.
+ // The only difference between this transform and the one by
+ // Sanitizer::encodeAttribute() is '<' is only encoded here if
+ // $wgWellFormedXml is set, and ' is not encoded.
$map = array(
'&' => '&amp;',
'"' => '&quot;',
+ '>' => '&gt;',
"\n" => '&#10;',
"\r" => '&#13;',
"\t" => '&#9;'
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 2f8094ab..55b1da00 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2743,7 +2743,7 @@ $templates
* call rather than a "<script src='...'>" tag.
* @return string The html "<script>", "<link>" and "<style>" tags
*/
- protected function makeResourceLoaderLink( $modules, $only, $useESI = false,
+ public function makeResourceLoaderLink( $modules, $only, $useESI = false,
array $extraQuery = array(), $loadCall = false
) {
$modules = (array)$modules;
@@ -3153,7 +3153,7 @@ $templates
* have to be purged on configuration changes.
* @return array
*/
- private function getJSVars() {
+ public function getJSVars() {
global $wgContLang;
$curRevisionId = 0;
@@ -3289,6 +3289,10 @@ $templates
if ( !$this->getTitle()->isJsSubpage() && !$this->getTitle()->isCssSubpage() ) {
return false;
}
+ if ( !$this->getTitle()->isSubpageOf( $this->getUser()->getUserPage() ) ) {
+ // Don't execute another user's CSS or JS on preview (T85855)
+ return false;
+ }
return !count( $this->getTitle()->getUserPermissionsErrors( 'edit', $this->getUser() ) );
}
diff --git a/includes/User.php b/includes/User.php
index 5e5d3eed..a925a3c4 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -773,15 +773,24 @@ class User implements IDBAccessObject {
}
/**
- * Check if this is a valid password for this user. Status will be good if
- * the password is valid, or have an array of error messages if not.
+ * Check if this is a valid password for this user
+ *
+ * Create a Status object based on the password's validity.
+ * The Status should be set to fatal if the user should not
+ * be allowed to log in, and should have any errors that
+ * would block changing the password.
+ *
+ * If the return value of this is not OK, the password
+ * should not be checked. If the return value is not Good,
+ * the password can be checked, but the user should not be
+ * able to set their password to this.
*
* @param string $password Desired password
* @return Status
* @since 1.23
*/
public function checkPasswordValidity( $password ) {
- global $wgMinimalPasswordLength, $wgContLang;
+ global $wgMinimalPasswordLength, $wgMaximalPasswordLength, $wgContLang;
static $blockedLogins = array(
'Useruser' => 'Passpass', 'Useruser1' => 'Passpass1', # r75589
@@ -801,6 +810,10 @@ class User implements IDBAccessObject {
if ( strlen( $password ) < $wgMinimalPasswordLength ) {
$status->error( 'passwordtooshort', $wgMinimalPasswordLength );
return $status;
+ } elseif ( strlen( $password ) > $wgMaximalPasswordLength ) {
+ // T64685: Password too long, might cause DoS attack
+ $status->fatal( 'passwordtoolong', $wgMaximalPasswordLength );
+ return $status;
} elseif ( $wgContLang->lc( $password ) == $wgContLang->lc( $this->mName ) ) {
$status->error( 'password-name-match' );
return $status;
@@ -2300,17 +2313,9 @@ class User implements IDBAccessObject {
throw new PasswordError( wfMessage( 'password-change-forbidden' )->text() );
}
- if ( !$this->isValidPassword( $str ) ) {
- global $wgMinimalPasswordLength;
- $valid = $this->getPasswordValidity( $str );
- if ( is_array( $valid ) ) {
- $message = array_shift( $valid );
- $params = $valid;
- } else {
- $message = $valid;
- $params = array( $wgMinimalPasswordLength );
- }
- throw new PasswordError( wfMessage( $message, $params )->text() );
+ $status = $this->checkPasswordValidity( $str );
+ if ( !$status->isGood() ) {
+ throw new PasswordError( $status->getMessage()->text() );
}
}
@@ -3792,6 +3797,13 @@ class User implements IDBAccessObject {
$this->loadPasswords();
+ // Some passwords will give a fatal Status, which means there is
+ // some sort of technical or security reason for this password to
+ // be completely invalid and should never be checked (e.g., T64685)
+ if ( !$this->checkPasswordValidity( $password )->isOK() ) {
+ return false;
+ }
+
// Certain authentication plugins do NOT want to save
// domain passwords in a mysql database, so we should
// check this (in case $wgAuth->strict() is false).
diff --git a/includes/Xml.php b/includes/Xml.php
index 159f7114..c6c02867 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -707,13 +707,15 @@ class Xml {
/**
* Check if a string is well-formed XML.
* Must include the surrounding tag.
+ * This function is a DoS vector if an attacker can define
+ * entities in $text.
*
* @param string $text String to test.
* @return bool
*
* @todo Error position reporting return
*/
- public static function isWellFormed( $text ) {
+ private static function isWellFormed( $text ) {
$parser = xml_parser_create( "UTF-8" );
# case folding violates XML standard, turn it off
diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php
index ba90c260..ec3dc2d9 100644
--- a/includes/api/ApiFormatWddx.php
+++ b/includes/api/ApiFormatWddx.php
@@ -38,15 +38,7 @@ class ApiFormatWddx extends ApiFormatBase {
public function execute() {
$this->markDeprecated();
- // Some versions of PHP have a broken wddx_serialize_value, see
- // PHP bug 45314. Test encoding an affected character (U+00A0)
- // to avoid this.
- $expected =
- "<wddxPacket version='1.0'><header/><data><string>\xc2\xa0</string></data></wddxPacket>";
- if ( function_exists( 'wddx_serialize_value' )
- && !$this->getIsHtml()
- && wddx_serialize_value( "\xc2\xa0" ) == $expected
- ) {
+ if ( !$this->getIsHtml() && !static::useSlowPrinter() ) {
$this->printText( wddx_serialize_value( $this->getResultData() ) );
} else {
// Don't do newlines and indentation if we weren't asked
@@ -63,6 +55,44 @@ class ApiFormatWddx extends ApiFormatBase {
}
}
+ public static function useSlowPrinter() {
+ if ( !function_exists( 'wddx_serialize_value' ) ) {
+ return true;
+ }
+
+ // Some versions of PHP have a broken wddx_serialize_value, see
+ // PHP bug 45314. Test encoding an affected character (U+00A0)
+ // to avoid this.
+ $expected =
+ "<wddxPacket version='1.0'><header/><data><string>\xc2\xa0</string></data></wddxPacket>";
+ if ( wddx_serialize_value( "\xc2\xa0" ) !== $expected ) {
+ return true;
+ }
+
+ // Some versions of HHVM don't correctly encode ampersands.
+ $expected =
+ "<wddxPacket version='1.0'><header/><data><string>&amp;</string></data></wddxPacket>";
+ if ( wddx_serialize_value( '&' ) !== $expected ) {
+ return true;
+ }
+
+ // Some versions of HHVM don't correctly encode empty arrays as subvalues.
+ $expected =
+ "<wddxPacket version='1.0'><header/><data><array length='1'><array length='0'></array></array></data></wddxPacket>";
+ if ( wddx_serialize_value( array( array() ) ) !== $expected ) {
+ return true;
+ }
+
+ // Some versions of HHVM don't correctly encode associative arrays with numeric keys.
+ $expected =
+ "<wddxPacket version='1.0'><header/><data><struct><var name='2'><number>1</number></var></struct></data></wddxPacket>";
+ if ( wddx_serialize_value( array( 2 => 1 ) ) !== $expected ) {
+ return true;
+ }
+
+ return false;
+ }
+
/**
* Recursively go through the object and output its data in WDDX format.
* @param mixed $elemValue
diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php
index 9e8ee94f..df2f0e32 100644
--- a/includes/installer/PostgresUpdater.php
+++ b/includes/installer/PostgresUpdater.php
@@ -384,8 +384,6 @@ class PostgresUpdater extends DatabaseUpdater {
'page(page_id) ON DELETE CASCADE' ),
array( 'changeFkeyDeferrable', 'protected_titles', 'pt_user',
'mwuser(user_id) ON DELETE SET NULL' ),
- array( 'changeFkeyDeferrable', 'recentchanges', 'rc_cur_id',
- 'page(page_id) ON DELETE SET NULL' ),
array( 'changeFkeyDeferrable', 'recentchanges', 'rc_user',
'mwuser(user_id) ON DELETE SET NULL' ),
array( 'changeFkeyDeferrable', 'redirect', 'rd_from', 'page(page_id) ON DELETE CASCADE' ),
@@ -418,6 +416,10 @@ class PostgresUpdater extends DatabaseUpdater {
array( 'addPgField', 'pagelinks', 'pl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
array( 'addPgField', 'templatelinks', 'tl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
array( 'addPgField', 'imagelinks', 'il_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ),
+
+ // 1.24.1 (backport from 1.25)
+ array( 'dropFkey', 'recentchanges', 'rc_cur_id' )
+
);
}
@@ -769,6 +771,24 @@ END;
}
}
+ protected function dropFkey( $table, $field ) {
+ $fi = $this->db->fieldInfo( $table, $field );
+ if ( is_null( $fi ) ) {
+ $this->output( "WARNING! Column '$table.$field' does not exist but it should! " .
+ "Please report this.\n" );
+ return;
+ }
+ $conname = $fi->conname();
+ if ( $fi->conname() ) {
+ $this->output( "Dropping foreign key constraint on '$table.$field'\n" );
+ $conclause = "CONSTRAINT \"$conname\"";
+ $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
+ $this->db->query( $command );
+ } else {
+ $this->output( "...foreign key constraint on '$table.$field' already does not exist\n" );
+ };
+ }
+
protected function changeFkeyDeferrable( $table, $field, $clause ) {
$fi = $this->db->fieldInfo( $table, $field );
if ( is_null( $fi ) ) {
diff --git a/includes/libs/XmlTypeCheck.php b/includes/libs/XmlTypeCheck.php
index aca857e9..31a4e28a 100644
--- a/includes/libs/XmlTypeCheck.php
+++ b/includes/libs/XmlTypeCheck.php
@@ -2,6 +2,11 @@
/**
* XML syntax and type checker.
*
+ * Since 1.24.2, it uses XMLReader instead of xml_parse, which gives us
+ * more control over the expansion of XML entities. When passed to the
+ * callback, entities will be fully expanded, but may report the XML is
+ * invalid if expanding the entities are likely to cause a DoS.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -25,7 +30,7 @@ class XmlTypeCheck {
* Will be set to true or false to indicate whether the file is
* well-formed XML. Note that this doesn't check schema validity.
*/
- public $wellFormed = false;
+ public $wellFormed = null;
/**
* Will be set to true if the optional element filter returned
@@ -78,12 +83,7 @@ class XmlTypeCheck {
function __construct( $input, $filterCallback = null, $isFile = true, $options = array() ) {
$this->filterCallback = $filterCallback;
$this->parserOptions = array_merge( $this->parserOptions, $options );
-
- if ( $isFile ) {
- $this->validateFromFile( $input );
- } else {
- $this->validateFromString( $input );
- }
+ $this->validateFromInput( $input, $isFile );
}
/**
@@ -125,140 +125,211 @@ class XmlTypeCheck {
return $this->rootElement;
}
+
/**
- * Get an XML parser with the root element handler.
- * @see XmlTypeCheck::rootElementOpen()
- * @return resource a resource handle for the XML parser
+ * @param string $fname the filename
*/
- private function getParser() {
- $parser = xml_parser_create_ns( 'UTF-8' );
- // case folding violates XML standard, turn it off
- xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false );
- xml_set_element_handler( $parser, array( $this, 'rootElementOpen' ), false );
- if ( $this->parserOptions['processing_instruction_handler'] ) {
- xml_set_processing_instruction_handler(
- $parser,
- array( $this, 'processingInstructionHandler' )
- );
+ private function validateFromInput( $xml, $isFile ) {
+ $reader = new XMLReader();
+ if ( $isFile ) {
+ $s = $reader->open( $xml, null, LIBXML_NOERROR | LIBXML_NOWARNING );
+ } else {
+ $s = $reader->XML( $xml, null, LIBXML_NOERROR | LIBXML_NOWARNING );
+ }
+ if ( $s !== true ) {
+ // Couldn't open the XML
+ $this->wellFormed = false;
+ } else {
+ $oldDisable = libxml_disable_entity_loader( true );
+ $reader->setParserProperty( XMLReader::SUBST_ENTITIES, true );
+ try {
+ $this->validate( $reader );
+ } catch ( Exception $e ) {
+ // Calling this malformed, because we didn't parse the whole
+ // thing. Maybe just an external entity refernce.
+ $this->wellFormed = false;
+ $reader->close();
+ libxml_disable_entity_loader( $oldDisable );
+ throw $e;
+ }
+ $reader->close();
+ libxml_disable_entity_loader( $oldDisable );
}
- return $parser;
}
- /**
- * @param string $fname the filename
- */
- private function validateFromFile( $fname ) {
- $parser = $this->getParser();
-
- if ( file_exists( $fname ) ) {
- $file = fopen( $fname, "rb" );
- if ( $file ) {
- do {
- $chunk = fread( $file, 32768 );
- $ret = xml_parse( $parser, $chunk, feof( $file ) );
- if ( $ret == 0 ) {
- $this->wellFormed = false;
- fclose( $file );
- xml_parser_free( $parser );
- return;
+ private function readNext( XMLReader $reader ) {
+ set_error_handler( array( $this, 'XmlErrorHandler' ) );
+ $ret = $reader->read();
+ restore_error_handler();
+ return $ret;
+ }
+
+ public function XmlErrorHandler( $errno, $errstr ) {
+ $this->wellFormed = false;
+ }
+
+ private function validate( $reader ) {
+
+ // First, move through anything that isn't an element, and
+ // handle any processing instructions with the callback
+ do {
+ if( !$this->readNext( $reader ) ) {
+ // Hit the end of the document before any elements
+ $this->wellFormed = false;
+ return;
+ }
+ if ( $reader->nodeType === XMLReader::PI ) {
+ $this->processingInstructionHandler( $reader->name, $reader->value );
+ }
+ } while ( $reader->nodeType != XMLReader::ELEMENT );
+
+ // Process the rest of the document
+ do {
+ switch ( $reader->nodeType ) {
+ case XMLReader::ELEMENT:
+ $name = $this->expandNS(
+ $reader->name,
+ $reader->namespaceURI
+ );
+ if ( $this->rootElement === '' ) {
+ $this->rootElement = $name;
}
- } while ( !feof( $file ) );
+ $empty = $reader->isEmptyElement;
+ $attrs = $this->getAttributesArray( $reader );
+ $this->elementOpen( $name, $attrs );
+ if ( $empty ) {
+ $this->elementClose();
+ }
+ break;
+
+ case XMLReader::END_ELEMENT:
+ $this->elementClose();
+ break;
+
+ case XMLReader::WHITESPACE:
+ case XMLReader::SIGNIFICANT_WHITESPACE:
+ case XMLReader::CDATA:
+ case XMLReader::TEXT:
+ $this->elementData( $reader->value );
+ break;
- fclose( $file );
+ case XMLReader::ENTITY_REF:
+ // Unexpanded entity (maybe external?),
+ // don't send to the filter (xml_parse didn't)
+ break;
+
+ case XMLReader::COMMENT:
+ // Don't send to the filter (xml_parse didn't)
+ break;
+
+ case XMLReader::PI:
+ // Processing instructions can happen after the header too
+ $this->processingInstructionHandler(
+ $reader->name,
+ $reader->value
+ );
+ break;
+ default:
+ // One of DOC, DOC_TYPE, ENTITY, END_ENTITY,
+ // NOTATION, or XML_DECLARATION
+ // xml_parse didn't send these to the filter, so we won't.
}
+
+ } while ( $this->readNext( $reader ) );
+
+ if ( $this->stackDepth !== 0 ) {
+ $this->wellFormed = false;
+ } elseif ( $this->wellFormed === null ) {
+ $this->wellFormed = true;
}
- $this->wellFormed = true;
- xml_parser_free( $parser );
}
/**
- *
- * @param string $string the XML-input-string to be checked.
+ * Get all of the attributes for an XMLReader's current node
+ * @param $r XMLReader
+ * @return array of attributes
*/
- private function validateFromString( $string ) {
- $parser = $this->getParser();
- $ret = xml_parse( $parser, $string, true );
- xml_parser_free( $parser );
- if ( $ret == 0 ) {
- $this->wellFormed = false;
- return;
+ private function getAttributesArray( XMLReader $r ) {
+ $attrs = array();
+ while ( $r->moveToNextAttribute() ) {
+ if ( $r->namespaceURI === 'http://www.w3.org/2000/xmlns/' ) {
+ // XMLReader treats xmlns attributes as normal
+ // attributes, while xml_parse doesn't
+ continue;
+ }
+ $name = $this->expandNS( $r->name, $r->namespaceURI );
+ $attrs[$name] = $r->value;
}
- $this->wellFormed = true;
+ return $attrs;
}
/**
- * @param $parser
- * @param $name
- * @param $attribs
+ * @param $name element or attribute name, maybe with a full or short prefix
+ * @param $namespaceURI the namespaceURI
+ * @return string the name prefixed with namespaceURI
*/
- private function rootElementOpen( $parser, $name, $attribs ) {
- $this->rootElement = $name;
-
- if ( is_callable( $this->filterCallback ) ) {
- xml_set_element_handler(
- $parser,
- array( $this, 'elementOpen' ),
- array( $this, 'elementClose' )
- );
- xml_set_character_data_handler( $parser, array( $this, 'elementData' ) );
- $this->elementOpen( $parser, $name, $attribs );
- } else {
- // We only need the first open element
- xml_set_element_handler( $parser, false, false );
+ private function expandNS( $name, $namespaceURI ) {
+ if ( $namespaceURI ) {
+ $parts = explode( ':', $name );
+ $localname = array_pop( $parts );
+ return "$namespaceURI:$localname";
}
+ return $name;
}
/**
- * @param $parser
* @param $name
* @param $attribs
*/
- private function elementOpen( $parser, $name, $attribs ) {
+ private function elementOpen( $name, $attribs ) {
$this->elementDataContext[] = array( $name, $attribs );
$this->elementData[] = '';
$this->stackDepth++;
}
/**
- * @param $parser
- * @param $name
*/
- private function elementClose( $parser, $name ) {
+ private function elementClose() {
list( $name, $attribs ) = array_pop( $this->elementDataContext );
$data = array_pop( $this->elementData );
$this->stackDepth--;
- if ( call_user_func(
- $this->filterCallback,
- $name,
- $attribs,
- $data
- ) ) {
- // Filter hit!
+ if ( is_callable( $this->filterCallback )
+ && call_user_func(
+ $this->filterCallback,
+ $name,
+ $attribs,
+ $data
+ )
+ ) {
+ // Filter hit
$this->filterMatch = true;
}
}
/**
- * @param $parser
* @param $data
*/
- private function elementData( $parser, $data ) {
- // xml_set_character_data_handler breaks the data on & characters, so
- // we collect any data here, and we'll run the callback in elementClose
+ private function elementData( $data ) {
+ // Collect any data here, and we'll run the callback in elementClose
$this->elementData[ $this->stackDepth - 1 ] .= trim( $data );
}
/**
- * @param $parser
* @param $target
* @param $data
*/
- private function processingInstructionHandler( $parser, $target, $data ) {
- if ( call_user_func( $this->parserOptions['processing_instruction_handler'], $target, $data ) ) {
- // Filter hit!
- $this->filterMatch = true;
+ private function processingInstructionHandler( $target, $data ) {
+ if ( $this->parserOptions['processing_instruction_handler'] ) {
+ if ( call_user_func(
+ $this->parserOptions['processing_instruction_handler'],
+ $target,
+ $data
+ ) ) {
+ // Filter hit!
+ $this->filterMatch = true;
+ }
}
}
}
diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php
index dd41c388..1d790155 100644
--- a/includes/media/BitmapMetadataHandler.php
+++ b/includes/media/BitmapMetadataHandler.php
@@ -154,7 +154,7 @@ class BitmapMetadataHandler {
* @throws MWException On invalid file.
*/
static function Jpeg( $filename ) {
- $showXMP = function_exists( 'xml_parser_create_ns' );
+ $showXMP = XMPReader::isSupported();
$meta = new self();
$seg = JpegMetadataExtractor::segmentSplitter( $filename );
@@ -196,7 +196,7 @@ class BitmapMetadataHandler {
* @return array Array for storage in img_metadata.
*/
public static function PNG( $filename ) {
- $showXMP = function_exists( 'xml_parser_create_ns' );
+ $showXMP = XMPReader::isSupported();
$meta = new self();
$array = PNGMetadataExtractor::getMetadata( $filename );
@@ -236,7 +236,7 @@ class BitmapMetadataHandler {
$meta->addMetadata( array( 'GIFFileComment' => $baseArray['comment'] ), 'native' );
}
- if ( $baseArray['xmp'] !== '' && function_exists( 'xml_parser_create_ns' ) ) {
+ if ( $baseArray['xmp'] !== '' && XMPReader::isSupported() ) {
$xmp = new XMPReader();
$xmp->parse( $baseArray['xmp'] );
$xmpRes = $xmp->getResults();
diff --git a/includes/media/JpegMetadataExtractor.php b/includes/media/JpegMetadataExtractor.php
index 8c5b46bb..aaa9930a 100644
--- a/includes/media/JpegMetadataExtractor.php
+++ b/includes/media/JpegMetadataExtractor.php
@@ -48,7 +48,7 @@ class JpegMetadataExtractor {
* @throws MWException If given invalid file.
*/
static function segmentSplitter( $filename ) {
- $showXMP = function_exists( 'xml_parser_create_ns' );
+ $showXMP = XMPReader::isSupported();
$segmentCount = 0;
diff --git a/includes/media/XMP.php b/includes/media/XMP.php
index cdbd5ab2..a3f45e6c 100644
--- a/includes/media/XMP.php
+++ b/includes/media/XMP.php
@@ -80,6 +80,12 @@ class XMPReader {
/** @var int */
private $extendedXMPOffset = 0;
+ /** @var int Flag determining if the XMP is safe to parse **/
+ private $parsable = 0;
+
+ /** @var string Buffer of XML to parse **/
+ private $xmlParsableBuffer = '';
+
/**
* These are various mode constants.
* they are used to figure out what to do
@@ -108,6 +114,12 @@ class XMPReader {
const NS_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
const NS_XML = 'http://www.w3.org/XML/1998/namespace';
+ // States used while determining if XML is safe to parse
+ const PARSABLE_UNKNOWN = 0;
+ const PARSABLE_OK = 1;
+ const PARSABLE_BUFFERING = 2;
+ const PARSABLE_NO = 3;
+
/**
* Constructor.
*
@@ -145,6 +157,9 @@ class XMPReader {
array( $this, 'endElement' ) );
xml_set_character_data_handler( $this->xmlParser, array( $this, 'char' ) );
+
+ $this->parsable = self::PARSABLE_UNKNOWN;
+ $this->xmlParsableBuffer = '';
}
/** Destroy the xml parser
@@ -156,6 +171,13 @@ class XMPReader {
xml_parser_free( $this->xmlParser );
}
+ /**
+ * Check if this instance supports using this class
+ */
+ public static function isSupported() {
+ return function_exists( 'xml_parser_create_ns' ) && class_exists( 'XMLReader' );
+ }
+
/** Get the result array. Do some post-processing before returning
* the array, and transform any metadata that is special-cased.
*
@@ -305,6 +327,27 @@ class XMPReader {
wfRestoreWarnings();
}
+ // Ensure the XMP block does not have an xml doctype declaration, which
+ // could declare entities unsafe to parse with xml_parse (T85848/T71210).
+ if ( $this->parsable !== self::PARSABLE_OK ) {
+ if ( $this->parsable === self::PARSABLE_NO ) {
+ throw new MWException( 'Unsafe doctype declaration in XML.' );
+ }
+
+ $content = $this->xmlParsableBuffer . $content;
+ if ( !$this->checkParseSafety( $content ) ) {
+ if ( !$allOfIt && $this->parsable !== self::PARSABLE_NO ) {
+ // parse wasn't Unsuccessful yet, so return true
+ // in this case.
+ return true;
+ }
+ $msg = ( $this->parsable === self::PARSABLE_NO ) ?
+ 'Unsafe doctype declaration in XML.' :
+ 'No root element found in XML.';
+ throw new MWException( $msg );
+ }
+ }
+
$ok = xml_parse( $this->xmlParser, $content, $allOfIt );
if ( !$ok ) {
$error = xml_error_string( xml_get_error_code( $this->xmlParser ) );
@@ -437,6 +480,59 @@ class XMPReader {
}
}
+ /**
+ * Check if a block of XML is safe to pass to xml_parse, i.e. doesn't
+ * contain a doctype declaration which could contain a dos attack if we
+ * parse it and expand internal entities (T85848).
+ *
+ * @param string $content xml string to check for parse safety
+ * @return bool true if the xml is safe to parse, false otherwise
+ */
+ private function checkParseSafety( $content ) {
+ $reader = new XMLReader();
+ $result = null;
+
+ // For XMLReader to parse incomplete/invalid XML, it has to be open()'ed
+ // instead of using XML().
+ $reader->open(
+ 'data://text/plain,' . urlencode( $content ),
+ null,
+ LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NONET
+ );
+
+ $oldDisable = libxml_disable_entity_loader( true );
+ $reader->setParserProperty( XMLReader::SUBST_ENTITIES, false );
+
+ // Even with LIBXML_NOWARNING set, XMLReader::read gives a warning
+ // when parsing truncated XML, which causes unit tests to fail.
+ wfSuppressWarnings();
+ while ( $reader->read() ) {
+ if ( $reader->nodeType === XMLReader::ELEMENT ) {
+ // Reached the first element without hitting a doctype declaration
+ $this->parsable = self::PARSABLE_OK;
+ $result = true;
+ break;
+ }
+ if ( $reader->nodeType === XMLReader::DOC_TYPE ) {
+ $this->parsable = self::PARSABLE_NO;
+ $result = false;
+ break;
+ }
+ }
+ wfRestoreWarnings();
+ libxml_disable_entity_loader( $oldDisable );
+
+ if ( !is_null( $result ) ) {
+ return $result;
+ }
+
+ // Reached the end of the parsable xml without finding an element
+ // or doctype. Buffer and try again.
+ $this->parsable = self::PARSABLE_BUFFERING;
+ $this->xmlParsableBuffer = $content;
+ return false;
+ }
+
/** When we hit a closing element in MODE_IGNORE
* Check to see if this is the element we started to ignore,
* in which case we get out of MODE_IGNORE
diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php
index 679492ae..23fdc71a 100644
--- a/includes/specialpage/SpecialPageFactory.php
+++ b/includes/specialpage/SpecialPageFactory.php
@@ -74,7 +74,7 @@ class SpecialPageFactory {
'Wantedtemplates' => 'WantedTemplatesPage',
// List of pages
- 'Allpages' => 'SpecialAllpages',
+ 'Allpages' => 'SpecialAllPages',
'Prefixindex' => 'SpecialPrefixindex',
'Categories' => 'SpecialCategories',
'Listredirects' => 'ListredirectsPage',
@@ -123,7 +123,7 @@ class SpecialPageFactory {
// Data and tools
'Statistics' => 'SpecialStatistics',
- 'Allmessages' => 'SpecialAllmessages',
+ 'Allmessages' => 'SpecialAllMessages',
'Version' => 'SpecialVersion',
'Lockdb' => 'SpecialLockdb',
'Unlockdb' => 'SpecialUnlockdb',
diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php
index ce436525..f983b452 100644
--- a/includes/specials/SpecialActiveusers.php
+++ b/includes/specials/SpecialActiveusers.php
@@ -115,10 +115,16 @@ class ActiveUsersPager extends UsersPager {
) . ')';
}
+ if ( $dbr->implicitGroupby() ) {
+ $options = array( 'GROUP BY' => array( 'qcc_title' ) );
+ } else {
+ $options = array( 'GROUP BY' => array( 'user_name', 'user_id', 'qcc_title' ) );
+ }
+
return array(
'tables' => array( 'querycachetwo', 'user', 'recentchanges' ),
'fields' => array( 'user_name', 'user_id', 'recentedits' => 'COUNT(*)', 'qcc_title' ),
- 'options' => array( 'GROUP BY' => array( 'qcc_title' ) ),
+ 'options' => $options,
'conds' => $conds
);
}
diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php
index 0efebb3e..7d745a50 100644
--- a/includes/specials/SpecialJavaScriptTest.php
+++ b/includes/specials/SpecialJavaScriptTest.php
@@ -26,12 +26,10 @@
*/
class SpecialJavaScriptTest extends SpecialPage {
/**
- * @var array Mapping of framework ids and their initilizer methods
- * in this class. If a framework is requested but not in this array,
- * the 'unknownframework' error is served.
+ * @var array Supported frameworks.
*/
private static $frameworks = array(
- 'qunit' => 'initQUnitTesting',
+ 'qunit',
);
public function __construct() {
@@ -44,43 +42,70 @@ class SpecialJavaScriptTest extends SpecialPage {
$this->setHeaders();
$out->disallowUserJs();
- $out->addModules( 'mediawiki.special.javaScriptTest' );
-
- // Determine framework
- $pars = explode( '/', $par );
- $framework = strtolower( $pars[0] );
-
- // No framework specified
- if ( $par == '' ) {
+ if ( $par === null ) {
+ // No framework specified
+ $out->setStatusCode( 404 );
$out->setPageTitle( $this->msg( 'javascripttest' ) );
- $summary = $this->wrapSummaryHtml(
- $this->msg( 'javascripttest-pagetext-noframework' )->escaped() .
- $this->getFrameworkListHtml(),
- 'noframework'
+ $out->addHTML(
+ $this->msg( 'javascripttest-pagetext-noframework' )->parseAsBlock()
+ . $this->getFrameworkListHtml()
);
- $out->addHtml( $summary );
- } elseif ( isset( self::$frameworks[$framework] ) ) {
- // Matched! Display proper title and initialize the framework
- $out->setPageTitle( $this->msg(
- 'javascripttest-title',
- // Messages: javascripttest-qunit-name
- $this->msg( "javascripttest-$framework-name" )->plain()
- ) );
- $out->setSubtitle( $this->msg( 'javascripttest-backlink' )
- ->rawParams( Linker::linkKnown( $this->getPageTitle() ) ) );
- $this->{self::$frameworks[$framework]}();
- } else {
- // Framework not found, display error
- $out->setPageTitle( $this->msg( 'javascripttest' ) );
- $summary = $this->wrapSummaryHtml(
- '<p class="error">' .
- $this->msg( 'javascripttest-pagetext-unknownframework', $par )->escaped() .
- '</p>' .
- $this->getFrameworkListHtml(),
- 'unknownframework'
+ return;
+ }
+
+ // Determine framework and mode
+ $pars = explode( '/', $par, 2 );
+
+ $framework = $pars[0];
+ if ( !in_array( $framework, self::$frameworks ) ) {
+ // Framework not found
+ $out->setStatusCode( 404 );
+ $out->addHTML(
+ '<div class="error">'
+ . $this->msg( 'javascripttest-pagetext-unknownframework' )
+ ->plaintextParams( $par )->parseAsBlock()
+ . '</div>'
+ . $this->getFrameworkListHtml()
);
- $out->addHtml( $summary );
+ return;
}
+
+ // This special page is disabled by default ($wgEnableJavaScriptTest), and contains
+ // no sensitive data. In order to allow TestSwarm to embed it into a test client window,
+ // we need to allow iframing of this page.
+ $out->allowClickjacking();
+ $out->setSubtitle(
+ $this->msg( 'javascripttest-backlink' )
+ ->rawParams( Linker::linkKnown( $this->getPageTitle() ) )
+ );
+
+ // Custom actions
+ if ( isset( $pars[1] ) ) {
+ $action = $pars[1];
+ if ( !in_array( $action, array( 'export', 'plain' ) ) ) {
+ $out->setStatusCode( 404 );
+ $out->addHTML(
+ '<div class="error">'
+ . $this->msg( 'javascripttest-pagetext-unknownaction' )
+ ->plaintextParams( $action )->parseAsBlock()
+ . '</div>'
+ );
+ return;
+ }
+ $method = $action . ucfirst( $framework );
+ $this->$method();
+ return;
+ }
+
+ $out->addModules( 'mediawiki.special.javaScriptTest' );
+
+ $method = 'view' . ucfirst( $framework );
+ $this->$method();
+ $out->setPageTitle( $this->msg(
+ 'javascripttest-title',
+ // Messages: javascripttest-qunit-name
+ $this->msg( "javascripttest-$framework-name" )->plain()
+ ) );
}
/**
@@ -91,7 +116,7 @@ class SpecialJavaScriptTest extends SpecialPage {
*/
private function getFrameworkListHtml() {
$list = '<ul>';
- foreach ( self::$frameworks as $framework => $initFn ) {
+ foreach ( self::$frameworks as $framework ) {
$list .= Html::rawElement(
'li',
array(),
@@ -109,60 +134,35 @@ class SpecialJavaScriptTest extends SpecialPage {
}
/**
- * Function to wrap the summary.
- * It must be given a valid state as a second parameter or an exception will
- * be thrown.
- * @param string $html The raw HTML.
- * @param string $state State, one of 'noframework', 'unknownframework' or 'frameworkfound'
- * @throws MWException
- * @return string
+ * Wrap HTML contents in a summary container.
+ *
+ * @param string $html HTML contents to be wrapped
+ * @return string HTML
*/
- private function wrapSummaryHtml( $html, $state ) {
- $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' );
-
- if ( !in_array( $state, $validStates ) ) {
- throw new MWException( __METHOD__
- . ' given an invalid state. Must be one of "'
- . join( '", "', $validStates ) . '".'
- );
- }
-
- return "<div id=\"mw-javascripttest-summary\" class=\"mw-javascripttest-$state\">$html</div>";
+ private function wrapSummaryHtml( $html ) {
+ return "<div id=\"mw-javascripttest-summary\">$html</div>";
}
/**
- * Initialize the page for QUnit.
+ * Run the test suite on the Special page.
+ *
+ * Rendered by OutputPage and Skin.
*/
- private function initQUnitTesting() {
+ private function viewQUnit() {
$out = $this->getOutput();
$testConfig = $this->getConfig()->get( 'JavaScriptTestConfig' );
- $out->addModules( 'test.mediawiki.qunit.testrunner' );
- $qunitTestModules = $out->getResourceLoader()->getTestModuleNames( 'qunit' );
- $out->addModules( $qunitTestModules );
+ $modules = $out->getResourceLoader()->getTestModuleNames( 'qunit' );
$summary = $this->msg( 'javascripttest-qunit-intro' )
->params( $testConfig['qunit']['documentation'] )
->parseAsBlock();
- $header = $this->msg( 'javascripttest-qunit-heading' )->escaped();
- $userDir = $this->getLanguage()->getDir();
$baseHtml = <<<HTML
<div class="mw-content-ltr">
-<div id="qunit-header"><span dir="$userDir">$header</span></div>
-<div id="qunit-banner"></div>
-<div id="qunit-testrunner-toolbar"></div>
-<div id="qunit-userAgent"></div>
-<ol id="qunit-tests"></ol>
-<div id="qunit-fixture">test markup, will be hidden</div>
+<div id="qunit"></div>
</div>
HTML;
- $out->addHtml( $this->wrapSummaryHtml( $summary, 'frameworkfound' ) . $baseHtml );
-
- // This special page is disabled by default ($wgEnableJavaScriptTest), and contains
- // no sensitive data. In order to allow TestSwarm to embed it into a test client window,
- // we need to allow iframing of this page.
- $out->allowClickjacking();
// Used in ./tests/qunit/data/testrunner.js, see also documentation of
// $wgJavaScriptTestConfig in DefaultSettings.php
@@ -170,6 +170,102 @@ HTML;
'QUnitTestSwarmInjectJSPath',
$testConfig['qunit']['testswarm-injectjs']
);
+
+ $out->addHtml( $this->wrapSummaryHtml( $summary ) . $baseHtml );
+
+ // The testrunner configures QUnit and essentially depends on it. However, test suites
+ // are reusable in environments that preload QUnit (or a compatibility interface to
+ // another framework). Therefore we have to load it ourselves.
+ $out->addHtml( Html::inlineScript(
+ ResourceLoader::makeLoaderConditionalScript(
+ Xml::encodeJsCall( 'mw.loader.using', array(
+ array( 'jquery.qunit', 'jquery.qunit.completenessTest' ),
+ new XmlJsCode(
+ 'function () {' . Xml::encodeJsCall( 'mw.loader.load', array( $modules ) ) . '}'
+ )
+ ) )
+ )
+ ) );
+ }
+
+ /**
+ * Generate self-sufficient JavaScript payload to run the tests elsewhere.
+ *
+ * Includes startup module to request modules from ResourceLoader.
+ *
+ * Note: This modifies the registry to replace 'jquery.qunit' with an
+ * empty module to allow external environment to preload QUnit with any
+ * neccecary framework adapters (e.g. Karma). Loading it again would
+ * re-define QUnit and dereference event handlers from Karma.
+ */
+ private function exportQUnit() {
+ $out = $this->getOutput();
+
+ $out->disable();
+
+ $rl = $out->getResourceLoader();
+
+ $query = array(
+ 'lang' => $this->getLanguage()->getCode(),
+ 'skin' => $this->getSkin()->getSkinName(),
+ 'debug' => ResourceLoader::inDebugMode() ? 'true' : 'false',
+ );
+ $embedContext = new ResourceLoaderContext( $rl, new FauxRequest( $query ) );
+ $query['only'] = 'scripts';
+ $startupContext = new ResourceLoaderContext( $rl, new FauxRequest( $query ) );
+
+ $modules = $rl->getTestModuleNames( 'qunit' );
+
+ // The below is essentially a pure-javascript version of OutputPage::getHeadScripts.
+ $startup = $rl->makeModuleResponse( $startupContext, array(
+ 'startup' => $rl->getModule( 'startup' ),
+ ) );
+ // Embed page-specific mw.config variables.
+ // The current Special page shouldn't be relevant to tests, but various modules (which
+ // are loaded before the test suites), reference mw.config while initialising.
+ $code = ResourceLoader::makeConfigSetScript( $out->getJSVars() );
+ // Embed private modules as they're not allowed to be loaded dynamically
+ $code .= $rl->makeModuleResponse( $embedContext, array(
+ 'user.options' => $rl->getModule( 'user.options' ),
+ 'user.tokens' => $rl->getModule( 'user.tokens' ),
+ ) );
+ $code .= Xml::encodeJsCall( 'mw.loader.load', array( $modules ) );
+
+ header( 'Content-Type: text/javascript; charset=utf-8' );
+ header( 'Cache-Control: private, no-cache, must-revalidate' );
+ header( 'Pragma: no-cache' );
+ echo $startup;
+ echo "\n";
+ // Note: The following has to be wrapped in a script tag because the startup module also
+ // writes a script tag (the one loading mediawiki.js). Script tags are synchronous, block
+ // each other, and run in order. But they don't nest. The code appended after the startup
+ // module runs before the added script tag is parsed and executed.
+ echo Xml::encodeJsCall( 'document.write', array( Html::inlineScript( $code ) ) );
+ }
+
+ private function plainQUnit() {
+ $out = $this->getOutput();
+ $out->disable();
+
+ $url = $this->getPageTitle( 'qunit/export' )->getFullURL( array(
+ 'debug' => ResourceLoader::inDebugMode() ? 'true' : 'false',
+ ) );
+
+ $styles = $out->makeResourceLoaderLink( 'jquery.qunit', ResourceLoaderModule::TYPE_STYLES, false );
+ // Use 'raw' since this is a plain HTML page without ResourceLoader
+ $scripts = $out->makeResourceLoaderLink( 'jquery.qunit', ResourceLoaderModule::TYPE_SCRIPTS, false, array( 'raw' => 'true' ) );
+
+ $head = trim( $styles['html'] . $scripts['html'] );
+ $html = <<<HTML
+<!DOCTYPE html>
+<title>QUnit</title>
+$head
+<div id="qunit"></div>
+HTML;
+ $html .= "\n" . Html::linkedScript( $url );
+
+ header( 'Content-Type: text/html; charset=utf-8' );
+ echo $html;
}
/**
@@ -183,7 +279,7 @@ HTML;
return self::prefixSearchArray(
$search,
$limit,
- array_keys( self::$frameworks )
+ self::$frameworks
);
}
diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php
index 6de7c90d..24b636b1 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -538,14 +538,11 @@ class LoginForm extends SpecialPage {
return Status::newFatal( 'badretype' );
}
- # check for minimal password length
- $valid = $u->getPasswordValidity( $this->mPassword );
- if ( $valid !== true ) {
- if ( !is_array( $valid ) ) {
- $valid = array( $valid, $wgMinimalPasswordLength );
- }
-
- return call_user_func_array( 'Status::newFatal', $valid );
+ # check for password validity, return a fatal Status if invalid
+ $validity = $u->checkPasswordValidity( $this->mPassword );
+ if ( !$validity->isGood() ) {
+ $validity->ok = false; // make sure this Status is fatal
+ return $validity;
}
}
diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index 89ce2b3a..14959c26 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -1416,27 +1416,22 @@ abstract class UploadBase {
}
}
- # href with embedded svg as target
- if ( $stripped == 'href' && preg_match( '!data:[^,]*image/svg[^,]*,!sim', $value ) ) {
- wfDebug( __METHOD__ . ": Found href to embedded svg "
- . "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
-
- return true;
- }
-
- # href with embedded (text/xml) svg as target
- if ( $stripped == 'href' && preg_match( '!data:[^,]*text/xml[^,]*,!sim', $value ) ) {
- wfDebug( __METHOD__ . ": Found href to embedded svg "
- . "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
-
- return true;
+ # only allow data: targets that should be safe. This prevents vectors like,
+ # image/svg, text/xml, application/xml, and text/html, which can contain scripts
+ if ( $stripped == 'href' && strncasecmp( 'data:', $value, 5 ) === 0 ) {
+ // rfc2397 parameters. This is only slightly slower than (;[\w;]+)*.
+ $parameters = '(?>;[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+=(?>[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+|"(?>[\0-\x0c\x0e-\x21\x23-\x5b\x5d-\x7f]+|\\\\[\0-\x7f])*"))*(?:;base64)?';
+ if ( !preg_match( "!^data:\s*image/(gif|jpeg|jpg|png)$parameters,!i", $value ) ) {
+ wfDebug( __METHOD__ . ": Found href to unwhitelisted data: uri "
+ . "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
+ return true;
+ }
}
- # Change href with animate from (http://html5sec.org/#137). This doesn't seem
- # possible without embedding the svg, but filter here in case.
- if ( $stripped == 'from'
+ # Change href with animate from (http://html5sec.org/#137).
+ if ( $stripped === 'attributename'
&& $strippedElement === 'animate'
- && !preg_match( '!^https?://!im', $value )
+ && $this->stripXmlNamespace( $value ) == 'href'
) {
wfDebug( __METHOD__ . ": Found animate that might be changing href using from "
. "\"<$strippedElement '$attrib'='$value'...\" in uploaded file.\n" );
@@ -1528,7 +1523,7 @@ abstract class UploadBase {
private static function checkCssFragment( $value ) {
# Forbid external stylesheets, for both reliability and to protect viewer's privacy
- if ( strpos( $value, '@import' ) !== false ) {
+ if ( stripos( $value, '@import' ) !== false ) {
return true;
}
diff --git a/jsduck.json b/jsduck.json
new file mode 100644
index 00000000..ef92fa12
--- /dev/null
+++ b/jsduck.json
@@ -0,0 +1,40 @@
+{
+ "--title": "MediaWiki core - Documentation",
+ "--categories": "maintenance/jsduck/categories.json",
+ "--eg-iframe": "maintenance/jsduck/eg-iframe.html",
+ "--tags": "maintenance/jsduck/CustomTags.rb",
+ "--warnings": ["-nodoc(class,public)"],
+ "--builtin-classes": true,
+ "--processes": "0",
+ "--warnings-exit-nonzero": true,
+ "--external": "HTMLElement,HTMLDocument,Window,File",
+ "--output": "docs/js",
+ "--": [
+ "maintenance/jsduck/external.js",
+ "resources/src/mediawiki",
+ "resources/src/mediawiki.action",
+ "resources/src/mediawiki.api",
+ "resources/src/mediawiki.language",
+ "resources/src/mediawiki.page",
+ "resources/src/mediawiki.special",
+ "resources/src/jquery/jquery.accessKeyLabel.js",
+ "resources/src/jquery/jquery.arrowSteps.js",
+ "resources/src/jquery/jquery.autoEllipsis.js",
+ "resources/src/jquery/jquery.badge.js",
+ "resources/src/jquery/jquery.byteLength.js",
+ "resources/src/jquery/jquery.byteLimit.js",
+ "resources/src/jquery/jquery.checkboxShiftClick.js",
+ "resources/src/jquery/jquery.client.js",
+ "resources/src/jquery/jquery.colorUtil.js",
+ "resources/src/jquery/jquery.confirmable.js",
+ "resources/src/jquery/jquery.footHovzer.js",
+ "resources/src/jquery/jquery.getAttrs.js",
+ "resources/src/jquery/jquery.hidpi.js",
+ "resources/src/jquery/jquery.localize.js",
+ "resources/src/jquery/jquery.makeCollapsible.js",
+ "resources/src/jquery/jquery.spinner.js",
+ "resources/src/jquery/jquery.tabIndex.js",
+ "resources/lib/oojs",
+ "resources/lib/oojs-ui"
+ ]
+}
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 9c1a0438..19832b22 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -452,6 +452,7 @@
"wrongpassword": "Incorrect password entered.\nPlease try again.",
"wrongpasswordempty": "Password entered was blank.\nPlease try again.",
"passwordtooshort": "Passwords must be at least {{PLURAL:$1|1 character|$1 characters}}.",
+ "passwordtoolong": "Passwords cannot be longer than {{PLURAL:$1|1 character|$1 characters}}.",
"password-name-match": "Your password must be different from your username.",
"password-login-forbidden": "The use of this username and password has been forbidden.",
"mailmypassword": "Reset password",
@@ -2331,14 +2332,14 @@
"import-logentry-interwiki-detail": "$1 {{PLURAL:$1|revision|revisions}} imported from $2",
"javascripttest": "JavaScript testing",
"javascripttest-backlink": "< $1",
- "javascripttest-title": "Running $1 tests",
+ "javascripttest-title": "$1",
"javascripttest-pagetext-noframework": "This page is reserved for running JavaScript tests.",
"javascripttest-pagetext-unknownframework": "Unknown testing framework \"$1\".",
+ "javascripttest-pagetext-unknownaction": "Unknown action \"$1\".",
"javascripttest-pagetext-frameworks": "Please choose one of the following testing frameworks: $1",
"javascripttest-pagetext-skins": "Choose a skin to run the tests with:",
"javascripttest-qunit-name": "QUnit",
"javascripttest-qunit-intro": "See [$1 testing documentation] on mediawiki.org.",
- "javascripttest-qunit-heading": "MediaWiki JavaScript QUnit test suite",
"accesskey-pt-userpage": ".",
"accesskey-pt-anonuserpage": ".",
"accesskey-pt-mytalk": "n",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 9562e450..7ee37392 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -612,6 +612,7 @@
"wrongpassword": "Used as error message when the provided password is wrong.\nThis message is used in html.\n{{Identical|Please try again}}",
"wrongpasswordempty": "Error message displayed when entering a blank password.\n{{Identical|Please try again}}",
"passwordtooshort": "This message is shown in [[Special:Preferences]] and [[Special:CreateAccount]].\n\nParameters:\n* $1 - the minimum number of characters in the password",
+ "passwordtoolong": "This message is shown in [[Special:Preferences]], [[Special:CreateAccount]], and [[Special:Userlogin]].\n\nParameters:\n* $1 - the maximum number of characters in the password",
"password-name-match": "Used as error message when password validity check failed.",
"password-login-forbidden": "Error message shown when the user has tried to log in using one of the special username/password combinations used for MediaWiki testing. (See [[mwr:75589]], [[mwr:75605]].)",
"mailmypassword": "Used as label for Submit button in [[Special:PasswordReset]].\n{{Identical|Reset password}}",
@@ -2491,14 +2492,14 @@
"import-logentry-interwiki-detail": "Used as success message and log entry. Parameters:\n* $1 - number of succeeded revisions\n* $2 - interwiki name\nSee also:\n* {{msg-mw|Import-logentry-upload-detail}}",
"javascripttest": "Title of the special page [[Special:JavaScriptTest]].\n\nSee also:\n* {{msg-mw|Javascripttest|title}}\n* {{msg-mw|Javascripttest-pagetext-noframework|summary}}\n* {{msg-mw|Javascripttest-pagetext-unknownframework|error message}}",
"javascripttest-backlink": "{{optional}}\nUsed as subtitle in [[Special:JavaScriptTest]]. Parameters:\n* $1 - page title",
- "javascripttest-title": "Title of the special page when running a test suite. Parameters:\n* $1 is the name of the framework, for example QUnit.",
+ "javascripttest-title": "{{Ignore}}",
"javascripttest-pagetext-noframework": "Used as summary when no framework specified.\n\nSee also:\n* {{msg-mw|Javascripttest|title}}\n* {{msg-mw|Javascripttest-pagetext-noframework|summary}}\n* {{msg-mw|Javascripttest-pagetext-unknownframework|error message}}",
"javascripttest-pagetext-unknownframework": "Error message when given framework ID is not found. Parameters:\n* $1 - the ID of the framework\nSee also:\n* {{msg-mw|Javascripttest|title}}\n* {{msg-mw|Javascripttest-pagetext-noframework|summary}}\n* {{msg-mw|Javascripttest-pagetext-unknownframework|error message}}",
+ "javascripttest-pagetext-unknownaction": "Error message when url specifies an unknown action. Parameters:\n* $1 - the action specified in the url.",
"javascripttest-pagetext-frameworks": "Parameters:\n* $1 - frameworks list which contain a link text {{msg-mw|Javascripttest-qunit-name}}",
"javascripttest-pagetext-skins": "Used as label in [[Special:JavaScriptTest]].",
"javascripttest-qunit-name": "{{Ignore}}",
"javascripttest-qunit-intro": "Used as summary. Parameters:\n* $1 - the configured URL to the documentation\nSee also:\n* {{msg-mw|Javascripttest-qunit-heading}}",
- "javascripttest-qunit-heading": "See also:\n* {{msg-mw|Javascripttest-qunit-intro}}",
"accesskey-pt-userpage": "{{doc-accesskey}}\nSee also:\n<!--* username-->\n* {{msg-mw|Accesskey-pt-userpage}}\n* {{msg-mw|Tooltip-pt-userpage}}",
"accesskey-pt-anonuserpage": "{{doc-accesskey}}",
"accesskey-pt-mytalk": "{{doc-accesskey}}\nSee also:\n* {{msg-mw|Mytalk}}\n* {{msg-mw|Accesskey-pt-mytalk}}\n* {{msg-mw|Tooltip-pt-mytalk}}",
diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json
deleted file mode 100644
index e97f2923..00000000
--- a/maintenance/jsduck/config.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "--title": "MediaWiki core - Documentation",
- "--categories": "./categories.json",
- "--eg-iframe": "./eg-iframe.html",
- "--tags": "./CustomTags.rb",
- "--warnings": ["-nodoc(class,public)"],
- "--builtin-classes": true,
- "--warnings-exit-nonzero": true,
- "--external": "HTMLElement,HTMLDocument,Window,File",
- "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.",
- "--output": "../../docs/js",
- "--": [
- "./external.js",
- "../../resources/src/mediawiki",
- "../../resources/src/mediawiki.action",
- "../../resources/src/mediawiki.api",
- "../../resources/src/mediawiki.language",
- "../../resources/src/mediawiki.page",
- "../../resources/src/mediawiki.special",
- "../../resources/src/jquery/jquery.accessKeyLabel.js",
- "../../resources/src/jquery/jquery.arrowSteps.js",
- "../../resources/src/jquery/jquery.autoEllipsis.js",
- "../../resources/src/jquery/jquery.badge.js",
- "../../resources/src/jquery/jquery.byteLength.js",
- "../../resources/src/jquery/jquery.byteLimit.js",
- "../../resources/src/jquery/jquery.checkboxShiftClick.js",
- "../../resources/src/jquery/jquery.client.js",
- "../../resources/src/jquery/jquery.colorUtil.js",
- "../../resources/src/jquery/jquery.confirmable.js",
- "../../resources/src/jquery/jquery.footHovzer.js",
- "../../resources/src/jquery/jquery.getAttrs.js",
- "../../resources/src/jquery/jquery.hidpi.js",
- "../../resources/src/jquery/jquery.localize.js",
- "../../resources/src/jquery/jquery.makeCollapsible.js",
- "../../resources/src/jquery/jquery.spinner.js",
- "../../resources/src/jquery/jquery.tabIndex.js",
- "../../resources/lib/oojs",
- "../../resources/lib/oojs-ui"
- ]
-}
diff --git a/maintenance/mwjsduck-gen b/maintenance/mwjsduck-gen
index 5247637b..6b7c77b6 100644
--- a/maintenance/mwjsduck-gen
+++ b/maintenance/mwjsduck-gen
@@ -1,25 +1,4 @@
#!/usr/bin/env bash
set -e
-
-JSDUCK_MWVERSION=master
-if [[ "$1" == "--version" && "$2" != "" ]]
-then
- JSDUCK_MWVERSION="$2"
-elif [[ "$*" != "" ]]
-then
- FILENAME=$(basename $0)
- echo "Usage: $FILENAME [--version <mediawiki version>]"
- echo
- exit 1
-fi
-
-MWCORE_DIR=$(cd $(dirname $0)/..; pwd)
-
-jsduck \
---config=$MWCORE_DIR/maintenance/jsduck/config.json \
---footer="Documentation for branch ($JSDUCK_MWVERSION) on {DATE} by {JSDUCK} {VERSION}." \
---processes 0
-
-echo 'JSDuck execution finished.'
-
-ln -s ../../resources $MWCORE_DIR/docs/js/modules
+cd $(dirname $0)/..
+jsduck
diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql
index 400050e7..12e357fc 100644
--- a/maintenance/postgres/tables.sql
+++ b/maintenance/postgres/tables.sql
@@ -421,7 +421,7 @@ CREATE TABLE recentchanges (
rc_minor SMALLINT NOT NULL DEFAULT 0,
rc_bot SMALLINT NOT NULL DEFAULT 0,
rc_new SMALLINT NOT NULL DEFAULT 0,
- rc_cur_id INTEGER NULL REFERENCES page(page_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
+ rc_cur_id INTEGER NULL,
rc_this_oldid INTEGER NOT NULL,
rc_last_oldid INTEGER NOT NULL,
rc_type SMALLINT NOT NULL DEFAULT 0,
diff --git a/resources/Resources.php b/resources/Resources.php
index 70f64dd3..ec1c0fc4 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1401,7 +1401,9 @@ return array(
'colon-separator',
'javascripttest-pagetext-skins',
) ),
- 'dependencies' => array( 'jquery.qunit' ),
+ 'dependencies' => array(
+ 'mediawiki.Uri',
+ ),
'position' => 'top',
'targets' => array( 'desktop', 'mobile' ),
),
diff --git a/resources/lib/jquery/jquery.js b/resources/lib/jquery/jquery.js
index d4b67f7e..1c3aa822 100644
--- a/resources/lib/jquery/jquery.js
+++ b/resources/lib/jquery/jquery.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.11.1
+ * jQuery JavaScript Library v1.11.2
* http://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* http://jquery.org/license
*
- * Date: 2014-05-01T17:42Z
+ * Date: 2014-12-17T15:27Z
*/
(function( global, factory ) {
@@ -64,7 +64,7 @@ var support = {};
var
- version = "1.11.1",
+ version = "1.11.2",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -269,7 +269,8 @@ jQuery.extend({
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
- return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
+ // adding 1 corrects loss of precision from parseFloat (#15100)
+ return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
},
isEmptyObject: function( obj ) {
@@ -584,14 +585,14 @@ function isArraylike( obj ) {
}
var Sizzle =
/*!
- * Sizzle CSS Selector Engine v1.10.19
+ * Sizzle CSS Selector Engine v2.2.0-pre
* http://sizzlejs.com/
*
- * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
- * Date: 2014-04-18
+ * Date: 2014-12-16
*/
(function( window ) {
@@ -618,7 +619,7 @@ var i,
contains,
// Instance-specific data
- expando = "sizzle" + -(new Date()),
+ expando = "sizzle" + 1 * new Date(),
preferredDoc = window.document,
dirruns = 0,
done = 0,
@@ -633,7 +634,6 @@ var i,
},
// General-purpose constants
- strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Instance methods
@@ -643,12 +643,13 @@ var i,
push_native = arr.push,
push = arr.push,
slice = arr.slice,
- // Use a stripped-down indexOf if we can't use a native one
- indexOf = arr.indexOf || function( elem ) {
+ // Use a stripped-down indexOf as it's faster than native
+ // http://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
var i = 0,
- len = this.length;
+ len = list.length;
for ( ; i < len; i++ ) {
- if ( this[i] === elem ) {
+ if ( list[i] === elem ) {
return i;
}
}
@@ -688,6 +689,7 @@ var i,
")\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
@@ -739,6 +741,14 @@ var i,
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
};
// Optimize for push.apply( _, NodeList )
@@ -781,19 +791,18 @@ function Sizzle( selector, context, results, seed ) {
context = context || document;
results = results || [];
+ nodeType = context.nodeType;
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
- if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
- return [];
+ return results;
}
- if ( documentIsHTML && !seed ) {
+ if ( !seed && documentIsHTML ) {
- // Shortcuts
- if ( (match = rquickExpr.exec( selector )) ) {
+ // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
@@ -825,7 +834,7 @@ function Sizzle( selector, context, results, seed ) {
return results;
// Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ } else if ( (m = match[3]) && support.getElementsByClassName ) {
push.apply( results, context.getElementsByClassName( m ) );
return results;
}
@@ -835,7 +844,7 @@ function Sizzle( selector, context, results, seed ) {
if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
nid = old = expando;
newContext = context;
- newSelector = nodeType === 9 && selector;
+ newSelector = nodeType !== 1 && selector;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
@@ -1022,7 +1031,7 @@ function createPositionalPseudo( fn ) {
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
function testContext( context ) {
- return context && typeof context.getElementsByTagName !== strundefined && context;
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
}
// Expose support vars for convenience
@@ -1046,9 +1055,8 @@ isXML = Sizzle.isXML = function( elem ) {
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare,
- doc = node ? node.ownerDocument || node : preferredDoc,
- parent = doc.defaultView;
+ var hasCompare, parent,
+ doc = node ? node.ownerDocument || node : preferredDoc;
// If no document and documentElement is available, return
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
@@ -1058,9 +1066,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Set our document
document = doc;
docElem = doc.documentElement;
-
- // Support tests
- documentIsHTML = !isXML( doc );
+ parent = doc.defaultView;
// Support: IE>8
// If iframe document is assigned to "document" variable and if iframe has been reloaded,
@@ -1069,21 +1075,22 @@ setDocument = Sizzle.setDocument = function( node ) {
if ( parent && parent !== parent.top ) {
// IE11 does not have attachEvent, so all must suffer
if ( parent.addEventListener ) {
- parent.addEventListener( "unload", function() {
- setDocument();
- }, false );
+ parent.addEventListener( "unload", unloadHandler, false );
} else if ( parent.attachEvent ) {
- parent.attachEvent( "onunload", function() {
- setDocument();
- });
+ parent.attachEvent( "onunload", unloadHandler );
}
}
+ /* Support tests
+ ---------------------------------------------------------------------- */
+ documentIsHTML = !isXML( doc );
+
/* Attributes
---------------------------------------------------------------------- */
// Support: IE<8
- // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
support.attributes = assert(function( div ) {
div.className = "i";
return !div.getAttribute("className");
@@ -1098,17 +1105,8 @@ setDocument = Sizzle.setDocument = function( node ) {
return !div.getElementsByTagName("*").length;
});
- // Check if getElementsByClassName can be trusted
- support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
- div.innerHTML = "<div class='a'></div><div class='a i'></div>";
-
- // Support: Safari<4
- // Catch class over-caching
- div.firstChild.className = "i";
- // Support: Opera<10
- // Catch gEBCN failure to find non-leading classes
- return div.getElementsByClassName("i").length === 2;
- });
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
// Support: IE<10
// Check if getElementById returns elements by name
@@ -1122,7 +1120,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// ID find and filter
if ( support.getById ) {
Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var m = context.getElementById( id );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
@@ -1143,7 +1141,7 @@ setDocument = Sizzle.setDocument = function( node ) {
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
@@ -1152,14 +1150,20 @@ setDocument = Sizzle.setDocument = function( node ) {
// Tag
Expr.find["TAG"] = support.getElementsByTagName ?
function( tag, context ) {
- if ( typeof context.getElementsByTagName !== strundefined ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
}
} :
+
function( tag, context ) {
var elem,
tmp = [],
i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
results = context.getElementsByTagName( tag );
// Filter out possible comments
@@ -1177,7 +1181,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Class
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ if ( documentIsHTML ) {
return context.getElementsByClassName( className );
}
};
@@ -1206,13 +1210,15 @@ setDocument = Sizzle.setDocument = function( node ) {
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
- div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
+ docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
+ "<select id='" + expando + "-\f]' msallowcapture=''>" +
+ "<option selected=''></option></select>";
// Support: IE8, Opera 11-12.16
// Nothing should be selected when empty strings follow ^= or $= or *=
// The test attribute must be unknown in Opera but "safe" for WinRT
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( div.querySelectorAll("[msallowclip^='']").length ) {
+ if ( div.querySelectorAll("[msallowcapture^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
}
@@ -1222,12 +1228,24 @@ setDocument = Sizzle.setDocument = function( node ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
}
+ // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibing-combinator selector` fails
+ if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
});
assert(function( div ) {
@@ -1344,7 +1362,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Maintain original order
return sortInput ?
- ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
}
@@ -1371,7 +1389,7 @@ setDocument = Sizzle.setDocument = function( node ) {
aup ? -1 :
bup ? 1 :
sortInput ?
- ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
// If the nodes are siblings, we can do a quick check
@@ -1434,7 +1452,7 @@ Sizzle.matchesSelector = function( elem, expr ) {
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
- } catch(e) {}
+ } catch (e) {}
}
return Sizzle( expr, document, null, [ elem ] ).length > 0;
@@ -1653,7 +1671,7 @@ Expr = Sizzle.selectors = {
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
});
},
@@ -1675,7 +1693,7 @@ Expr = Sizzle.selectors = {
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
};
@@ -1795,7 +1813,7 @@ Expr = Sizzle.selectors = {
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
- idx = indexOf.call( seed, matched[i] );
+ idx = indexOf( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
@@ -1834,6 +1852,8 @@ Expr = Sizzle.selectors = {
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
return !results.pop();
};
}),
@@ -1845,6 +1865,7 @@ Expr = Sizzle.selectors = {
}),
"contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
@@ -2266,7 +2287,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
seed[temp] = !(results[temp] = elem);
}
@@ -2301,13 +2322,16 @@ function matcherFromTokens( tokens ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
- return indexOf.call( checkContext, elem ) > -1;
+ return indexOf( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
} ];
for ( ; i < len; i++ ) {
@@ -2557,7 +2581,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
// Sort stability
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-// Support: Chrome<14
+// Support: Chrome 14-35+
// Always assume duplicates if they aren't passed to the comparison function
support.detectDuplicates = !!hasDuplicate;
@@ -6115,7 +6139,14 @@ var getStyles, curCSS,
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
- return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
+ // IE throws on elements created in popups
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+ if ( elem.ownerDocument.defaultView.opener ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ }
+
+ return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, computed ) {
@@ -6363,6 +6394,8 @@ function addGetHookIf( conditionFn, hookFn ) {
reliableMarginRightVal =
!parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
+
+ div.removeChild( contents );
}
// Support: IE8
@@ -9070,7 +9103,8 @@ jQuery.extend({
}
// We can fire global events as of now if asked to
- fireGlobals = s.global;
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ fireGlobals = jQuery.event && s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
@@ -9329,13 +9363,6 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
};
});
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
-});
-
jQuery._evalUrl = function( url ) {
return jQuery.ajax({
@@ -9561,8 +9588,9 @@ var xhrId = 0,
// Support: IE<10
// Open requests must be manually aborted on unload (#5280)
-if ( window.ActiveXObject ) {
- jQuery( window ).on( "unload", function() {
+// See https://support.microsoft.com/kb/2856746 for more info
+if ( window.attachEvent ) {
+ window.attachEvent( "onunload", function() {
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
}
@@ -9996,6 +10024,16 @@ jQuery.fn.load = function( url, params, callback ) {
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+});
+
+
+
+
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
diff --git a/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js b/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js
index d3e8f299..fb74e4ec 100644
--- a/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js
+++ b/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js
@@ -6,7 +6,7 @@
// Create useskin dropdown menu and reload onchange to the selected skin
// (only if a framework was found, not on error pages).
- $( '#mw-javascripttest-summary.mw-javascripttest-frameworkfound' ).append( function () {
+ $( '#mw-javascripttest-summary' ).append( function () {
var $html = $( '<p><label for="useskin">'
+ mw.message( 'javascripttest-pagetext-skins' ).escaped()
@@ -25,7 +25,8 @@
// Bind onchange event handler and append to form
$html.append(
$( select ).change( function () {
- window.location = QUnit.url( { useskin: $( this ).val() } );
+ var url = new mw.Uri();
+ location.href = url.extend( { useskin: $( this ).val() } );
} )
);
diff --git a/skins/CologneBlue/SkinCologneBlue.php b/skins/CologneBlue/SkinCologneBlue.php
index eb7d50b6..41bc0bae 100644
--- a/skins/CologneBlue/SkinCologneBlue.php
+++ b/skins/CologneBlue/SkinCologneBlue.php
@@ -571,6 +571,9 @@ class CologneBlueTemplate extends BaseTemplate {
$s = "<div id='quickbar'>\n";
foreach ( $bar as $heading => $data ) {
+ // Numeric strings gets an integer when set as key, cast back - T73639
+ $heading = (string)$heading;
+
$portletId = Sanitizer::escapeId( "p-$heading" );
$headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
$headingHTML = "<h3>";
diff --git a/skins/MonoBook/MonoBookTemplate.php b/skins/MonoBook/MonoBookTemplate.php
index c432625f..8637b087 100644
--- a/skins/MonoBook/MonoBookTemplate.php
+++ b/skins/MonoBook/MonoBookTemplate.php
@@ -207,6 +207,9 @@ class MonoBookTemplate extends BaseTemplate {
continue;
}
+ // Numeric strings gets an integer when set as key, cast back - T73639
+ $boxName = (string)$boxName;
+
if ( $boxName == 'SEARCH' ) {
$this->searchBox();
} elseif ( $boxName == 'TOOLBOX' ) {
diff --git a/skins/Vector/SkinVector.php b/skins/Vector/SkinVector.php
index 8f7056d7..565c64bb 100644
--- a/skins/Vector/SkinVector.php
+++ b/skins/Vector/SkinVector.php
@@ -35,8 +35,8 @@ class SkinVector extends SkinTemplate {
*/
private $vectorConfig;
- public function __construct( Config $config ) {
- $this->vectorConfig = $config;
+ public function __construct() {
+ $this->vectorConfig = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
}
protected static $bodyClasses = array( 'vector-animateLayout' );
diff --git a/skins/Vector/Vector.php b/skins/Vector/Vector.php
index 16bec178..2ffc3a7b 100644
--- a/skins/Vector/Vector.php
+++ b/skins/Vector/Vector.php
@@ -38,10 +38,7 @@ $GLOBALS['wgAutoloadClasses']['VectorTemplate'] = __DIR__ . '/VectorTemplate.php
$GLOBALS['wgMessagesDirs']['Vector'] = __DIR__ . '/i18n';
// Register skin
-SkinFactory::getDefaultInstance()->register( 'vector', 'Vector', function(){
- $config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
- return new SkinVector( $config );
-} );
+$GLOBALS['wgValidSkinNames']['vector'] = 'Vector';
// Register config
$GLOBALS['wgConfigRegistry']['vector'] = 'GlobalVarConfig::newInstance';
@@ -97,11 +94,14 @@ $GLOBALS['wgResourceModuleSkinStyles']['vector'] = array(
'jquery.ui.button' => 'skinStyles/jquery.ui/jquery.ui.button.css',
'jquery.ui.datepicker' => 'skinStyles/jquery.ui/jquery.ui.datepicker.css',
'jquery.ui.dialog' => 'skinStyles/jquery.ui/jquery.ui.dialog.css',
+ 'jquery.ui.menu' => 'skinStyles/jquery.ui/jquery.ui.menu.css',
'jquery.ui.progressbar' => 'skinStyles/jquery.ui/jquery.ui.progressbar.css',
'jquery.ui.resizable' => 'skinStyles/jquery.ui/jquery.ui.resizable.css',
'jquery.ui.selectable' => 'skinStyles/jquery.ui/jquery.ui.selectable.css',
'jquery.ui.slider' => 'skinStyles/jquery.ui/jquery.ui.slider.css',
+ 'jquery.ui.spinner' => 'skinStyles/jquery.ui/jquery.ui.spinner.css',
'jquery.ui.tabs' => 'skinStyles/jquery.ui/jquery.ui.tabs.css',
+ 'jquery.ui.tooltips' => 'skinStyles/jquery.ui/jquery.ui.tooltips.css',
'mediawiki.notification' => 'skinStyles/mediawiki.notification.less',
'mediawiki.special' => 'skinStyles/mediawiki.special.less',
'mediawiki.special.preferences' => 'skinStyles/mediawiki.special.preferences.less',
diff --git a/skins/Vector/VectorTemplate.php b/skins/Vector/VectorTemplate.php
index 30ba32e5..6e4e2f1e 100644
--- a/skins/Vector/VectorTemplate.php
+++ b/skins/Vector/VectorTemplate.php
@@ -279,6 +279,9 @@ class VectorTemplate extends BaseTemplate {
continue;
}
+ // Numeric strings gets an integer when set as key, cast back - T73639
+ $name = (string)$name;
+
switch ( $name ) {
case 'SEARCH':
break;
diff --git a/skins/Vector/skinStyles/jquery.ui/PATCHES b/skins/Vector/skinStyles/jquery.ui/PATCHES
new file mode 100644
index 00000000..85f663ed
--- /dev/null
+++ b/skins/Vector/skinStyles/jquery.ui/PATCHES
@@ -0,0 +1,25 @@
+jquery.ui.button.css
+* Picked from jQuery UI 1.11.2-alpha instead of 1.9.2.
+* Extra customizations.
+
+jquery.ui.datepicker.css
+* Add @noflip to prevent CSSJanus flipping.
+
+jquery.ui.dialog.css
+* Extra customizations.
+
+jquery.ui.resizable.css
+* Add @noflip to prevent CSSJanus flipping.
+
+jquery.ui.theme.css
+* Add @embed instructions for CSSMin.
+* Change font-size from 1.0em to 0.8em.
+* Join ".ui-icon", ".ui-widget-content .ui-icon" and ".ui-widget-header .ui-icon" rules
+ to optimise image embedding.
+* Removed ".ui-widget-content a { color: #362b36; }" and
+ ".ui-widget-header a { color: #222222; }" due to bug T85857.
+
+images:
+* Add close.png and titlebar-fade.png (used in customizations for
+ jquery.ui.dialog.css)
+* Change chmod from 755 to 644.
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-anim_basic_16x16.gif b/skins/Vector/skinStyles/jquery.ui/images/ui-anim_basic_16x16.gif
deleted file mode 100644
index 085ccaec..00000000
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-anim_basic_16x16.gif
+++ /dev/null
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_100_000000_40x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_100_000000_40x100.png
new file mode 100644
index 00000000..162ef61b
--- /dev/null
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_100_000000_40x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_15_cd0a0a_40x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_15_cd0a0a_40x100.png
index 09de537f..debc52e6 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_15_cd0a0a_40x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_15_cd0a0a_40x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_70_000000_40x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_70_000000_40x100.png
index c06dd561..13032d6d 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_70_000000_40x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_flat_70_000000_40x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png
index 5308b466..7ccbbd06 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_80_d7ebf9_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_80_d7ebf9_1x100.png
index 0c8997f7..d09a8746 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_80_d7ebf9_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-hard_80_d7ebf9_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_e4f1fb_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_e4f1fb_1x100.png
index 31492556..8d46985f 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_e4f1fb_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_e4f1fb_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_ffffff_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_ffffff_1x100.png
index 09b23761..26e4666f 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_ffffff_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_100_ffffff_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_25_ffef8f_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_25_ffef8f_1x100.png
index 66627c18..d044ef6f 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_25_ffef8f_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_highlight-soft_25_ffef8f_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_inset-hard_100_f0f0f0_1x100.png b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_inset-hard_100_f0f0f0_1x100.png
index ccb6dc06..47e1f073 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-bg_inset-hard_100_f0f0f0_1x100.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-bg_inset-hard_100_f0f0f0_1x100.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_2694e8_256x240.png b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_2694e8_256x240.png
index 998ac3bc..252bf0f5 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_2694e8_256x240.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_2694e8_256x240.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_3d80b3_256x240.png b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_3d80b3_256x240.png
index ec129a8b..ff1c26ff 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_3d80b3_256x240.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_3d80b3_256x240.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_666666_256x240.png b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_666666_256x240.png
index a32c57d8..76cecfc0 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_666666_256x240.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_666666_256x240.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_72a7cf_256x240.png b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_72a7cf_256x240.png
index 88fad1a5..9d079149 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_72a7cf_256x240.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_72a7cf_256x240.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_ffffff_256x240.png b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_ffffff_256x240.png
index 29ba7d28..4f624bb2 100644
--- a/skins/Vector/skinStyles/jquery.ui/images/ui-icons_ffffff_256x240.png
+++ b/skins/Vector/skinStyles/jquery.ui/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.autocomplete.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.autocomplete.css
index da6de452..4ef3497a 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.autocomplete.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.autocomplete.css
@@ -1,40 +1,19 @@
-/* Autocomplete
-----------------------------------*/
-.ui-autocomplete { position: absolute; cursor: default; }
-.ui-autocomplete-loading { /* @embed */ background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
+/*!
+ * jQuery UI Autocomplete 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
-
-/* Menu
-----------------------------------*/
-.ui-menu {
- list-style:none;
- padding: 2px;
- margin: 0;
- display:block;
- float: left;
-}
-.ui-menu .ui-menu {
- margin-top: -3px;
-}
-.ui-menu .ui-menu-item {
- margin:0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
-}
-.ui-menu .ui-menu-item a {
- text-decoration:none;
- display:block;
- padding:.2em .4em;
- line-height:1.5;
- zoom:1;
-}
-.ui-menu .ui-menu-item a.ui-state-hover,
-.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
-}
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.button.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.button.css
index 8c2286d1..d3bb7275 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.button.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.button.css
@@ -1,92 +1,118 @@
-/* Button
-----------------------------------*/
-
+/*!
+ * jQuery UI Button 1.11.2-alpha
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/button/#theming
+ */
.ui-button {
display: inline-block;
position: relative;
padding: 0;
+ line-height: normal;
margin-right: .1em;
- text-decoration: none !important;
cursor: pointer;
+ vertical-align: middle;
text-align: center;
- zoom: 1;
- overflow: visible; /* the overflow property removes extra width in IE */
+ overflow: visible; /* removes extra width in IE */
+}
+.ui-button,
+.ui-button:link,
+.ui-button:visited,
+.ui-button:hover,
+.ui-button:active {
+ text-decoration: none;
+}
+/* to make room for the icon, a width needs to be set here */
+.ui-button-icon-only {
+ width: 2.2em;
+}
+/* button elements seem to need a little more width */
+button.ui-button-icon-only {
+ width: 2.4em;
+}
+.ui-button-icons-only {
+ width: 3.4em;
+}
+button.ui-button-icons-only {
+ width: 3.7em;
}
-/*button text element */
+/* button text element */
.ui-button .ui-button-text {
display: block;
- line-height: 1.4;
- text-shadow: 0 1px 1px #fff;
+ line-height: normal;
}
.ui-button-text-only .ui-button-text {
- padding: 0.3em 1em 0.25em 1em;
+ padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
- padding: 0.3em;
+ padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
- padding: 0.3em 1em 0.25em 2.1em;
+ padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
- padding: 0.3em 2.1em 0.25em 1em;
+ padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
-
/* no icon support for input elements, provide padding by default */
input.ui-button {
- padding: 0.3em 1em;
+ padding: .4em 1em;
}
-/*button icon element(s) */
+/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
-.ui-button-text-icon .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
- margin-top: -9px;
+ margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
-.ui-button-text-icon .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
- left: 0.5em;
+ left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
-.ui-button-text-icon .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
- right: 0.5em;
+ right: .5em;
}
-/*button sets*/
+/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
- margin-right: -.4em;
+ margin-right: -.3em;
}
/* workarounds */
+/* reset extra padding in Firefox, see h5bp.com/l */
+input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
- padding: 0; /* reset extra padding in Firefox */
+ padding: 0;
}
+
/* Disables the annoying dashed border Firefox puts on active buttons */
body button.ui-button::-moz-focus-inner {
border: 0;
@@ -187,6 +213,8 @@ body .ui-button:active {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f0f0f0', endColorstr='#d0d0d0', GradientType=0); /* IE6-8 */
}
+/* Customizations for MediaWiki Vector */
+
/* Green buttons */
body .ui-button-green,
body .ui-button-green .ui-button-text {
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.datepicker.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.datepicker.css
index 871bf690..b28332ff 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.datepicker.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.datepicker.css
@@ -1,5 +1,13 @@
-/* Datepicker
-----------------------------------*/
+/*!
+ * jQuery UI Datepicker 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
@@ -10,7 +18,7 @@
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; padding:1px 0; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
@@ -18,7 +26,7 @@
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .2em 0 0 0; padding: 0 .2em; border-top: 1px solid #DDDDDD; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
@@ -32,7 +40,7 @@
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
/* @noflip */ .ui-datepicker-rtl { direction: rtl; }
@@ -49,8 +57,6 @@
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.dialog.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.dialog.css
index cd85f14e..f7c47a7a 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.dialog.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.dialog.css
@@ -1,17 +1,28 @@
-/* Dialog
-----------------------------------*/
-.ui-dialog { position: absolute; padding: 0; width: 300px; }
-.ui-dialog .ui-dialog-titlebar { padding: .75em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: 0; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .75em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+/*!
+ * jQuery UI Dialog 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/* Customizations */
+
+/* Customizations for MediaWiki Vector */
+
body .ui-dialog .ui-dialog-titlebar-close:hover {
text-decoration: none;
}
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.menu.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.menu.css
new file mode 100644
index 00000000..83fd84e4
--- /dev/null
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.menu.css
@@ -0,0 +1,30 @@
+/*!
+ * jQuery UI Menu 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
+.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
+.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
+.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
+.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
+.ui-menu .ui-menu-item a.ui-state-focus,
+.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
+
+.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
+.ui-menu .ui-state-disabled a { cursor: default; }
+
+/* icon support */
+.ui-menu-icons { position: relative; }
+.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
+
+/* left-aligned */
+.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
+
+/* right-aligned */
+.ui-menu .ui-menu-icon { position: static; float: right; }
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.resizable.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.resizable.css
index f1bd7c5e..f8822e80 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.resizable.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.resizable.css
@@ -1,7 +1,15 @@
-/* Resizable
-----------------------------------*/
+/*!
+ * jQuery UI Resizable 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.spinner.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.spinner.css
new file mode 100644
index 00000000..e89b7206
--- /dev/null
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.spinner.css
@@ -0,0 +1,23 @@
+/*!
+ * jQuery UI Spinner 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Spinner#theming
+ */
+.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
+.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
+.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
+.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
+.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
+.ui-spinner-up { top: 0; }
+.ui-spinner-down { bottom: 0; }
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+ /* need to fix icons sprite */
+ background-position:-65px -16px;
+}
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.theme.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.theme.css
index 6bde5d3e..cccfe4b5 100644
--- a/skins/Vector/skinStyles/jquery.ui/jquery.ui.theme.css
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.theme.css
@@ -1,11 +1,15 @@
-
-
-/*
-* jQuery UI CSS Framework
-* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=normal&fsDefault=1.0em&cornerRadius=3px&bgColorHeader=ffffff&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=aed0ea&fcHeader=222222&iconColorHeader=72a7cf&bgColorContent=f2f5f7&bgTextureContent=04_highlight_hard.png&bgImgOpacityContent=100&borderColorContent=cccccc&fcContent=362b36&iconColorContent=72a7cf&bgColorDefault=d7ebf9&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=80&borderColorDefault=aed0ea&fcDefault=2779aa&iconColorDefault=3d80b3&bgColorHover=e4f1fb&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=100&borderColorHover=74b2e2&fcHover=0070a3&iconColorHover=2694e8&bgColorActive=f0f0f0&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=cccccc&fcActive=000000&iconColorActive=666666&bgColorHighlight=ffef8f&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=25&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=cd0a0a&bgTextureError=01_flat.png&bgImgOpacityError=15&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=000000&bgTextureOverlay=21_glow_ball.png&bgImgOpacityOverlay=100&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=70&opacityShadow=20&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px
-*/
+/*!
+ * jQuery UI CSS Framework 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=normal&fsDefault=1.0em&cornerRadius=3px&bgColorHeader=ffffff&bgTextureHeader=highlight_soft&bgImgOpacityHeader=100&borderColorHeader=aed0ea&fcHeader=222222&iconColorHeader=72a7cf&bgColorContent=f2f5f7&bgTextureContent=highlight_hard&bgImgOpacityContent=100&borderColorContent=cccccc&fcContent=362b36&iconColorContent=72a7cf&bgColorDefault=d7ebf9&bgTextureDefault=highlight_hard&bgImgOpacityDefault=80&borderColorDefault=aed0ea&fcDefault=2779aa&iconColorDefault=3d80b3&bgColorHover=e4f1fb&bgTextureHover=highlight_soft&bgImgOpacityHover=100&borderColorHover=74b2e2&fcHover=0070a3&iconColorHover=2694e8&bgColorActive=f0f0f0&bgTextureActive=inset_hard&bgImgOpacityActive=100&borderColorActive=cccccc&fcActive=000000&iconColorActive=666666&bgColorHighlight=ffef8f&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=25&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=cd0a0a&bgTextureError=flat&bgImgOpacityError=15&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=000000&bgTextureOverlay=flat&bgImgOpacityOverlay=100&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=70&opacityShadow=20&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px
+ */
/* Component containers
@@ -13,41 +17,43 @@
.ui-widget { font-family: sans-serif; font-size: 0.8em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #cccccc; /* @embed */ background: #f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; color: #362b36; }
-.ui-widget-header { border-bottom: 1px solid #bbbbbb; line-height: 1em; /* @embed */ background: #ffffff url(images/ui-bg_highlight-soft_100_ffffff_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
+.ui-widget-content { border: 1px solid #cccccc; /* @embed */ background: #f2f5f7 url("images/ui-bg_highlight-hard_100_f2f5f7_1x100.png") 50% top repeat-x; color: #362b36; }
+.ui-widget-header { border: 1px solid #aed0ea; /* @embed */ background: #ffffff url("images/ui-bg_highlight-soft_100_ffffff_1x100.png") 50% 50% repeat-x; color: #222222; font-weight: bold; }
/* Interaction states
----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aed0ea; /* @embed */ background: #d7ebf9 url(images/ui-bg_highlight-hard_80_d7ebf9_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #2779aa; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aed0ea; /* @embed */ background: #d7ebf9 url("images/ui-bg_highlight-hard_80_d7ebf9_1x100.png") 50% 50% repeat-x; font-weight: normal; color: #2779aa; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2779aa; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #74b2e2; /* @embed */ background: #e4f1fb url(images/ui-bg_highlight-soft_100_e4f1fb_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #0070a3; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #0070a3; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #cccccc; background: #f0f0f0 /* @embed */ url(images/ui-bg_inset-hard_100_f0f0f0_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #000000; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #74b2e2; /* @embed */ background: #e4f1fb url("images/ui-bg_highlight-soft_100_e4f1fb_1x100.png") 50% 50% repeat-x; font-weight: normal; color: #0070a3; }
+.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #0070a3; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #cccccc; background: #f0f0f0 /* @embed */ url("images/ui-bg_inset-hard_100_f0f0f0_1x100.png") 50% 50% repeat-x; font-weight: normal; color: #000000; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #000000; text-decoration: none; }
-.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #ffef8f /* @embed */ url(images/ui-bg_highlight-soft_25_ffef8f_1x100.png) 50% top repeat-x; color: #363636; }
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #ffef8f /* @embed */ url("images/ui-bg_highlight-soft_25_ffef8f_1x100.png") 50% top repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #cd0a0a /* @embed */ url(images/ui-bg_flat_15_cd0a0a_40x100.png) 50% 50% repeat-x; color: #ffffff; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #cd0a0a /* @embed */ url("images/ui-bg_flat_15_cd0a0a_40x100.png") 50% 50% repeat-x; color: #ffffff; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; }
-.ui-icon, .ui-widget-content .ui-icon, .ui-widget-header .ui-icon { /* @embed */ background-image: url(images/ui-icons_72a7cf_256x240.png); }
-.ui-state-default .ui-icon { /* @embed */ background-image: url(images/ui-icons_3d80b3_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { /* @embed */ background-image: url(images/ui-icons_2694e8_256x240.png); }
-.ui-state-active .ui-icon { /* @embed */ background-image: url(images/ui-icons_666666_256x240.png); }
-.ui-state-highlight .ui-icon { /* @embed */ background-image: url(images/ui-icons_2e83ff_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { /* @embed */ background-image: url(images/ui-icons_ffffff_256x240.png); }
+.ui-icon,
+.ui-widget-content .ui-icon,
+.ui-widget-header .ui-icon { /* @embed */ background-image: url("images/ui-icons_72a7cf_256x240.png"); }
+.ui-state-default .ui-icon { /* @embed */ background-image: url("images/ui-icons_3d80b3_256x240.png"); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { /* @embed */ background-image: url("images/ui-icons_2694e8_256x240.png"); }
+.ui-state-active .ui-icon { /* @embed */ background-image: url("images/ui-icons_666666_256x240.png"); }
+.ui-state-highlight .ui-icon { /* @embed */ background-image: url("images/ui-icons_2e83ff_256x240.png"); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { /* @embed */ background-image: url("images/ui-icons_ffffff_256x240.png"); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
@@ -176,8 +182,8 @@
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
@@ -231,16 +237,11 @@
----------------------------------*/
/* Corner radius */
-.ui-corner-tl { border-top-left-radius: 0; }
-.ui-corner-tr { border-top-right-radius: 0; }
-.ui-corner-bl { border-bottom-left-radius: 0; }
-.ui-corner-br { border-bottom-right-radius: 0; }
-.ui-corner-top { border-top-left-radius: 0; border-top-right-radius: 0; }
-.ui-corner-bottom { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
-.ui-corner-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
-.ui-corner-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
-.ui-corner-all { border-radius: 0; }
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; -khtml-border-top-left-radius: 3px; border-top-left-radius: 3px; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; -khtml-border-top-right-radius: 3px; border-top-right-radius: 3px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; -khtml-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; -khtml-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
/* Overlays */
-.ui-widget-overlay { background: #000000; opacity: .75;filter:Alpha(Opacity=75); }
-.ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; /* @embed */ background: #000000 url(images/ui-bg_flat_70_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); border-radius: 8px; }
+.ui-widget-overlay { /* @embed */ background: #000000 url("images/ui-bg_flat_100_000000_40x100.png") 50% 50% repeat-x; opacity: .5;filter:Alpha(Opacity=50); }
+.ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; /* @embed */ background: #000000 url("images/ui-bg_flat_70_000000_40x100.png") 50% 50% repeat-x; opacity: .2;filter:Alpha(Opacity=20); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
diff --git a/skins/Vector/skinStyles/jquery.ui/jquery.ui.tooltip.css b/skins/Vector/skinStyles/jquery.ui/jquery.ui.tooltip.css
new file mode 100644
index 00000000..88b0d02e
--- /dev/null
+++ b/skins/Vector/skinStyles/jquery.ui/jquery.ui.tooltip.css
@@ -0,0 +1,21 @@
+/*!
+ * jQuery UI Tooltip 1.9.2
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+.ui-tooltip {
+ padding: 8px;
+ position: absolute;
+ z-index: 9999;
+ max-width: 300px;
+ -webkit-box-shadow: 0 0 5px #aaa;
+ box-shadow: 0 0 5px #aaa;
+}
+/* Fades and background-images don't work well together in IE6, drop the image */
+* html .ui-tooltip {
+ background-image: none;
+}
+body .ui-tooltip { border-width: 2px; }
diff --git a/tests/.htaccess b/tests/.htaccess
new file mode 100644
index 00000000..3a428827
--- /dev/null
+++ b/tests/.htaccess
@@ -0,0 +1 @@
+Deny from all
diff --git a/tests/TestsAutoLoader.php b/tests/TestsAutoLoader.php
new file mode 100644
index 00000000..2e8fed44
--- /dev/null
+++ b/tests/TestsAutoLoader.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * AutoLoader for the testing suite.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Testing
+ */
+
+global $wgAutoloadClasses;
+$testDir = __DIR__;
+
+$wgAutoloadClasses += array(
+
+ # tests
+ 'DbTestPreviewer' => "$testDir/testHelpers.inc",
+ 'DbTestRecorder' => "$testDir/testHelpers.inc",
+ 'DelayedParserTest' => "$testDir/testHelpers.inc",
+ 'ParserTestResult' => "$testDir/parser/ParserTestResult.php",
+ 'TestFileIterator' => "$testDir/testHelpers.inc",
+ 'TestRecorder' => "$testDir/testHelpers.inc",
+ 'ITestRecorder' => "$testDir/testHelpers.inc",
+ 'DjVuSupport' => "$testDir/testHelpers.inc",
+ 'TidySupport' => "$testDir/testHelpers.inc",
+
+ # tests/phpunit
+ 'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php",
+ 'MediaWikiPHPUnitTestListener' => "$testDir/phpunit/MediaWikiPHPUnitTestListener.php",
+ 'MediaWikiLangTestCase' => "$testDir/phpunit/MediaWikiLangTestCase.php",
+ 'ResourceLoaderTestCase' => "$testDir/phpunit/ResourceLoaderTestCase.php",
+ 'ResourceLoaderTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php",
+ 'ResourceLoaderFileModuleTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php",
+ 'ResourceLoaderWikiModuleTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php",
+ 'TestUser' => "$testDir/phpunit/includes/TestUser.php",
+ 'LessFileCompilationTest' => "$testDir/phpunit/LessFileCompilationTest.php",
+
+ # tests/phpunit/includes
+ 'BlockTest' => "$testDir/phpunit/includes/BlockTest.php",
+ 'RevisionStorageTest' => "$testDir/phpunit/includes/RevisionStorageTest.php",
+ 'WikiPageTest' => "$testDir/phpunit/includes/WikiPageTest.php",
+
+ # tests/phpunit/includes/api
+ 'ApiFormatTestBase' => "$testDir/phpunit/includes/api/format/ApiFormatTestBase.php",
+ 'ApiTestCase' => "$testDir/phpunit/includes/api/ApiTestCase.php",
+ 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestContext.php",
+ 'MockApi' => "$testDir/phpunit/includes/api/MockApi.php",
+ 'MockApiQueryBase' => "$testDir/phpunit/includes/api/MockApiQueryBase.php",
+ 'UserWrapper' => "$testDir/phpunit/includes/api/UserWrapper.php",
+ 'RandomImageGenerator' => "$testDir/phpunit/includes/api/RandomImageGenerator.php",
+
+ # tests/phpunit/includes/changes
+ 'TestRecentChangesHelper' => "$testDir/phpunit/includes/changes/TestRecentChangesHelper.php",
+
+ # tests/phpunit/includes/content
+ 'DummyContentHandlerForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'DummyContentForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'ContentHandlerTest' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'JavaScriptContentTest' => "$testDir/phpunit/includes/content/JavaScriptContentTest.php",
+ 'TextContentTest' => "$testDir/phpunit/includes/content/TextContentTest.php",
+ 'WikitextContentTest' => "$testDir/phpunit/includes/content/WikitextContentTest.php",
+
+ # tests/phpunit/includes/db
+ 'ORMRowTest' => "$testDir/phpunit/includes/db/ORMRowTest.php",
+ 'ORMTableTest' => "$testDir/phpunit/includes/db/ORMTableTest.php",
+ 'PageORMTableForTesting' => "$testDir/phpunit/includes/db/ORMTableTest.php",
+ 'DatabaseTestHelper' => "$testDir/phpunit/includes/db/DatabaseTestHelper.php",
+
+ # tests/phpunit/includes/passwords
+ 'PasswordTestCase' => "$testDir/phpunit/includes/password/PasswordTestCase.php",
+
+ # tests/phpunit/languages
+ 'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php",
+
+ # tests/phpunit/includes/libs
+ 'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php",
+
+ # tests/phpunit/maintenance
+ 'DumpTestCase' => "$testDir/phpunit/maintenance/DumpTestCase.php",
+
+ # tests/phpunit/media
+ 'FakeDimensionFile' => "$testDir/phpunit/includes/media/FakeDimensionFile.php",
+ 'MediaWikiMediaTestCase' => "$testDir/phpunit/includes/media/MediaWikiMediaTestCase.php",
+
+ # tests/phpunit/mocks
+ 'MockFSFile' => "$testDir/phpunit/mocks/filebackend/MockFSFile.php",
+ 'MockFileBackend' => "$testDir/phpunit/mocks/filebackend/MockFileBackend.php",
+ 'MockBitmapHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php",
+ 'MockImageHandler' => "$testDir/phpunit/mocks/media/MockImageHandler.php",
+ 'MockSvgHandler' => "$testDir/phpunit/mocks/media/MockSvgHandler.php",
+ 'MockDjVuHandler' => "$testDir/phpunit/mocks/media/MockDjVuHandler.php",
+
+ # tests/parser
+ 'NewParserTest' => "$testDir/phpunit/includes/parser/NewParserTest.php",
+ 'MediaWikiParserTest' => "$testDir/phpunit/includes/parser/MediaWikiParserTest.php",
+ 'ParserTest' => "$testDir/parser/parserTest.inc",
+ 'ParserTestParserHook' => "$testDir/parser/parserTestsParserHook.php",
+
+ # tests/phpunit/includes/site
+ 'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php",
+ 'TestSites' => "$testDir/phpunit/includes/site/TestSites.php",
+);
diff --git a/tests/browser/Gemfile.lock b/tests/browser/Gemfile.lock
new file mode 100644
index 00000000..1ea4eb55
--- /dev/null
+++ b/tests/browser/Gemfile.lock
@@ -0,0 +1,82 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ builder (3.2.2)
+ childprocess (0.5.3)
+ ffi (~> 1.0, >= 1.0.11)
+ cucumber (1.3.16)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.12)
+ multi_json (>= 1.7.5, < 2.0)
+ multi_test (>= 0.1.1)
+ data_magic (0.19)
+ faker (>= 1.1.2)
+ yml_reader (>= 0.3)
+ diff-lcs (1.2.5)
+ domain_name (0.5.20)
+ unf (>= 0.0.5, < 1.0.0)
+ faker (1.4.3)
+ i18n (~> 0.5)
+ faraday (0.9.0)
+ multipart-post (>= 1.2, < 3)
+ faraday-cookie_jar (0.0.6)
+ faraday (>= 0.7.4)
+ http-cookie (~> 1.0.0)
+ ffi (1.9.3)
+ gherkin (2.12.2)
+ multi_json (~> 1.3)
+ headless (1.0.2)
+ http-cookie (1.0.2)
+ domain_name (~> 0.5)
+ i18n (0.6.11)
+ json (1.8.1)
+ mediawiki_api (0.2.1)
+ faraday (~> 0.9, >= 0.9.0)
+ faraday-cookie_jar (~> 0.0, >= 0.0.6)
+ mediawiki_selenium (0.3.2)
+ cucumber (~> 1.3, >= 1.3.10)
+ headless (~> 1.0, >= 1.0.1)
+ json (~> 1.8, >= 1.8.1)
+ mediawiki_api (~> 0.2, >= 0.2.1)
+ page-object (~> 1.0)
+ rest-client (~> 1.6, >= 1.6.7)
+ rspec-expectations (~> 2.14, >= 2.14.4)
+ syntax (~> 1.2, >= 1.2.0)
+ mime-types (2.3)
+ multi_json (1.10.1)
+ multi_test (0.1.1)
+ multipart-post (2.0.0)
+ netrc (0.7.7)
+ page-object (1.0.2)
+ page_navigation (>= 0.9)
+ selenium-webdriver (>= 2.42.0)
+ watir-webdriver (>= 0.6.9)
+ page_navigation (0.9)
+ data_magic (>= 0.14)
+ rest-client (1.7.2)
+ mime-types (>= 1.16, < 3.0)
+ netrc (~> 0.7)
+ rspec-expectations (2.99.2)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rubyzip (1.1.6)
+ selenium-webdriver (2.42.0)
+ childprocess (>= 0.5.0)
+ multi_json (~> 1.0)
+ rubyzip (~> 1.0)
+ websocket (~> 1.0.4)
+ syntax (1.2.0)
+ unf (0.1.4)
+ unf_ext
+ unf_ext (0.0.6)
+ watir-webdriver (0.6.10)
+ selenium-webdriver (>= 2.18.0)
+ websocket (1.0.7)
+ yml_reader (0.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ mediawiki_api
+ mediawiki_selenium
diff --git a/tests/browser/README.mediawiki b/tests/browser/README.mediawiki
new file mode 100644
index 00000000..22657627
--- /dev/null
+++ b/tests/browser/README.mediawiki
@@ -0,0 +1,64 @@
+Purpose:
+
+The purpose of these tests is to validate that a newly installed (or updated, or hacked, or whatever) mediawiki instance presents to the user a set of expected features, regardless of what language the wiki is in, or where it is installed, or what extensions it might have.
+
+The tests are based on the basic definition of a wiki, a website where anyone
+
+* can read a page
+* can create a page
+* can edit a page
+* can link one page to another page
+
+Install:
+
+Ruby 1.9.3 or higher is required
+Firefox browser is required
+::
+ cd /tests/browser
+ gem update --system
+ gem install bundler
+ bundle install
+
+Run the tests:
+
+Edit the environment_variables file with appropriate values for your wiki
+$source environment_variables (example shown in bash shell)
+
+bundle exec cucumber features/
+
+Note that the acceptance tests will create three pages in your wiki entitled "Editing Test Page", "Link Source Test Page", and "Link Target Test Page". These pages may be deleted at any time. If you wish to re-run the tests at any time, these test pages will be re-created or reset to their original contents at the time that the tests run.
+
+For more information about running Selenium tests please see
+https://github.com/wikimedia/mediawiki-selenium
+
+Details:
+
+create_account.feature
+* Checks three different ways to arrive on page allowing the user to create an account
+
+create_and_follow_wiki_link.feature:
+* uses the mediawiki API to create a link target page
+* uses the mediawiki API to create a link source page
+* navigates a browser to the link source page
+* clicks the link in that page to the link target page
+* validates that the browser has in fact followed the link to the target page correctly
+
+edit_page.feature:
+* uses the mediawiki API to create an editable page on the wiki
+* navigates a browser to the page
+* clicks the Edit button to invoke the basic editor
+* edits the page with a particular string containing a static part and also a quasi-unique random part
+* saves the edited page
+* checks that the saved page contains the particular string with which the page was edited
+
+main_page.feature:
+* navigates a browser to the default landing page of the wiki
+* checks for the View History link on the landing page
+* checks for the full set of of sidebar links that should exist on every mediawiki wiki
+
+view_history.feature
+* similar to edit_page.feature but checks for an older version of the edited page
+
+Notes:
+
+Tested on beta labs hewiki, dewiki, enwiki, and on a local installation of mediawiki \ No newline at end of file
diff --git a/tests/browser/environment_variables b/tests/browser/environment_variables
new file mode 100644
index 00000000..25c45775
--- /dev/null
+++ b/tests/browser/environment_variables
@@ -0,0 +1,5 @@
+export MEDIAWIKI_URL=http://localhost/wiki/
+export MEDIAWIKI_API_URL=http://localhost/w/api.php
+export MEDIAWIKI_USER=Selenium_user
+export MEDIAWIKI_PASSWORD=Selenium_password
+export BROWSER=firefox
diff --git a/tests/browser/features/create_account.feature b/tests/browser/features/create_account.feature
new file mode 100644
index 00000000..0b4e83a5
--- /dev/null
+++ b/tests/browser/features/create_account.feature
@@ -0,0 +1,12 @@
+@chrome @clean @firefox @phantomjs
+Feature: Create account
+
+ Scenario Outline: Go to Create account page
+ Given I go to Create account page at <path>
+ Then form has Create account button
+
+ Examples:
+ | path |
+ | Special:CreateAccount |
+ | Special:UserLogin/signup |
+ | Special:UserLogin?type=signup |
diff --git a/tests/browser/features/create_and_follow_wiki_link.feature b/tests/browser/features/create_and_follow_wiki_link.feature
new file mode 100644
index 00000000..a0aa624e
--- /dev/null
+++ b/tests/browser/features/create_and_follow_wiki_link.feature
@@ -0,0 +1,9 @@
+@chrome @clean @firefox @login @phantomjs
+Feature: Create Page With Wiki Link
+
+ Scenario: Create Page With Wiki Link
+ Given I create page "Link Target Test Page" with content "Link Target Test Page"
+ And I go to the "Link Source Test Page" page with content "This is a [[Link Target Test Page|link to the test target page]] right here."
+ When I click the Link Target link
+ Then I should be on the Link Target Test Page
+ And the page content should contain "Link Target Test Page"
diff --git a/tests/browser/features/edit_page.feature b/tests/browser/features/edit_page.feature
new file mode 100644
index 00000000..b905795e
--- /dev/null
+++ b/tests/browser/features/edit_page.feature
@@ -0,0 +1,11 @@
+@chrome @clean @firefox @login @phantomjs
+Feature: Edit Page
+
+ Scenario: Create and edit page
+ Given I go to the "Editing Test Page" page with content "This is a page to test editing"
+ When I click Edit
+ And I edit the page with "Edited and a random string"
+ And I click Preview
+ And I click Show Changes
+ And I save the edit
+ Then the edited page content should contain "Edited and a random string"
diff --git a/tests/browser/features/file.feature b/tests/browser/features/file.feature
new file mode 100644
index 00000000..0bd36ed6
--- /dev/null
+++ b/tests/browser/features/file.feature
@@ -0,0 +1,23 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @phantomjs
+Feature: File
+
+ Scenario: Anonymous goes to file that does not exist
+ Given I am at file that does not exist
+ Then page should show that no such file exists
+
+ @login
+ Scenario: Logged-in user goes to file that does not exist
+ Given I am logged in
+ And I am at file that does not exist
+ Then page should show that no such file exists
diff --git a/tests/browser/features/login.feature b/tests/browser/features/login.feature
new file mode 100644
index 00000000..c34d23d3
--- /dev/null
+++ b/tests/browser/features/login.feature
@@ -0,0 +1,42 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @phantomjs
+Feature: Log in
+
+ Background:
+ Given I am at Log in page
+
+ Scenario: Go to Log in page
+ Then Username element should be there
+ And Password element should be there
+ And Log in element should be there
+
+ Scenario: Log in without entering credentials
+ When I log in without entering credentials
+ Then error box should be visible
+
+ Scenario: Log in without entering password
+ When I log in without entering password
+ Then error box should be visible
+
+ Scenario: Log in with incorrect username
+ When I log in with incorrect username
+ Then error box should be visible
+
+ Scenario: Log in with incorrect password
+ When I log in with incorrect password
+ Then error box should be visible
+
+ @login
+ Scenario: Log in with valid credentials
+ When I am logged in
+ Then error box should not be visible
diff --git a/tests/browser/features/main_page_links.feature b/tests/browser/features/main_page_links.feature
new file mode 100644
index 00000000..3613c828
--- /dev/null
+++ b/tests/browser/features/main_page_links.feature
@@ -0,0 +1,19 @@
+@chrome @clean @firefox @phantomjs
+Feature: Main Page View History Links
+
+ Background:
+ Given I open the main wiki URL
+
+ Scenario: Main Page View History links exist
+ Then I should see a link for View History
+
+ Scenario: Main Page Sidebar Links
+ Then I should see a link for Recent changes
+ And I should see a link for Random page
+ And I should see a link for Help
+ And I should see a link for What links here
+ And I should see a link for Related changes
+ And I should see a link for Special pages
+ And I should see a link for Printable version
+ And I should see a link for Permanent link
+ And I should see a link for Page information
diff --git a/tests/browser/features/preferences.feature b/tests/browser/features/preferences.feature
new file mode 100644
index 00000000..9e3abfde
--- /dev/null
+++ b/tests/browser/features/preferences.feature
@@ -0,0 +1,60 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+@chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @login @phantomjs
+Feature: Preferences
+
+ Scenario: Preferences Appearance
+ Given I am logged in
+ When I navigate to Preferences
+ And I click Appearance
+ Then I can select skins
+ And I can select image size
+ And I can select thumbnail size
+ And I can select Threshold for stub link
+ And I can select underline preferences
+ And I have advanced options checkboxes
+ And I can click Save
+ And I can restore default settings
+ And I can select date format
+ And I can see time offset section
+ And I can see local time
+ And I can select my time zone
+
+
+ Scenario: Preferences Editing
+ Given I am logged in
+ When I navigate to Preferences
+ And I click Editing
+ Then I can select edit area font style
+ And I can select section editing via edit links
+ And I can select section editing by right clicking
+ And I can select section editing by double clicking
+ And I can select to prompt me when entering a blank edit summary
+ And I can select to warn me when I leave an edit page with unsaved changes
+ And I can select show edit toolbar
+ And I can select show preview on first edit
+ And I can select show preview before edit box
+ And I can select live preview
+
+
+ Scenario: Preferences User profile
+ Given I am logged in
+ When I navigate to Preferences
+ And I click User profile
+ Then I can see my Basic informations
+ And I can change my language
+ And I can change my gender
+ And I can see my signature
+ And I can change my signature
+ And I can see my email
+ And I can click Save
+ And I can restore default settings
diff --git a/tests/browser/features/step_definitions/create_account_steps.rb b/tests/browser/features/step_definitions/create_account_steps.rb
new file mode 100644
index 00000000..7fa29843
--- /dev/null
+++ b/tests/browser/features/step_definitions/create_account_steps.rb
@@ -0,0 +1,18 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Given(/^I go to Create account page at (.+)$/) do |path|
+ visit(CreateAccountPage, :using_params => {:page_title => path})
+end
+
+Then(/^form has Create account button$/) do
+ on(CreateAccountPage).create_account_element.should exist
+end
diff --git a/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb b/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb
new file mode 100644
index 00000000..ba41f7fb
--- /dev/null
+++ b/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb
@@ -0,0 +1,28 @@
+Given(/^I go to the "(.+)" page with content "(.+)"$/) do |page_title, page_content|
+ @wikitext = page_content
+ on(APIPage).create page_title, page_content
+ step "I am on the #{page_title} page"
+end
+
+Given(/^I am on the (.+) page$/) do |article|
+ article = article.gsub(/ /, '_')
+ visit(ZtargetPage, :using_params => {:article_name => article})
+end
+
+Given(/^I create page "(.*?)" with content "(.*?)"$/) do |page_title, page_content|
+ on(APIPage).create page_title, page_content
+end
+
+
+When(/^I click the Link Target link$/) do
+ on(ZtargetPage).link_target_page_link
+end
+
+Then(/^I should be on the Link Target Test Page$/) do
+ @browser.url.should match /Link_Target_Test_Page/
+end
+
+Then(/^the page content should contain "(.*?)"$/) do |content|
+ on(ZtargetPage).page_content.should match content
+end
+
diff --git a/tests/browser/features/step_definitions/edit_page_steps.rb b/tests/browser/features/step_definitions/edit_page_steps.rb
new file mode 100644
index 00000000..5ab02bec
--- /dev/null
+++ b/tests/browser/features/step_definitions/edit_page_steps.rb
@@ -0,0 +1,24 @@
+When(/^I click Edit$/) do
+ on(MainPage).edit_link
+end
+
+When(/^I click Preview$/) do
+ on(EditPage).preview_button
+end
+
+When(/^I click Show Changes$/) do
+ on(EditPage).show_changes_button
+end
+
+When(/^I edit the page with "(.*?)"$/) do |edit_content|
+ on(EditPage).edit_page_content_element.send_keys(edit_content + @random_string)
+end
+
+When(/^I save the edit$/) do
+ on(EditPage).save_button
+end
+
+Then(/^the edited page content should contain "(.*?)"$/) do |content|
+ on(MainPage).page_content.should match(content + @random_string)
+end
+
diff --git a/tests/browser/features/step_definitions/file_steps.rb b/tests/browser/features/step_definitions/file_steps.rb
new file mode 100644
index 00000000..a2ed1bfc
--- /dev/null
+++ b/tests/browser/features/step_definitions/file_steps.rb
@@ -0,0 +1,18 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Given(/^I am at file that does not exist$/) do
+ visit(FileDoesNotExistPage, using_params: {page_name: @random_string})
+end
+
+Then(/^page should show that no such file exists$/) do
+ on(FileDoesNotExistPage).file_does_not_exist_message_element.should be_visible
+end
diff --git a/tests/browser/features/step_definitions/login_steps.rb b/tests/browser/features/step_definitions/login_steps.rb
new file mode 100644
index 00000000..b654b2d3
--- /dev/null
+++ b/tests/browser/features/step_definitions/login_steps.rb
@@ -0,0 +1,65 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+Given(/^I am at Log in page$/) do
+ visit LoginPage
+end
+
+When(/^I log in with incorrect password$/) do
+ on(LoginPage).login_with(ENV["MEDIAWIKI_USER"], "incorrect password", false)
+end
+
+When(/^I log in with incorrect username$/) do
+ on(LoginPage).login_with("incorrect username", ENV["MEDIAWIKI_PASSWORD"], false)
+end
+
+When(/^I log in without entering credentials$/) do
+ on(LoginPage).login_with("", "", false)
+end
+
+When(/^I log in without entering password$/) do
+ on(LoginPage).login_with(ENV["MEDIAWIKI_USER"], "", false)
+end
+
+Then(/^error box should be visible$/) do
+ on(LoginErrorPage).error_box_element.should be_visible
+end
+
+Then(/^error box should not be visible$/) do
+ on(LoginErrorPage).error_box_element.should_not be_visible
+end
+
+Then(/^feedback should be (.+)$/) do |feedback|
+ on(LoginPage) do |page|
+ page.feedback_element.when_present.click
+ page.feedback.should match Regexp.escape(feedback)
+ end
+end
+
+Then(/^Log in element should be there$/) do
+ on(LoginPage).login_element.should exist
+end
+
+Then(/^main page should open$/) do
+ @browser.url.should == on(MainPage).class.url
+end
+
+Then(/^Password element should be there$/) do
+ on(LoginPage).password_element.should exist
+end
+
+Then(/^there should be a link to (.+)$/) do |text|
+ on(LoginPage).username_displayed_element.when_present.text.should == text
+end
+
+Then(/^Username element should be there$/) do
+ on(LoginPage).username_element.should exist
+end
diff --git a/tests/browser/features/step_definitions/main_page_links_steps.rb b/tests/browser/features/step_definitions/main_page_links_steps.rb
new file mode 100644
index 00000000..c76fd2ba
--- /dev/null
+++ b/tests/browser/features/step_definitions/main_page_links_steps.rb
@@ -0,0 +1,47 @@
+Given(/^I open the main wiki URL$/) do
+ visit(MainPage)
+end
+
+Then(/^I should see a link for View History$/) do
+ on(MainPage).view_history_link_element.should be_visible
+end
+
+Then(/^I should see a link for Edit$/) do
+ on(MainPage).edit_link_element.should be_visible
+end
+
+Then(/^I should see a link for Recent changes$/) do
+ on(MainPage).recent_changes_link_element.should be_visible
+end
+
+Then(/^I should see a link for Random page$/) do
+ on(MainPage).random_page_link_element.should be_visible
+end
+
+Then(/^I should see a link for Help$/) do
+ on(MainPage).help_link_element.should be_visible
+end
+
+Then(/^I should see a link for What links here$/) do
+ on(MainPage).what_links_here_link_element.should be_visible
+end
+
+Then(/^I should see a link for Related changes$/) do
+ on(MainPage).related_changes_link_element.should be_visible
+end
+
+Then(/^I should see a link for Special pages$/) do
+ on(MainPage).special_pages_link_element.should be_visible
+end
+
+Then(/^I should see a link for Printable version$/) do
+ on(MainPage).printable_version_link_element.should be_visible
+end
+
+Then(/^I should see a link for Permanent link$/) do
+ on(MainPage).permanent_link_link_element.should be_visible
+end
+
+Then(/^I should see a link for Page information$/) do
+ on(MainPage).page_information_link_element.should be_visible
+end
diff --git a/tests/browser/features/step_definitions/preferences_appearance_steps.rb b/tests/browser/features/step_definitions/preferences_appearance_steps.rb
new file mode 100644
index 00000000..0046af69
--- /dev/null
+++ b/tests/browser/features/step_definitions/preferences_appearance_steps.rb
@@ -0,0 +1,85 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+When(/^I click Appearance$/) do
+ visit(PreferencesPage).appearance_link_element.when_present.click
+end
+
+When(/^I navigate to Preferences$/) do
+ visit(PreferencesPage)
+end
+
+Then(/^I can click Save$/) do
+ on(PreferencesPage).save_button_element.should exist
+end
+
+Then(/^I can restore default settings$/) do
+ on(PreferencesAppearancePage).restore_default_link_element.should exist
+end
+
+Then(/^I can see local time$/) do
+ on(PreferencesAppearancePage).local_time_span_element.should exist
+end
+
+Then(/^I can see time offset section$/) do
+ on(PreferencesAppearancePage).time_offset_table_element.should be_visible
+end
+
+Then(/^I can select date format$/) do
+ on(PreferencesAppearancePage) do |page|
+ page.no_preference_radio_element.should exist
+ page.mo_day_year_radio_element.should exist
+ page.day_mo_year_radio_element.should exist
+ page.year_mo_day_radio_element.should exist
+ page.iso_8601_radio_element.should exist
+ end
+end
+
+Then(/^I can select image size$/) do
+ on(PreferencesAppearancePage).size_select_element.should exist
+end
+
+Then(/^I can select my time zone$/) do
+ on(PreferencesAppearancePage) do |page|
+ page.time_offset_select_element.should exist
+ page.other_offset_element.should exist
+ end
+end
+
+Then(/^I can select skins$/) do
+ on(PreferencesAppearancePage) do |page|
+ page.cologne_blue_element.should exist
+ page.modern_element.should exist
+ page.monobook_element.should exist
+ page.vector_element.should exist
+ end
+end
+
+Then(/^I can select Threshold for stub link$/) do
+ on(PreferencesAppearancePage).threshold_select_element.should exist
+end
+
+Then(/^I can select thumbnail size$/) do
+ on(PreferencesAppearancePage).thumb_select_element.should exist
+end
+
+Then(/^I can select underline preferences$/) do
+ on(PreferencesAppearancePage).underline_select_element.should exist
+end
+
+Then(/^I have advanced options checkboxes$/) do
+ on(PreferencesAppearancePage) do |page|
+ page.hidden_categories_check_element.should exist
+ page.auto_number_check_element.should exist
+ end
+end
+
+
diff --git a/tests/browser/features/step_definitions/preferences_editing_steps.rb b/tests/browser/features/step_definitions/preferences_editing_steps.rb
new file mode 100644
index 00000000..ad29a745
--- /dev/null
+++ b/tests/browser/features/step_definitions/preferences_editing_steps.rb
@@ -0,0 +1,54 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+When(/^I click Editing$/) do
+ visit(PreferencesPage).editing_link_element.when_present.click
+end
+
+Then(/^I can select edit area font style$/) do
+ on(PreferencesEditingPage).edit_area_font_style_select_element.when_present.should exist
+end
+
+Then(/^I can select live preview$/) do
+ on(PreferencesEditingPage).live_preview_check_element.when_present.should exist
+end
+
+Then(/^I can select section editing by double clicking$/) do
+ on(PreferencesEditingPage).edit_section_double_click_check_element.when_present.should exist
+end
+
+Then(/^I can select section editing by right clicking$/) do
+ on(PreferencesEditingPage).edit_section_right_click_check_element.when_present.should exist
+end
+
+Then(/^I can select section editing via edit links$/) do
+ on(PreferencesEditingPage).edit_section_edit_link_element.when_present.should exist
+end
+
+Then(/^I can select show edit toolbar$/) do
+ on(PreferencesEditingPage).show_edit_toolbar_check_element.when_present.should exist
+end
+
+Then(/^I can select show preview before edit box$/) do
+ on(PreferencesEditingPage).preview_on_top_check_element.when_present.should exist
+end
+
+Then(/^I can select show preview on first edit$/) do
+ on(PreferencesEditingPage).preview_on_first_check_element.when_present.should exist
+end
+
+Then(/^I can select to prompt me when entering a blank edit summary$/) do
+ on(PreferencesEditingPage).forced_edit_summary_check_element.when_present.should exist
+end
+
+Then(/^I can select to warn me when I leave an edit page with unsaved changes$/) do
+ on(PreferencesEditingPage).unsaved_changes_check_element.when_present.should exist
+end
diff --git a/tests/browser/features/step_definitions/preferences_user_profile_steps.rb b/tests/browser/features/step_definitions/preferences_user_profile_steps.rb
new file mode 100644
index 00000000..529af66d
--- /dev/null
+++ b/tests/browser/features/step_definitions/preferences_user_profile_steps.rb
@@ -0,0 +1,43 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+When(/^I click User profile$/) do
+ visit(PreferencesPage).user_profile_link_element.when_present.click
+end
+
+Then(/^I can change my gender$/) do
+ on(PreferencesUserProfilePage) do |page|
+ page.gender_undefined_radio_element.should exist
+ page.gender_male_radio_element.should exist
+ page.gender_female_radio_element.should exist
+ end
+end
+
+Then(/^I can change my language$/) do
+ on(PreferencesUserProfilePage).lang_select_element.should exist
+end
+
+Then(/^I can change my signature$/) do
+ on(PreferencesUserProfilePage).signature_field_element.should exist
+end
+
+Then(/^I can see my Basic informations$/) do
+ on(PreferencesUserProfilePage).basic_info_table_element.should exist
+end
+
+Then(/^I can see my email$/) do
+ on(PreferencesUserProfilePage).email_table_element.should exist
+end
+
+Then(/^I can see my signature$/) do
+ on(PreferencesUserProfilePage).signature_table_element.should exist
+end
+
diff --git a/tests/browser/features/step_definitions/view_history_steps.rb b/tests/browser/features/step_definitions/view_history_steps.rb
new file mode 100644
index 00000000..1ecc0085
--- /dev/null
+++ b/tests/browser/features/step_definitions/view_history_steps.rb
@@ -0,0 +1,8 @@
+When(/^I click View History$/) do
+ on(ViewHistoryPage).view_history_link
+end
+
+Then(/^I should see a link to a previous version of the page$/) do
+ on(ViewHistoryPage).old_version_link_element.should be_visible
+end
+
diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb
new file mode 100644
index 00000000..7c122366
--- /dev/null
+++ b/tests/browser/features/support/env.rb
@@ -0,0 +1,2 @@
+require "mediawiki_api"
+require "mediawiki_selenium"
diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb
new file mode 100644
index 00000000..85309f39
--- /dev/null
+++ b/tests/browser/features/support/hooks.rb
@@ -0,0 +1,2 @@
+# Needed for cucumber --dry-run -f stepdefs
+require 'page-object'
diff --git a/tests/browser/features/support/modules/url_module.rb b/tests/browser/features/support/modules/url_module.rb
new file mode 100644
index 00000000..6c329e87
--- /dev/null
+++ b/tests/browser/features/support/modules/url_module.rb
@@ -0,0 +1,10 @@
+module URL
+ def self.url(name)
+ if ENV["MEDIAWIKI_URL"]
+ mediawiki_url = ENV["MEDIAWIKI_URL"]
+ else
+ mediawiki_url = "http://127.0.0.1:80/w/index.php"
+ end
+ "#{mediawiki_url}#{name}"
+ end
+end
diff --git a/tests/browser/features/support/pages/create_account_page.rb b/tests/browser/features/support/pages/create_account_page.rb
new file mode 100644
index 00000000..380bccbc
--- /dev/null
+++ b/tests/browser/features/support/pages/create_account_page.rb
@@ -0,0 +1,19 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class CreateAccountPage
+ include PageObject
+
+ include URL
+ page_url URL.url("<%=params[:page_title]%>")
+
+ button(:create_account, id: "wpCreateaccount")
+end
diff --git a/tests/browser/features/support/pages/edit_page.rb b/tests/browser/features/support/pages/edit_page.rb
new file mode 100644
index 00000000..b619c342
--- /dev/null
+++ b/tests/browser/features/support/pages/edit_page.rb
@@ -0,0 +1,8 @@
+class EditPage
+ include PageObject
+
+ text_area(:edit_page_content, id: "wpTextbox1")
+ button(:preview_button, id: "wpPreview")
+ button(:show_changes_button, id: "wpDiff")
+ button(:save_button, id: "wpSave")
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/file_does_not_exist_page.rb b/tests/browser/features/support/pages/file_does_not_exist_page.rb
new file mode 100644
index 00000000..c8491f3b
--- /dev/null
+++ b/tests/browser/features/support/pages/file_does_not_exist_page.rb
@@ -0,0 +1,19 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class FileDoesNotExistPage
+ include PageObject
+
+ include URL
+ page_url URL.url("File:<%=params[:page_name]%>")
+
+ div(:file_does_not_exist_message, id: "mw-imagepage-nofile")
+end
diff --git a/tests/browser/features/support/pages/login_error_page.rb b/tests/browser/features/support/pages/login_error_page.rb
new file mode 100644
index 00000000..4fc9ca7f
--- /dev/null
+++ b/tests/browser/features/support/pages/login_error_page.rb
@@ -0,0 +1,5 @@
+class LoginErrorPage
+ include PageObject
+
+ div(:error_box, class: "errorbox")
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/main_page.rb b/tests/browser/features/support/pages/main_page.rb
new file mode 100644
index 00000000..7d96c2b2
--- /dev/null
+++ b/tests/browser/features/support/pages/main_page.rb
@@ -0,0 +1,19 @@
+class MainPage
+ include PageObject
+
+ include URL
+ page_url URL.url("")
+
+ a(:edit_link, href: /action=edit/)
+ li(:help_link, id: "n-help")
+ div(:page_content, id: "content")
+ li(:page_information_link, id: "t-info")
+ li(:permanent_link_link, id: "t-permalink")
+ a(:printable_version_link, href: /printable=yes/)
+ li(:random_page_link, id: "n-randompage")
+ li(:recent_changes_link, id: "n-recentchanges")
+ li(:related_changes_link, id: "t-recentchangeslinked")
+ li(:special_pages_link, id: "t-specialpages")
+ a(:view_history_link, href: /action=history/)
+ li(:what_links_here_link, id: "t-whatlinkshere")
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/preferences_appearance_page.rb b/tests/browser/features/support/pages/preferences_appearance_page.rb
new file mode 100644
index 00000000..c24e3862
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_appearance_page.rb
@@ -0,0 +1,41 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class PreferencesAppearancePage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-rendering")
+
+ checkbox(:auto_number_check, id: "mw-input-wpnumberheadings")
+ radio_button(:cologne_blue, id: "mw-input-wpskin-cologneblue")
+ radio_button(:day_mo_year_radio, id: "mw-input-wpdate-dmy")
+ checkbox(:dont_show_aft_check, id: "mw-input-wparticlefeedback-disable")
+ checkbox(:exclude_from_experiments_check, id: "mw-input-wpvector-noexperiments")
+ checkbox(:hidden_categories_check, id: "mw-input-wpshowhiddencats")
+ radio_button(:iso_8601_radio, id: "mw-input-wpdate-ISO_8601")
+ span(:local_time_span, id: "wpLocalTime")
+ radio_button(:mo_day_year_radio, id: "mw-input-wpdate-mdy")
+ radio_button(:modern, id: "mw-input-wpskin-modern")
+ radio_button(:monobook, id: "mw-input-wpskin-monobook")
+ radio_button(:no_preference_radio, id: "mw-input-wpdate-default")
+ text_field(:other_offset, id: "mw-input-wptimecorrection-other")
+ a(:restore_default_link, href: /reset/)
+ select_list(:size_select, id: "mw-input-wpimagesize")
+ select_list(:threshold_select, id: "mw-input-wpstubthreshold")
+ select_list(:time_offset_select, id: "mw-input-wptimecorrection")
+ table(:time_offset_table, id: "mw-htmlform-timeoffset")
+ select_list(:thumb_select, id: "mw-input-wpthumbsize")
+ select_list(:underline_select, id: "mw-input-wpunderline")
+ radio_button(:vector, id: "mw-input-wpskin-vector")
+ radio_button(:year_mo_day_radio, id: "mw-input-wpdate-ymd")
+end
+
diff --git a/tests/browser/features/support/pages/preferences_editing_page.rb b/tests/browser/features/support/pages/preferences_editing_page.rb
new file mode 100644
index 00000000..aed9c41d
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_editing_page.rb
@@ -0,0 +1,28 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class PreferencesEditingPage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-rendering")
+
+ select_list(:edit_area_font_style_select, id: "mw-input-wpeditfont")
+ checkbox(:edit_section_double_click_check, id: "mw-input-wpeditondblclick")
+ checkbox(:edit_section_edit_link, id: "mw-input-wpeditsectiononrightclick")
+ checkbox(:edit_section_right_click_check, id: "mw-input-wpeditsectiononrightclick")
+ checkbox(:forced_edit_summary_check, id: "mw-input-wpforceeditsummary")
+ checkbox(:live_preview_check, id: "mw-input-wpuselivepreview")
+ checkbox(:preview_on_first_check, id: "mw-input-wppreviewonfirst")
+ checkbox(:preview_on_top_check, id: "mw-input-wppreviewontop")
+ checkbox(:show_edit_toolbar_check, id: "mw-input-wpshowtoolbar")
+ checkbox(:unsaved_changes_check, id: "mw-input-wpuseeditwarning")
+end
diff --git a/tests/browser/features/support/pages/preferences_page.rb b/tests/browser/features/support/pages/preferences_page.rb
new file mode 100644
index 00000000..919ba27f
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_page.rb
@@ -0,0 +1,22 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class PreferencesPage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences")
+
+ a(:appearance_link, id: "preftab-rendering")
+ a(:editing_link, id: "preftab-editing")
+ a(:user_profile_link, id: "preftab-personal")
+ button(:save_button, id: "prefcontrol")
+end
diff --git a/tests/browser/features/support/pages/preferences_user_profile_page.rb b/tests/browser/features/support/pages/preferences_user_profile_page.rb
new file mode 100644
index 00000000..28e10b97
--- /dev/null
+++ b/tests/browser/features/support/pages/preferences_user_profile_page.rb
@@ -0,0 +1,28 @@
+#
+# This file is subject to the license terms in the LICENSE file found in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of
+# qa-browsertests, including this file, may be copied, modified, propagated, or
+# distributed except according to the terms contained in the LICENSE file.
+#
+# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the
+# qa-browsertests top-level directory and at
+# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS
+#
+class PreferencesUserProfilePage
+ include PageObject
+
+ include URL
+ page_url URL.url("Special:Preferences#mw-prefsection-personal")
+
+ table(:basic_info_table, id: "mw-htmlform-info")
+ link(:change_password_link, text: "Change password")
+ table(:email_table, id: "mw-htmlform-email")
+ radio_button(:gender_female_radio, id: "mw-input-wpgender-male")
+ radio_button(:gender_male_radio, id: "mw-input-wpgender-female")
+ radio_button(:gender_undefined_radio, id: "mw-input-wpgender-unknown")
+ select_list(:lang_select, id: "mw-input-wplanguage")
+ checkbox(:remember_password_check, id: "mw-input-wprememberpassword")
+ text_field(:signature_field, id: "mw-input-wpnickname")
+ table(:signature_table, id: "mw-htmlform-signature")
+end
diff --git a/tests/browser/features/support/pages/view_history_page.rb b/tests/browser/features/support/pages/view_history_page.rb
new file mode 100644
index 00000000..66895986
--- /dev/null
+++ b/tests/browser/features/support/pages/view_history_page.rb
@@ -0,0 +1,7 @@
+class ViewHistoryPage
+ include PageObject
+
+ a(:view_history_link, href: /action=history/)
+ a(:old_version_link, href: /oldid=/)
+
+end \ No newline at end of file
diff --git a/tests/browser/features/support/pages/ztargetpage.rb b/tests/browser/features/support/pages/ztargetpage.rb
new file mode 100644
index 00000000..c1f46eca
--- /dev/null
+++ b/tests/browser/features/support/pages/ztargetpage.rb
@@ -0,0 +1,7 @@
+class ZtargetPage < MainPage
+ include URL
+ page_url URL.url("<%=params[:article_name]%>")
+ include PageObject
+
+ a(:link_target_page_link, text: "link to the test target page")
+end \ No newline at end of file
diff --git a/tests/browser/features/view_history.feature b/tests/browser/features/view_history.feature
new file mode 100644
index 00000000..ba61ebda
--- /dev/null
+++ b/tests/browser/features/view_history.feature
@@ -0,0 +1,11 @@
+@chrome @clean @firefox @phantomjs
+Feature: View History
+
+ Scenario: Edit page and view history
+ Given I go to the "History Test Page" page with content "This is a page that will have history"
+ When I click Edit
+ And I edit the page with "Edited and a random string"
+ And I save the edit
+ And the edited page content should contain "Edited and a random string"
+ And I click View History
+ Then I should see a link to a previous version of the page
diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php
new file mode 100644
index 00000000..7d9415a2
--- /dev/null
+++ b/tests/parser/ParserTestResult.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * @copyright Copyright © 2013, Antoine Musso
+ * @copyright Copyright © 2013, Wikimedia Foundation Inc.
+ * @license GNU GPL v2
+ *
+ * @file
+ */
+
+/**
+ * Represent the result of a parser test.
+ *
+ * @since 1.22
+ */
+class ParserTestResult {
+ /**
+ * Description of the parser test.
+ *
+ * This is usually the text used to describe a parser test in the .txt
+ * files. It is initialized on a construction and you most probably
+ * never want to change it.
+ */
+ public $description;
+ /** Text that was expected */
+ public $expected;
+ /** Actual text rendered */
+ public $actual;
+
+ /**
+ * @param string $description A short text describing the parser test
+ * usually the text in the parser test .txt file. The description
+ * is later available using the property $description.
+ */
+ public function __construct( $description ) {
+ $this->description = $description;
+ }
+
+ /**
+ * Whether the test passed
+ * @return bool
+ */
+ public function isSuccess() {
+ return $this->expected === $this->actual;
+ }
+}
diff --git a/tests/parser/README b/tests/parser/README
new file mode 100644
index 00000000..8b413376
--- /dev/null
+++ b/tests/parser/README
@@ -0,0 +1,8 @@
+Parser tests are run using our PHPUnit test suite in tests/phpunit:
+
+ $ cd tests/phpunit
+ ./phpunit.php --group Parser
+
+You can optionally filter by title using --regex. I.e. :
+
+ ./phpunit.php --group Parser --regex="Bug 6200"
diff --git a/tests/parser/extraParserTests.txt b/tests/parser/extraParserTests.txt
new file mode 100644
index 00000000..bef8f506
--- /dev/null
+++ b/tests/parser/extraParserTests.txt
Binary files differ
diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
new file mode 100644
index 00000000..a9df6832
--- /dev/null
+++ b/tests/parser/parserTest.inc
@@ -0,0 +1,1655 @@
+<?php
+/**
+ * Helper code for the MediaWiki parser test suite. Some code is duplicated
+ * in PHPUnit's NewParserTests.php, so you'll probably want to update both
+ * at the same time.
+ *
+ * Copyright © 2004, 2010 Brion Vibber <brion@pobox.com>
+ * https://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @todo Make this more independent of the configuration (and if possible the database)
+ * @todo document
+ * @file
+ * @ingroup Testing
+ */
+
+/**
+ * @ingroup Testing
+ */
+class ParserTest {
+ /**
+ * @var bool $color whereas output should be colorized
+ */
+ private $color;
+
+ /**
+ * @var bool $showOutput Show test output
+ */
+ private $showOutput;
+
+ /**
+ * @var bool $useTemporaryTables Use temporary tables for the temporary database
+ */
+ private $useTemporaryTables = true;
+
+ /**
+ * @var bool $databaseSetupDone True if the database has been set up
+ */
+ private $databaseSetupDone = false;
+
+ /**
+ * Our connection to the database
+ * @var DatabaseBase
+ */
+ private $db;
+
+ /**
+ * Database clone helper
+ * @var CloneDatabase
+ */
+ private $dbClone;
+
+ /**
+ * @var DjVuSupport
+ */
+ private $djVuSupport;
+
+ /**
+ * @var TidySupport
+ */
+ private $tidySupport;
+
+ private $maxFuzzTestLength = 300;
+ private $fuzzSeed = 0;
+ private $memoryLimit = 50;
+ private $uploadDir = null;
+
+ public $regex = "";
+ private $savedGlobals = array();
+
+ /**
+ * Sets terminal colorization and diff/quick modes depending on OS and
+ * command-line options (--color and --quick).
+ * @param array $options
+ */
+ public function __construct( $options = array() ) {
+ # Only colorize output if stdout is a terminal.
+ $this->color = !wfIsWindows() && Maintenance::posix_isatty( 1 );
+
+ if ( isset( $options['color'] ) ) {
+ switch ( $options['color'] ) {
+ case 'no':
+ $this->color = false;
+ break;
+ case 'yes':
+ default:
+ $this->color = true;
+ break;
+ }
+ }
+
+ $this->term = $this->color
+ ? new AnsiTermColorer()
+ : new DummyTermColorer();
+
+ $this->showDiffs = !isset( $options['quick'] );
+ $this->showProgress = !isset( $options['quiet'] );
+ $this->showFailure = !(
+ isset( $options['quiet'] )
+ && ( isset( $options['record'] )
+ || isset( $options['compare'] ) ) ); // redundant output
+
+ $this->showOutput = isset( $options['show-output'] );
+
+ if ( isset( $options['filter'] ) ) {
+ $options['regex'] = $options['filter'];
+ }
+
+ if ( isset( $options['regex'] ) ) {
+ if ( isset( $options['record'] ) ) {
+ echo "Warning: --record cannot be used with --regex, disabling --record\n";
+ unset( $options['record'] );
+ }
+ $this->regex = $options['regex'];
+ } else {
+ # Matches anything
+ $this->regex = '';
+ }
+
+ $this->setupRecorder( $options );
+ $this->keepUploads = isset( $options['keep-uploads'] );
+
+ if ( isset( $options['seed'] ) ) {
+ $this->fuzzSeed = intval( $options['seed'] ) - 1;
+ }
+
+ $this->runDisabled = isset( $options['run-disabled'] );
+ $this->runParsoid = isset( $options['run-parsoid'] );
+
+ $this->djVuSupport = new DjVuSupport();
+ $this->tidySupport = new TidySupport();
+ if ( !$this->tidySupport->isEnabled() ) {
+ echo "Warning: tidy is not installed, skipping some tests\n";
+ }
+
+ $this->hooks = array();
+ $this->functionHooks = array();
+ $this->transparentHooks = array();
+ self::setUp();
+ }
+
+ static function setUp() {
+ global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc,
+ $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
+ $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
+ $wgExtraInterlanguageLinkPrefixes, $wgLocalInterwikis,
+ $parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
+ $wgArticlePath, $wgScript, $wgStylePath, $wgExtensionAssetsPath,
+ $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers;
+
+ $wgScript = '/index.php';
+ $wgScriptPath = '/';
+ $wgArticlePath = '/wiki/$1';
+ $wgStylePath = '/skins';
+ $wgExtensionAssetsPath = '/extensions';
+ $wgThumbnailScriptPath = false;
+ $wgLockManagers = array( array(
+ 'name' => 'fsLockManager',
+ 'class' => 'FSLockManager',
+ 'lockDirectory' => wfTempDir() . '/test-repo/lockdir',
+ ), array(
+ 'name' => 'nullLockManager',
+ 'class' => 'NullLockManager',
+ ) );
+ $wgLocalFileRepo = array(
+ 'class' => 'LocalRepo',
+ 'name' => 'local',
+ 'url' => 'http://example.com/images',
+ 'hashLevels' => 2,
+ 'transformVia404' => false,
+ 'backend' => new FSFileBackend( array(
+ 'name' => 'local-backend',
+ 'wikiId' => wfWikiId(),
+ 'containerPaths' => array(
+ 'local-public' => wfTempDir() . '/test-repo/public',
+ 'local-thumb' => wfTempDir() . '/test-repo/thumb',
+ 'local-temp' => wfTempDir() . '/test-repo/temp',
+ 'local-deleted' => wfTempDir() . '/test-repo/deleted',
+ )
+ ) )
+ );
+ $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
+ $wgNamespaceAliases['Image'] = NS_FILE;
+ $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
+ # add a namespace shadowing a interwiki link, to test
+ # proper precedence when resolving links. (bug 51680)
+ $wgExtraNamespaces[100] = 'MemoryAlpha';
+
+ // XXX: tests won't run without this (for CACHE_DB)
+ if ( $wgMainCacheType === CACHE_DB ) {
+ $wgMainCacheType = CACHE_NONE;
+ }
+ if ( $wgMessageCacheType === CACHE_DB ) {
+ $wgMessageCacheType = CACHE_NONE;
+ }
+ if ( $wgParserCacheType === CACHE_DB ) {
+ $wgParserCacheType = CACHE_NONE;
+ }
+
+ $wgEnableParserCache = false;
+ DeferredUpdates::clearPendingUpdates();
+ $wgMemc = wfGetMainCache(); // checks $wgMainCacheType
+ $messageMemc = wfGetMessageCacheStorage();
+ $parserMemc = wfGetParserCacheStorage();
+
+ $wgUser = new User;
+ $context = new RequestContext;
+ $wgLang = $context->getLanguage();
+ $wgOut = $context->getOutput();
+ $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
+ $wgRequest = $context->getRequest();
+
+ if ( $wgStyleDirectory === false ) {
+ $wgStyleDirectory = "$IP/skins";
+ }
+
+ self::setupInterwikis();
+ $wgLocalInterwikis = array( 'local', 'mi' );
+ // "extra language links"
+ // see https://gerrit.wikimedia.org/r/111390
+ array_push( $wgExtraInterlanguageLinkPrefixes, 'mul' );
+ }
+
+ /**
+ * Insert hardcoded interwiki in the lookup table.
+ *
+ * This function insert a set of well known interwikis that are used in
+ * the parser tests. They can be considered has fixtures are injected in
+ * the interwiki cache by using the 'InterwikiLoadPrefix' hook.
+ * Since we are not interested in looking up interwikis in the database,
+ * the hook completely replace the existing mechanism (hook returns false).
+ */
+ public static function setupInterwikis() {
+ # Hack: insert a few Wikipedia in-project interwiki prefixes,
+ # for testing inter-language links
+ Hooks::register( 'InterwikiLoadPrefix', function ( $prefix, &$iwData ) {
+ static $testInterwikis = array(
+ 'local' => array(
+ 'iw_url' => 'http://doesnt.matter.org/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 0 ),
+ 'wikipedia' => array(
+ 'iw_url' => 'http://en.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 0 ),
+ 'meatball' => array(
+ 'iw_url' => 'http://www.usemod.com/cgi-bin/mb.pl?$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 0 ),
+ 'memoryalpha' => array(
+ 'iw_url' => 'http://www.memory-alpha.org/en/index.php/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 0 ),
+ 'zh' => array(
+ 'iw_url' => 'http://zh.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ 'es' => array(
+ 'iw_url' => 'http://es.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ 'fr' => array(
+ 'iw_url' => 'http://fr.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ 'ru' => array(
+ 'iw_url' => 'http://ru.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ 'mi' => array(
+ 'iw_url' => 'http://mi.wikipedia.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ 'mul' => array(
+ 'iw_url' => 'http://wikisource.org/wiki/$1',
+ 'iw_api' => '',
+ 'iw_wikiid' => '',
+ 'iw_local' => 1 ),
+ );
+ if ( array_key_exists( $prefix, $testInterwikis ) ) {
+ $iwData = $testInterwikis[$prefix];
+ }
+
+ // We only want to rely on the above fixtures
+ return false;
+ } );// hooks::register
+ }
+
+ /**
+ * Remove the hardcoded interwiki lookup table.
+ */
+ public static function tearDownInterwikis() {
+ Hooks::clear( 'InterwikiLoadPrefix' );
+ }
+
+ public function setupRecorder( $options ) {
+ if ( isset( $options['record'] ) ) {
+ $this->recorder = new DbTestRecorder( $this );
+ $this->recorder->version = isset( $options['setversion'] ) ?
+ $options['setversion'] : SpecialVersion::getVersion();
+ } elseif ( isset( $options['compare'] ) ) {
+ $this->recorder = new DbTestPreviewer( $this );
+ } else {
+ $this->recorder = new TestRecorder( $this );
+ }
+ }
+
+ /**
+ * Remove last character if it is a newline
+ * @group utility
+ * @param string $s
+ * @return string
+ */
+ public static function chomp( $s ) {
+ if ( substr( $s, -1 ) === "\n" ) {
+ return substr( $s, 0, -1 );
+ } else {
+ return $s;
+ }
+ }
+
+ /**
+ * Run a fuzz test series
+ * Draw input from a set of test files
+ * @param array $filenames
+ */
+ function fuzzTest( $filenames ) {
+ $GLOBALS['wgContLang'] = Language::factory( 'en' );
+ $dict = $this->getFuzzInput( $filenames );
+ $dictSize = strlen( $dict );
+ $logMaxLength = log( $this->maxFuzzTestLength );
+ $this->setupDatabase();
+ ini_set( 'memory_limit', $this->memoryLimit * 1048576 );
+
+ $numTotal = 0;
+ $numSuccess = 0;
+ $user = new User;
+ $opts = ParserOptions::newFromUser( $user );
+ $title = Title::makeTitle( NS_MAIN, 'Parser_test' );
+
+ while ( true ) {
+ // Generate test input
+ mt_srand( ++$this->fuzzSeed );
+ $totalLength = mt_rand( 1, $this->maxFuzzTestLength );
+ $input = '';
+
+ while ( strlen( $input ) < $totalLength ) {
+ $logHairLength = mt_rand( 0, 1000000 ) / 1000000 * $logMaxLength;
+ $hairLength = min( intval( exp( $logHairLength ) ), $dictSize );
+ $offset = mt_rand( 0, $dictSize - $hairLength );
+ $input .= substr( $dict, $offset, $hairLength );
+ }
+
+ $this->setupGlobals();
+ $parser = $this->getParser();
+
+ // Run the test
+ try {
+ $parser->parse( $input, $title, $opts );
+ $fail = false;
+ } catch ( Exception $exception ) {
+ $fail = true;
+ }
+
+ if ( $fail ) {
+ echo "Test failed with seed {$this->fuzzSeed}\n";
+ echo "Input:\n";
+ printf( "string(%d) \"%s\"\n\n", strlen( $input ), $input );
+ echo "$exception\n";
+ } else {
+ $numSuccess++;
+ }
+
+ $numTotal++;
+ $this->teardownGlobals();
+ $parser->__destruct();
+
+ if ( $numTotal % 100 == 0 ) {
+ $usage = intval( memory_get_usage( true ) / $this->memoryLimit / 1048576 * 100 );
+ echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n";
+ if ( $usage > 90 ) {
+ echo "Out of memory:\n";
+ $memStats = $this->getMemoryBreakdown();
+
+ foreach ( $memStats as $name => $usage ) {
+ echo "$name: $usage\n";
+ }
+ $this->abort();
+ }
+ }
+ }
+ }
+
+ /**
+ * Get an input dictionary from a set of parser test files
+ * @param array $filenames
+ * @return string
+ */
+ function getFuzzInput( $filenames ) {
+ $dict = '';
+
+ foreach ( $filenames as $filename ) {
+ $contents = file_get_contents( $filename );
+ preg_match_all(
+ '/!!\s*(input|wikitext)\n(.*?)\n!!\s*(result|html|html\/\*|html\/php)/s',
+ $contents,
+ $matches
+ );
+
+ foreach ( $matches[1] as $match ) {
+ $dict .= $match . "\n";
+ }
+ }
+
+ return $dict;
+ }
+
+ /**
+ * Get a memory usage breakdown
+ * @return array
+ */
+ function getMemoryBreakdown() {
+ $memStats = array();
+
+ foreach ( $GLOBALS as $name => $value ) {
+ $memStats['$' . $name] = strlen( serialize( $value ) );
+ }
+
+ $classes = get_declared_classes();
+
+ foreach ( $classes as $class ) {
+ $rc = new ReflectionClass( $class );
+ $props = $rc->getStaticProperties();
+ $memStats[$class] = strlen( serialize( $props ) );
+ $methods = $rc->getMethods();
+
+ foreach ( $methods as $method ) {
+ $memStats[$class] += strlen( serialize( $method->getStaticVariables() ) );
+ }
+ }
+
+ $functions = get_defined_functions();
+
+ foreach ( $functions['user'] as $function ) {
+ $rf = new ReflectionFunction( $function );
+ $memStats["$function()"] = strlen( serialize( $rf->getStaticVariables() ) );
+ }
+
+ asort( $memStats );
+
+ return $memStats;
+ }
+
+ function abort() {
+ $this->abort();
+ }
+
+ /**
+ * Run a series of tests listed in the given text files.
+ * Each test consists of a brief description, wikitext input,
+ * and the expected HTML output.
+ *
+ * Prints status updates on stdout and counts up the total
+ * number and percentage of passed tests.
+ *
+ * @param array $filenames Array of strings
+ * @return bool True if passed all tests, false if any tests failed.
+ */
+ public function runTestsFromFiles( $filenames ) {
+ $ok = false;
+
+ // be sure, ParserTest::addArticle has correct language set,
+ // so that system messages gets into the right language cache
+ $GLOBALS['wgLanguageCode'] = 'en';
+ $GLOBALS['wgContLang'] = Language::factory( 'en' );
+
+ $this->recorder->start();
+ try {
+ $this->setupDatabase();
+ $ok = true;
+
+ foreach ( $filenames as $filename ) {
+ $tests = new TestFileIterator( $filename, $this );
+ $ok = $this->runTests( $tests ) && $ok;
+ }
+
+ $this->teardownDatabase();
+ $this->recorder->report();
+ } catch ( DBError $e ) {
+ echo $e->getMessage();
+ }
+ $this->recorder->end();
+
+ return $ok;
+ }
+
+ function runTests( $tests ) {
+ $ok = true;
+
+ foreach ( $tests as $t ) {
+ $result =
+ $this->runTest( $t['test'], $t['input'], $t['result'], $t['options'], $t['config'] );
+ $ok = $ok && $result;
+ $this->recorder->record( $t['test'], $result );
+ }
+
+ if ( $this->showProgress ) {
+ print "\n";
+ }
+
+ return $ok;
+ }
+
+ /**
+ * Get a Parser object
+ *
+ * @param string $preprocessor
+ * @return Parser
+ */
+ function getParser( $preprocessor = null ) {
+ global $wgParserConf;
+
+ $class = $wgParserConf['class'];
+ $parser = new $class( array( 'preprocessorClass' => $preprocessor ) + $wgParserConf );
+
+ foreach ( $this->hooks as $tag => $callback ) {
+ $parser->setHook( $tag, $callback );
+ }
+
+ foreach ( $this->functionHooks as $tag => $bits ) {
+ list( $callback, $flags ) = $bits;
+ $parser->setFunctionHook( $tag, $callback, $flags );
+ }
+
+ foreach ( $this->transparentHooks as $tag => $callback ) {
+ $parser->setTransparentTagHook( $tag, $callback );
+ }
+
+ wfRunHooks( 'ParserTestParser', array( &$parser ) );
+
+ return $parser;
+ }
+
+ /**
+ * Run a given wikitext input through a freshly-constructed wiki parser,
+ * and compare the output against the expected results.
+ * Prints status and explanatory messages to stdout.
+ *
+ * @param string $desc Test's description
+ * @param string $input Wikitext to try rendering
+ * @param string $result Result to output
+ * @param array $opts Test's options
+ * @param string $config Overrides for global variables, one per line
+ * @return bool
+ */
+ public function runTest( $desc, $input, $result, $opts, $config ) {
+ if ( $this->showProgress ) {
+ $this->showTesting( $desc );
+ }
+
+ $opts = $this->parseOptions( $opts );
+ $context = $this->setupGlobals( $opts, $config );
+
+ $user = $context->getUser();
+ $options = ParserOptions::newFromContext( $context );
+
+ if ( isset( $opts['djvu'] ) ) {
+ if ( !$this->djVuSupport->isEnabled() ) {
+ return $this->showSkipped();
+ }
+ }
+
+ if ( isset( $opts['title'] ) ) {
+ $titleText = $opts['title'];
+ } else {
+ $titleText = 'Parser test';
+ }
+
+ $local = isset( $opts['local'] );
+ $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
+ $parser = $this->getParser( $preprocessor );
+ $title = Title::newFromText( $titleText );
+
+ if ( isset( $opts['pst'] ) ) {
+ $out = $parser->preSaveTransform( $input, $title, $user, $options );
+ } elseif ( isset( $opts['msg'] ) ) {
+ $out = $parser->transformMsg( $input, $options, $title );
+ } elseif ( isset( $opts['section'] ) ) {
+ $section = $opts['section'];
+ $out = $parser->getSection( $input, $section );
+ } elseif ( isset( $opts['replace'] ) ) {
+ $section = $opts['replace'][0];
+ $replace = $opts['replace'][1];
+ $out = $parser->replaceSection( $input, $section, $replace );
+ } elseif ( isset( $opts['comment'] ) ) {
+ $out = Linker::formatComment( $input, $title, $local );
+ } elseif ( isset( $opts['preload'] ) ) {
+ $out = $parser->getPreloadText( $input, $title, $options );
+ } else {
+ $output = $parser->parse( $input, $title, $options, true, true, 1337 );
+ $output->setTOCEnabled( !isset( $opts['notoc'] ) );
+ $out = $output->getText();
+ if ( isset( $opts['tidy'] ) ) {
+ if ( !$this->tidySupport->isEnabled() ) {
+ return $this->showSkipped();
+ }
+ $out = MWTidy::tidy( $out );
+ $out = preg_replace( '/\s+$/', '', $out );
+ }
+
+ if ( isset( $opts['showtitle'] ) ) {
+ if ( $output->getTitleText() ) {
+ $title = $output->getTitleText();
+ }
+
+ $out = "$title\n$out";
+ }
+
+ if ( isset( $opts['ill'] ) ) {
+ $out = implode( ' ', $output->getLanguageLinks() );
+ } elseif ( isset( $opts['cat'] ) ) {
+ $outputPage = $context->getOutput();
+ $outputPage->addCategoryLinks( $output->getCategories() );
+ $cats = $outputPage->getCategoryLinks();
+
+ if ( isset( $cats['normal'] ) ) {
+ $out = implode( ' ', $cats['normal'] );
+ } else {
+ $out = '';
+ }
+ }
+ }
+
+ $this->teardownGlobals();
+
+ $testResult = new ParserTestResult( $desc );
+ $testResult->expected = $result;
+ $testResult->actual = $out;
+
+ return $this->showTestResult( $testResult );
+ }
+
+ /**
+ * Refactored in 1.22 to use ParserTestResult
+ * @param ParserTestResult $testResult
+ * @return bool
+ */
+ function showTestResult( ParserTestResult $testR