summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitreview6
-rw-r--r--.jshintignore27
-rw-r--r--.jshintrc34
-rw-r--r--RELEASE-NOTES-1.2116
-rw-r--r--extensions/Cite/.gitreview5
-rw-r--r--extensions/ConfirmEdit/.gitreview5
-rw-r--r--extensions/ConfirmEdit/ReCaptcha.i18n.php3
-rw-r--r--extensions/Gadgets/.gitreview5
-rw-r--r--extensions/Gadgets/tests/GadgetTest.php81
-rw-r--r--extensions/ImageMap/.gitreview5
-rw-r--r--extensions/InputBox/.gitreview5
-rw-r--r--extensions/Interwiki/.gitreview6
-rw-r--r--extensions/LocalisationUpdate/.gitreview5
-rw-r--r--extensions/LocalisationUpdate/tests/tokenTest.php91
-rw-r--r--extensions/Nuke/.gitreview5
-rw-r--r--extensions/ParserFunctions/.gitreview5
-rw-r--r--extensions/ParserFunctions/ParserFunctions.i18n.magic.php4
-rw-r--r--extensions/ParserFunctions/tests/ExpressionTest.php76
-rw-r--r--extensions/PdfHandler/.gitreview5
-rw-r--r--extensions/PdfHandler/PdfHandler_body.php2
-rw-r--r--extensions/Poem/.gitreview5
-rw-r--r--extensions/Renameuser/.gitreview5
-rw-r--r--extensions/SpamBlacklist/.gitreview5
-rw-r--r--extensions/SyntaxHighlight_GeSHi/.gitreview5
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php123
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php466
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen2.php59
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/example.php217
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/langcheck.php769
-rw-r--r--extensions/SyntaxHighlight_GeSHi/geshi/contrib/langwiz.php1158
-rw-r--r--extensions/TitleBlacklist/.gitreview5
-rw-r--r--extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php110
-rw-r--r--extensions/TitleBlacklist/tests/testSource4
-rw-r--r--extensions/Vector/.gitreview5
-rw-r--r--extensions/WikiEditor/.gitreview6
-rw-r--r--extensions/WikiEditor/.jshintignore2
-rw-r--r--extensions/WikiEditor/.jshintrc9
-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.php27
-rw-r--r--extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php35
-rw-r--r--includes/DefaultSettings.php2
-rw-r--r--includes/api/ApiBlock.php15
-rw-r--r--includes/api/ApiCreateAccount.php4
-rw-r--r--includes/api/ApiLogin.php9
-rw-r--r--includes/api/ApiMain.php10
-rw-r--r--includes/api/ApiQueryDeletedrevs.php5
-rw-r--r--includes/api/ApiTokens.php5
-rw-r--r--includes/api/ApiUnblock.php15
-rw-r--r--includes/filerepo/file/LocalFile.php16
-rw-r--r--includes/installer/Installer.php29
-rw-r--r--includes/installer/MysqlUpdater.php2
-rw-r--r--includes/installer/WebInstallerPage.php2
-rw-r--r--includes/libs/IEUrlExtension.php2
-rw-r--r--includes/resourceloader/ResourceLoader.php26
-rw-r--r--includes/revisiondelete/RevisionDelete.php11
-rw-r--r--maintenance/language/zhtable/trad2simp_supp_unset.manual (renamed from includes/zhtable/trad2simp_supp_unset.manual)0
-rw-r--r--maintenance/postgres/archives/patch-ipb_address_unique.sql0
-rw-r--r--skins/common/images/icons/fileicon-djvu.xcfbin0 -> 83394 bytes
-rw-r--r--skins/common/images/icons/fileicon-ogg.xcfbin0 -> 40236 bytes
-rw-r--r--tests/.htaccess1
-rw-r--r--tests/RunSeleniumTests.php258
-rw-r--r--tests/TestsAutoLoader.php104
-rw-r--r--tests/parser/README8
-rw-r--r--tests/parser/extraParserTests.txtbin0 -> 1261 bytes
-rw-r--r--tests/parser/parserTest.inc1349
-rw-r--r--tests/parser/parserTests.txt13859
-rw-r--r--tests/parser/parserTestsParserHook.php66
-rw-r--r--tests/parser/preprocess/All_system_messages.expected5646
-rw-r--r--tests/parser/preprocess/All_system_messages.txt5645
-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.php94
-rw-r--r--tests/phpunit/AutoLoaderTest.php51
-rw-r--r--tests/phpunit/Makefile91
-rw-r--r--tests/phpunit/MediaWikiLangTestCase.php29
-rw-r--r--tests/phpunit/MediaWikiPHPUnitCommand.php101
-rw-r--r--tests/phpunit/MediaWikiTestCase.php938
-rw-r--r--tests/phpunit/README53
-rw-r--r--tests/phpunit/StructureTest.php63
-rw-r--r--tests/phpunit/TODO10
-rw-r--r--tests/phpunit/bootstrap.php32
-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.sql483
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.17.sql516
-rw-r--r--tests/phpunit/data/db/sqlite/tables-1.18.sql535
-rw-r--r--tests/phpunit/data/media/1bit-png.pngbin0 -> 167 bytes
-rw-r--r--tests/phpunit/data/media/80x60-2layers.xcfbin0 -> 1162 bytes
-rw-r--r--tests/phpunit/data/media/80x60-Greyscale.xcfbin0 -> 667 bytes
-rw-r--r--tests/phpunit/data/media/80x60-RGB.xcfbin0 -> 677 bytes
-rw-r--r--tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.pngbin0 -> 72209 bytes
-rw-r--r--tests/phpunit/data/media/Gtk-media-play-ltr.svg35
-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/README38
-rw-r--r--tests/phpunit/data/media/Toll_Texas_1.svg150
-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/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/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/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.php39
-rw-r--r--tests/phpunit/includes/ArticleTablesTest.php33
-rw-r--r--tests/phpunit/includes/ArticleTest.php92
-rw-r--r--tests/phpunit/includes/BlockTest.php231
-rw-r--r--tests/phpunit/includes/CdbTest.php88
-rw-r--r--tests/phpunit/includes/CollationTest.php109
-rw-r--r--tests/phpunit/includes/DiffHistoryBlobTest.php41
-rw-r--r--tests/phpunit/includes/EditPageTest.php416
-rw-r--r--tests/phpunit/includes/ExternalStoreTest.php81
-rw-r--r--tests/phpunit/includes/ExtraParserTest.php158
-rw-r--r--tests/phpunit/includes/FauxResponseTest.php71
-rw-r--r--tests/phpunit/includes/FormOptionsInitializationTest.php85
-rw-r--r--tests/phpunit/includes/FormOptionsTest.php91
-rw-r--r--tests/phpunit/includes/GlobalFunctions/GlobalTest.php679
-rw-r--r--tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php29
-rw-r--r--tests/phpunit/includes/GlobalFunctions/README2
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php110
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php134
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php181
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php36
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php113
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php35
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php143
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php89
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php28
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php133
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php116
-rw-r--r--tests/phpunit/includes/HooksTest.php137
-rw-r--r--tests/phpunit/includes/HtmlTest.php620
-rw-r--r--tests/phpunit/includes/HttpTest.php213
-rw-r--r--tests/phpunit/includes/IPTest.php541
-rw-r--r--tests/phpunit/includes/JsonTest.php27
-rw-r--r--tests/phpunit/includes/LanguageConverterTest.php135
-rw-r--r--tests/phpunit/includes/LicensesTest.php22
-rw-r--r--tests/phpunit/includes/LinkerTest.php71
-rw-r--r--tests/phpunit/includes/LinksUpdateTest.php164
-rw-r--r--tests/phpunit/includes/LocalFileTest.php107
-rw-r--r--tests/phpunit/includes/LocalisationCacheTest.php31
-rw-r--r--tests/phpunit/includes/MWFunctionTest.php75
-rw-r--r--tests/phpunit/includes/MWNamespaceTest.php574
-rw-r--r--tests/phpunit/includes/MessageTest.php74
-rw-r--r--tests/phpunit/includes/OutputPageTest.php172
-rw-r--r--tests/phpunit/includes/PathRouterTest.php255
-rw-r--r--tests/phpunit/includes/PreferencesTest.php82
-rw-r--r--tests/phpunit/includes/Providers.php44
-rw-r--r--tests/phpunit/includes/RecentChangeTest.php280
-rw-r--r--tests/phpunit/includes/RequestContextTest.php69
-rw-r--r--tests/phpunit/includes/ResourceLoaderTest.php91
-rw-r--r--tests/phpunit/includes/RevisionStorageTest.php546
-rw-r--r--tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php95
-rw-r--r--tests/phpunit/includes/RevisionTest.php445
-rw-r--r--tests/phpunit/includes/SampleTest.php105
-rw-r--r--tests/phpunit/includes/SanitizerTest.php250
-rw-r--r--tests/phpunit/includes/SanitizerValidateEmailTest.php96
-rw-r--r--tests/phpunit/includes/SeleniumConfigurationTest.php222
-rw-r--r--tests/phpunit/includes/SiteConfigurationTest.php312
-rw-r--r--tests/phpunit/includes/StringUtilsTest.php143
-rw-r--r--tests/phpunit/includes/TemplateCategoriesTest.php37
-rw-r--r--tests/phpunit/includes/TestUser.php58
-rw-r--r--tests/phpunit/includes/TimeAdjustTest.php45
-rw-r--r--tests/phpunit/includes/TimestampTest.php86
-rw-r--r--tests/phpunit/includes/TitleMethodsTest.php290
-rw-r--r--tests/phpunit/includes/TitlePermissionTest.php662
-rw-r--r--tests/phpunit/includes/TitleTest.php329
-rw-r--r--tests/phpunit/includes/UIDGeneratorTest.php76
-rw-r--r--tests/phpunit/includes/UserTest.php217
-rw-r--r--tests/phpunit/includes/WebRequestTest.php220
-rw-r--r--tests/phpunit/includes/WikiPageTest.php1018
-rw-r--r--tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php62
-rw-r--r--tests/phpunit/includes/XmlJsTest.php9
-rw-r--r--tests/phpunit/includes/XmlSelectTest.php150
-rw-r--r--tests/phpunit/includes/XmlTest.php336
-rw-r--r--tests/phpunit/includes/ZipDirectoryReaderTest.php80
-rw-r--r--tests/phpunit/includes/api/ApiAccountCreationTest.php153
-rw-r--r--tests/phpunit/includes/api/ApiBlockTest.php118
-rw-r--r--tests/phpunit/includes/api/ApiEditPageTest.php352
-rw-r--r--tests/phpunit/includes/api/ApiOptionsTest.php412
-rw-r--r--tests/phpunit/includes/api/ApiParseTest.php30
-rw-r--r--tests/phpunit/includes/api/ApiPurgeTest.php41
-rw-r--r--tests/phpunit/includes/api/ApiTest.php266
-rw-r--r--tests/phpunit/includes/api/ApiTestCase.php239
-rw-r--r--tests/phpunit/includes/api/ApiTestCaseUpload.php149
-rw-r--r--tests/phpunit/includes/api/ApiUploadTest.php565
-rw-r--r--tests/phpunit/includes/api/ApiWatchTest.php177
-rw-r--r--tests/phpunit/includes/api/PrefixUniquenessTest.php25
-rw-r--r--tests/phpunit/includes/api/RandomImageGenerator.php465
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatPhpTest.php19
-rw-r--r--tests/phpunit/includes/api/format/ApiFormatTestBase.php22
-rw-r--r--tests/phpunit/includes/api/generateRandomImages.php46
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryBasicTest.php348
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinue2Test.php68
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinueTest.php313
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php203
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php39
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryTest.php69
-rw-r--r--tests/phpunit/includes/api/query/ApiQueryTestBase.php149
-rw-r--r--tests/phpunit/includes/api/words.txt1000
-rw-r--r--tests/phpunit/includes/cache/GenderCacheTest.php101
-rw-r--r--tests/phpunit/includes/cache/ProcessCacheLRUTest.php239
-rw-r--r--tests/phpunit/includes/content/ContentHandlerTest.php424
-rw-r--r--tests/phpunit/includes/content/CssContentTest.php81
-rw-r--r--tests/phpunit/includes/content/JavaScriptContentTest.php273
-rw-r--r--tests/phpunit/includes/content/TextContentTest.php431
-rw-r--r--tests/phpunit/includes/content/WikitextContentHandlerTest.php185
-rw-r--r--tests/phpunit/includes/content/WikitextContentTest.php386
-rw-r--r--tests/phpunit/includes/db/DatabaseSQLTest.php148
-rw-r--r--tests/phpunit/includes/db/DatabaseSqliteTest.php389
-rw-r--r--tests/phpunit/includes/db/DatabaseTest.php212
-rw-r--r--tests/phpunit/includes/db/ORMRowTest.php225
-rw-r--r--tests/phpunit/includes/db/ORMTableTest.php146
-rw-r--r--tests/phpunit/includes/db/TestORMRowTest.php199
-rw-r--r--tests/phpunit/includes/debug/MWDebugTest.php72
-rw-r--r--tests/phpunit/includes/filebackend/FileBackendTest.php2189
-rw-r--r--tests/phpunit/includes/filerepo/FileRepoTest.php48
-rw-r--r--tests/phpunit/includes/filerepo/StoreBatchTest.php123
-rw-r--r--tests/phpunit/includes/installer/InstallDocFormatterTest.php64
-rw-r--r--tests/phpunit/includes/jobqueue/JobQueueTest.php292
-rw-r--r--tests/phpunit/includes/json/ServicesJsonTest.php93
-rw-r--r--tests/phpunit/includes/libs/CSSJanusTest.php560
-rw-r--r--tests/phpunit/includes/libs/CSSMinTest.php133
-rw-r--r--tests/phpunit/includes/libs/GenericArrayObjectTest.php262
-rw-r--r--tests/phpunit/includes/libs/IEUrlExtensionTest.php126
-rw-r--r--tests/phpunit/includes/libs/JavaScriptMinifierTest.php170
-rw-r--r--tests/phpunit/includes/logging/LogFormatterTest.php207
-rw-r--r--tests/phpunit/includes/logging/LogTests.i18n.php15
-rw-r--r--tests/phpunit/includes/media/BitmapMetadataHandlerTest.php152
-rw-r--r--tests/phpunit/includes/media/BitmapScalingTest.php154
-rw-r--r--tests/phpunit/includes/media/ExifBitmapTest.php104
-rw-r--r--tests/phpunit/includes/media/ExifRotationTest.php261
-rw-r--r--tests/phpunit/includes/media/ExifTest.php44
-rw-r--r--tests/phpunit/includes/media/FormatMetadataTest.php50
-rw-r--r--tests/phpunit/includes/media/GIFMetadataExtractorTest.php106
-rw-r--r--tests/phpunit/includes/media/GIFTest.php104
-rw-r--r--tests/phpunit/includes/media/IPTCTest.php60
-rw-r--r--tests/phpunit/includes/media/JpegMetadataExtractorTest.php106
-rw-r--r--tests/phpunit/includes/media/JpegTest.php29
-rw-r--r--tests/phpunit/includes/media/MediaHandlerTest.php48
-rw-r--r--tests/phpunit/includes/media/PNGMetadataExtractorTest.php153
-rw-r--r--tests/phpunit/includes/media/PNGTest.php107
-rw-r--r--tests/phpunit/includes/media/SVGMetadataExtractorTest.php107
-rw-r--r--tests/phpunit/includes/media/TiffTest.php31
-rw-r--r--tests/phpunit/includes/media/XMPTest.php161
-rw-r--r--tests/phpunit/includes/media/XMPValidateTest.php47
-rw-r--r--tests/phpunit/includes/normal/CleanUpTest.php405
-rw-r--r--tests/phpunit/includes/objectcache/BagOStuffTest.php138
-rw-r--r--tests/phpunit/includes/parser/MagicVariableTest.php219
-rw-r--r--tests/phpunit/includes/parser/MediaWikiParserTest.php34
-rw-r--r--tests/phpunit/includes/parser/NewParserTest.php914
-rw-r--r--tests/phpunit/includes/parser/ParserMethodsTest.php49
-rw-r--r--tests/phpunit/includes/parser/ParserOutputTest.php55
-rw-r--r--tests/phpunit/includes/parser/ParserPreloadTest.php72
-rw-r--r--tests/phpunit/includes/parser/PreprocessorTest.php229
-rw-r--r--tests/phpunit/includes/parser/TagHooksTest.php82
-rw-r--r--tests/phpunit/includes/search/SearchEngineTest.php176
-rw-r--r--tests/phpunit/includes/search/SearchUpdateTest.php81
-rw-r--r--tests/phpunit/includes/site/MediaWikiSiteTest.php89
-rw-r--r--tests/phpunit/includes/site/SiteListTest.php190
-rw-r--r--tests/phpunit/includes/site/SiteSQLStoreTest.php123
-rw-r--r--tests/phpunit/includes/site/SiteTest.php267
-rw-r--r--tests/phpunit/includes/site/TestSites.php101
-rw-r--r--tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php79
-rw-r--r--tests/phpunit/includes/specials/SpecialRecentchangesTest.php127
-rw-r--r--tests/phpunit/includes/specials/SpecialSearchTest.php140
-rw-r--r--tests/phpunit/includes/upload/UploadFromUrlTest.php352
-rw-r--r--tests/phpunit/includes/upload/UploadStashTest.php77
-rw-r--r--tests/phpunit/includes/upload/UploadTest.php144
-rw-r--r--tests/phpunit/install-phpunit.sh37
-rw-r--r--tests/phpunit/languages/LanguageAmTest.php25
-rw-r--r--tests/phpunit/languages/LanguageArTest.php72
-rw-r--r--tests/phpunit/languages/LanguageBeTest.php32
-rw-r--r--tests/phpunit/languages/LanguageBe_taraskTest.php73
-rw-r--r--tests/phpunit/languages/LanguageBhoTest.php26
-rw-r--r--tests/phpunit/languages/LanguageBsTest.php33
-rw-r--r--tests/phpunit/languages/LanguageClassesTestCase.php100
-rw-r--r--tests/phpunit/languages/LanguageCsTest.php32
-rw-r--r--tests/phpunit/languages/LanguageCuTest.php33
-rw-r--r--tests/phpunit/languages/LanguageCyTest.php34
-rw-r--r--tests/phpunit/languages/LanguageDsbTest.php32
-rw-r--r--tests/phpunit/languages/LanguageFrTest.php26
-rw-r--r--tests/phpunit/languages/LanguageGaTest.php26
-rw-r--r--tests/phpunit/languages/LanguageGdTest.php48
-rw-r--r--tests/phpunit/languages/LanguageGvTest.php32
-rw-r--r--tests/phpunit/languages/LanguageHeTest.php77
-rw-r--r--tests/phpunit/languages/LanguageHiTest.php26
-rw-r--r--tests/phpunit/languages/LanguageHrTest.php33
-rw-r--r--tests/phpunit/languages/LanguageHsbTest.php32
-rw-r--r--tests/phpunit/languages/LanguageHuTest.php26
-rw-r--r--tests/phpunit/languages/LanguageHyTest.php26
-rw-r--r--tests/phpunit/languages/LanguageKshTest.php26
-rw-r--r--tests/phpunit/languages/LanguageLnTest.php26
-rw-r--r--tests/phpunit/languages/LanguageLtTest.php45
-rw-r--r--tests/phpunit/languages/LanguageLvTest.php31
-rw-r--r--tests/phpunit/languages/LanguageMgTest.php27
-rw-r--r--tests/phpunit/languages/LanguageMkTest.php33
-rw-r--r--tests/phpunit/languages/LanguageMlTest.php35
-rw-r--r--tests/phpunit/languages/LanguageMoTest.php35
-rw-r--r--tests/phpunit/languages/LanguageMtTest.php64
-rw-r--r--tests/phpunit/languages/LanguageNlTest.php20
-rw-r--r--tests/phpunit/languages/LanguageNsoTest.php24
-rw-r--r--tests/phpunit/languages/LanguagePlTest.php64
-rw-r--r--tests/phpunit/languages/LanguageRoTest.php35
-rw-r--r--tests/phpunit/languages/LanguageRuTest.php78
-rw-r--r--tests/phpunit/languages/LanguageSeTest.php40
-rw-r--r--tests/phpunit/languages/LanguageSgsTest.php58
-rw-r--r--tests/phpunit/languages/LanguageShTest.php24
-rw-r--r--tests/phpunit/languages/LanguageSkTest.php32
-rw-r--r--tests/phpunit/languages/LanguageSlTest.php34
-rw-r--r--tests/phpunit/languages/LanguageSmaTest.php40
-rw-r--r--tests/phpunit/languages/LanguageSrTest.php219
-rw-r--r--tests/phpunit/languages/LanguageTest.php1352
-rw-r--r--tests/phpunit/languages/LanguageTiTest.php24
-rw-r--r--tests/phpunit/languages/LanguageTlTest.php24
-rw-r--r--tests/phpunit/languages/LanguageTrTest.php60
-rw-r--r--tests/phpunit/languages/LanguageUkTest.php48
-rw-r--r--tests/phpunit/languages/LanguageUzTest.php115
-rw-r--r--tests/phpunit/languages/LanguageWaTest.php24
-rw-r--r--tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php95
-rw-r--r--tests/phpunit/maintenance/DumpTestCase.php377
-rw-r--r--tests/phpunit/maintenance/MaintenanceTest.php820
-rw-r--r--tests/phpunit/maintenance/backupPrefetchTest.php278
-rw-r--r--tests/phpunit/maintenance/backupTextPassTest.php584
-rw-r--r--tests/phpunit/maintenance/backup_LogTest.php230
-rw-r--r--tests/phpunit/maintenance/backup_PageTest.php408
-rw-r--r--tests/phpunit/maintenance/fetchTextTest.php240
-rw-r--r--tests/phpunit/maintenance/getSlaveServerTest.php69
-rw-r--r--tests/phpunit/phpunit.php111
-rw-r--r--tests/phpunit/resources/ResourcesTest.php128
-rw-r--r--tests/phpunit/run-tests.bat1
-rw-r--r--tests/phpunit/skins/SideBarTest.php205
-rw-r--r--tests/phpunit/suite.xml50
-rw-r--r--tests/phpunit/suites/ExtensionsTestSuite.php33
-rw-r--r--tests/phpunit/suites/UploadFromUrlTestSuite.php206
-rw-r--r--tests/qunit/.htaccess1
-rw-r--r--tests/qunit/QUnitTestResources.php66
-rw-r--r--tests/qunit/data/callMwLoaderTestCallback.js1
-rw-r--r--tests/qunit/data/generateJqueryMsgData.php150
-rw-r--r--tests/qunit/data/load.mock.php58
-rw-r--r--tests/qunit/data/mediawiki.jqueryMsg.data.js492
-rw-r--r--tests/qunit/data/qunitOkCall.js2
-rw-r--r--tests/qunit/data/styleTest.css.php61
-rw-r--r--tests/qunit/data/testrunner.js408
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js58
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.byteLength.test.js35
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js258
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.client.test.js375
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js63
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js37
-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.mwExtension.test.js57
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js35
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js1128
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.textSelection.test.js282
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js28
-rw-r--r--tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js61
-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.js198
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js433
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js81
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js599
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js70
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js443
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.test.js765
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js53
-rw-r--r--tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js303
-rw-r--r--tests/selenium/Selenium.php191
-rw-r--r--tests/selenium/SeleniumConfig.php80
-rw-r--r--tests/selenium/SeleniumLoader.php9
-rw-r--r--tests/selenium/SeleniumServerManager.php252
-rw-r--r--tests/selenium/SeleniumTestCase.php127
-rw-r--r--tests/selenium/SeleniumTestConsoleLogger.php25
-rw-r--r--tests/selenium/SeleniumTestConstants.php24
-rw-r--r--tests/selenium/SeleniumTestHTMLLogger.php36
-rw-r--r--tests/selenium/SeleniumTestListener.php65
-rw-r--r--tests/selenium/SeleniumTestSuite.php57
-rw-r--r--tests/selenium/data/SimpleSeleniumTestDB.sql1453
-rw-r--r--tests/selenium/data/SimpleSeleniumTestImages.zipbin0 -> 21993 bytes
-rw-r--r--tests/selenium/data/Wikipedia-logo-v2-de.pngbin0 -> 21479 bytes
-rw-r--r--tests/selenium/data/mediawiki118_fresh_installation.sql1543
-rw-r--r--tests/selenium/installer/MediaWikiButtonsAvailabilityTestCase.php90
-rw-r--r--tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php73
-rw-r--r--tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php88
-rw-r--r--tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php131
-rw-r--r--tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php119
-rw-r--r--tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php128
-rw-r--r--tests/selenium/installer/MediaWikiInstallationCommonFunction.php259
-rw-r--r--tests/selenium/installer/MediaWikiInstallationConfig.php45
-rw-r--r--tests/selenium/installer/MediaWikiInstallationMessage.php53
-rw-r--r--tests/selenium/installer/MediaWikiInstallationVariables.php73
-rw-r--r--tests/selenium/installer/MediaWikiInstallerTestSuite.php49
-rw-r--r--tests/selenium/installer/MediaWikiMySQLDataBaseTestCase.php71
-rw-r--r--tests/selenium/installer/MediaWikiMySQLiteDataBaseTestCase.php73
-rw-r--r--tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php65
-rw-r--r--tests/selenium/installer/MediaWikiRestartInstallationTestCase.php104
-rw-r--r--tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php83
-rw-r--r--tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php111
-rw-r--r--tests/selenium/installer/MediaWikiUserInterfaceTestCase.php494
-rw-r--r--tests/selenium/installer/README.txt32
-rw-r--r--tests/selenium/selenium_settings.ini.sample32
-rw-r--r--tests/selenium/selenium_settings_grid.ini.sample16
-rw-r--r--tests/selenium/suites/AddContentToNewPageTestCase.php173
-rw-r--r--tests/selenium/suites/AddNewPageTestCase.php59
-rw-r--r--tests/selenium/suites/CreateAccountTestCase.php109
-rw-r--r--tests/selenium/suites/DeletePageAdminTestCase.php82
-rw-r--r--tests/selenium/suites/EmailPasswordTestCase.php74
-rw-r--r--tests/selenium/suites/MediaWikiEditorConfig.php41
-rw-r--r--tests/selenium/suites/MediaWikiEditorTestSuite.php19
-rw-r--r--tests/selenium/suites/MediaWikiExtraTestSuite.php21
-rw-r--r--tests/selenium/suites/MediawikiCoreSmokeTestCase.php70
-rw-r--r--tests/selenium/suites/MediawikiCoreSmokeTestSuite.php19
-rw-r--r--tests/selenium/suites/MovePageTestCase.php111
-rw-r--r--tests/selenium/suites/MyContributionsTestCase.php59
-rw-r--r--tests/selenium/suites/MyWatchListTestCase.php51
-rw-r--r--tests/selenium/suites/PageDeleteTestSuite.php15
-rw-r--r--tests/selenium/suites/PageSearchTestCase.php98
-rw-r--r--tests/selenium/suites/PreviewPageTestCase.php48
-rw-r--r--tests/selenium/suites/SavePageTestCase.php53
-rw-r--r--tests/selenium/suites/SimpleSeleniumConfig.php30
-rw-r--r--tests/selenium/suites/SimpleSeleniumTestCase.php39
-rw-r--r--tests/selenium/suites/SimpleSeleniumTestSuite.php26
-rw-r--r--tests/selenium/suites/UserPreferencesTestCase.php170
-rw-r--r--tests/testHelpers.inc604
514 files changed, 88029 insertions, 2855 deletions
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 00000000..65dbc270
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/core.git
+defaultbranch=REL1_21
+defaultrebase=0
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 00000000..3869deb9
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,27 @@
+# third-party libs
+extensions/
+node_modules/
+resources/jquery/jquery.appear.js
+resources/jquery/jquery.async.js
+resources/jquery/jquery.cycle.all.js
+resources/jquery/jquery.cookie.js
+resources/jquery/jquery.farbtastic.js
+resources/jquery/jquery.form.js
+resources/jquery/jquery.hoverIntent.js
+resources/jquery/jquery.js
+resources/jquery/jquery.json.js
+resources/jquery/jquery.jStorage.js
+resources/jquery/jquery.mockjax.js
+resources/jquery/jquery.qunit.js
+resources/jquery/jquery.validate.js
+resources/jquery/jquery.xmldom.js
+resources/jquery.effects/
+resources/jquery.tipsy/
+resources/jquery.ui/
+resources/mediawiki.libs/
+
+# legacy scripts
+skins/common/
+
+# github.com/jshint/jshint/issues/729
+tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 00000000..7fa138d4
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,34 @@
+{
+ "predef": [
+ "mediaWiki",
+ "jQuery",
+ "QUnit"
+ ],
+
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "forin": false,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "nonew": true,
+ "quotmark": "single",
+ "regexp": false,
+ "undef": true,
+ "unused": true,
+ "strict": false,
+ "trailing": true,
+
+ "laxbreak": true,
+ "smarttabs": true,
+ "multistr": true,
+
+ "browser": true,
+
+ "nomen": true,
+ "onevar": true
+}
diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21
index ef4f08c6..4e08480f 100644
--- a/RELEASE-NOTES-1.21
+++ b/RELEASE-NOTES-1.21
@@ -3,11 +3,25 @@
Security reminder: MediaWiki does not require PHP's register_globals. If you
have it on, turn it '''off''' if you can.
+== MediaWiki 1.21.2 ==
+
+This is a security adn maintenance release of the MediaWiki 1.21 branch.
+
+=== Changes since 1.21.1 ===
+
+* SECURITY: Fix extension detection with 2 .'s
+* SECURITY: Support for the 'gettoken' parameter to action=block and action=unblock,
+ deprecated since 1.20, has been removed.
+* SECURITY: Sanitize ResourceLoader exception messages
+* Purge upstream caches when deleting file assets.
+* Unit test suite now runs the AutoLoader tests. Also fixed the autoloading
+ entry for the PageORMTableForTesting class though it had no impact.
+
== MediaWiki 1.21.1 ==
This is a maintenance release of the 1.21 branch.
-MediaWiki 1.21 is an stable branch and is recommended for use in production.
+MediaWiki 1.21 is a stable branch, and is recommended for use in production.
=== Changes since 1.21.0 ===
diff --git a/extensions/Cite/.gitreview b/extensions/Cite/.gitreview
new file mode 100644
index 00000000..6ae9db41
--- /dev/null
+++ b/extensions/Cite/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Cite.git
+defaultbranch=master
diff --git a/extensions/ConfirmEdit/.gitreview b/extensions/ConfirmEdit/.gitreview
new file mode 100644
index 00000000..780d35df
--- /dev/null
+++ b/extensions/ConfirmEdit/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/ConfirmEdit.git
+defaultbranch=master
diff --git a/extensions/ConfirmEdit/ReCaptcha.i18n.php b/extensions/ConfirmEdit/ReCaptcha.i18n.php
index a7fffb59..e8722f93 100644
--- a/extensions/ConfirmEdit/ReCaptcha.i18n.php
+++ b/extensions/ConfirmEdit/ReCaptcha.i18n.php
@@ -400,13 +400,12 @@ $messages['nl-informal'] = array(
);
/** Polish (polski)
- * @author WTM
*/
$messages['pl'] = array(
'recaptcha-edit' => 'Aby uchronić nas przed robotami, proszę wpisać dwa widoczne słowa w poniższym polu:',
'recaptcha-addurl' => 'Twoja edycja zawiera linki zewnętrzne. Aby uchronić nas przed robotami, proszę wpisać dwa widoczne słowa w poniższym polu:',
'recaptcha-badpass' => 'Aby uchronić nas przed złamaniem automatycznym haseł, proszę wpisać dwa widoczne słowa w poniższym polu:',
- 'recaptcha-createaccount' => 'Aby uchronić nas przed automatycznym tworzeniem użytkowników, proszę wpisać dwa widoczne słowa w poniższym polu:',
+ 'recaptcha-createaccount' => 'Aby uchronić nas przed automatycznym stworzeniem użytkowników, proszę wpisać dwa widoczne słowa w poniższym polu:',
'recaptcha-createaccount-fail' => 'Odpowiedź na reCAPTCHA jest fałszywa lub brakująca.',
'recaptcha-create' => 'Aby uchronić nas przed tworzeniem stron przez robotów, proszę wpisać dwa widoczne słowa w poniższym polu:',
);
diff --git a/extensions/Gadgets/.gitreview b/extensions/Gadgets/.gitreview
new file mode 100644
index 00000000..a1a8ead4
--- /dev/null
+++ b/extensions/Gadgets/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Gadgets.git
+defaultbranch=master
diff --git a/extensions/Gadgets/tests/GadgetTest.php b/extensions/Gadgets/tests/GadgetTest.php
new file mode 100644
index 00000000..c9332a6c
--- /dev/null
+++ b/extensions/Gadgets/tests/GadgetTest.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @group Gadgets
+ */
+
+class GadgetsTest extends MediaWikiTestCase {
+ private function create( $line ) {
+ $g = Gadget::newFromDefinition( $line );
+ // assertInstanceOf() is available since PHPUnit 3.5
+ $this->assertEquals( 'Gadget', get_class( $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() {
+ global $wgUser, $wgOut, $wgTitle;
+
+ // This test makes call to the parser which requires valids Outputpage
+ // and Title objects. Set them up there, they will be released at the
+ // end of the test.
+ $old_wgOut = $wgOut;
+ $old_wgTitle = $wgTitle;
+ $wgTitle = Title::newFromText( 'Parser test for Gadgets extension' );
+
+ // Proceed with test setup:
+ $prefs = array();
+ $context = new RequestContext();
+ $wgOut = $context->getOutput();
+ $wgOut->setTitle( Title::newFromText( 'test' ) );
+
+ 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( $wgUser, $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;'] ) );
+
+ // Restore globals
+ $wgOut = $old_wgOut;
+ $wgTitle = $old_wgTitle;
+ }
+}
diff --git a/extensions/ImageMap/.gitreview b/extensions/ImageMap/.gitreview
new file mode 100644
index 00000000..2629c9d9
--- /dev/null
+++ b/extensions/ImageMap/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/ImageMap.git
+defaultbranch=master
diff --git a/extensions/InputBox/.gitreview b/extensions/InputBox/.gitreview
new file mode 100644
index 00000000..9d0c704d
--- /dev/null
+++ b/extensions/InputBox/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/InputBox.git
+defaultbranch=master
diff --git a/extensions/Interwiki/.gitreview b/extensions/Interwiki/.gitreview
new file mode 100644
index 00000000..fcc03f61
--- /dev/null
+++ b/extensions/Interwiki/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Interwiki.git
+defaultbranch=master
+defaultrebase=0 \ No newline at end of file
diff --git a/extensions/LocalisationUpdate/.gitreview b/extensions/LocalisationUpdate/.gitreview
new file mode 100644
index 00000000..da37d04d
--- /dev/null
+++ b/extensions/LocalisationUpdate/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/LocalisationUpdate.git
+defaultbranch=master
diff --git a/extensions/LocalisationUpdate/tests/tokenTest.php b/extensions/LocalisationUpdate/tests/tokenTest.php
new file mode 100644
index 00000000..1112313c
--- /dev/null
+++ b/extensions/LocalisationUpdate/tests/tokenTest.php
@@ -0,0 +1,91 @@
+<?php
+
+$IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
+ ? getenv( 'MW_INSTALL_PATH' )
+ : realpath( dirname( __FILE__ ) . "/../../../" );
+
+require_once( "$IP/maintenance/commandLine.inc" );
+
+function evalExtractArray( $php, $varname ) {
+ eval( $php );
+ return @$$varname;
+}
+
+function confExtractArray( $php, $varname ) {
+ try {
+ $ce = new ConfEditor("<?php $php");
+ $vars = $ce->getVars();
+ $retval = @$vars[$varname];
+ } catch( Exception $e ) {
+ print $e . "\n";
+ $retval = null;
+ }
+ return $retval;
+}
+
+function quickTokenExtractArray( $php, $varname ) {
+ $reader = new QuickArrayReader("<?php $php");
+ return $reader->getVar( $varname );
+}
+
+
+if( count( $args ) ) {
+ $sources = $args;
+} else {
+ $sources =
+ array_merge(
+ glob("$IP/extensions/*/*.i18n.php"),
+ glob("$IP/languages/messages/Messages*.php") );
+}
+
+foreach( $sources as $sourceFile ) {
+ $rel = basename( $sourceFile );
+ $out = str_replace( '/', '-', $rel );
+
+ $sourceData = file_get_contents( $sourceFile );
+
+ if( preg_match( '!extensions/!', $sourceFile ) ) {
+ $sourceData = LocalisationUpdate::cleanupExtensionFile( $sourceData );
+ $items = 'langs';
+ } else {
+ $sourceData = LocalisationUpdate::cleanupFile( $sourceData );
+ $items = 'messages';
+ }
+
+ file_put_contents( "$out.txt", $sourceData );
+
+ $start = microtime(true);
+ $eval = evalExtractArray( $sourceData, 'messages' );
+ $deltaEval = microtime(true) - $start;
+
+ $start = microtime(true);
+ $quick = quickTokenExtractArray( $sourceData, 'messages' );
+ $deltaQuick = microtime(true) - $start;
+
+ $start = microtime(true);
+ $token = confExtractArray( $sourceData, 'messages' );
+ $deltaToken = microtime(true) - $start;
+
+ $hashEval = md5(serialize($eval));
+ $hashToken = md5(serialize($token));
+ $hashQuick = md5(serialize($quick));
+ $countEval = count( (array)$eval);
+ $countToken = count( (array)$token );
+ $countQuick = count( (array)$quick );
+
+ printf( "%s %s %d $items - %0.1fms - eval\n", $rel, $hashEval, $countEval, $deltaEval * 1000 );
+ printf( "%s %s %d $items - %0.1fms - QuickArrayReader\n", $rel, $hashQuick, $countQuick, $deltaQuick * 1000 );
+ printf( "%s %s %d $items - %0.1fms - ConfEditor\n", $rel, $hashToken, $countToken, $deltaToken * 1000 );
+
+ if( $hashEval !== $hashToken || $hashEval !== $hashQuick ) {
+ echo "FAILED on $rel\n";
+ file_put_contents( "$out-eval.txt", var_export( $eval, true ) );
+ file_put_contents( "$out-token.txt", var_export( $token, true ) );
+ file_put_contents( "$out-quick.txt", var_export( $quick, true ) );
+ #die("check eval.txt and token.txt\n");
+ }
+ echo "\n";
+}
+
+echo "ok\n";
+
diff --git a/extensions/Nuke/.gitreview b/extensions/Nuke/.gitreview
new file mode 100644
index 00000000..c623aede
--- /dev/null
+++ b/extensions/Nuke/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Nuke.git
+defaultbranch=master
diff --git a/extensions/ParserFunctions/.gitreview b/extensions/ParserFunctions/.gitreview
new file mode 100644
index 00000000..decb9867
--- /dev/null
+++ b/extensions/ParserFunctions/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/ParserFunctions.git
+defaultbranch=master
diff --git a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php
index 1a37cf9e..4fdb83eb 100644
--- a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php
+++ b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php
@@ -96,8 +96,8 @@ $magicWords['br'] = array(
/** Chechen (нохчийн) */
$magicWords['ce'] = array(
- 'time' => array( 0, 'хан' ),
- 'replace' => array( 0, 'хийцарна', 'замена' ),
+ 'time' => array( 0, 'хан', 'time' ),
+ 'replace' => array( 0, 'хийцарна', 'замена', 'replace' ),
);
/** Czech (česky) */
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/.gitreview b/extensions/PdfHandler/.gitreview
new file mode 100644
index 00000000..f5eca40e
--- /dev/null
+++ b/extensions/PdfHandler/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/PdfHandler.git
+defaultbranch=master
diff --git a/extensions/PdfHandler/PdfHandler_body.php b/extensions/PdfHandler/PdfHandler_body.php
index 8fa6719b..73ce1b58 100644
--- a/extensions/PdfHandler/PdfHandler_body.php
+++ b/extensions/PdfHandler/PdfHandler_body.php
@@ -315,7 +315,7 @@ class PdfHandler extends ImageHandler {
*/
function pageCount( $image ) {
$data = $this->getMetaArray( $image );
- if ( !$data || !isset( $data['Pages'] ) ) {
+ if ( !$data ) {
return false;
}
return intval( $data['Pages'] );
diff --git a/extensions/Poem/.gitreview b/extensions/Poem/.gitreview
new file mode 100644
index 00000000..aac78b2b
--- /dev/null
+++ b/extensions/Poem/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Poem.git
+defaultbranch=master
diff --git a/extensions/Renameuser/.gitreview b/extensions/Renameuser/.gitreview
new file mode 100644
index 00000000..0d757141
--- /dev/null
+++ b/extensions/Renameuser/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/Renameuser.git
+defaultbranch=master
diff --git a/extensions/SpamBlacklist/.gitreview b/extensions/SpamBlacklist/.gitreview
new file mode 100644
index 00000000..d74ae8f9
--- /dev/null
+++ b/extensions/SpamBlacklist/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/SpamBlacklist.git
+defaultbranch=master
diff --git a/extensions/SyntaxHighlight_GeSHi/.gitreview b/extensions/SyntaxHighlight_GeSHi/.gitreview
new file mode 100644
index 00000000..cb9e4b44
--- /dev/null
+++ b/extensions/SyntaxHighlight_GeSHi/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/SyntaxHighlight_GeSHi.git
+defaultbranch=master
diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php b/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php
deleted file mode 100644
index cee31289..00000000
--- a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-
-/**
- * Another GeSHi example script
- *
- * Configure your Apache server with 'AcceptPathInfo true' and something like
- * 'Alias /viewmysource /var/www/geshi/contrib/aliased.php'. Don't forget
- * to protect this alias as necessary.
- *
- * Usage - visit /viewmysource/file.name.ext to see that file with syntax
- * highlighting, where "viewmysource" is the name of the alias you set up.
- * You can use this without an alias too, just by visiting
- * aliased.php/file.name.ext.
- *
- * @author Ross Golder <ross@golder.org>
- * @version $Id: aliased.php 2533 2012-08-15 18:49:04Z benbe $
- */
-
-// Your config here
-define("SOURCE_ROOT", "/var/www/your/source/root/");
-
-// Assume you've put geshi in the include_path already
-require_once("geshi.php");
-
-// Get path info
-$path = SOURCE_ROOT.$_SERVER['PATH_INFO'];
-
-// Check for dickheads trying to use '../' to get to sensitive areas
-$base_path_len = strlen(SOURCE_ROOT);
-$real_path = realpath($path);
-if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) {
- exit("Access outside acceptable path.");
-}
-
-// Check file exists
-if(!file_exists($path)) {
- exit("File not found ($path).");
-}
-
-// Prepare GeSHi instance
-$geshi = new GeSHi();
-$geshi->set_language('text');
-$geshi->load_from_file($path);
-$geshi->set_header_type(GESHI_HEADER_PRE);
-$geshi->enable_classes();
-$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
-$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
-$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true);
-$geshi->set_code_style('color: #000020;', 'color: #000020;');
-$geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
-$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
-$geshi->set_header_content('Source code viewer - ' . $path . ' - ' . $geshi->get_language_name());
-$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
-$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>');
-$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Source code viewer - <?php echo $path; ?> - <?php $geshi->get_language_name(); ?></title>
- <style type="text/css">
- <!--
- <?php
- // Output the stylesheet. Note it doesn't output the <style> tag
- echo $geshi->get_stylesheet();
- ?>
- html {
- background-color: #f0f0f0;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #e0e0e0;
- background-color: #fcfcfc;
- padding: 5px;
- }
- h2 {
- margin: .1em 0 .2em .5em;
- border-bottom: 1px solid #b0b0b0;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 150%;
- }
- h3 {
- margin: .1em 0 .2em .5em;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 120%;
- }
- #footer {
- text-align: center;
- font-size: 80%;
- color: #a9a9a9;
- }
- #footer a {
- color: #9999ff;
- }
- textarea {
- border: 1px solid #b0b0b0;
- font-size: 90%;
- color: #333;
- margin-left: 20px;
- }
- select, input {
- margin-left: 20px;
- }
- p {
- font-size: 90%;
- margin-left: .5em;
- }
- -->
- </style>
-</head>
-<body>
-<?php
-// The fun part :)
-echo $geshi->parse_code();
-?>
-<hr/>
-</body>
-</html>
diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php b/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php
deleted file mode 100644
index cc71b58f..00000000
--- a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php
+++ /dev/null
@@ -1,466 +0,0 @@
-<?php
-/*************************************************************************************
- * cssgen.php
- * ----------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie
- * Release Version: 1.0.8.6
- * Date Started: 2004/05/20
- *
- * Application to generate custom CSS files for GeSHi (based on an idea by Andreas
- * Gohr)
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi 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.
- *
- * GeSHi 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 GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-set_magic_quotes_runtime(0);
-//
-// Functions
-//
-
-function make_header ( $title )
-{
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>GeSHi CSS Generator :: ' . $title . ' </title>
- <style type="text/css" media="screen">
- <!--
- html {
- font-family: Verdana, Arial, sans-serif;
- font-size: 80%;
- background-color: #d0d0d0;
- }
- body {
- margin: 10px;
- padding: 5px;
- border: 1px solid #f0f0f0;
- background-color: #f6f6f6;
- }
- h1 {
- border-bottom: 2px solid #e0e0e0;
- font-weight: normal;
- font-size: 150%;
- color: #c0c0c0;
- }
- input, textarea {
- border: 1px solid #d0d0d0;
- }
- th {
- text-align: right;
- font-weight: normal;
- }
- pre {
- font-size: 110%;
- color: #202020;
- }
- #footer {
- color: #b0b0b0;
- text-align: center;
- font-size: 90%;
- margin: 0 auto;
- border-top: 1px solid #e0e0e0;
- }
- #footer a {
- color: #c0c0c0;
- }
- -->
- </style>
- <script type="text/javascript">
- function select (state)
- {
- var cboxes = document.getElementsByTagName(\'input\');
- for (var i = 0; i < cboxes.length; i++) {
- if (cboxes[i].type == "checkbox") {
- if (state == "true") {
- cboxes[i].checked = true;
- } elseif (state == "false") {
- cboxes[i].checked = false;
- } elseif (state == "invert") {
- cboxes[i].checked = !cboxes[i].checked;
- }
- }
- }
- }
- </script>
-</head>
-<body>
-<h1>' . $title . '</h1>
-';
-}
-
-function make_footer ()
-{
- echo '<div id="footer"><a href="http://qbnz.com/highlighter/">GeSHi</a> &copy; Nigel McNie, 2004, released under the GPL</div></body>
-</html>';
-}
-
-
-function get_var ( $var_name )
-{
- if ( isset($_GET[$var_name]) )
- {
- return str_replace("\'", "'", $_GET[$var_name]);
- }
- elseif ( isset($_POST[$var_name]) )
- {
- return str_replace("\'", "'", $_POST[$var_name]);
- }
- return null;
-}
-
-
-
-//
-// Unset everything
-//
-foreach ( $_REQUEST as $var )
-{
- unset($$var);
-}
-foreach ( array(
- '_POST' => 'HTTP_POST_VARS',
- '_GET' => 'HTTP_GET_VARS',
- '_COOKIE' => 'HTTP_COOKIE_VARS',
- '_SERVER' => 'HTTP_SERVER_VARS',
- '_ENV' => 'HTTP_ENV_VARS',
- '_FILES' => 'HTTP_POST_FILES') as $array => $other )
-{
- if ( !isset($$array) )
- {
- $$array = $$other;
- }
- unset($$other);
-}
-
-
-// Get what step we're up to
-$step = get_var('step');
-
-if ( !$step || $step == 1 )
-{
- $errors = 0;
- make_header('Step 1');
- echo "Welcome to the GeSHi CSS generator.<br /><pre>Searching for GeSHi... ";
-
- // Find GeSHi
- $geshi_path = get_var('geshi-path');
- $geshi_lang_path = get_var('geshi-lang-path');
-
- if(strstr($geshi_path, '..')) {
- unset($geshi_path);
- }
- if(strstr($geshi_lang_path, '..')) {
- unset($geshi_lang_path);
- }
-
- if ( !$geshi_path )
- {
- $geshi_path = '../geshi.php';
- }
- if ( !$geshi_lang_path )
- {
- $geshi_lang_path = '../geshi/';
- }
-
- if ( is_file($geshi_path) && is_readable($geshi_path) )
- {
- // Get file contents and see if GeSHi is in here
- $file = @file($geshi_path);
- $contents = '';
- foreach ( $file as $line )
- {
- $contents .= $line;
- }
- if ( strpos($contents, '<?php
-/**
- * GeSHi - Generic Syntax Highlighter') !== false )
- {
- echo '<span style="color: green;">Found at ' . realpath($geshi_path) . '</span>';
- }
- else
- {
- ++$errors;
- $no_geshi_dot_php_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
- }
- else
- {
- ++$errors;
- $no_geshi_dot_php_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
-
- // Find language files
- echo "\nSearching for language files... ";
- if ( is_readable($geshi_lang_path . 'css-gen.cfg') )
- {
-
- echo '<span style="color: green;">Found at ' . realpath($geshi_lang_path) . '</span>';
- }
- else
- {
- ++$errors;
- $no_lang_dir_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
- echo "</pre>\n";
-
- if ( $errors > 0 )
- {
- // We're gonna have to ask for the paths...
- echo 'Unfortunately CSSGen could not detect the following paths. Please input them and press &quot;submit&quot; to try again.';
- echo "
-<form action=\"cssgen.php\" method=\"post\">";
- if ( $no_geshi_dot_php_error )
- {
- echo "
-<br />geshi.php: <input type=\"text\" name=\"geshi-path\" value=\"" . realpath('../geshi.php') . "\" size=\"50\" />";
- }
- else
- {
- echo '<input type="hidden" name="geshi-path" value="' . htmlspecialchars($geshi_path) . '" />';
- }
- if ( $no_lang_dir_error )
- {
- echo "
-<br />language files directory: <input type=\"text\" name=\"geshi-lang-path\" value=\"" . realpath('../geshi/') . "/\" size=\"50\" /> (should have a trailing slash)";
- }
- else
- {
- echo '<input type="hidden" name="geshi-lang-path" value="' . $geshi_lang_path . '" />';
- }
-
- echo "
-<br /><input type=\"submit\" value=\"Search\" /></form>";
- }
- else
- {
- // no errors - echo continue form
- echo 'Everything seems to be detected successfully. Use the button to continue.
-<br /><br /><form action="cssgen.php?step=2" method="post">
-<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
-<input type="submit" value="Step 2" />';
- }
-
- make_footer();
-}
-// Step 2
-elseif ( $step == 2 )
-{
- make_header('Step 2');
-
- $geshi_path = get_var('geshi-path');
- $geshi_lang_path = get_var('geshi-lang-path');
-
- $dh = opendir($geshi_lang_path);
- $lang_files = array();
- $file = readdir($dh);
- while ( $file !== false )
- {
- if ( $file == '.' || $file == '..' || $file == 'CVS' || $file == 'css-gen.cfg' )
- {
- $file = readdir($dh);
- continue;
- }
- if(!strstr(file_get_contents($dh . DIRECTORY_SEPARATOR . $file), '$language_data')) {
- $file = readdir($dh);
- continue;
- }
- $lang_files[] = $file;
- $file = readdir($dh);
- }
- closedir($dh);
- sort($lang_files);
-
- // Now installed languages are in $lang_files
-
- echo '<form action="cssgen.php?step=3" method="post" id="step2">
-What languages are you wanting to make this stylesheet for?<br /><br />
-Detected languages:<br />';
-
- foreach ( $lang_files as $lang )
- {
- $lang = substr($lang, 0, strpos($lang, '.'));
- if ($lang) {
- echo "<input type=\"checkbox\" name=\"langs[$lang]\" checked=\"checked\" />&nbsp;$lang<br />\n";
- }
- }
-
- echo "Select: <a href=\"javascript:select('true')\">All</a>, <a href=\"javascript:select('false')\">None</a>, <a href=\"javascript:select('invert')\">Invert</a><br />\n";
-
- echo 'If you\'d like any other languages not detected here to be supported, please enter
-them here, one per line:<br /><textarea rows="4" cols="20" name="extra-langs"></textarea><br />
-';
-
- echo '<br />Styles:
-<table>
- <tr><th>Style for the overall code block:</th><td><input type="text" name="overall" value="border: 1px dotted #a0a0a0; font-family: \'Courier New\', Courier, monospace; background-color: #f0f0f0; color: #0000bb;" /></td></tr>
- <tr><th>Default Styles</th><td><input type="text" name="default-styles" value="font-weight:normal;background:transparent;color:#000; padding-left: 5px;" /></td></tr>
- <tr><th>Keywords I (if, do, while etc)</th><td><input type="text" name="keywords-1" value="color: #a1a100;" /></td></tr>
- <tr><th>Keywords II (null, true, false etc)</th><td><input type="text" name="keywords-2" value="color: #000; font-weight: bold;" /></td></tr>
- <tr><th>Inbuilt Functions (echo, print etc)</th><td><input type="text" name="keywords-3" value="color: #000066;" /></td></tr>
- <tr><th>Data Types (int, boolean etc)</th><td><input type="text" name="keywords-4" value="color: #f63333;" /></td></tr>
-
- <tr><th>Comments (//, <!-- --> etc)</th><td><input type="text" name="comments" value="color: #808080;" /></td></tr>
- <tr><th>Escaped Characters (\n, \t etc)</th><td><input type="text" name="escaped-chars" value="color: #000033; font-weight: bold;" /></td></tr>
- <tr><th>Brackets ( ([{}]) etc)</th><td><input type="text" name="brackets" value="color: #66cc66;" /></td></tr>
- <tr><th>Strings ("foo" etc)</th><td><input type="text" name="strings" value="color: #ff0000;" /></td></tr>
- <tr><th>Numbers (1, -54, 2.5 etc)</th><td><input type="text" name="numbers" value="color: #ff33ff;" /></td></tr>
- <tr><th>Methods (Foo.bar() etc)</th><td><input type="text" name="methods" value="color: #006600;" /></td></tr>
-</table>';
-
- echo '<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
-<input type="submit" value="Step 3" /></form>';
-
- make_footer();
-}
-// Step 3
-elseif ( $step == 3 )
-{
- make_header('Step 3');
- echo '<p>Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing,
-you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however
-it includes most of the basic information.</p>';
-
- // Make the stylesheet
- $part_selector_1 = '';
- $part_selector_2 = '';
- $part_selector_3 = '';
-
- $langs = get_var('langs');
- $extra_langs = trim(get_var('extra-langs'));
- if ( $extra_langs != '' )
- {
- $l = explode("\r\n", $extra_langs);
- foreach ( $l as $lng )
- {
- $langs[$lng] = true;
- }
- }
-
-
- foreach ( $langs as $lang => $dummy )
- {
- $part_selector_1 .= ".$lang {PART}, ";
- $part_selector_2 .= ".$lang {PART1}, .$lang {PART2}, ";
- $part_selector_3 .= ".$lang {PART1}, .$lang {PART2}, .$lang {PART3}, ";
- }
- $part_selector_1 = substr($part_selector_1, 0, -2);
- $part_selector_2 = substr($part_selector_2, 0, -2);
- $part_selector_3 = substr($part_selector_3, 0, -2);
-
-
- $default_styles = get_var('default-styles');
- $ol_selector = str_replace('{PART}', 'ol', $part_selector_1);
- $overall_styles = get_var('overall');
- $overall_selector = str_replace('{PART}', '', $part_selector_1);
-
- $stylesheet = "/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */";
-
- if ( $overall != '' )
- {
- $stylesheet .= "\n$overall_selector {{$overall_styles}}";
- }
- if ( $default_styles != '' )
- {
- $default_selector = str_replace(array('{PART1}', '{PART2}'), array('.de1', '.de2'), $part_selector_2);
- $stylesheet .= "\n$default_selector {{$default_styles}}";
- }
-
- // Do keywords
- $keywords_1 = get_var('keywords-1');
- $keyword_selector_1 = str_replace('{PART}', '.kw1', $part_selector_1);
- if ( $keywords_1 != '' )
- {
- $stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}";
- }
-
- $keywords_2 = get_var('keywords-2');
- $keyword_selector_2 = str_replace('{PART}', '.kw2', $part_selector_1);
- if ( $keywords_2 != '' )
- {
- $stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}";
- }
-
- $keywords_3 = get_var('keywords-3');
- $keyword_selector_3 = str_replace('{PART}', '.kw3', $part_selector_1);
- if ( $keywords_3 != '' )
- {
- $stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}";
- }
-
- $keywords_4 = get_var('keywords-4');
- $keyword_selector_4 = str_replace('{PART}', '.kw4', $part_selector_1);
- if ( $keywords_4 != '' )
- {
- $stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}";
- }
-
- // Do other lexics
- $comments = get_var('comments');
- $comment_selector = str_replace(array('{PART1}', '{PART2}', '{PART3}'), array('.co1', '.co2', '.coMULTI'), $part_selector_3);
- if ( $comments != '' )
- {
- $stylesheet .= "\n$comment_selector {{$comments}}";
- }
-
- $esc = get_var('escaped-chars');
- $esc_selector = str_replace('{PART}', '.es0', $part_selector_1);
- if ( $esc != '' )
- {
- $stylesheet .= "\n$esc_selector {{$esc}}";
- }
-
- $brackets = get_var('brackets');
- $brk_selector = str_replace('{PART}', '.br0', $part_selector_1);
- if ( $brackets != '' )
- {
- $stylesheet .= "\n$brk_selector {{$brackets}}";
- }
-
- $strings = get_var('strings');
- $string_selector = str_replace('{PART}', '.st0', $part_selector_1);
- if ( $strings != '' )
- {
- $stylesheet .= "\n$string_selector {{$strings}}";
- }
-
- $numbers = get_var('numbers');
- $num_selector = str_replace('{PART}', '.nu0', $part_selector_1);
- if ( $numbers != '' )
- {
- $stylesheet .= "\n$num_selector {{$numbers}}";
- }
-
- $methods = get_var('methods');
- $method_selector = str_replace('{PART}', '.me0', $part_selector_1);
- if ( $methods != '' )
- {
- $stylesheet .= "\n$method_selector {{$methods}}";
- }
-
- echo "<pre>$stylesheet</pre>";
-
- make_footer();
-}
-
-?>
diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen2.php b/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen2.php
deleted file mode 100644
index cc3c39cb..00000000
--- a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen2.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
- * A simple script which outputs the CSS classes for all languages
- * supported by GeSHi. You can access it directly to download
- * the CSS file. On *NIX you can also do a simple `php cssgen.php > geshi.css`.
- *
- * This file is part of GeSHi.
- *
- * GeSHi 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.
- *
- * GeSHi 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 GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package geshi
- * @subpackage contrib
- * @author revulo <revulon@gmail.com>
- * @copyright 2008 revulo
- * @license http://gnu.org/copyleft/gpl.html GNU GPL
- *
- */
-
-require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'geshi.php';
-$geshi = new GeSHi;
-
-$languages = array();
-if ($handle = opendir($geshi->language_path)) {
- while (($file = readdir($handle)) !== false) {
- $pos = strpos($file, '.');
- if ($pos > 0 && substr($file, $pos) == '.php') {
- $languages[] = substr($file, 0, $pos);
- }
- }
- closedir($handle);
-}
-sort($languages);
-
-header('Content-Type: application/octet-stream');
-header('Content-Disposition: attachment; filename="geshi.css"');
-
-echo "/**\n".
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
- " */\n";
-
-foreach ($languages as $language) {
- $geshi->set_language($language);
- // note: the false argument is required for stylesheet generators, see API documentation
- $css = $geshi->get_stylesheet(false);
- echo preg_replace('/^\/\*\*.*?\*\//s', '', $css);
-}
diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/example.php b/extensions/SyntaxHighlight_GeSHi/geshi/contrib/example.php
deleted file mode 100644
index e07399e3..00000000
--- a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/example.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/**
- * GeSHi example script
- *
- * Just point your browser at this script (with geshi.php in the parent directory,
- * and the language files in subdirectory "../geshi/")
- *
- * @author Nigel McNie
- * @version $Id: example.php 2510 2012-06-27 15:57:55Z reedy_boy $
- */
-header('Content-Type: text/html; charset=utf-8');
-
-error_reporting(E_ALL);
-
-// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
-// it could be in the current directory if the include_path is set. There's nowhere else
-// we can reasonably guess.
-if (is_readable('../geshi.php')) {
- $path = '../';
-} elseif (is_readable('geshi.php')) {
- $path = './';
-} else {
- die('Could not find geshi.php - make sure it is in your include path!');
-}
-require $path . 'geshi.php';
-
-$fill_source = false;
-if (isset($_POST['submit'])) {
- if (get_magic_quotes_gpc()) {
- $_POST['source'] = stripslashes($_POST['source']);
- }
- if (!strlen(trim($_POST['source']))) {
- $_POST['language'] = preg_replace('#[^a-zA-Z0-9\-_]#', '', $_POST['language']);
- $_POST['source'] = implode('', @file($path . 'geshi/' . $_POST['language'] . '.php'));
- $_POST['language'] = 'php';
- } else {
- $fill_source = true;
- }
-
- // Here's a free demo of how GeSHi works.
-
- // First the initialisation: source code to highlight and the language to use. Make sure
- // you sanitise correctly if you use $_POST of course - this very script has had a security
- // advisory against it in the past because of this. Please try not to use this script on a
- // live site.
- $geshi = new GeSHi($_POST['source'], $_POST['language']);
-
- // Use the PRE_VALID header. This means less output source since we don't have to output &nbsp;
- // everywhere. Of course it also means you can't set the tab width.
- // HEADER_PRE_VALID puts the <pre> tag inside the list items (<li>) thus producing valid HTML markup.
- // HEADER_PRE puts the <pre> tag around the list (<ol>) which is invalid in HTML 4 and XHTML 1
- // HEADER_DIV puts a <div> tag arount the list (valid!) but needs to replace whitespaces with &nbsp
- // thus producing much larger overhead. You can set the tab width though.
- $geshi->set_header_type(GESHI_HEADER_PRE_VALID);
-
- // Enable CSS classes. You can use get_stylesheet() to output a stylesheet for your code. Using
- // CSS classes results in much less output source.
- $geshi->enable_classes();
-
- // Enable line numbers. We want fancy line numbers, and we want every 5th line number to be fancy
- $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5);
-
- // Set the style for the PRE around the code. The line numbers are contained within this box (not
- // XHTML compliant btw, but if you are liberally minded about these things then you'll appreciate
- // the reduced source output).
- $geshi->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', false);
-
- // Set the style for line numbers. In order to get style for line numbers working, the <li> element
- // is being styled. This means that the code on the line will also be styled, and most of the time
- // you don't want this. So the set_code_style reverts styles for the line (by using a <div> on the line).
- // So the source output looks like this:
- //
- // <pre style="[set_overall_style styles]"><ol>
- // <li style="[set_line_style styles]"><div style="[set_code_style styles]>...</div></li>
- // ...
- // </ol></pre>
- $geshi->set_line_style('color: #003030;', 'font-weight: bold; color: #006060;', true);
- $geshi->set_code_style('color: #000020;', true);
-
- // Styles for hyperlinks in the code. GESHI_LINK for default styles, GESHI_HOVER for hover style etc...
- // note that classes must be enabled for this to work.
- $geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
- $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
-
- // Use the header/footer functionality. This puts a div with content within the PRE element, so it is
- // affected by the styles set by set_overall_style. So if the PRE has a border then the header/footer will
- // appear inside it.
- $geshi->set_header_content('<SPEED> <TIME> GeSHi &copy; 2004-2007, Nigel McNie, 2007-2008 Benny Baumann. View source of example.php for example of using GeSHi');
- $geshi->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
-
- // You can use <TIME> and <VERSION> as placeholders
- $geshi->set_footer_content('Parsed in <TIME> seconds at <SPEED>, using GeSHi <VERSION>');
- $geshi->set_footer_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
-} else {
- // make sure we don't preselect any language
- $_POST['language'] = null;
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>GeSHi examples</title>
- <style type="text/css">
- <!--
- <?php
- if (isset($_POST['submit'])) {
- // Output the stylesheet. Note it doesn't output the <style> tag
- echo $geshi->get_stylesheet(true);
- }
- ?>
- html {
- background-color: #f0f0f0;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #e0e0e0;
- background-color: #fcfcfc;
- padding: 5px;
- }
- h2 {
- margin: .1em 0 .2em .5em;
- border-bottom: 1px solid #b0b0b0;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 150%;
- }
- h3 {
- margin: .1em 0 .2em .5em;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 120%;
- }
- #footer {
- text-align: center;
- font-size: 80%;
- color: #a9a9a9;
- }
- #footer a {
- color: #9999ff;
- }
- textarea {
- border: 1px solid #b0b0b0;
- font-size: 90%;
- color: #333;
- margin-left: 20px;
- }
- select, input {
- margin-left: 20px;
- }
- p {
- font-size: 90%;
- margin-left: .5em;
- }
- -->
- </style>
-</head>
-<body>
-<h2>GeSHi Example Script</h2>
-<p>To use this script, make sure that <strong>geshi.php</strong> is in the parent directory or in your
-include_path, and that the language files are in a s