summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
committerGuy Brand <gb@unistra.fr>2015-08-10 10:03:27 +0200
commit53a57d16b9c741bb44099fd93bf79efa06796341 (patch)
tree24a90a50afe9325926c8ebaa2ed90f9fa093e5b9
parentcf6e6645c31a9f185cef3fb9452fb188882ede47 (diff)
parenta060d9973e7c1d5051f2cc426937881826e4972e (diff)
downloadrpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.gz
rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.bz2
Merge branch master into stable
-rw-r--r--.editorconfig10
-rw-r--r--.gitattributes2
-rw-r--r--.gitignore13
-rw-r--r--.travis.yml7
-rw-r--r--README2
-rw-r--r--_cs/DokuWiki/Sniffs/PHP/DeprecatedFunctionsSniff.php2
-rw-r--r--_cs/DokuWiki/Sniffs/PHP/DiscouragedFunctionsSniff.php2
-rw-r--r--_test/core/DokuWikiTest.php4
-rw-r--r--_test/core/TestRequest.php2
-rw-r--r--_test/data/media/wiki/dokuwiki-128.pngbin33615 -> 27895 bytes
-rw-r--r--_test/data/media/wiki/kind_zu_katze.ogvbin0 -> 45883 bytes
-rw-r--r--_test/data/media/wiki/kind_zu_katze.pngbin0 -> 437 bytes
-rw-r--r--_test/data/media/wiki/kind_zu_katze.webmbin0 -> 101529 bytes
-rw-r--r--_test/phpunit.xml6
-rw-r--r--_test/tests/inc/auth_password.test.php9
-rw-r--r--_test/tests/inc/cache_use.test.php19
-rw-r--r--_test/tests/inc/form/checkableelement.test.php49
-rw-r--r--_test/tests/inc/form/form.test.php115
-rw-r--r--_test/tests/inc/form/inputelement.test.php41
-rw-r--r--_test/tests/inc/form_form.test.php4
-rw-r--r--_test/tests/inc/httpclient_http.test.php1
-rw-r--r--_test/tests/inc/httpclient_http_proxy.test.php4
-rw-r--r--_test/tests/inc/httpclient_https_proxy.test.php4
-rw-r--r--_test/tests/inc/io_deletefromfile.test.php15
-rw-r--r--_test/tests/inc/io_readfile.test.php58
-rw-r--r--_test/tests/inc/io_readfile/corrupt.txt.bz21
-rw-r--r--_test/tests/inc/io_readfile/corrupt.txt.gzbin0 -> 31 bytes
-rw-r--r--_test/tests/inc/io_readfile/large.txt.bz2bin0 -> 47 bytes
-rw-r--r--_test/tests/inc/io_readfile/long.txt.bz2bin0 -> 53 bytes
-rw-r--r--_test/tests/inc/io_readfile/test.txt.bz2bin0 -> 49 bytes
-rw-r--r--_test/tests/inc/io_readfile/test.txt.gzbin0 -> 31 bytes
-rw-r--r--_test/tests/inc/io_replaceinfile.test.php108
-rw-r--r--_test/tests/inc/io_savefile.test.php49
-rw-r--r--_test/tests/inc/ixr_library_date.test.php13
-rw-r--r--_test/tests/inc/parser/lexer.test.php4
-rw-r--r--_test/tests/inc/parser/parser_footnote.test.php2
-rw-r--r--_test/tests/inc/parser/parser_lists.test.php20
-rw-r--r--_test/tests/inc/parser/parser_media.test.php103
-rw-r--r--_test/tests/inc/parser/renderer_resolveinterwiki.test.php22
-rw-r--r--_test/tests/inc/remote.test.php8
-rw-r--r--_test/tests/inc/tar.test.php454
-rw-r--r--_test/tests/inc/tar/block.txt1
-rw-r--r--_test/tests/inc/tar/foobar/testdata2.txt1
-rw-r--r--_test/tests/inc/tar/longpath-gnu.tgzbin413 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/longpath-ustar.tgzbin311 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/tarbomb.tgzbin183 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/test.tarbin10240 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/test.tbzbin217 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/test.tgzbin220 -> 0 bytes
-rw-r--r--_test/tests/inc/tar/testdata1.txt1
-rw-r--r--_test/tests/inc/tar/zero.txt0
-rw-r--r--_test/tests/inc/template_include_page.test.php77
-rw-r--r--_test/tests/lib/exe/js_js_compress.test.php78
-rwxr-xr-xbin/dwpage.php5
-rwxr-xr-xbin/gittool.php10
-rwxr-xr-xbin/striplangs.php3
-rwxr-xr-xbin/wantedpages.php20
-rw-r--r--composer.json6
-rw-r--r--composer.lock111
-rw-r--r--conf/interwiki.conf50
-rw-r--r--conf/mysql.conf.php.example10
-rw-r--r--conf/wordblock.conf6
-rw-r--r--data/deleted.files246
-rw-r--r--data/media/wiki/dokuwiki-128.pngbin33615 -> 27895 bytes
-rw-r--r--data/pages/wiki/dokuwiki.txt2
-rw-r--r--data/pages/wiki/syntax.txt46
-rw-r--r--data/security.pngbin7917 -> 6516 bytes
-rw-r--r--doku.php11
-rw-r--r--feed.php8
-rw-r--r--inc/DifferenceEngine.php80
-rw-r--r--inc/Form/CheckableElement.php62
-rw-r--r--inc/Form/Element.php151
-rw-r--r--inc/Form/FieldsetCloseElement.php30
-rw-r--r--inc/Form/FieldsetOpenElement.php36
-rw-r--r--inc/Form/Form.php367
-rw-r--r--inc/Form/HTMLElement.php29
-rw-r--r--inc/Form/InputElement.php160
-rw-r--r--inc/Form/Label.php27
-rw-r--r--inc/Form/LegacyForm.php181
-rw-r--r--inc/Form/TagCloseElement.php76
-rw-r--r--inc/Form/TagElement.php29
-rw-r--r--inc/Form/TagOpenElement.php30
-rw-r--r--inc/Form/TextareaElement.php51
-rw-r--r--inc/Form/ValueElement.php45
-rw-r--r--inc/HTTPClient.php64
-rw-r--r--inc/IXR_Library.php673
-rw-r--r--inc/Input.class.php9
-rw-r--r--inc/JSON.php2
-rw-r--r--inc/JpegMeta.php140
-rw-r--r--inc/Mailer.class.php31
-rw-r--r--inc/PassHash.class.php25
-rw-r--r--inc/RemoteAPICore.php138
-rw-r--r--inc/Sitemapper.php22
-rw-r--r--inc/Tar.class.php25
-rw-r--r--inc/TarLib.class.php89
-rw-r--r--inc/ZipLib.class.php82
-rw-r--r--inc/actions.php68
-rw-r--r--inc/auth.php80
-rw-r--r--inc/blowfish.php15
-rw-r--r--inc/cache.php18
-rw-r--r--inc/changelog.php33
-rw-r--r--inc/cli.php23
-rw-r--r--inc/cliopts.php12
-rw-r--r--inc/common.php71
-rw-r--r--inc/compatibility.php36
-rw-r--r--inc/config_cascade.php10
-rw-r--r--inc/confutils.php64
-rw-r--r--inc/events.php39
-rw-r--r--inc/farm.php10
-rw-r--r--inc/feedcreator.class.php56
-rw-r--r--inc/fetch.functions.php43
-rw-r--r--inc/form.php106
-rw-r--r--inc/fulltext.php48
-rw-r--r--inc/geshi/actionscript-french.php957
-rw-r--r--inc/geshi/cobol.php244
-rw-r--r--inc/geshi/parigp.php277
-rw-r--r--inc/html.php148
-rw-r--r--inc/httputils.php11
-rw-r--r--inc/indexer.php89
-rw-r--r--inc/infoutils.php42
-rw-r--r--inc/init.php47
-rw-r--r--inc/io.php273
-rw-r--r--inc/lang/af/lang.php2
-rw-r--r--inc/lang/ar/jquery.ui.datepicker.js13
-rw-r--r--inc/lang/ar/lang.php14
-rw-r--r--inc/lang/ar/register.txt2
-rw-r--r--inc/lang/ar/stopwords.txt163
-rw-r--r--inc/lang/az/lang.php3
-rw-r--r--inc/lang/bg/lang.php20
-rw-r--r--inc/lang/bn/lang.php48
-rw-r--r--inc/lang/ca-valencia/lang.php3
-rw-r--r--inc/lang/ca/lang.php40
-rw-r--r--inc/lang/ca/subscr_form.txt2
-rw-r--r--inc/lang/cs/adminplugins.txt2
-rw-r--r--inc/lang/cs/lang.php37
-rw-r--r--inc/lang/cs/mailtext.txt2
-rw-r--r--inc/lang/cs/password.txt4
-rw-r--r--inc/lang/cs/pwconfirm.txt6
-rw-r--r--inc/lang/cs/registermail.txt2
-rw-r--r--inc/lang/cs/resendpwd.txt2
-rw-r--r--inc/lang/cs/subscr_digest.txt6
-rw-r--r--inc/lang/cs/subscr_list.txt4
-rw-r--r--inc/lang/cs/subscr_single.txt6
-rw-r--r--inc/lang/cs/uploadmail.txt4
-rw-r--r--inc/lang/da/denied.txt2
-rw-r--r--inc/lang/da/lang.php125
-rw-r--r--inc/lang/de-informal/lang.php23
-rw-r--r--inc/lang/de/lang.php15
-rw-r--r--inc/lang/el/jquery.ui.datepicker.js2
-rw-r--r--inc/lang/el/lang.php10
-rw-r--r--inc/lang/en/lang.php14
-rw-r--r--inc/lang/eo/lang.php8
-rw-r--r--inc/lang/es/lang.php15
-rw-r--r--inc/lang/et/lang.php6
-rw-r--r--inc/lang/eu/lang.php17
-rw-r--r--inc/lang/fa/jquery.ui.datepicker.js24
-rw-r--r--inc/lang/fa/lang.php6
-rw-r--r--inc/lang/fi/lang.php20
-rw-r--r--inc/lang/fo/lang.php13
-rw-r--r--inc/lang/fr/jquery.ui.datepicker.js2
-rw-r--r--inc/lang/fr/lang.php46
-rw-r--r--inc/lang/fr/subscr_digest.txt2
-rw-r--r--inc/lang/fr/subscr_form.txt2
-rw-r--r--inc/lang/fr/subscr_list.txt2
-rw-r--r--inc/lang/fr/subscr_single.txt2
-rw-r--r--inc/lang/gl/lang.php8
-rw-r--r--inc/lang/he/lang.php42
-rw-r--r--inc/lang/he/mailtext.txt4
-rw-r--r--inc/lang/he/registermail.txt4
-rw-r--r--inc/lang/he/resetpwd.txt3
-rw-r--r--inc/lang/hi/lang.php2
-rw-r--r--inc/lang/hr/lang.php31
-rw-r--r--inc/lang/hu/lang.php4
-rw-r--r--inc/lang/ia/lang.php3
-rw-r--r--inc/lang/id-ni/lang.php1
-rw-r--r--inc/lang/id/lang.php30
-rw-r--r--inc/lang/is/lang.php3
-rw-r--r--inc/lang/it/lang.php13
-rw-r--r--inc/lang/ja/index.txt2
-rw-r--r--inc/lang/ja/lang.php11
-rw-r--r--inc/lang/ja/register.txt2
-rw-r--r--inc/lang/ka/jquery.ui.datepicker.js35
-rw-r--r--inc/lang/ka/lang.php90
-rw-r--r--inc/lang/kk/lang.php5
-rw-r--r--inc/lang/km/lang.php12
-rw-r--r--inc/lang/ko/backlinks.txt2
-rw-r--r--inc/lang/ko/denied.txt3
-rw-r--r--inc/lang/ko/draft.txt2
-rw-r--r--inc/lang/ko/edit.txt2
-rw-r--r--inc/lang/ko/lang.php54
-rw-r--r--inc/lang/ko/searchpage.txt2
-rw-r--r--inc/lang/ko/updateprofile.txt2
-rw-r--r--inc/lang/ku/admin.txt4
-rw-r--r--inc/lang/ku/denied.txt4
-rw-r--r--inc/lang/ku/editrev.txt2
-rw-r--r--inc/lang/ku/lang.php97
-rw-r--r--inc/lang/ku/locked.txt3
-rw-r--r--inc/lang/ku/login.txt4
-rw-r--r--inc/lang/ku/mailtext.txt17
-rw-r--r--inc/lang/ku/norev.txt4
-rw-r--r--inc/lang/ku/password.txt10
-rw-r--r--inc/lang/ku/read.txt2
-rw-r--r--inc/lang/ku/register.txt4
-rw-r--r--inc/lang/ku/revisions.txt4
-rw-r--r--inc/lang/ku/showrev.txt2
-rw-r--r--inc/lang/ku/stopwords.txt29
-rw-r--r--inc/lang/la/lang.php11
-rw-r--r--inc/lang/lb/lang.php3
-rw-r--r--inc/lang/lt/lang.php22
-rw-r--r--inc/lang/lv/lang.php4
-rw-r--r--inc/lang/mg/lang.php3
-rw-r--r--inc/lang/mk/lang.php7
-rw-r--r--inc/lang/ml/admin.txt3
-rw-r--r--inc/lang/mr/lang.php3
-rw-r--r--inc/lang/ms/lang.php2
-rw-r--r--inc/lang/ne/adminplugins.txt1
-rw-r--r--inc/lang/ne/lang.php18
-rw-r--r--inc/lang/nl/lang.php17
-rw-r--r--inc/lang/no/lang.php19
-rw-r--r--inc/lang/pl/lang.php10
-rw-r--r--inc/lang/pt-br/lang.php10
-rw-r--r--inc/lang/pt/conflict.txt10
-rw-r--r--inc/lang/pt/denied.txt2
-rw-r--r--inc/lang/pt/lang.php20
-rw-r--r--inc/lang/pt/resetpwd.txt3
-rw-r--r--inc/lang/ro/lang.php23
-rw-r--r--inc/lang/ru/index.txt2
-rw-r--r--inc/lang/ru/lang.php49
-rw-r--r--inc/lang/ru/mailtext.txt2
-rw-r--r--inc/lang/ru/password.txt2
-rw-r--r--inc/lang/ru/pwconfirm.txt2
-rw-r--r--inc/lang/ru/registermail.txt2
-rw-r--r--inc/lang/ru/revisions.txt2
-rw-r--r--inc/lang/ru/uploadmail.txt2
-rw-r--r--inc/lang/sk/lang.php4
-rw-r--r--inc/lang/sl/lang.php4
-rw-r--r--inc/lang/sq/lang.php11
-rw-r--r--inc/lang/sr/lang.php3
-rw-r--r--inc/lang/sv/lang.php4
-rw-r--r--inc/lang/ta/admin.txt3
-rw-r--r--inc/lang/ta/adminplugins.txt1
-rw-r--r--inc/lang/ta/backlinks.txt3
-rw-r--r--inc/lang/ta/conflict.txt3
-rw-r--r--inc/lang/ta/diff.txt3
-rw-r--r--inc/lang/ta/draft.txt1
-rw-r--r--inc/lang/ta/edit.txt1
-rw-r--r--inc/lang/ta/jquery.ui.datepicker.js37
-rw-r--r--inc/lang/ta/lang.php20
-rw-r--r--inc/lang/th/lang.php7
-rw-r--r--inc/lang/tr/lang.php24
-rw-r--r--inc/lang/uk/lang.php33
-rw-r--r--inc/lang/vi/lang.php1
-rw-r--r--inc/lang/zh-tw/lang.php11
-rw-r--r--inc/lang/zh/lang.php10
-rw-r--r--inc/load.php10
-rw-r--r--inc/mail.php17
-rw-r--r--inc/media.php379
-rw-r--r--inc/pageutils.php50
-rw-r--r--inc/parser/code.php5
-rw-r--r--inc/parser/handler.php83
-rw-r--r--inc/parser/lexer.php33
-rw-r--r--inc/parser/metadata.php19
-rw-r--r--inc/parser/parser.php41
-rw-r--r--inc/parser/renderer.php39
-rw-r--r--inc/parser/xhtml.php140
-rw-r--r--inc/parserutils.php82
-rw-r--r--inc/phpseclib/Crypt_AES.php4
-rw-r--r--inc/phpseclib/Crypt_Base.php2
-rw-r--r--inc/phpseclib/Crypt_Hash.php2
-rw-r--r--inc/phpseclib/Crypt_Rijndael.php4
-rw-r--r--inc/plugin.php57
-rw-r--r--inc/plugincontroller.class.php54
-rw-r--r--inc/pluginutils.php37
-rw-r--r--inc/remote.php109
-rw-r--r--inc/search.php6
-rw-r--r--inc/subscription.php25
-rw-r--r--inc/template.php285
-rw-r--r--inc/utf8.php129
-rw-r--r--install.php39
-rw-r--r--lib/exe/css.php92
-rw-r--r--lib/exe/detail.php2
-rw-r--r--lib/exe/indexer.php13
-rw-r--r--lib/exe/js.php98
-rw-r--r--lib/exe/xmlrpc.php15
-rw-r--r--lib/images/admin/README2
-rw-r--r--lib/images/admin/acl.pngbin1074 -> 1065 bytes
-rw-r--r--lib/images/admin/config.pngbin1496 -> 1484 bytes
-rw-r--r--lib/images/admin/plugin.pngbin1127 -> 1115 bytes
-rw-r--r--lib/images/admin/popularity.pngbin1189 -> 1172 bytes
-rw-r--r--lib/images/admin/revert.pngbin1295 -> 1295 bytes
-rw-r--r--lib/images/admin/styling.pngbin0 -> 970 bytes
-rw-r--r--lib/images/admin/usermanager.pngbin1467 -> 1460 bytes
-rw-r--r--lib/images/bullet.pngbin112 -> 101 bytes
-rw-r--r--lib/images/closed-rtl.pngbin118 -> 111 bytes
-rw-r--r--lib/images/closed.pngbin119 -> 110 bytes
-rw-r--r--lib/images/diff.pngbin206 -> 190 bytes
-rw-r--r--lib/images/email.pngbin659 -> 370 bytes
-rw-r--r--lib/images/error.pngbin648 -> 637 bytes
-rw-r--r--lib/images/external-link.pngbin816 -> 431 bytes
-rw-r--r--lib/images/fileicons/32x32/7z.pngbin992 -> 911 bytes
-rw-r--r--lib/images/fileicons/32x32/asm.pngbin989 -> 955 bytes
-rw-r--r--lib/images/fileicons/32x32/bash.pngbin993 -> 966 bytes
-rw-r--r--lib/images/fileicons/32x32/bz2.pngbin1001 -> 920 bytes
-rw-r--r--lib/images/fileicons/32x32/c.pngbin945 -> 929 bytes
-rw-r--r--lib/images/fileicons/32x32/cc.pngbin955 -> 933 bytes
-rw-r--r--lib/images/fileicons/32x32/conf.pngbin832 -> 666 bytes
-rw-r--r--lib/images/fileicons/32x32/cpp.pngbin960 -> 943 bytes
-rw-r--r--lib/images/fileicons/32x32/cs.pngbin960 -> 944 bytes
-rw-r--r--lib/images/fileicons/32x32/csh.pngbin981 -> 952 bytes
-rw-r--r--lib/images/fileicons/32x32/css.pngbin969 -> 952 bytes
-rw-r--r--lib/images/fileicons/32x32/csv.pngbin819 -> 663 bytes
-rw-r--r--lib/images/fileicons/32x32/deb.pngbin991 -> 914 bytes
-rw-r--r--lib/images/fileicons/32x32/diff.pngbin975 -> 942 bytes
-rw-r--r--lib/images/fileicons/32x32/doc.pngbin1034 -> 956 bytes
-rw-r--r--lib/images/fileicons/32x32/docx.pngbin1078 -> 970 bytes
-rw-r--r--lib/images/fileicons/32x32/file.pngbin605 -> 543 bytes
-rw-r--r--lib/images/fileicons/32x32/gif.pngbin944 -> 873 bytes
-rw-r--r--lib/images/fileicons/32x32/gz.pngbin994 -> 914 bytes
-rw-r--r--lib/images/fileicons/32x32/h.pngbin941 -> 884 bytes
-rw-r--r--lib/images/fileicons/32x32/hpp.pngbin974 -> 942 bytes
-rw-r--r--lib/images/fileicons/32x32/htm.pngbin983 -> 945 bytes
-rw-r--r--lib/images/fileicons/32x32/html.pngbin983 -> 945 bytes
-rw-r--r--lib/images/fileicons/32x32/ico.pngbin941 -> 865 bytes
-rw-r--r--lib/images/fileicons/32x32/java.pngbin992 -> 961 bytes
-rw-r--r--lib/images/fileicons/32x32/jpeg.pngbin948 -> 877 bytes
-rw-r--r--lib/images/fileicons/32x32/jpg.pngbin948 -> 877 bytes
-rw-r--r--lib/images/fileicons/32x32/js.pngbin960 -> 937 bytes
-rw-r--r--lib/images/fileicons/32x32/json.pngbin996 -> 966 bytes
-rw-r--r--lib/images/fileicons/32x32/lua.pngbin979 -> 941 bytes
-rw-r--r--lib/images/fileicons/32x32/mp3.pngbin947 -> 896 bytes
-rw-r--r--lib/images/fileicons/32x32/mp4.pngbin1197 -> 1116 bytes
-rw-r--r--lib/images/fileicons/32x32/odc.pngbin1061 -> 946 bytes
-rw-r--r--lib/images/fileicons/32x32/odf.pngbin1059 -> 951 bytes
-rw-r--r--lib/images/fileicons/32x32/odg.pngbin1066 -> 949 bytes
-rw-r--r--lib/images/fileicons/32x32/odi.pngbin1058 -> 944 bytes
-rw-r--r--lib/images/fileicons/32x32/odp.pngbin1060 -> 949 bytes
-rw-r--r--lib/images/fileicons/32x32/ods.pngbin1063 -> 955 bytes
-rw-r--r--lib/images/fileicons/32x32/odt.pngbin1060 -> 949 bytes
-rw-r--r--lib/images/fileicons/32x32/ogg.pngbin950 -> 885 bytes
-rw-r--r--lib/images/fileicons/32x32/ogv.pngbin1187 -> 1106 bytes
-rw-r--r--lib/images/fileicons/32x32/pas.pngbin976 -> 945 bytes
-rw-r--r--lib/images/fileicons/32x32/pdf.pngbin1076 -> 1003 bytes
-rw-r--r--lib/images/fileicons/32x32/php.pngbin974 -> 952 bytes
-rw-r--r--lib/images/fileicons/32x32/pl.pngbin951 -> 936 bytes
-rw-r--r--lib/images/fileicons/32x32/png.pngbin957 -> 877 bytes
-rw-r--r--lib/images/fileicons/32x32/ppt.pngbin871 -> 850 bytes
-rw-r--r--lib/images/fileicons/32x32/pptx.pngbin924 -> 866 bytes
-rw-r--r--lib/images/fileicons/32x32/ps.pngbin1086 -> 996 bytes
-rw-r--r--lib/images/fileicons/32x32/py.pngbin966 -> 942 bytes
-rw-r--r--lib/images/fileicons/32x32/rar.pngbin1000 -> 914 bytes
-rw-r--r--lib/images/fileicons/32x32/rb.pngbin953 -> 936 bytes
-rw-r--r--lib/images/fileicons/32x32/rpm.pngbin1001 -> 920 bytes
-rw-r--r--lib/images/fileicons/32x32/rtf.pngbin867 -> 738 bytes
-rw-r--r--lib/images/fileicons/32x32/sh.pngbin962 -> 941 bytes
-rw-r--r--lib/images/fileicons/32x32/sql.pngbin827 -> 664 bytes
-rw-r--r--lib/images/fileicons/32x32/swf.pngbin1268 -> 1173 bytes
-rw-r--r--lib/images/fileicons/32x32/sxc.pngbin1078 -> 964 bytes
-rw-r--r--lib/images/fileicons/32x32/sxd.pngbin1079 -> 965 bytes
-rw-r--r--lib/images/fileicons/32x32/sxi.pngbin1067 -> 962 bytes
-rw-r--r--lib/images/fileicons/32x32/sxw.pngbin1086 -> 968 bytes
-rw-r--r--lib/images/fileicons/32x32/tar.pngbin987 -> 914 bytes
-rw-r--r--lib/images/fileicons/32x32/tgz.pngbin999 -> 919 bytes
-rw-r--r--lib/images/fileicons/32x32/txt.pngbin836 -> 661 bytes
-rw-r--r--lib/images/fileicons/32x32/wav.pngbin944 -> 888 bytes
-rw-r--r--lib/images/fileicons/32x32/webm.pngbin1232 -> 1210 bytes
-rw-r--r--lib/images/fileicons/32x32/xls.pngbin1137 -> 1124 bytes
-rw-r--r--lib/images/fileicons/32x32/xlsx.pngbin1182 -> 1131 bytes
-rw-r--r--lib/images/fileicons/32x32/xml.pngbin615 -> 560 bytes
-rw-r--r--lib/images/fileicons/32x32/zip.pngbin987 -> 914 bytes
-rw-r--r--lib/images/fileicons/7z.pngbin415 -> 375 bytes
-rw-r--r--lib/images/fileicons/asm.pngbin427 -> 379 bytes
-rw-r--r--lib/images/fileicons/bash.pngbin433 -> 378 bytes
-rw-r--r--lib/images/fileicons/bz2.pngbin419 -> 378 bytes
-rw-r--r--lib/images/fileicons/c.pngbin412 -> 369 bytes
-rw-r--r--lib/images/fileicons/cc.pngbin411 -> 369 bytes
-rw-r--r--lib/images/fileicons/conf.pngbin402 -> 370 bytes
-rw-r--r--lib/images/fileicons/cpp.pngbin430 -> 377 bytes
-rw-r--r--lib/images/fileicons/cs.pngbin419 -> 374 bytes
-rw-r--r--lib/images/fileicons/csh.pngbin427 -> 378 bytes
-rw-r--r--lib/images/fileicons/css.pngbin427 -> 374 bytes
-rw-r--r--lib/images/fileicons/csv.pngbin409 -> 371 bytes
-rw-r--r--lib/images/fileicons/deb.pngbin421 -> 376 bytes
-rw-r--r--lib/images/fileicons/diff.pngbin425 -> 376 bytes
-rw-r--r--lib/images/fileicons/doc.pngbin410 -> 372 bytes
-rw-r--r--lib/images/fileicons/docx.pngbin415 -> 375 bytes
-rw-r--r--lib/images/fileicons/file.pngbin319 -> 249 bytes
-rw-r--r--lib/images/fileicons/gif.pngbin407 -> 374 bytes
-rw-r--r--lib/images/fileicons/gz.pngbin417 -> 374 bytes
-rw-r--r--lib/images/fileicons/h.pngbin411 -> 368 bytes
-rw-r--r--lib/images/fileicons/hpp.pngbin417 -> 376 bytes
-rw-r--r--lib/images/fileicons/htm.pngbin417 -> 375 bytes
-rw-r--r--lib/images/fileicons/html.pngbin417 -> 375 bytes
-rw-r--r--lib/images/fileicons/ico.pngbin405 -> 372 bytes
-rw-r--r--lib/images/fileicons/java.pngbin420 -> 376 bytes
-rw-r--r--lib/images/fileicons/jpeg.pngbin412 -> 376 bytes
-rw-r--r--lib/images/fileicons/jpg.pngbin412 -> 376 bytes
-rw-r--r--lib/images/fileicons/js.pngbin420 -> 374 bytes
-rw-r--r--lib/images/fileicons/json.pngbin435 -> 379 bytes
-rw-r--r--lib/images/fileicons/lua.pngbin418 -> 374 bytes
-rw-r--r--lib/images/fileicons/mp3.pngbin415 -> 378 bytes
-rw-r--r--lib/images/fileicons/mp4.pngbin419 -> 377 bytes
-rw-r--r--lib/images/fileicons/odc.pngbin407 -> 369 bytes
-rw-r--r--lib/images/fileicons/odf.pngbin411 -> 373 bytes
-rw-r--r--lib/images/fileicons/odg.pngbin411 -> 370 bytes
-rw-r--r--lib/images/fileicons/odi.pngbin398 -> 371 bytes
-rw-r--r--lib/images/fileicons/odp.pngbin404 -> 374 bytes
-rw-r--r--lib/images/fileicons/ods.pngbin416 -> 373 bytes
-rw-r--r--lib/images/fileicons/odt.pngbin403 -> 372 bytes
-rw-r--r--lib/images/fileicons/ogg.pngbin408 -> 373 bytes
-rw-r--r--lib/images/fileicons/ogv.pngbin412 -> 376 bytes
-rw-r--r--lib/images/fileicons/pas.pngbin435 -> 380 bytes
-rw-r--r--lib/images/fileicons/pdf.pngbin425 -> 377 bytes
-rw-r--r--lib/images/fileicons/php.pngbin424 -> 376 bytes
-rw-r--r--lib/images/fileicons/pl.pngbin418 -> 372 bytes
-rw-r--r--lib/images/fileicons/png.pngbin417 -> 375 bytes
-rw-r--r--lib/images/fileicons/ppt.pngbin412 -> 375 bytes
-rw-r--r--lib/images/fileicons/pptx.pngbin414 -> 375 bytes
-rw-r--r--lib/images/fileicons/ps.pngbin424 -> 377 bytes
-rw-r--r--lib/images/fileicons/py.pngbin426 -> 374 bytes
-rw-r--r--lib/images/fileicons/rar.pngbin418 -> 377 bytes
-rw-r--r--lib/images/fileicons/rb.pngbin421 -> 375 bytes
-rw-r--r--lib/images/fileicons/rpm.pngbin415 -> 374 bytes
-rw-r--r--lib/images/fileicons/rtf.pngbin418 -> 376 bytes
-rw-r--r--lib/images/fileicons/sh.pngbin422 -> 375 bytes
-rw-r--r--lib/images/fileicons/sql.pngbin410 -> 373 bytes
-rw-r--r--lib/images/fileicons/swf.pngbin416 -> 379 bytes
-rw-r--r--lib/images/fileicons/sxc.pngbin420 -> 377 bytes
-rw-r--r--lib/images/fileicons/sxd.pngbin424 -> 377 bytes
-rw-r--r--lib/images/fileicons/sxi.pngbin414 -> 377 bytes
-rw-r--r--lib/images/fileicons/sxw.pngbin417 -> 376 bytes
-rw-r--r--lib/images/fileicons/tar.pngbin417 -> 377 bytes
-rw-r--r--lib/images/fileicons/tgz.pngbin417 -> 377 bytes
-rw-r--r--lib/images/fileicons/txt.pngbin407 -> 371 bytes
-rw-r--r--lib/images/fileicons/wav.pngbin415 -> 375 bytes
-rw-r--r--lib/images/fileicons/webm.pngbin412 -> 378 bytes
-rw-r--r--lib/images/fileicons/xls.pngbin415 -> 378 bytes
-rw-r--r--lib/images/fileicons/xlsx.pngbin425 -> 379 bytes
-rw-r--r--lib/images/fileicons/xml.pngbin400 -> 376 bytes
-rw-r--r--lib/images/fileicons/zip.pngbin418 -> 377 bytes
-rw-r--r--lib/images/history.pngbin149 -> 149 bytes
-rw-r--r--lib/images/icon-list.pngbin3342 -> 584 bytes
-rw-r--r--lib/images/icon-sort.pngbin316 -> 211 bytes
-rw-r--r--lib/images/info.pngbin725 -> 721 bytes
-rw-r--r--lib/images/interwiki.pngbin443 -> 442 bytes
-rw-r--r--lib/images/interwiki/coral.gifbin85 -> 0 bytes
-rw-r--r--lib/images/interwiki/sb.gifbin195 -> 0 bytes
-rw-r--r--lib/images/interwiki/tel.gifbin0 -> 177 bytes
-rw-r--r--lib/images/interwiki/user.pngbin741 -> 684 bytes
-rw-r--r--lib/images/license/badge/cc-by-nc-nd.pngbin1475 -> 1456 bytes
-rw-r--r--lib/images/license/badge/cc-by-nc-sa.pngbin1587 -> 1567 bytes
-rw-r--r--lib/images/license/badge/cc-by-nc.pngbin1421 -> 1401 bytes
-rw-r--r--lib/images/license/badge/cc-by-nd.pngbin1283 -> 1261 bytes
-rw-r--r--lib/images/license/badge/cc-by-sa.pngbin1421 -> 1407 bytes
-rw-r--r--lib/images/license/badge/cc-by.pngbin1204 -> 1186 bytes
-rw-r--r--lib/images/license/badge/cc-zero.pngbin1202 -> 1182 bytes
-rw-r--r--lib/images/license/badge/cc.pngbin898 -> 846 bytes
-rw-r--r--lib/images/license/badge/gnufdl.pngbin1667 -> 1649 bytes
-rw-r--r--lib/images/license/badge/publicdomain.pngbin1345 -> 1326 bytes
-rw-r--r--lib/images/license/button/cc-by-nc-nd.pngbin396 -> 391 bytes
-rw-r--r--lib/images/license/button/cc-by-nc-sa.pngbin403 -> 396 bytes
-rw-r--r--lib/images/license/button/cc-by-nc.pngbin388 -> 381 bytes
-rw-r--r--lib/images/license/button/cc-by-nd.pngbin386 -> 382 bytes
-rw-r--r--lib/images/license/button/cc-by-sa.pngbin386 -> 379 bytes
-rw-r--r--lib/images/license/button/cc-by.pngbin369 -> 364 bytes
-rw-r--r--lib/images/license/button/cc-zero.pngbin386 -> 381 bytes
-rw-r--r--lib/images/license/button/cc.pngbin399 -> 391 bytes
-rw-r--r--lib/images/license/button/gnufdl.pngbin509 -> 497 bytes
-rw-r--r--lib/images/license/button/publicdomain.pngbin368 -> 364 bytes
-rw-r--r--lib/images/magnifier.pngbin569 -> 565 bytes
-rw-r--r--lib/images/media_align_center.pngbin250 -> 249 bytes
-rw-r--r--lib/images/media_align_left.pngbin251 -> 247 bytes
-rw-r--r--lib/images/media_align_noalign.pngbin220 -> 218 bytes
-rw-r--r--lib/images/media_align_right.pngbin252 -> 250 bytes
-rw-r--r--lib/images/media_link_direct.pngbin720 -> 714 bytes
-rw-r--r--lib/images/media_link_displaylnk.pngbin306 -> 304 bytes
-rw-r--r--lib/images/media_link_lnk.pngbin580 -> 578 bytes
-rw-r--r--lib/images/media_link_nolnk.pngbin464 -> 452 bytes
-rw-r--r--lib/images/media_size_large.pngbin102 -> 100 bytes
-rw-r--r--lib/images/media_size_medium.pngbin231 -> 226 bytes
-rw-r--r--lib/images/media_size_original.pngbin212 -> 210 bytes
-rw-r--r--lib/images/media_size_small.pngbin210 -> 206 bytes
-rw-r--r--lib/images/mediamanager.pngbin507 -> 455 bytes
-rw-r--r--lib/images/notify.pngbin736 -> 735 bytes
-rw-r--r--lib/images/ns.pngbin800 -> 799 bytes
-rw-r--r--lib/images/open.pngbin118 -> 107 bytes
-rw-r--r--lib/images/resizecol.pngbin158 -> 148 bytes
-rw-r--r--lib/images/smileys/index.php2
-rw-r--r--lib/images/success.pngbin728 -> 725 bytes
-rw-r--r--lib/images/toolbar/bold.pngbin251 -> 249 bytes
-rw-r--r--lib/images/toolbar/chars.pngbin496 -> 493 bytes
-rw-r--r--lib/images/toolbar/h.pngbin258 -> 257 bytes
-rw-r--r--lib/images/toolbar/h1.pngbin290 -> 287 bytes
-rw-r--r--lib/images/toolbar/h2.pngbin328 -> 319 bytes
-rw-r--r--lib/images/toolbar/h3.pngbin322 -> 320 bytes
-rw-r--r--lib/images/toolbar/h4.pngbin310 -> 310 bytes
-rw-r--r--lib/images/toolbar/h5.pngbin325 -> 318 bytes
-rw-r--r--lib/images/toolbar/hequal.pngbin311 -> 306 bytes
-rw-r--r--lib/images/toolbar/hminus.pngbin409 -> 403 bytes
-rw-r--r--lib/images/toolbar/hplus.pngbin396 -> 391 bytes
-rw-r--r--lib/images/toolbar/hr.pngbin254 -> 251 bytes
-rw-r--r--lib/images/toolbar/image.pngbin554 -> 539 bytes
-rw-r--r--lib/images/toolbar/italic.pngbin241 -> 239 bytes
-rw-r--r--lib/images/toolbar/link.pngbin405 -> 402 bytes
-rw-r--r--lib/images/toolbar/linkextern.pngbin904 -> 902 bytes
-rw-r--r--lib/images/toolbar/mono.pngbin296 -> 293 bytes
-rw-r--r--lib/images/toolbar/ol.pngbin304 -> 302 bytes
-rw-r--r--lib/images/toolbar/smiley.pngbin684 -> 680 bytes
-rw-r--r--lib/images/toolbar/strike.pngbin318 -> 316 bytes
-rw-r--r--lib/images/toolbar/ul.pngbin291 -> 288 bytes
-rw-r--r--lib/images/toolbar/underline.pngbin317 -> 297 bytes
-rw-r--r--lib/images/unc.pngbin553 -> 290 bytes
-rw-r--r--lib/images/up.pngbin248 -> 248 bytes
-rw-r--r--lib/plugins/acl/admin.php27
-rw-r--r--lib/plugins/acl/lang/ca/lang.php4
-rw-r--r--lib/plugins/acl/lang/cs/help.txt13
-rw-r--r--lib/plugins/acl/lang/eu/lang.php5
-rw-r--r--lib/plugins/acl/lang/ja/help.txt15
-rw-r--r--lib/plugins/acl/lang/ko/lang.php8
-rw-r--r--lib/plugins/acl/lang/lt/lang.php4
-rw-r--r--lib/plugins/acl/lang/ro/lang.php5
-rw-r--r--lib/plugins/acl/pix/group.pngbin700 -> 699 bytes
-rw-r--r--lib/plugins/acl/pix/ns.pngbin800 -> 799 bytes
-rw-r--r--lib/plugins/acl/pix/user.pngbin653 -> 650 bytes
-rw-r--r--lib/plugins/acl/plugin.info.txt2
-rw-r--r--lib/plugins/acl/remote.php11
-rw-r--r--lib/plugins/acl/script.js2
-rw-r--r--lib/plugins/acl/style.css4
-rw-r--r--lib/plugins/action.php2
-rw-r--r--lib/plugins/admin.php44
-rw-r--r--lib/plugins/auth.php13
-rw-r--r--lib/plugins/authad/action.php2
-rw-r--r--lib/plugins/authad/adLDAP/adLDAP.php2
-rw-r--r--lib/plugins/authad/auth.php188
-rw-r--r--lib/plugins/authad/lang/ar/lang.php2
-rw-r--r--lib/plugins/authad/lang/bg/lang.php8
-rw-r--r--lib/plugins/authad/lang/ca/lang.php8
-rw-r--r--lib/plugins/authad/lang/cs/lang.php2
-rw-r--r--lib/plugins/authad/lang/cs/settings.php2
-rw-r--r--lib/plugins/authad/lang/da/lang.php10
-rw-r--r--lib/plugins/authad/lang/de-informal/lang.php11
-rw-r--r--lib/plugins/authad/lang/de/lang.php4
-rw-r--r--lib/plugins/authad/lang/el/lang.php8
-rw-r--r--lib/plugins/authad/lang/en/lang.php6
-rw-r--r--lib/plugins/authad/lang/eo/lang.php1
-rw-r--r--lib/plugins/authad/lang/es/lang.php5
-rw-r--r--lib/plugins/authad/lang/et/lang.php8
-rw-r--r--lib/plugins/authad/lang/eu/lang.php8
-rw-r--r--lib/plugins/authad/lang/fa/lang.php2
-rw-r--r--lib/plugins/authad/lang/fa/settings.php10
-rw-r--r--lib/plugins/authad/lang/fi/lang.php8
-rw-r--r--lib/plugins/authad/lang/fr/lang.php5
-rw-r--r--lib/plugins/authad/lang/gl/lang.php8
-rw-r--r--lib/plugins/authad/lang/he/lang.php10
-rw-r--r--lib/plugins/authad/lang/he/settings.php8
-rw-r--r--lib/plugins/authad/lang/hr/lang.php3
-rw-r--r--lib/plugins/authad/lang/hu/lang.php1
-rw-r--r--lib/plugins/authad/lang/it/lang.php8
-rw-r--r--lib/plugins/authad/lang/ja/lang.php5
-rw-r--r--lib/plugins/authad/lang/ka/lang.php8
-rw-r--r--lib/plugins/authad/lang/ko/lang.php3
-rw-r--r--lib/plugins/authad/lang/lv/lang.php1
-rw-r--r--lib/plugins/authad/lang/nl/lang.php5
-rw-r--r--lib/plugins/authad/lang/no/lang.php13
-rw-r--r--lib/plugins/authad/lang/no/settings.php5
-rw-r--r--lib/plugins/authad/lang/pl/lang.php8
-rw-r--r--lib/plugins/authad/lang/pl/settings.php1
-rw-r--r--lib/plugins/authad/lang/pt-br/lang.php4
-rw-r--r--lib/plugins/authad/lang/pt/lang.php5
-rw-r--r--lib/plugins/authad/lang/pt/settings.php6
-rw-r--r--lib/plugins/authad/lang/ro/lang.php8
-rw-r--r--lib/plugins/authad/lang/ru/lang.php4
-rw-r--r--lib/plugins/authad/lang/ru/settings.php11
-rw-r--r--lib/plugins/authad/lang/sk/lang.php8
-rw-r--r--lib/plugins/authad/lang/sl/lang.php8
-rw-r--r--lib/plugins/authad/lang/sv/lang.php8
-rw-r--r--lib/plugins/authad/lang/tr/lang.php8
-rw-r--r--lib/plugins/authad/lang/zh-tw/lang.php2
-rw-r--r--lib/plugins/authad/lang/zh/lang.php4
-rw-r--r--lib/plugins/authad/plugin.info.txt2
-rw-r--r--lib/plugins/authldap/auth.php34
-rw-r--r--lib/plugins/authldap/conf/default.php6
-rw-r--r--lib/plugins/authldap/conf/metadata.php4
-rw-r--r--lib/plugins/authldap/lang/cs/settings.php10
-rw-r--r--lib/plugins/authldap/lang/da/settings.php5
-rw-r--r--lib/plugins/authldap/lang/de/lang.php9
-rw-r--r--lib/plugins/authldap/lang/de/settings.php7
-rw-r--r--lib/plugins/authldap/lang/en/lang.php11
-rw-r--r--lib/plugins/authldap/lang/en/settings.php6
-rw-r--r--lib/plugins/authldap/lang/es/lang.php8
-rw-r--r--lib/plugins/authldap/lang/es/settings.php5
-rw-r--r--lib/plugins/authldap/lang/fa/settings.php10
-rw-r--r--lib/plugins/authldap/lang/fr/lang.php9
-rw-r--r--lib/plugins/authldap/lang/fr/settings.php6
-rw-r--r--lib/plugins/authldap/lang/he/settings.php4
-rw-r--r--lib/plugins/authldap/lang/hr/lang.php9
-rw-r--r--lib/plugins/authldap/lang/hr/settings.php5
-rw-r--r--lib/plugins/authldap/lang/ja/lang.php9
-rw-r--r--lib/plugins/authldap/lang/ja/settings.php6
-rw-r--r--lib/plugins/authldap/lang/ko/lang.php9
-rw-r--r--lib/plugins/authldap/lang/ko/settings.php5
-rw-r--r--lib/plugins/authldap/lang/nl/lang.php9
-rw-r--r--lib/plugins/authldap/lang/nl/settings.php6
-rw-r--r--lib/plugins/authldap/lang/no/settings.php2
-rw-r--r--lib/plugins/authldap/lang/pl/settings.php6
-rw-r--r--lib/plugins/authldap/lang/pt-br/lang.php9
-rw-r--r--lib/plugins/authldap/lang/pt-br/settings.php6
-rw-r--r--lib/plugins/authldap/lang/pt/lang.php9
-rw-r--r--lib/plugins/authldap/lang/pt/settings.php16
-rw-r--r--lib/plugins/authldap/lang/ru/lang.php9
-rw-r--r--lib/plugins/authldap/lang/ru/settings.php23
-rw-r--r--lib/plugins/authldap/lang/zh-tw/settings.php6
-rw-r--r--lib/plugins/authldap/lang/zh/lang.php9
-rw-r--r--lib/plugins/authldap/lang/zh/settings.php10
-rw-r--r--lib/plugins/authldap/plugin.info.txt2
-rw-r--r--lib/plugins/authmysql/auth.php38
-rw-r--r--lib/plugins/authmysql/lang/bg/lang.php10
-rw-r--r--lib/plugins/authmysql/lang/cs/settings.php5
-rw-r--r--lib/plugins/authmysql/lang/da/settings.php8
-rw-r--r--lib/plugins/authmysql/lang/de/lang.php13
-rw-r--r--lib/plugins/authmysql/lang/en/lang.php13
-rw-r--r--lib/plugins/authmysql/lang/es/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/es/settings.php7
-rw-r--r--lib/plugins/authmysql/lang/fi/settings.php11
-rw-r--r--lib/plugins/authmysql/lang/fr/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/he/settings.php12
-rw-r--r--lib/plugins/authmysql/lang/hr/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/it/settings.php2
-rw-r--r--lib/plugins/authmysql/lang/ja/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/ja/settings.php2
-rw-r--r--lib/plugins/authmysql/lang/ko/lang.php12
-rw-r--r--lib/plugins/authmysql/lang/nl/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/no/settings.php14
-rw-r--r--lib/plugins/authmysql/lang/pl/settings.php10
-rw-r--r--lib/plugins/authmysql/lang/pt-br/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/pt/lang.php10
-rw-r--r--lib/plugins/authmysql/lang/pt/settings.php20
-rw-r--r--lib/plugins/authmysql/lang/ru/lang.php11
-rw-r--r--lib/plugins/authmysql/lang/ru/settings.php6
-rw-r--r--lib/plugins/authmysql/lang/tr/lang.php9
-rw-r--r--lib/plugins/authmysql/lang/zh/lang.php11
-rw-r--r--lib/plugins/authmysql/plugin.info.txt2
-rw-r--r--lib/plugins/authpgsql/auth.php11
-rw-r--r--lib/plugins/authpgsql/lang/cs/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/es/settings.php3
-rw-r--r--lib/plugins/authpgsql/lang/it/settings.php5
-rw-r--r--lib/plugins/authpgsql/lang/ja/settings.php2
-rw-r--r--lib/plugins/authpgsql/lang/pt/settings.php17
-rw-r--r--lib/plugins/authpgsql/lang/ru/settings.php11
-rw-r--r--lib/plugins/authpgsql/plugin.info.txt2
-rw-r--r--lib/plugins/authplain/_test/escaping.test.php15
-rw-r--r--lib/plugins/authplain/auth.php45
-rw-r--r--lib/plugins/authplain/lang/af/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ar/lang.php6
-rw-r--r--lib/plugins/authplain/lang/az/lang.php6
-rw-r--r--lib/plugins/authplain/lang/bg/lang.php9
-rw-r--r--lib/plugins/authplain/lang/bn/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ca-valencia/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ca/lang.php7
-rw-r--r--lib/plugins/authplain/lang/cs/lang.php6
-rw-r--r--lib/plugins/authplain/lang/da/lang.php6
-rw-r--r--lib/plugins/authplain/lang/de-informal/lang.php6
-rw-r--r--lib/plugins/authplain/lang/de/lang.php10
-rw-r--r--lib/plugins/authplain/lang/el/lang.php6
-rw-r--r--lib/plugins/authplain/lang/en/lang.php8
-rw-r--r--lib/plugins/authplain/lang/eo/lang.php6
-rw-r--r--lib/plugins/authplain/lang/es/lang.php10
-rw-r--r--lib/plugins/authplain/lang/et/lang.php6
-rw-r--r--lib/plugins/authplain/lang/eu/lang.php6
-rw-r--r--lib/plugins/authplain/lang/fa/lang.php6
-rw-r--r--lib/plugins/authplain/lang/fi/lang.php6
-rw-r--r--lib/plugins/authplain/lang/fo/lang.php6
-rw-r--r--lib/plugins/authplain/lang/fr/lang.php11
-rw-r--r--lib/plugins/authplain/lang/gl/lang.php6
-rw-r--r--lib/plugins/authplain/lang/he/lang.php6
-rw-r--r--lib/plugins/authplain/lang/hr/lang.php6
-rw-r--r--lib/plugins/authplain/lang/hu/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ia/lang.php6
-rw-r--r--lib/plugins/authplain/lang/id-ni/lang.php6
-rw-r--r--lib/plugins/authplain/lang/id/lang.php6
-rw-r--r--lib/plugins/authplain/lang/is/lang.php6
-rw-r--r--lib/plugins/authplain/lang/it/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ja/lang.php10
-rw-r--r--lib/plugins/authplain/lang/ka/lang.php6
-rw-r--r--lib/plugins/authplain/lang/kk/lang.php6
-rw-r--r--lib/plugins/authplain/lang/km/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ko/lang.php10
-rw-r--r--lib/plugins/authplain/lang/ku/lang.php6
-rw-r--r--lib/plugins/authplain/lang/la/lang.php6
-rw-r--r--lib/plugins/authplain/lang/lb/lang.php6
-rw-r--r--lib/plugins/authplain/lang/lt/lang.php6
-rw-r--r--lib/plugins/authplain/lang/lv/lang.php6
-rw-r--r--lib/plugins/authplain/lang/mg/lang.php6
-rw-r--r--lib/plugins/authplain/lang/mk/lang.php6
-rw-r--r--lib/plugins/authplain/lang/mr/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ms/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ne/lang.php6
-rw-r--r--lib/plugins/authplain/lang/nl/lang.php10
-rw-r--r--lib/plugins/authplain/lang/no/lang.php6
-rw-r--r--lib/plugins/authplain/lang/pl/lang.php6
-rw-r--r--lib/plugins/authplain/lang/pt-br/lang.php10
-rw-r--r--lib/plugins/authplain/lang/pt/lang.php9
-rw-r--r--lib/plugins/authplain/lang/ro/lang.php6
-rw-r--r--lib/plugins/authplain/lang/ru/lang.php6
-rw-r--r--lib/plugins/authplain/lang/sk/lang.php6
-rw-r--r--lib/plugins/authplain/lang/sl/lang.php6
-rw-r--r--lib/plugins/authplain/lang/sq/lang.php6
-rw-r--r--lib/plugins/authplain/lang/sr/lang.php6
-rw-r--r--lib/plugins/authplain/lang/sv/lang.php6
-rw-r--r--lib/plugins/authplain/lang/th/lang.php6
-rw-r--r--lib/plugins/authplain/lang/tr/lang.php7
-rw-r--r--lib/plugins/authplain/lang/uk/lang.php6
-rw-r--r--lib/plugins/authplain/lang/vi/lang.php6
-rw-r--r--lib/plugins/authplain/lang/zh-tw/lang.php6
-rw-r--r--lib/plugins/authplain/lang/zh/lang.php10
-rw-r--r--lib/plugins/authplain/plugin.info.txt2
-rw-r--r--lib/plugins/config/_test/configuration.test.php6
-rw-r--r--lib/plugins/config/admin.php53
-rw-r--r--lib/plugins/config/images/danger.pngbin648 -> 637 bytes
-rw-r--r--lib/plugins/config/images/security.pngbin706 -> 682 bytes
-rw-r--r--lib/plugins/config/images/warning.pngbin613 -> 606 bytes
-rw-r--r--lib/plugins/config/lang/ar/intro.txt2
-rw-r--r--lib/plugins/config/lang/bg/lang.php408
-rw-r--r--lib/plugins/config/lang/ca-valencia/intro.txt2
-rw-r--r--lib/plugins/config/lang/ca/lang.php6
-rw-r--r--lib/plugins/config/lang/cs/intro.txt1
-rw-r--r--lib/plugins/config/lang/da/intro.txt1
-rw-r--r--lib/plugins/config/lang/de-informal/intro.txt2
-rw-r--r--lib/plugins/config/lang/de/intro.txt3
-rw-r--r--lib/plugins/config/lang/de/lang.php107
-rw-r--r--lib/plugins/config/lang/en/intro.txt2
-rw-r--r--lib/plugins/config/lang/eo/lang.php2
-rw-r--r--lib/plugins/config/lang/es/lang.php8
-rw-r--r--lib/plugins/config/lang/fa/intro.txt2
-rw-r--r--lib/plugins/config/lang/fi/intro.txt2
-rw-r--r--lib/plugins/config/lang/fr/intro.txt2
-rw-r--r--lib/plugins/config/lang/fr/lang.php10
-rw-r--r--lib/plugins/config/lang/he/intro.txt2
-rw-r--r--lib/plugins/config/lang/ia/intro.txt2
-rw-r--r--lib/plugins/config/lang/it/intro.txt2
-rw-r--r--lib/plugins/config/lang/ja/intro.txt12
-rw-r--r--lib/plugins/config/lang/ja/lang.php8
-rw-r--r--lib/plugins/config/lang/ko/intro.txt7
-rw-r--r--lib/plugins/config/lang/ko/lang.php262
-rw-r--r--lib/plugins/config/lang/la/intro.txt2
-rw-r--r--lib/plugins/config/lang/mr/intro.txt2
-rw-r--r--lib/plugins/config/lang/nl/intro.txt2
-rw-r--r--lib/plugins/config/lang/nl/lang.php17
-rw-r--r--lib/plugins/config/lang/pl/intro.txt2
-rw-r--r--lib/plugins/config/lang/pt-br/intro.txt2
-rw-r--r--lib/plugins/config/lang/pt-br/lang.php8
-rw-r--r--lib/plugins/config/lang/pt/intro.txt2
-rw-r--r--lib/plugins/config/lang/pt/lang.php100
-rw-r--r--lib/plugins/config/lang/ru/intro.txt2
-rw-r--r--lib/plugins/config/lang/sk/intro.txt2
-rw-r--r--lib/plugins/config/lang/sq/intro.txt2
-rw-r--r--lib/plugins/config/lang/sv/intro.txt2
-rw-r--r--lib/plugins/config/lang/tr/intro.txt2
-rw-r--r--lib/plugins/config/lang/tr/lang.php6
-rw-r--r--lib/plugins/config/lang/zh-tw/intro.txt2
-rw-r--r--lib/plugins/config/lang/zh-tw/lang.php2
-rw-r--r--lib/plugins/config/lang/zh/intro.txt2
-rw-r--r--lib/plugins/config/lang/zh/lang.php7
-rw-r--r--lib/plugins/config/plugin.info.txt2
-rw-r--r--lib/plugins/config/settings/config.class.php239
-rw-r--r--lib/plugins/config/settings/extra.class.php111
-rw-r--r--lib/plugins/extension/_test/extension.test.php2
-rw-r--r--lib/plugins/extension/admin.php10
-rw-r--r--lib/plugins/extension/helper/extension.php88
-rw-r--r--lib/plugins/extension/helper/gui.php4
-rw-r--r--lib/plugins/extension/helper/list.php11
-rw-r--r--lib/plugins/extension/helper/repository.php6
-rw-r--r--lib/plugins/extension/images/bug.gif (renamed from lib/images/interwiki/dokubug.gif)bin194 -> 194 bytes
-rw-r--r--lib/plugins/extension/images/disabled.pngbin1396 -> 1163 bytes
-rw-r--r--lib/plugins/extension/images/donate.pngbin724 -> 677 bytes
-rw-r--r--lib/plugins/extension/images/down.pngbin280 -> 197 bytes
-rw-r--r--lib/plugins/extension/images/enabled.pngbin1398 -> 1172 bytes
-rw-r--r--lib/plugins/extension/images/overlay.pngbin109 -> 68 bytes
-rw-r--r--lib/plugins/extension/images/plugin.pngbin6824 -> 4054 bytes
-rw-r--r--lib/plugins/extension/images/tag.pngbin753 -> 341 bytes
-rw-r--r--lib/plugins/extension/images/template.pngbin7547 -> 5206 bytes
-rw-r--r--lib/plugins/extension/images/up.pngbin281 -> 197 bytes
-rw-r--r--lib/plugins/extension/images/warning.pngbin613 -> 606 bytes
-rw-r--r--lib/plugins/extension/lang/bg/lang.php73
-rw-r--r--lib/plugins/extension/lang/cs/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/cs/intro_search.txt1
-rw-r--r--lib/plugins/extension/lang/cs/intro_templates.txt1
-rw-r--r--lib/plugins/extension/lang/cs/lang.php39
-rw-r--r--lib/plugins/extension/lang/da/intro_install.txt1
-rw-r--r--lib/plugins/extension/lang/da/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/da/intro_templates.txt1
-rw-r--r--lib/plugins/extension/lang/da/lang.php80
-rw-r--r--lib/plugins/extension/lang/de/lang.php11
-rw-r--r--lib/plugins/extension/lang/en/lang.php12
-rw-r--r--lib/plugins/extension/lang/eo/lang.php4
-rw-r--r--lib/plugins/extension/lang/es/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/es/intro_search.txt1
-rw-r--r--lib/plugins/extension/lang/es/lang.php18
-rw-r--r--lib/plugins/extension/lang/fi/lang.php37
-rw-r--r--lib/plugins/extension/lang/fr/lang.php18
-rw-r--r--lib/plugins/extension/lang/hr/intro_install.txt2
-rw-r--r--lib/plugins/extension/lang/hr/intro_plugins.txt2
-rw-r--r--lib/plugins/extension/lang/hr/intro_search.txt2
-rw-r--r--lib/plugins/extension/lang/hr/intro_templates.txt2
-rw-r--r--lib/plugins/extension/lang/hr/lang.php33
-rw-r--r--lib/plugins/extension/lang/hu/lang.php4
-rw-r--r--lib/plugins/extension/lang/it/intro_install.txt1
-rw-r--r--lib/plugins/extension/lang/it/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/it/lang.php48
-rw-r--r--lib/plugins/extension/lang/ja/lang.php11
-rw-r--r--lib/plugins/extension/lang/ko/lang.php14
-rw-r--r--lib/plugins/extension/lang/lv/lang.php4
-rw-r--r--lib/plugins/extension/lang/nl/lang.php13
-rw-r--r--lib/plugins/extension/lang/pl/lang.php4
-rw-r--r--lib/plugins/extension/lang/pt-br/lang.php24
-rw-r--r--lib/plugins/extension/lang/pt/intro_install.txt1
-rw-r--r--lib/plugins/extension/lang/pt/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/pt/intro_search.txt1
-rw-r--r--lib/plugins/extension/lang/pt/intro_templates.txt1
-rw-r--r--lib/plugins/extension/lang/pt/lang.php135
-rw-r--r--lib/plugins/extension/lang/ru/intro_install.txt1
-rw-r--r--lib/plugins/extension/lang/ru/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/ru/intro_search.txt1
-rw-r--r--lib/plugins/extension/lang/ru/intro_templates.txt1
-rw-r--r--lib/plugins/extension/lang/ru/lang.php164
-rw-r--r--lib/plugins/extension/lang/tr/lang.php3
-rw-r--r--lib/plugins/extension/lang/zh-tw/intro_plugins.txt1
-rw-r--r--lib/plugins/extension/lang/zh-tw/lang.php30
-rw-r--r--lib/plugins/extension/lang/zh/lang.php8
-rw-r--r--lib/plugins/extension/plugin.info.txt2
-rw-r--r--lib/plugins/extension/script.js26
-rw-r--r--lib/plugins/extension/style.less29
-rw-r--r--lib/plugins/info/plugin.info.txt2
-rw-r--r--lib/plugins/info/syntax.php38
-rw-r--r--lib/plugins/popularity/action.php2
-rw-r--r--lib/plugins/popularity/admin.php6
-rw-r--r--lib/plugins/popularity/helper.php34
-rw-r--r--lib/plugins/popularity/lang/ca/lang.php5
-rw-r--r--lib/plugins/popularity/lang/eu/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ja/intro.txt2
-rw-r--r--lib/plugins/popularity/lang/ko/intro.txt2
-rw-r--r--lib/plugins/popularity/lang/lt/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ro/lang.php5
-rw-r--r--lib/plugins/popularity/plugin.info.txt2
-rw-r--r--lib/plugins/remote.php13
-rw-r--r--lib/plugins/revert/admin.php10
-rw-r--r--lib/plugins/revert/lang/ca/lang.php5
-rw-r--r--lib/plugins/revert/lang/eu/lang.php6
-rw-r--r--lib/plugins/revert/lang/ko/lang.php6
-rw-r--r--lib/plugins/revert/lang/no/lang.php2
-rw-r--r--lib/plugins/revert/lang/ro/lang.php5
-rw-r--r--lib/plugins/revert/plugin.info.txt2
-rw-r--r--lib/plugins/styling/.travis.yml13
-rw-r--r--lib/plugins/styling/README27
-rw-r--r--lib/plugins/styling/_test/general.test.php33
-rw-r--r--lib/plugins/styling/action.php60
-rw-r--r--lib/plugins/styling/admin.php211
-rw-r--r--lib/plugins/styling/iris.js1488
-rw-r--r--lib/plugins/styling/lang/bg/lang.php17
-rw-r--r--lib/plugins/styling/lang/de/intro.txt2
-rw-r--r--lib/plugins/styling/lang/de/lang.php23
-rw-r--r--lib/plugins/styling/lang/en/intro.txt2
-rw-r--r--lib/plugins/styling/lang/en/lang.php35
-rw-r--r--lib/plugins/styling/lang/es/intro.txt2
-rw-r--r--lib/plugins/styling/lang/es/lang.php23
-rw-r--r--lib/plugins/styling/lang/fr/intro.txt2
-rw-r--r--lib/plugins/styling/lang/fr/lang.php24
-rw-r--r--lib/plugins/styling/lang/ja/intro.txt2
-rw-r--r--lib/plugins/styling/lang/ja/lang.php23
-rw-r--r--lib/plugins/styling/lang/ko/intro.txt2
-rw-r--r--lib/plugins/styling/lang/ko/lang.php23
-rw-r--r--lib/plugins/styling/lang/nl/intro.txt2
-rw-r--r--lib/plugins/styling/lang/nl/lang.php24
-rw-r--r--lib/plugins/styling/lang/pt-br/intro.txt2
-rw-r--r--lib/plugins/styling/lang/pt-br/lang.php23
-rw-r--r--lib/plugins/styling/lang/zh/intro.txt1
-rw-r--r--lib/plugins/styling/lang/zh/lang.php23
-rw-r--r--lib/plugins/styling/plugin.info.txt7
-rw-r--r--lib/plugins/styling/popup.php30
-rw-r--r--lib/plugins/styling/script.js97
-rw-r--r--lib/plugins/styling/style.less13
-rw-r--r--lib/plugins/syntax.php11
-rw-r--r--lib/plugins/usermanager/admin.php84
-rw-r--r--lib/plugins/usermanager/images/search.pngbin550 -> 549 bytes
-rw-r--r--lib/plugins/usermanager/lang/bg/lang.php9
-rw-r--r--lib/plugins/usermanager/lang/ca/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/cs/lang.php14
-rw-r--r--lib/plugins/usermanager/lang/da/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/da/lang.php2
-rw-r--r--lib/plugins/usermanager/lang/en/import.txt4
-rw-r--r--lib/plugins/usermanager/lang/es/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/es/lang.php7
-rw-r--r--lib/plugins/usermanager/lang/eu/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/fi/lang.php10
-rw-r--r--lib/plugins/usermanager/lang/hr/lang.php4
-rw-r--r--lib/plugins/usermanager/lang/ja/import.txt2
-rw-r--r--lib/plugins/usermanager/lang/ja/lang.php4
-rw-r--r--lib/plugins/usermanager/lang/ko/lang.php12
-rw-r--r--lib/plugins/usermanager/lang/lt/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/pt-br/import.txt9
-rw-r--r--lib/plugins/usermanager/lang/pt/lang.php11
-rw-r--r--lib/plugins/usermanager/lang/ro/lang.php5
-rw-r--r--lib/plugins/usermanager/lang/ru/import.txt4
-rw-r--r--lib/plugins/usermanager/lang/ru/lang.php7
-rw-r--r--lib/plugins/usermanager/plugin.info.txt2
-rw-r--r--lib/plugins/usermanager/style.css2
-rw-r--r--lib/scripts/behaviour.js47
-rw-r--r--lib/scripts/compatibility.js395
-rw-r--r--lib/scripts/drag.js87
-rw-r--r--lib/scripts/editor.js12
-rw-r--r--lib/scripts/fileuploaderextended.js4
-rw-r--r--lib/scripts/hotkeys.js6
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/animated-overlay.gifbin1738 -> 0 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.pngbin251 -> 251 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_flat_75_ffffff_40x100.pngbin247 -> 247 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_55_fbf9ee_1x400.pngbin374 -> 374 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_65_ffffff_1x400.pngbin246 -> 246 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_dadada_1x400.pngbin301 -> 301 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_75_e6e6e6_1x400.pngbin301 -> 301 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_glass_95_fef1ec_1x400.pngbin371 -> 371 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.pngbin319 -> 319 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-icons_222222_256x240.pngbin7006 -> 7006 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-icons_2e83ff_256x240.pngbin4599 -> 4599 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-icons_454545_256x240.pngbin7071 -> 7071 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-icons_888888_256x240.pngbin7092 -> 7092 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/images/ui-icons_cd0a0a_256x240.pngbin4599 -> 4599 bytes
-rw-r--r--lib/scripts/jquery/jquery-ui-theme/smoothness.css24
-rw-r--r--lib/scripts/jquery/jquery-ui.js1823
-rw-r--r--lib/scripts/jquery/jquery-ui.min.js20
-rw-r--r--lib/scripts/jquery/jquery.js195
-rw-r--r--lib/scripts/jquery/jquery.min.js9
-rwxr-xr-xlib/scripts/jquery/update.sh10
-rw-r--r--lib/scripts/linkwiz.js10
-rw-r--r--lib/scripts/locktimer.js23
-rw-r--r--lib/scripts/media.js4
-rw-r--r--lib/scripts/page.js13
-rw-r--r--lib/scripts/toolbar.js15
-rw-r--r--lib/scripts/tw-sack.js140
-rw-r--r--lib/tpl/dokuwiki/css/_admin.css3
-rw-r--r--lib/tpl/dokuwiki/css/_edit.css4
-rw-r--r--lib/tpl/dokuwiki/css/_forms.css3
-rw-r--r--lib/tpl/dokuwiki/css/_links.css1
-rw-r--r--lib/tpl/dokuwiki/css/_media_fullscreen.css8
-rw-r--r--lib/tpl/dokuwiki/css/_media_popup.css2
-rw-r--r--lib/tpl/dokuwiki/css/_modal.css2
-rw-r--r--lib/tpl/dokuwiki/css/basic.less6
-rw-r--r--lib/tpl/dokuwiki/css/content.less3
-rw-r--r--lib/tpl/dokuwiki/css/design.less33
-rw-r--r--lib/tpl/dokuwiki/css/mobile.less10
-rw-r--r--lib/tpl/dokuwiki/css/pagetools.less19
-rw-r--r--lib/tpl/dokuwiki/css/print.css3
-rw-r--r--lib/tpl/dokuwiki/detail.php23
-rw-r--r--lib/tpl/dokuwiki/images/apple-touch-icon.pngbin6399 -> 6336 bytes
-rw-r--r--lib/tpl/dokuwiki/images/button-css.pngbin299 -> 297 bytes
-rw-r--r--lib/tpl/dokuwiki/images/button-html5.pngbin354 -> 305 bytes
-rw-r--r--lib/tpl/dokuwiki/images/button-rss.pngbin180 -> 178 bytes
-rw-r--r--lib/tpl/dokuwiki/images/logo.pngbin3820 -> 3744 bytes
-rw-r--r--lib/tpl/dokuwiki/images/page-gradient.pngbin280 -> 209 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools-build.php4
-rw-r--r--lib/tpl/dokuwiki/images/pagetools-sprite.pngbin11325 -> 7759 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/00_default.pngbin616 -> 494 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/01_edit.pngbin740 -> 519 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/02_create.pngbin808 -> 580 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/03_draft.pngbin828 -> 592 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/04_show.pngbin458 -> 321 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/05_source.pngbin753 -> 478 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/06_revert.pngbin752 -> 462 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/07_revisions.pngbin1144 -> 769 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/08_backlink.pngbin844 -> 527 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/09_subscribe.pngbin589 -> 374 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/10_top.pngbin465 -> 297 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/11_mediamanager.pngbin441 -> 320 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/12_back.pngbin483 -> 288 bytes
-rw-r--r--lib/tpl/dokuwiki/images/search.pngbin316 -> 307 bytes
-rw-r--r--lib/tpl/dokuwiki/images/toc-bullet.pngbin121 -> 113 bytes
-rw-r--r--lib/tpl/dokuwiki/images/usertools.pngbin1541 -> 1428 bytes
-rw-r--r--lib/tpl/dokuwiki/lang/de/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/de/style.txt1
-rw-r--r--lib/tpl/dokuwiki/lang/en/lang.php12
-rw-r--r--lib/tpl/dokuwiki/lang/en/style.txt4
-rw-r--r--lib/tpl/dokuwiki/lang/es/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/es/style.txt1
-rw-r--r--lib/tpl/dokuwiki/lang/fr/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/fr/style.txt1
-rw-r--r--lib/tpl/dokuwiki/lang/ja/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/ja/style.txt5
-rw-r--r--lib/tpl/dokuwiki/lang/ko/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/ko/style.txt4
-rw-r--r--lib/tpl/dokuwiki/lang/nl/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/nl/style.txt1
-rw-r--r--lib/tpl/dokuwiki/lang/pt-br/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/pt-br/style.txt1
-rw-r--r--lib/tpl/dokuwiki/lang/zh/lang.php15
-rw-r--r--lib/tpl/dokuwiki/lang/zh/style.txt1
-rw-r--r--lib/tpl/dokuwiki/main.php23
-rw-r--r--lib/tpl/dokuwiki/mediamanager.php4
-rw-r--r--lib/tpl/dokuwiki/template.info.txt2
-rw-r--r--lib/tpl/dokuwiki/tpl_header.php20
-rw-r--r--vendor/README6
-rw-r--r--vendor/autoload.php7
-rw-r--r--vendor/composer/ClassLoader.php413
-rw-r--r--vendor/composer/autoload_classmap.php10
-rw-r--r--vendor/composer/autoload_namespaces.php9
-rw-r--r--vendor/composer/autoload_psr4.php10
-rw-r--r--vendor/composer/autoload_real.php50
-rw-r--r--vendor/composer/installed.json99
-rw-r--r--vendor/easybook/geshi/README.md10
-rw-r--r--vendor/easybook/geshi/composer.json24
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi.php (renamed from inc/geshi.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/4cs.php (renamed from inc/geshi/4cs.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/6502acme.php (renamed from inc/geshi/6502acme.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/6502kickass.php (renamed from inc/geshi/6502kickass.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/6502tasm.php (renamed from inc/geshi/6502tasm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/68000devpac.php (renamed from inc/geshi/68000devpac.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/abap.php (renamed from inc/geshi/abap.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/actionscript.php (renamed from inc/geshi/actionscript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/actionscript3.php (renamed from inc/geshi/actionscript3.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ada.php (renamed from inc/geshi/ada.php)0
-rw-r--r--vendor/easybook/geshi/geshi/aimms.php316
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/algol68.php (renamed from inc/geshi/algol68.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/apache.php (renamed from inc/geshi/apache.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/applescript.php (renamed from inc/geshi/applescript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/apt_sources.php (renamed from inc/geshi/apt_sources.php)11
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/arm.php (renamed from inc/geshi/arm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/asm.php (renamed from inc/geshi/asm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/asp.php (renamed from inc/geshi/asp.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/asymptote.php (renamed from inc/geshi/asymptote.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/autoconf.php (renamed from inc/geshi/autoconf.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/autohotkey.php (renamed from inc/geshi/autohotkey.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/autoit.php (renamed from inc/geshi/autoit.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/avisynth.php (renamed from inc/geshi/avisynth.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/awk.php (renamed from inc/geshi/awk.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/bascomavr.php (renamed from inc/geshi/bascomavr.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/bash.php (renamed from inc/geshi/bash.php)62
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/basic4gl.php (renamed from inc/geshi/basic4gl.php)2
-rw-r--r--vendor/easybook/geshi/geshi/batch.php138
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/bf.php (renamed from inc/geshi/bf.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/bibtex.php (renamed from inc/geshi/bibtex.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/blitzbasic.php (renamed from inc/geshi/blitzbasic.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/bnf.php (renamed from inc/geshi/bnf.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/boo.php (renamed from inc/geshi/boo.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/c.php (renamed from inc/geshi/c.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/c_loadrunner.php (renamed from inc/geshi/c_loadrunner.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/c_mac.php (renamed from inc/geshi/c_mac.php)0
-rw-r--r--vendor/easybook/geshi/geshi/c_winapi.php870
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/caddcl.php (renamed from inc/geshi/caddcl.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cadlisp.php (renamed from inc/geshi/cadlisp.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cfdg.php (renamed from inc/geshi/cfdg.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cfm.php (renamed from inc/geshi/cfm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/chaiscript.php (renamed from inc/geshi/chaiscript.php)0
-rw-r--r--vendor/easybook/geshi/geshi/chapel.php169
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cil.php (renamed from inc/geshi/cil.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/clojure.php (renamed from inc/geshi/clojure.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cmake.php (renamed from inc/geshi/cmake.php)0
-rwxr-xr-xvendor/easybook/geshi/geshi/cobol.php457
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/coffeescript.php (renamed from inc/geshi/coffeescript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cpp-qt.php (renamed from inc/geshi/cpp-qt.php)10
-rw-r--r--vendor/easybook/geshi/geshi/cpp-winapi.php836
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cpp.php (renamed from inc/geshi/cpp.php)10
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/csharp.php (renamed from inc/geshi/csharp.php)11
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/css.php (renamed from inc/geshi/css.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/cuesheet.php (renamed from inc/geshi/cuesheet.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/d.php (renamed from inc/geshi/d.php)0
-rw-r--r--vendor/easybook/geshi/geshi/dart.php159
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/dcl.php (renamed from inc/geshi/dcl.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/dcpu16.php (renamed from inc/geshi/dcpu16.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/dcs.php (renamed from inc/geshi/dcs.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/delphi.php (renamed from inc/geshi/delphi.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/diff.php (renamed from inc/geshi/diff.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/div.php (renamed from inc/geshi/div.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/dos.php (renamed from inc/geshi/dos.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/dot.php (renamed from inc/geshi/dot.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/e.php (renamed from inc/geshi/e.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ecmascript.php (renamed from inc/geshi/ecmascript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/eiffel.php (renamed from inc/geshi/eiffel.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/email.php (renamed from inc/geshi/email.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/epc.php (renamed from inc/geshi/epc.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/erlang.php (renamed from inc/geshi/erlang.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/euphoria.php (renamed from inc/geshi/euphoria.php)0
-rw-r--r--vendor/easybook/geshi/geshi/ezt.php134
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/f1.php (renamed from inc/geshi/f1.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/falcon.php (renamed from inc/geshi/falcon.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/fo.php (renamed from inc/geshi/fo.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/fortran.php (renamed from inc/geshi/fortran.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/freebasic.php (renamed from inc/geshi/freebasic.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/freeswitch.php (renamed from inc/geshi/freeswitch.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/fsharp.php (renamed from inc/geshi/fsharp.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gambas.php (renamed from inc/geshi/gambas.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gdb.php (renamed from inc/geshi/gdb.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/genero.php (renamed from inc/geshi/genero.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/genie.php (renamed from inc/geshi/genie.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gettext.php (renamed from inc/geshi/gettext.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/glsl.php (renamed from inc/geshi/glsl.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gml.php (renamed from inc/geshi/gml.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gnuplot.php (renamed from inc/geshi/gnuplot.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/go.php (renamed from inc/geshi/go.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/groovy.php (renamed from inc/geshi/groovy.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/gwbasic.php (renamed from inc/geshi/gwbasic.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/haskell.php (renamed from inc/geshi/haskell.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/haxe.php (renamed from inc/geshi/haxe.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/hicest.php (renamed from inc/geshi/hicest.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/hq9plus.php (renamed from inc/geshi/hq9plus.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/html4strict.php (renamed from inc/geshi/html4strict.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/html5.php (renamed from inc/geshi/html5.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/icon.php (renamed from inc/geshi/icon.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/idl.php (renamed from inc/geshi/idl.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ini.php (renamed from inc/geshi/ini.php)5
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/inno.php (renamed from inc/geshi/inno.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/intercal.php (renamed from inc/geshi/intercal.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/io.php (renamed from inc/geshi/io.php)2
-rw-r--r--vendor/easybook/geshi/geshi/ispfpanel.php165
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/j.php (renamed from inc/geshi/j.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/java.php (renamed from inc/geshi/java.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/java5.php (renamed from inc/geshi/java5.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/javascript.php (renamed from inc/geshi/javascript.php)0
-rw-r--r--vendor/easybook/geshi/geshi/jcl.php155
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/jquery.php (renamed from inc/geshi/jquery.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/kixtart.php (renamed from inc/geshi/kixtart.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/klonec.php (renamed from inc/geshi/klonec.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/klonecpp.php (renamed from inc/geshi/klonecpp.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/latex.php (renamed from inc/geshi/latex.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lb.php (renamed from inc/geshi/lb.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ldif.php (renamed from inc/geshi/ldif.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lisp.php (renamed from inc/geshi/lisp.php)11
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/llvm.php (renamed from inc/geshi/llvm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/locobasic.php (renamed from inc/geshi/locobasic.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/logtalk.php (renamed from inc/geshi/logtalk.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lolcode.php (renamed from inc/geshi/lolcode.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lotusformulas.php (renamed from inc/geshi/lotusformulas.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lotusscript.php (renamed from inc/geshi/lotusscript.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lscript.php (renamed from inc/geshi/lscript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lsl2.php (renamed from inc/geshi/lsl2.php)415
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/lua.php (renamed from inc/geshi/lua.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/m68k.php (renamed from inc/geshi/m68k.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/magiksf.php (renamed from inc/geshi/magiksf.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/make.php (renamed from inc/geshi/make.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mapbasic.php (renamed from inc/geshi/mapbasic.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/matlab.php (renamed from inc/geshi/matlab.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mirc.php (renamed from inc/geshi/mirc.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mmix.php (renamed from inc/geshi/mmix.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/modula2.php (renamed from inc/geshi/modula2.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/modula3.php (renamed from inc/geshi/modula3.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mpasm.php (renamed from inc/geshi/mpasm.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mxml.php (renamed from inc/geshi/mxml.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/mysql.php (renamed from inc/geshi/mysql.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/nagios.php (renamed from inc/geshi/nagios.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/netrexx.php (renamed from inc/geshi/netrexx.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/newlisp.php (renamed from inc/geshi/newlisp.php)0
-rw-r--r--vendor/easybook/geshi/geshi/nginx.php868
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/nsis.php (renamed from inc/geshi/nsis.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oberon2.php (renamed from inc/geshi/oberon2.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/objc.php (renamed from inc/geshi/objc.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/objeck.php (renamed from inc/geshi/objeck.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ocaml-brief.php (renamed from inc/geshi/ocaml-brief.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ocaml.php (renamed from inc/geshi/ocaml.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/octave.php (renamed from inc/geshi/octave.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oobas.php (renamed from inc/geshi/oobas.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oorexx.php (renamed from inc/geshi/oorexx.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oracle11.php (renamed from inc/geshi/oracle11.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oracle8.php (renamed from inc/geshi/oracle8.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oxygene.php (renamed from inc/geshi/oxygene.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/oz.php (renamed from inc/geshi/oz.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/parasail.php (renamed from inc/geshi/parasail.php)0
-rwxr-xr-xvendor/easybook/geshi/geshi/parigp.php293
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pascal.php (renamed from inc/geshi/pascal.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pcre.php (renamed from inc/geshi/pcre.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/per.php (renamed from inc/geshi/per.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/perl.php (renamed from inc/geshi/perl.php)14
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/perl6.php (renamed from inc/geshi/perl6.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pf.php (renamed from inc/geshi/pf.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/php-brief.php (renamed from inc/geshi/php-brief.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/php.php (renamed from inc/geshi/php.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pic16.php (renamed from inc/geshi/pic16.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pike.php (renamed from inc/geshi/pike.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pixelbender.php (renamed from inc/geshi/pixelbender.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pli.php (renamed from inc/geshi/pli.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/plsql.php (renamed from inc/geshi/plsql.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/postgresql.php (renamed from inc/geshi/postgresql.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/povray.php (renamed from inc/geshi/povray.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/powerbuilder.php (renamed from inc/geshi/powerbuilder.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/powershell.php (renamed from inc/geshi/powershell.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/proftpd.php (renamed from inc/geshi/proftpd.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/progress.php (renamed from inc/geshi/progress.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/prolog.php (renamed from inc/geshi/prolog.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/properties.php (renamed from inc/geshi/properties.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/providex.php (renamed from inc/geshi/providex.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/purebasic.php (renamed from inc/geshi/purebasic.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pycon.php (renamed from inc/geshi/pycon.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/pys60.php (renamed from inc/geshi/pys60.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/python.php (renamed from inc/geshi/python.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/q.php (renamed from inc/geshi/q.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/qbasic.php (renamed from inc/geshi/qbasic.php)0
-rw-r--r--vendor/easybook/geshi/geshi/racket.php964
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/rails.php (renamed from inc/geshi/rails.php)2
-rw-r--r--vendor/easybook/geshi/geshi/rbs.php224
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/rebol.php (renamed from inc/geshi/rebol.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/reg.php (renamed from inc/geshi/reg.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/rexx.php (renamed from inc/geshi/rexx.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/robots.php (renamed from inc/geshi/robots.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/rpmspec.php (renamed from inc/geshi/rpmspec.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/rsplus.php (renamed from inc/geshi/rsplus.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/ruby.php (renamed from inc/geshi/ruby.php)0
-rw-r--r--vendor/easybook/geshi/geshi/rust.php228
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/sas.php (renamed from inc/geshi/sas.php)0
-rw-r--r--vendor/easybook/geshi/geshi/sass.php248
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/scala.php (renamed from inc/geshi/scala.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/scheme.php (renamed from inc/geshi/scheme.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/scilab.php (renamed from inc/geshi/scilab.php)0
-rw-r--r--vendor/easybook/geshi/geshi/scl.php148
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/sdlbasic.php (renamed from inc/geshi/sdlbasic.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/smalltalk.php (renamed from inc/geshi/smalltalk.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/smarty.php (renamed from inc/geshi/smarty.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/spark.php (renamed from inc/geshi/spark.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/sparql.php (renamed from inc/geshi/sparql.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/sql.php (renamed from inc/geshi/sql.php)5
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/stonescript.php (renamed from inc/geshi/stonescript.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/systemverilog.php (renamed from inc/geshi/systemverilog.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/tcl.php (renamed from inc/geshi/tcl.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/teraterm.php (renamed from inc/geshi/teraterm.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/text.php (renamed from inc/geshi/text.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/thinbasic.php (renamed from inc/geshi/thinbasic.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/tsql.php (renamed from inc/geshi/tsql.php)0
-rw-r--r--vendor/easybook/geshi/geshi/twig.php190
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/typoscript.php (renamed from inc/geshi/typoscript.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/unicon.php (renamed from inc/geshi/unicon.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/upc.php (renamed from inc/geshi/upc.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/urbi.php (renamed from inc/geshi/urbi.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/uscript.php (renamed from inc/geshi/uscript.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vala.php (renamed from inc/geshi/vala.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vb.php (renamed from inc/geshi/vb.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vbnet.php (renamed from inc/geshi/vbnet.php)0
-rw-r--r--vendor/easybook/geshi/geshi/vbscript.php153
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vedit.php (renamed from inc/geshi/vedit.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/verilog.php (renamed from inc/geshi/verilog.php)60
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vhdl.php (renamed from inc/geshi/vhdl.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/vim.php (renamed from inc/geshi/vim.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/visualfoxpro.php (renamed from inc/geshi/visualfoxpro.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/visualprolog.php (renamed from inc/geshi/visualprolog.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/whitespace.php (renamed from inc/geshi/whitespace.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/whois.php (renamed from inc/geshi/whois.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/winbatch.php (renamed from inc/geshi/winbatch.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/xbasic.php (renamed from inc/geshi/xbasic.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/xml.php (renamed from inc/geshi/xml.php)2
-rw-r--r--vendor/easybook/geshi/geshi/xojo.php166
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/xorg_conf.php (renamed from inc/geshi/xorg_conf.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/xpp.php (renamed from inc/geshi/xpp.php)2
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/yaml.php (renamed from inc/geshi/yaml.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/z80.php (renamed from inc/geshi/z80.php)0
-rwxr-xr-x[-rw-r--r--]vendor/easybook/geshi/geshi/zxbasic.php (renamed from inc/geshi/zxbasic.php)0
-rw-r--r--vendor/splitbrain/php-archive/.gitignore7
-rw-r--r--vendor/splitbrain/php-archive/LICENSE19
-rw-r--r--vendor/splitbrain/php-archive/README.md66
-rw-r--r--vendor/splitbrain/php-archive/composer.json26
-rw-r--r--vendor/splitbrain/php-archive/phpunit.xml17
-rw-r--r--vendor/splitbrain/php-archive/src/Archive.php128
-rw-r--r--vendor/splitbrain/php-archive/src/FileInfo.php342
-rw-r--r--vendor/splitbrain/php-archive/src/Tar.php635
-rw-r--r--vendor/splitbrain/php-archive/src/Zip.php750
1257 files changed, 24253 insertions, 6917 deletions
diff --git a/.editorconfig b/.editorconfig
index 9088a1657..d88e75a28 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,15 +1,19 @@
; http://editorconfig.org/
+root = true
+
[*]
indent_style = space
indent_size = 4
+end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
-[inc/{geshi,phpseclib}/**]
+[{vendor,inc/phpseclib}/**]
; Use editor default (possible autodetection).
indent_style =
indent_size =
-trim_trailing_whitespace = false
-insert_final_newline = false
+end_of_line =
+trim_trailing_whitespace =
+insert_final_newline =
diff --git a/.gitattributes b/.gitattributes
index 1012087d4..6beb1fb7a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -9,6 +9,8 @@
.gitignore export-ignore
.editorconfig export-ignore
.travis.yml export-ignore
+composer.json export-ignore
+composer.lock export-ignore
_test export-ignore
_cs export-ignore
lib/plugins/testing export-ignore
diff --git a/.gitignore b/.gitignore
index bb39ba7cf..dd5c9cf18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@
!/lib/plugins/popularity
!/lib/plugins/revert
!/lib/plugins/safefnrecode
+!/lib/plugins/styling
!/lib/plugins/testing
!/lib/plugins/usermanager
!/lib/plugins/action.php
@@ -56,3 +57,15 @@
!/lib/plugins/remote.php
!/lib/plugins/syntax.php
lib/images/*/local/*
+
+# composer default ignores
+composer.phar
+vendor/bin/*
+vendor/*/*/phpunit.xml
+vendor/*/*/.travis.yml
+vendor/*/*/bin/*
+vendor/*/*/tests/*
+vendor/*/*/test/*
+vendor/*/*/doc/*
+vendor/*/*/docs/*
+vendor/*/*/contrib/*
diff --git a/.travis.yml b/.travis.yml
index 9c3193d19..61e47522d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,13 +1,16 @@
language: php
+sudo: false
php:
- "5.6"
- "5.5"
- "5.4"
- "5.3"
-# PHP 5.6 is not yet released, allow failures
+ - "hhvm"
+ - "nightly"
matrix:
allow_failures:
- - php: "5.6"
+ - php: "hhvm"
+ - php: "nightly"
notifications:
irc:
channels:
diff --git a/README b/README
index 35de49ab1..1611a6df1 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ at http://www.dokuwiki.org/
For Installation Instructions see
http://www.dokuwiki.org/install
-DokuWiki - 2004-2014 (c) Andreas Gohr <andi@splitbrain.org>
+DokuWiki - 2004-2015 (c) Andreas Gohr <andi@splitbrain.org>
and the DokuWiki Community
See COPYING and file headers for license info
diff --git a/_cs/DokuWiki/Sniffs/PHP/DeprecatedFunctionsSniff.php b/_cs/DokuWiki/Sniffs/PHP/DeprecatedFunctionsSniff.php
index c5d14377b..c15a5be02 100644
--- a/_cs/DokuWiki/Sniffs/PHP/DeprecatedFunctionsSniff.php
+++ b/_cs/DokuWiki/Sniffs/PHP/DeprecatedFunctionsSniff.php
@@ -39,7 +39,7 @@ class DokuWiki_Sniffs_PHP_DeprecatedFunctionsSniff extends Generic_Sniffs_PHP_Fo
*
* @var array(string => string|null)
*/
- protected $forbiddenFunctions = array(
+ public $forbiddenFunctions = array(
'setCorrectLocale' => null,
'html_attbuild' => 'buildAttributes',
'io_runcmd' => null,
diff --git a/_cs/DokuWiki/Sniffs/PHP/DiscouragedFunctionsSniff.php b/_cs/DokuWiki/Sniffs/PHP/DiscouragedFunctionsSniff.php
index 9cd9a7d36..bd51b1166 100644
--- a/_cs/DokuWiki/Sniffs/PHP/DiscouragedFunctionsSniff.php
+++ b/_cs/DokuWiki/Sniffs/PHP/DiscouragedFunctionsSniff.php
@@ -39,7 +39,7 @@ class DokuWiki_Sniffs_PHP_DiscouragedFunctionsSniff extends Generic_Sniffs_PHP_F
*
* @var array(string => string|null)
*/
- protected $forbiddenFunctions = array(
+ public $forbiddenFunctions = array(
'date' => 'dformat',
'strftime' => 'dformat',
);
diff --git a/_test/core/DokuWikiTest.php b/_test/core/DokuWikiTest.php
index f4521256a..4e40d510a 100644
--- a/_test/core/DokuWikiTest.php
+++ b/_test/core/DokuWikiTest.php
@@ -54,7 +54,7 @@ abstract class DokuWikiTest extends PHPUnit_Framework_TestCase {
foreach (array('default','local','protected') as $config_group) {
if (empty($config_cascade['main'][$config_group])) continue;
foreach ($config_cascade['main'][$config_group] as $config_file) {
- if (@file_exists($config_file)) {
+ if (file_exists($config_file)) {
include($config_file);
}
}
@@ -68,7 +68,7 @@ abstract class DokuWikiTest extends PHPUnit_Framework_TestCase {
foreach (array('default','local') as $config_group) {
if (empty($config_cascade['license'][$config_group])) continue;
foreach ($config_cascade['license'][$config_group] as $config_file) {
- if(@file_exists($config_file)){
+ if(file_exists($config_file)){
include($config_file);
}
}
diff --git a/_test/core/TestRequest.php b/_test/core/TestRequest.php
index 060e37d28..dad2060e5 100644
--- a/_test/core/TestRequest.php
+++ b/_test/core/TestRequest.php
@@ -45,8 +45,6 @@ class TestRequest {
*/
public function execute($uri='/doku.php') {
global $INPUT;
- global $ID;
- global $INFO;
// save old environment
$server = $_SERVER;
diff --git a/_test/data/media/wiki/dokuwiki-128.png b/_test/data/media/wiki/dokuwiki-128.png
index b2306ac95..f3f1d66bd 100644
--- a/_test/data/media/wiki/dokuwiki-128.png
+++ b/_test/data/media/wiki/dokuwiki-128.png
Binary files differ
diff --git a/_test/data/media/wiki/kind_zu_katze.ogv b/_test/data/media/wiki/kind_zu_katze.ogv
new file mode 100644
index 000000000..1ad3732dc
--- /dev/null
+++ b/_test/data/media/wiki/kind_zu_katze.ogv
Binary files differ
diff --git a/_test/data/media/wiki/kind_zu_katze.png b/_test/data/media/wiki/kind_zu_katze.png
new file mode 100644
index 000000000..e0eee61bc
--- /dev/null
+++ b/_test/data/media/wiki/kind_zu_katze.png
Binary files differ
diff --git a/_test/data/media/wiki/kind_zu_katze.webm b/_test/data/media/wiki/kind_zu_katze.webm
new file mode 100644
index 000000000..2973ff833
--- /dev/null
+++ b/_test/data/media/wiki/kind_zu_katze.webm
Binary files differ
diff --git a/_test/phpunit.xml b/_test/phpunit.xml
index 25506b1ae..6e2509749 100644
--- a/_test/phpunit.xml
+++ b/_test/phpunit.xml
@@ -18,6 +18,12 @@
</testsuite>
</testsuites>
+ <groups>
+ <exclude>
+ <group>flaky</group>
+ </exclude>
+ </groups>
+
<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">../</directory>
diff --git a/_test/tests/inc/auth_password.test.php b/_test/tests/inc/auth_password.test.php
index 07b9f5bb2..5067e2ca1 100644
--- a/_test/tests/inc/auth_password.test.php
+++ b/_test/tests/inc/auth_password.test.php
@@ -16,9 +16,16 @@ class auth_password_test extends DokuWikiTest {
'kmd5' => 'a579299436d7969791189acadd86fcb716',
'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158',
'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678',
- 'sha512' => '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1'
+
);
+ function __construct() {
+ if(defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) {
+ // Check SHA512 only if available in this PHP
+ $this->passes['sha512'] = '$6$abcdefgh12345678$J9.zOcgx0lotwZdcz0uulA3IVQMinZvFZVjA5vapRLVAAqtay23XD4xeeUxQ3B4JvDWYFBIxVWW1tOYlHX13k1';
+ }
+ }
+
function test_cryptPassword(){
foreach($this->passes as $method => $hash){
diff --git a/_test/tests/inc/cache_use.test.php b/_test/tests/inc/cache_use.test.php
index 3ea212d50..c0c12580a 100644
--- a/_test/tests/inc/cache_use.test.php
+++ b/_test/tests/inc/cache_use.test.php
@@ -4,6 +4,8 @@
* Class cache_use_test
*
* Tests if caching can actually be used
+ *
+ * @todo tests marked as flaky until Ticket #694 has been fixed
*/
class cache_use_test extends DokuWikiTest {
/** @var cache_renderer $cache */
@@ -28,18 +30,11 @@ class cache_use_test extends DokuWikiTest {
touch($this->cache->cache, $time);
}
- function test_use() {
- $this->markTestSkipped('Disabled until Ticket #694 has been fixed');
- return;
-
- $this->assertTrue($this->cache->useCache());
- }
-
/**
* In all the following tests the cache should not be usable
* as such, they are meaningless if test_use didn't pass.
*
- * @depends test_use
+ * @group flaky
*/
function test_purge() {
/* @var Input $INPUT */
@@ -51,7 +46,7 @@ class cache_use_test extends DokuWikiTest {
}
/**
- * @depends test_use
+ * @group flaky
*/
function test_filedependency() {
// give the dependent src file the same mtime as the cache
@@ -60,7 +55,7 @@ class cache_use_test extends DokuWikiTest {
}
/**
- * @depends test_use
+ * @group flaky
*/
function test_age() {
// need to age both our source file & the cache
@@ -74,7 +69,7 @@ class cache_use_test extends DokuWikiTest {
}
/**
- * @depends test_use
+ * @group flaky
*/
function test_confnocaching() {
global $conf;
@@ -83,4 +78,4 @@ class cache_use_test extends DokuWikiTest {
$this->assertFalse($this->cache->useCache());
$this->assertNotEmpty($this->cache->_nocache);
}
-} \ No newline at end of file
+}
diff --git a/_test/tests/inc/form/checkableelement.test.php b/_test/tests/inc/form/checkableelement.test.php
new file mode 100644
index 000000000..a0e4173e8
--- /dev/null
+++ b/_test/tests/inc/form/checkableelement.test.php
@@ -0,0 +1,49 @@
+<?php
+
+use dokuwiki\Form;
+
+class form_checkableelement_test extends DokuWikiTest {
+
+ function test_defaults() {
+ $form = new Form\Form();
+ $form->addRadioButton('foo', 'label text first')->val('first')->attr('checked', 'checked');
+ $form->addRadioButton('foo', 'label text second')->val('second');
+
+ $html = $form->toHTML();
+ $pq = phpQuery::newDocumentXHTML($html);
+
+ $input = $pq->find('input[name=foo]');
+ $this->assertTrue($input->length == 2);
+
+ $label = $pq->find('label');
+ $this->assertTrue($label->length == 2);
+
+ $inputs = $pq->find('input[name=foo]');
+ $this->assertEquals('first', pq($inputs->elements[0])->val());
+ $this->assertEquals('second', pq($inputs->elements[1])->val());
+ $this->assertEquals('checked', pq($inputs->elements[0])->attr('checked'));
+ $this->assertEquals('', pq($inputs->elements[1])->attr('checked'));
+ }
+
+ /**
+ * check that posted values overwrite preset default
+ */
+ function test_prefill() {
+ global $INPUT;
+ $INPUT->post->set('foo', 'second');
+
+
+ $form = new Form\Form();
+ $form->addRadioButton('foo', 'label text first')->val('first')->attr('checked', 'checked');
+ $form->addRadioButton('foo', 'label text second')->val('second');
+
+ $html = $form->toHTML();
+ $pq = phpQuery::newDocumentXHTML($html);
+
+ $inputs = $pq->find('input[name=foo]');
+ $this->assertEquals('first', pq($inputs->elements[0])->val());
+ $this->assertEquals('second', pq($inputs->elements[1])->val());
+ $this->assertEquals('', pq($inputs->elements[0])->attr('checked'));
+ $this->assertEquals('checked', pq($inputs->elements[1])->attr('checked'));
+ }
+}
diff --git a/_test/tests/inc/form/form.test.php b/_test/tests/inc/form/form.test.php
new file mode 100644
index 000000000..3ae832b2c
--- /dev/null
+++ b/_test/tests/inc/form/form.test.php
@@ -0,0 +1,115 @@
+<?php
+
+use dokuwiki\Form;
+
+/**
+ * makes form internals accessible for testing
+ */
+class TestForm extends Form\Form {
+ /**
+ * @return array list of element types
+ */
+ function getElementTypeList() {
+ $list = array();
+ foreach($this->elements as $element) $list[] = $element->getType();
+ return $list;
+ }
+
+ public function balanceFieldsets() {
+ parent::balanceFieldsets();
+ }
+
+}
+
+class form_form_test extends DokuWikiTest {
+
+ /**
+ * checks that an empty form is initialized correctly
+ */
+ function test_defaults() {
+ global $INPUT;
+ global $ID;
+ $ID = 'some:test';
+ $INPUT->get->set('id', $ID);
+ $INPUT->get->set('foo', 'bar');
+
+ $form = new Form\Form();
+ $html = $form->toHTML();
+ $pq = phpQuery::newDocumentXHTML($html);
+
+ $this->assertTrue($pq->find('form')->hasClass('doku_form'));
+ $this->assertEquals(wl($ID, array('foo' => 'bar'), false, '&'), $pq->find('form')->attr('action'));
+ $this->assertEquals('post', $pq->find('form')->attr('method'));
+
+ $this->assertTrue($pq->find('input[name=sectok]')->length == 1);
+ }
+
+
+ function test_fieldsetbalance() {
+ $form = new TestForm();
+ $form->addFieldsetOpen();
+ $form->addHTML('ignored');
+ $form->addFieldsetClose();
+ $form->balanceFieldsets();
+
+ $this->assertEquals(
+ array(
+ 'fieldsetopen',
+ 'html',
+ 'fieldsetclose'
+ ),
+ $form->getElementTypeList()
+ );
+
+ $form = new TestForm();
+ $form->addHTML('ignored');
+ $form->addFieldsetClose();
+ $form->balanceFieldsets();
+
+ $this->assertEquals(
+ array(
+ 'fieldsetopen',
+ 'html',
+ 'fieldsetclose'
+ ),
+ $form->getElementTypeList()
+ );
+
+
+ $form = new TestForm();
+ $form->addFieldsetOpen();
+ $form->addHTML('ignored');
+ $form->balanceFieldsets();
+
+ $this->assertEquals(
+ array(
+ 'fieldsetopen',
+ 'html',
+ 'fieldsetclose'
+ ),
+ $form->getElementTypeList()
+ );
+
+ $form = new TestForm();
+ $form->addHTML('ignored');
+ $form->addFieldsetClose();
+ $form->addHTML('ignored');
+ $form->addFieldsetOpen();
+ $form->addHTML('ignored');
+ $form->balanceFieldsets();
+
+ $this->assertEquals(
+ array(
+ 'fieldsetopen',
+ 'html',
+ 'fieldsetclose',
+ 'html',
+ 'fieldsetopen',
+ 'html',
+ 'fieldsetclose'
+ ),
+ $form->getElementTypeList()
+ );
+ }
+
+}
diff --git a/_test/tests/inc/form/inputelement.test.php b/_test/tests/inc/form/inputelement.test.php
new file mode 100644
index 000000000..7a5e6d2ea
--- /dev/null
+++ b/_test/tests/inc/form/inputelement.test.php
@@ -0,0 +1,41 @@
+<?php
+
+use dokuwiki\Form;
+
+class form_inputelement_test extends DokuWikiTest {
+
+ function test_defaults() {
+ $form = new Form\Form();
+ $form->addTextInput('foo', 'label text')->val('this is text');
+
+ $html = $form->toHTML();
+ $pq = phpQuery::newDocumentXHTML($html);
+
+ $input = $pq->find('input[name=foo]');
+ $this->assertTrue($input->length == 1);
+ $this->assertEquals('this is text', $input->val());
+
+ $label = $pq->find('label');
+ $this->assertTrue($label->length == 1);
+ $this->assertEquals('label text', $label->find('span')->text());
+ }
+
+ /**
+ * check that posted values overwrite preset default
+ */
+ function test_prefill() {
+ global $INPUT;
+ $INPUT->post->set('foo', 'a new text');
+
+ $form = new Form\Form();
+ $form->addTextInput('foo', 'label text')->val('this is text');
+
+ $html = $form->toHTML();
+ $pq = phpQuery::newDocumentXHTML($html);
+
+ $input = $pq->find('input[name=foo]');
+ $this->assertTrue($input->length == 1);
+ $this->assertEquals('a new text', $input->val());
+ }
+
+}
diff --git a/_test/tests/inc/form_form.test.php b/_test/tests/inc/form_form.test.php
index 02242a807..7f168b895 100644
--- a/_test/tests/inc/form_form.test.php
+++ b/_test/tests/inc/form_form.test.php
@@ -30,9 +30,9 @@ class form_test extends DokuWikiTest {
$realoutput .= '<input type="checkbox" id="check__id" name="r" value="1" /> ';
$realoutput .= '<span>Check</span></label>';
$realoutput .= "\n";
- $realoutput .= '<input name="do[save]" type="submit" value="Save" class="button" accesskey="s" title="Save [S]" />';
+ $realoutput .= '<button name="do[save]" type="submit" accesskey="s" title="Save [S]">Save</button>';
$realoutput .= "\n";
- $realoutput .= '<input name="do[cancel]" type="submit" value="Cancel" class="button" />';
+ $realoutput .= '<button name="do[cancel]" type="submit">Cancel</button>';
$realoutput .= "\n";
$realoutput .= "</fieldset>\n</div></form>\n";
return $realoutput;
diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php
index 3446e1184..94b8e1bc1 100644
--- a/_test/tests/inc/httpclient_http.test.php
+++ b/_test/tests/inc/httpclient_http.test.php
@@ -289,6 +289,7 @@ class httpclient_http_test extends DokuWikiTest {
* This address caused trouble with stream_select()
*
* @group internet
+ * @group flaky
*/
function test_wikimatrix(){
$http = new HTTPMockClient();
diff --git a/_test/tests/inc/httpclient_http_proxy.test.php b/_test/tests/inc/httpclient_http_proxy.test.php
index c44dc7ed7..dae801dbd 100644
--- a/_test/tests/inc/httpclient_http_proxy.test.php
+++ b/_test/tests/inc/httpclient_http_proxy.test.php
@@ -3,7 +3,7 @@
require_once (__DIR__ . '/httpclient_mock.php');
class httpclient_http_proxy_test extends DokuWikiTest {
- protected $url = 'http://test.dokuwiki.org/README';
+ protected $url = 'http://httpbin.org/user-agent';
/**
* @group internet
@@ -15,7 +15,7 @@ class httpclient_http_proxy_test extends DokuWikiTest {
$http->proxy_port = 8080;
$data = $http->get($this->url);
- $this->assertFalse($data === false, 'HTTP response '.$http->error);
+ $this->assertFalse($data === false, 'HTTP response: '.$http->error.' ['.$this->url.']');
$this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content');
}
} \ No newline at end of file
diff --git a/_test/tests/inc/httpclient_https_proxy.test.php b/_test/tests/inc/httpclient_https_proxy.test.php
index 9402e91af..cf5b9a8b9 100644
--- a/_test/tests/inc/httpclient_https_proxy.test.php
+++ b/_test/tests/inc/httpclient_https_proxy.test.php
@@ -2,7 +2,7 @@
require_once dirname(__FILE__).'/httpclient_http_proxy.test.php';
class httpclient_https_proxy_test extends httpclient_http_proxy_test {
- protected $url = 'https://www.dokuwiki.org/README';
+ protected $url = 'https://httpbin.org/user-agent';
public function setUp(){
// skip tests when this PHP has no SSL support
@@ -27,4 +27,4 @@ class httpclient_https_proxy_test extends httpclient_http_proxy_test {
$this->assertFalse($data);
$this->assertEquals(-150, $http->status);
}
-} \ No newline at end of file
+}
diff --git a/_test/tests/inc/io_deletefromfile.test.php b/_test/tests/inc/io_deletefromfile.test.php
new file mode 100644
index 000000000..e86150aac
--- /dev/null
+++ b/_test/tests/inc/io_deletefromfile.test.php
@@ -0,0 +1,15 @@
+<?php
+
+class io_deletefromfile_test extends DokuWikiTest {
+
+ function test_delete(){
+ $file = TMP_DIR.'/test.txt';
+ $contents = "The\012Delete\012Delete01\012Delete02\012Delete\012DeleteX\012Test\012";
+ io_saveFile($file, $contents);
+ $this->assertTrue(io_deleteFromFile($file, "Delete\012"));
+ $this->assertEquals("The\012Delete01\012Delete02\012DeleteX\012Test\012", io_readFile($file));
+ $this->assertTrue(io_deleteFromFile($file, "#Delete\\d+\012#", true));
+ $this->assertEquals("The\012DeleteX\012Test\012", io_readFile($file));
+ }
+
+}
diff --git a/_test/tests/inc/io_readfile.test.php b/_test/tests/inc/io_readfile.test.php
new file mode 100644
index 000000000..700c1902b
--- /dev/null
+++ b/_test/tests/inc/io_readfile.test.php
@@ -0,0 +1,58 @@
+<?php
+
+class io_readfile_test extends DokuWikiTest {
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_zlib() {
+ if (!extension_loaded('zlib')) {
+ $this->markTestSkipped('skipping all zlib tests. Need zlib extension');
+ }
+ }
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_bz2() {
+ if (!extension_loaded('bz2')) {
+ $this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension');
+ }
+ }
+
+ function test_plain(){
+ // since git converts line endings, we can't check in this test file but have to create it ourselves
+ $plain = TMP_DIR.'/test.txt';
+ file_put_contents($plain, "The\015\012Test\015\012");
+
+ $this->assertEquals("The\012Test\012", io_readFile($plain));
+ $this->assertEquals("The\015\012Test\015\012", io_readFile($plain, false));
+ $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt'));
+ }
+
+ /**
+ * @depends test_ext_zlib
+ */
+ function test_gzfiles(){
+ $this->assertEquals("The\012Test\012", io_readFile(__DIR__.'/io_readfile/test.txt.gz'));
+ $this->assertEquals("The\015\012Test\015\012", io_readFile(__DIR__.'/io_readfile/test.txt.gz', false));
+ $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt.gz'));
+ $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/corrupt.txt.gz'));
+ }
+
+ /**
+ * @depends test_ext_bz2
+ */
+ function test_bzfiles(){
+ $this->assertEquals("The\012Test\012", io_readFile(__DIR__.'/io_readfile/test.txt.bz2'));
+ $this->assertEquals("The\015\012Test\015\012", io_readFile(__DIR__.'/io_readfile/test.txt.bz2', false));
+ $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt.bz2'));
+ $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/corrupt.txt.bz2'));
+ // internal bzfile function
+ $this->assertEquals(array("The\015\012","Test\015\012"), bzfile(__DIR__.'/io_readfile/test.txt.bz2', true));
+ $this->assertEquals(array_fill(0, 120, str_repeat('a', 80)."\012"), bzfile(__DIR__.'/io_readfile/large.txt.bz2', true));
+ $line = str_repeat('a', 8888)."\012";
+ $this->assertEquals(array($line,"\012",$line,"!"), bzfile(__DIR__.'/io_readfile/long.txt.bz2', true));
+ }
+
+}
diff --git a/_test/tests/inc/io_readfile/corrupt.txt.bz2 b/_test/tests/inc/io_readfile/corrupt.txt.bz2
new file mode 100644
index 000000000..97f742919
--- /dev/null
+++ b/_test/tests/inc/io_readfile/corrupt.txt.bz2
@@ -0,0 +1 @@
+BZh91AY&SYXHd \ No newline at end of file
diff --git a/_test/tests/inc/io_readfile/corrupt.txt.gz b/_test/tests/inc/io_readfile/corrupt.txt.gz
new file mode 100644
index 000000000..9d7666f47
--- /dev/null
+++ b/_test/tests/inc/io_readfile/corrupt.txt.gz
Binary files differ
diff --git a/_test/tests/inc/io_readfile/large.txt.bz2 b/_test/tests/inc/io_readfile/large.txt.bz2
new file mode 100644
index 000000000..3135435f8
--- /dev/null
+++ b/_test/tests/inc/io_readfile/large.txt.bz2
Binary files differ
diff --git a/_test/tests/inc/io_readfile/long.txt.bz2 b/_test/tests/inc/io_readfile/long.txt.bz2
new file mode 100644
index 000000000..fb40759e6
--- /dev/null
+++ b/_test/tests/inc/io_readfile/long.txt.bz2
Binary files differ
diff --git a/_test/tests/inc/io_readfile/test.txt.bz2 b/_test/tests/inc/io_readfile/test.txt.bz2
new file mode 100644
index 000000000..3d4e1b226
--- /dev/null
+++ b/_test/tests/inc/io_readfile/test.txt.bz2
Binary files differ
diff --git a/_test/tests/inc/io_readfile/test.txt.gz b/_test/tests/inc/io_readfile/test.txt.gz
new file mode 100644
index 000000000..8ac8f7d40
--- /dev/null
+++ b/_test/tests/inc/io_readfile/test.txt.gz
Binary files differ
diff --git a/_test/tests/inc/io_replaceinfile.test.php b/_test/tests/inc/io_replaceinfile.test.php
new file mode 100644
index 000000000..452ed7401
--- /dev/null
+++ b/_test/tests/inc/io_replaceinfile.test.php
@@ -0,0 +1,108 @@
+<?php
+
+class io_replaceinfile_test extends DokuWikiTest {
+
+ protected $contents = "The\012Delete\012Delete\012Delete01\012Delete02\012Delete\012DeleteX\012Test\012";
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_zlib() {
+ if (!extension_loaded('zlib')) {
+ $this->markTestSkipped('skipping all zlib tests. Need zlib extension');
+ }
+ }
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_bz2() {
+ if (!extension_loaded('bz2')) {
+ $this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension');
+ }
+ }
+
+ function _write($file){
+
+ io_saveFile($file, $this->contents);
+ // Replace one, no regex
+ $this->assertTrue(io_replaceInFile($file, "Delete\012", "Delete00\012", false, 1));
+ $this->assertEquals("The\012Delete00\012Delete\012Delete01\012Delete02\012Delete\012DeleteX\012Test\012", io_readFile($file));
+ // Replace all, no regex
+ $this->assertTrue(io_replaceInFile($file, "Delete\012", "DeleteX\012", false, -1));
+ $this->assertEquals("The\012Delete00\012DeleteX\012Delete01\012Delete02\012DeleteX\012DeleteX\012Test\012", io_readFile($file));
+ // Replace two, regex and backreference
+ $this->assertTrue(io_replaceInFile($file, "#Delete(\\d+)\012#", "\\1\012", true, 2));
+ $this->assertEquals("The\01200\012DeleteX\01201\012Delete02\012DeleteX\012DeleteX\012Test\012", io_readFile($file));
+ // Delete and insert, no regex
+ $this->assertTrue(io_replaceInFile($file, "DeleteX\012", "Replace\012", false, 0));
+ $this->assertEquals("The\01200\01201\012Delete02\012Test\012Replace\012", io_readFile($file));
+ }
+
+ function test_replace(){
+ $this->_write(TMP_DIR.'/test.txt');
+ }
+
+
+ /**
+ * @depends test_ext_zlib
+ */
+ function test_gzwrite(){
+ $this->_write(TMP_DIR.'/test.txt.gz');
+ }
+
+ /**
+ * @depends test_ext_bz2
+ */
+ function test_bzwrite(){
+ $this->_write(TMP_DIR.'/test.txt.bz2');
+ }
+
+ /**
+ * Test for a non-regex replacement where $newline contains a backreference like construct - it shouldn't affect the replacement
+ */
+ function test_edgecase1()
+ {
+ $file = TMP_DIR . '/test.txt';
+
+ io_saveFile($file, $this->contents);
+ $this->assertTrue(io_replaceInFile($file, "Delete\012", "Delete\\00\012", false, -1));
+ $this->assertEquals("The\012Delete\\00\012Delete\\00\012Delete01\012Delete02\012Delete\\00\012DeleteX\012Test\012", io_readFile($file), "Edge case: backreference like construct in replacement line");
+ }
+ /**
+ * Test with replace all where replacement line == search line - must not timeout
+ *
+ * @small
+ */
+ function test_edgecase2() {
+ $file = TMP_DIR.'/test.txt';
+
+ io_saveFile($file, $this->contents);
+ $this->assertTrue(io_replaceInFile($file, "Delete\012", "Delete\012", false, -1));
+ $this->assertEquals("The\012Delete\012Delete\012Delete01\012Delete02\012Delete\012DeleteX\012Test\012", io_readFile($file), "Edge case: new line the same as old line");
+ }
+
+ /**
+ * Test where $oldline exactly matches one line and also matches part of other lines - only the exact match should be replaced
+ */
+ function test_edgecase3()
+ {
+ $file = TMP_DIR . '/test.txt';
+ $contents = "The\012Delete\01201Delete\01202Delete\012Test\012";
+
+ io_saveFile($file, $contents);
+ $this->assertTrue(io_replaceInFile($file, "Delete\012", "Replace\012", false, -1));
+ $this->assertEquals("The\012Replace\01201Delete\01202Delete\012Test\012", io_readFile($file), "Edge case: old line is a match for parts of other lines");
+ }
+
+ /**
+ * Test passing an invalid parameter.
+ *
+ * @expectedException PHPUnit_Framework_Error_Warning
+ */
+ function test_badparam()
+ {
+ /* The empty $oldline parameter should be caught before the file doesn't exist test. */
+ $this->assertFalse(io_replaceInFile(TMP_DIR.'/not_existing_file.txt', '', '', false, 0));
+ }
+}
diff --git a/_test/tests/inc/io_savefile.test.php b/_test/tests/inc/io_savefile.test.php
new file mode 100644
index 000000000..4a4d4671d
--- /dev/null
+++ b/_test/tests/inc/io_savefile.test.php
@@ -0,0 +1,49 @@
+<?php
+
+class io_savefile_test extends DokuWikiTest {
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_zlib() {
+ if (!extension_loaded('zlib')) {
+ $this->markTestSkipped('skipping all zlib tests. Need zlib extension');
+ }
+ }
+
+ /*
+ * dependency for tests needing zlib extension to pass
+ */
+ public function test_ext_bz2() {
+ if (!extension_loaded('bz2')) {
+ $this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension');
+ }
+ }
+
+ function _write($file){
+ $contents = "The\012Write\012Test\012";
+ $this->assertTrue(io_saveFile($file, $contents));
+ $this->assertEquals($contents, io_readFile($file));
+ $this->assertTrue(io_saveFile($file, $contents, true));
+ $this->assertEquals($contents.$contents, io_readFile($file));
+ }
+
+ function test_write(){
+ $this->_write(TMP_DIR.'/test.txt');
+ }
+
+ /**
+ * @depends test_ext_zlib
+ */
+ function test_gzwrite(){
+ $this->_write(TMP_DIR.'/test.txt.gz');
+ }
+
+ /**
+ * @depends test_ext_bz2
+ */
+ function test_bzwrite(){
+ $this->_write(TMP_DIR.'/test.txt.bz2');
+ }
+
+}
diff --git a/_test/tests/inc/ixr_library_date.test.php b/_test/tests/inc/ixr_library_date.test.php
index f38486925..0c81e6741 100644
--- a/_test/tests/inc/ixr_library_date.test.php
+++ b/_test/tests/inc/ixr_library_date.test.php
@@ -2,6 +2,9 @@
require_once DOKU_INC.'inc/IXR_Library.php';
+/**
+ * Class ixr_library_date_test
+ */
class ixr_library_date_test extends DokuWikiTest {
@@ -16,18 +19,24 @@ class ixr_library_date_test extends DokuWikiTest {
array('2010-08-17T09:23:14Z', 1282036994),
array('20100817T09:23:14Z', 1282036994),
+ // with timezone
+ array('2010-08-17 09:23:14+0000', 1282036994),
+ array('2010-08-17 09:23:14+00:00', 1282036994),
+ array('2010-08-17 12:23:14+03:00', 1282036994),
+
// no seconds
array('2010-08-17T09:23', 1282036980),
array('20100817T09:23', 1282036980),
// no time
array('2010-08-17', 1282003200),
- //array('20100817', 1282003200), #this will NOT be parsed, but is assumed to be timestamp
+ array(1282036980, 1282036980),
+// array('20100817', 1282003200), #this will NOT be parsed, but is assumed to be timestamp
);
foreach($tests as $test){
$dt = new IXR_Date($test[0]);
- $this->assertEquals($dt->getTimeStamp(),$test[1]);
+ $this->assertEquals($test[1], $dt->getTimeStamp());
}
}
diff --git a/_test/tests/inc/parser/lexer.test.php b/_test/tests/inc/parser/lexer.test.php
index d0965a13e..c50665928 100644
--- a/_test/tests/inc/parser/lexer.test.php
+++ b/_test/tests/inc/parser/lexer.test.php
@@ -146,7 +146,7 @@ class TestOfLexerStateStack extends DokuWikiTest {
}
class TestParser {
- function TestParser() {
+ function __construct() {
}
function accept() {
}
@@ -364,7 +364,7 @@ class TestOfLexerHandlers extends DokuWikiTest {
class TestParserByteIndex {
- function TestParserByteIndex() {}
+ function __construct() {}
function ignore() {}
diff --git a/_test/tests/inc/parser/parser_footnote.test.php b/_test/tests/inc/parser/parser_footnote.test.php
index b47a575de..2457fb031 100644
--- a/_test/tests/inc/parser/parser_footnote.test.php
+++ b/_test/tests/inc/parser/parser_footnote.test.php
@@ -303,7 +303,7 @@ class TestOfDoku_Parser_Footnote extends TestOfDoku_Parser {
array('nest', array ( array (
array('footnote_open',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
diff --git a/_test/tests/inc/parser/parser_lists.test.php b/_test/tests/inc/parser/parser_lists.test.php
index e4ef1f83e..6acaff637 100644
--- a/_test/tests/inc/parser/parser_lists.test.php
+++ b/_test/tests/inc/parser/parser_lists.test.php
@@ -13,7 +13,7 @@ class TestOfDoku_Parser_Lists extends TestOfDoku_Parser {
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -46,7 +46,7 @@ class TestOfDoku_Parser_Lists extends TestOfDoku_Parser {
$calls = array (
array('document_start',array()),
array('listo_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -80,7 +80,7 @@ class TestOfDoku_Parser_Lists extends TestOfDoku_Parser {
$calls = array (
array('document_start',array()),
array('listo_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -109,7 +109,7 @@ class TestOfDoku_Parser_Lists extends TestOfDoku_Parser {
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -138,7 +138,7 @@ class TestOfDoku_Parser_Lists extends TestOfDoku_Parser {
$calls = array (
array('document_start',array()),
array('listo_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -188,7 +188,7 @@ Bar');
array('cdata',array("Foo")),
array('p_close',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('listcontent_close',array()),
@@ -227,7 +227,7 @@ Bar');
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('strong_open',array()),
array('cdata',array("A")),
@@ -262,7 +262,7 @@ Bar');
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('unformatted',array("A")),
array('listcontent_close',array()),
@@ -291,7 +291,7 @@ Bar');
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('cdata',array("A")),
array('linebreak',array()),
@@ -355,7 +355,7 @@ Bar');
$calls = array (
array('document_start',array()),
array('listu_open',array()),
- array('listitem_open',array(1)),
+ array('listitem_open',array(1,Doku_Handler_List::NODE)),
array('listcontent_open',array()),
array('nest', array( array(
array('footnote_open',array()),
diff --git a/_test/tests/inc/parser/parser_media.test.php b/_test/tests/inc/parser/parser_media.test.php
new file mode 100644
index 000000000..d9a0626f5
--- /dev/null
+++ b/_test/tests/inc/parser/parser_media.test.php
@@ -0,0 +1,103 @@
+<?php
+require_once 'parser.inc.php';
+
+/**
+ * Tests for the implementation of audio and video files
+ *
+ * @author Michael Große <grosse@cosmocode.de>
+*/
+class TestOfDoku_Parser_Media extends TestOfDoku_Parser {
+
+ function testVideoOGVExternal() {
+ $file = 'http://some.where.far/away.ogv';
+ $parser_response = p_get_instructions('{{' . $file . '}}');
+
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('externalmedia',array($file,null,null,null,null,'cache','details')),
+ array('cdata',array(null)),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEquals(array_map('stripbyteindex',$parser_response),$calls);
+
+ $Renderer = new Doku_Renderer_xhtml();
+ $url = $Renderer->externalmedia($file,null,null,null,null,'cache','details',true);
+ //print_r("url: " . $url);
+ $video = '<video class="media" width="320" height="240" controls="controls">';
+ $this->assertEquals(substr($url,0,66),$video);
+ $source = '<source src="http://some.where.far/away.ogv" type="video/ogg" />';
+ $this->assertEquals(substr($url,67,64),$source);
+ // work around random token
+ $a_first_part = '<a href="/./lib/exe/fetch.php?cache=&amp;tok=';
+ $a_second_part = '&amp;media=http%3A%2F%2Fsome.where.far%2Faway.ogv" class="media mediafile mf_ogv" title="http://some.where.far/away.ogv">';
+ $this->assertEquals(substr($url,132,45),$a_first_part);
+ $this->assertEquals(substr($url,183,121),$a_second_part);
+ $rest = 'away.ogv</a></video>'."\n";
+ $this->assertEquals(substr($url,304),$rest);
+ }
+
+ /**
+ * unknown extension of external media file
+ */
+ function testVideoVIDExternal() {
+ $file = 'http://some.where.far/away.vid';
+ $parser_response = p_get_instructions('{{' . $file . '}}');
+
+ $calls = array(
+ array('document_start', array()),
+ array('p_open', array()),
+ array('externalmedia', array($file, null, null, null, null, 'cache', 'details')),
+ array('cdata', array(null)),
+ array('p_close', array()),
+ array('document_end', array()),
+ );
+ $this->assertEquals(array_map('stripbyteindex', $parser_response), $calls);
+
+ $Renderer = new Doku_Renderer_xhtml();
+ $url = $Renderer->externalmedia($file, null, null, null, null, 'cache', 'details', true);
+ // work around random token
+ $a_first_part = '<a href="/./lib/exe/fetch.php?tok=';
+ $a_second_part = '&amp;media=http%3A%2F%2Fsome.where.far%2Faway.vid" class="media mediafile mf_vid" title="http://some.where.far/away.vid">';
+ $this->assertEquals(substr($url,0,34),$a_first_part);
+ $this->assertEquals(substr($url,40,121),$a_second_part);
+ $rest = 'away.vid</a>';
+ $this->assertEquals(substr($url,161),$rest);
+ }
+
+
+ function testVideoOGVInternal() {
+ $file = 'wiki:kind_zu_katze.ogv';
+ $parser_response = p_get_instructions('{{' . $file . '}}');
+
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('internalmedia',array($file,null,null,null,null,'cache','details')),
+ array('cdata',array(null)),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEquals(array_map('stripbyteindex',$parser_response),$calls);
+
+ $Renderer = new Doku_Renderer_xhtml();
+ $url = $Renderer->externalmedia($file,null,null,null,null,'cache','details',true);
+
+ $video = '<video class="media" width="320" height="240" controls="controls" poster="/./lib/exe/fetch.php?media=wiki:kind_zu_katze.png">';
+ $this->assertEquals(substr($url,0,125),$video);
+
+ $source_webm = '<source src="/./lib/exe/fetch.php?media=wiki:kind_zu_katze.webm" type="video/webm" />';
+ $this->assertEquals(substr($url,126,85),$source_webm);
+ $source_ogv = '<source src="/./lib/exe/fetch.php?media=wiki:kind_zu_katze.ogv" type="video/ogg" />';
+ $this->assertEquals(substr($url,212,83),$source_ogv);
+
+ $a_webm = '<a href="/./lib/exe/fetch.php?id=&amp;cache=&amp;media=wiki:kind_zu_katze.webm" class="media mediafile mf_webm" title="wiki:kind_zu_katze.webm (99.1 KB)">kind_zu_katze.webm</a>';
+ $a_ogv = '<a href="/./lib/exe/fetch.php?id=&amp;cache=&amp;media=wiki:kind_zu_katze.ogv" class="media mediafile mf_ogv" title="wiki:kind_zu_katze.ogv (44.8 KB)">kind_zu_katze.ogv</a>';
+ $this->assertEquals(substr($url,296,176),$a_webm);
+ $this->assertEquals(substr($url,472,172),$a_ogv);
+
+ $rest = '</video>'."\n";
+ $this->assertEquals(substr($url,644),$rest);
+ }
+}
diff --git a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
index dd1ed1d3f..772001b99 100644
--- a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
+++ b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
@@ -14,21 +14,23 @@ class Test_resolveInterwiki extends DokuWikiTest {
$Renderer->interwiki['withslash'] = '/test';
$Renderer->interwiki['onlytext'] = ':onlytext{NAME}'; //with {URL} double urlencoded
$Renderer->interwiki['withquery'] = ':anyns:{NAME}?do=edit';
+ //this was the only link with host/port/path/query. Keep it here for regression
+ $Renderer->interwiki['coral'] = 'http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}';
$tests = array(
// shortcut, reference and expected
- array('wp', 'foo @+%/#txt', 'http://en.wikipedia.org/wiki/foo @+%/#txt'),
- array('amazon', 'foo @+%/#txt', 'http://www.amazon.com/exec/obidos/ASIN/foo%20%40%2B%25%2F/splitbrain-20/#txt'),
- array('doku', 'foo @+%/#txt', 'http://www.dokuwiki.org/foo%20%40%2B%25%2F#txt'),
- array('coral', 'http://example.com:83/path/naar/?query=foo%20%40%2B%25%2F', 'http://example.com.83.nyud.net:8090/path/naar/?query=foo%20%40%2B%25%2F'),
+ array('wp', 'foo [\\]^`{|}~@+#%?/#txt', 'https://en.wikipedia.org/wiki/foo %5B%5C%5D%5E%60%7B%7C%7D~@+%23%25?/#txt'),
+ array('amazon', 'foo [\\]^`{|}~@+#%?/#txt', 'https://www.amazon.com/exec/obidos/ASIN/foo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F/splitbrain-20/#txt'),
+ array('doku', 'foo [\\]^`{|}~@+#%?/#txt', 'https://www.dokuwiki.org/foo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F#txt'),
+ array('coral', 'http://example.com:83/path/naar/?query=foo%20%40%2B%25%3F%2F', 'http://example.com.83.nyud.net:8090/path/naar/?query=foo%20%40%2B%25%3F%2F'),
array('scheme', 'ftp://foo @+%/#txt', 'ftp://example.com#txt'),
//relative url
- array('withslash', 'foo @+%/#txt', '/testfoo%20%40%2B%25%2F#txt'),
- array('skype', 'foo @+%/#txt', 'skype:foo @+%/#txt'),
+ array('withslash', 'foo [\\]^`{|}~@+#%?/#txt', '/testfoo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F#txt'),
+ array('skype', 'foo [\\]^`{|}~@+#%?/#txt', 'skype:foo %5B%5C%5D%5E%60%7B%7C%7D~@+%23%25?/#txt'),
//dokuwiki id's
- array('onlytext', 'foo @+%#txt', DOKU_BASE.'doku.php?id=onlytextfoo#txt'),
- array('user', 'foo @+%#txt', DOKU_BASE.'doku.php?id=user:foo#txt'),
- array('withquery', 'foo @+%#txt', DOKU_BASE.'doku.php?id=anyns:foo&amp;do=edit#txt')
+ array('onlytext', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=onlytextfoo#txt'),
+ array('user', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=user:foo#txt'),
+ array('withquery', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=anyns:foo&amp;do=edit#txt')
);
foreach($tests as $test) {
@@ -45,7 +47,7 @@ class Test_resolveInterwiki extends DokuWikiTest {
$shortcut = 'nonexisting';
$reference = 'foo @+%/';
$url = $Renderer->_resolveInterWiki($shortcut, $reference);
- $expected = 'http://www.google.com/search?q=foo%20%40%2B%25%2F&amp;btnI=lucky';
+ $expected = 'https://www.google.com/search?q=foo%20%40%2B%25%2F&amp;btnI=lucky';
$this->assertEquals($expected, $url);
}
diff --git a/_test/tests/inc/remote.test.php b/_test/tests/inc/remote.test.php
index d0d4eb7ce..037b1dc0b 100644
--- a/_test/tests/inc/remote.test.php
+++ b/_test/tests/inc/remote.test.php
@@ -160,10 +160,16 @@ class remote_test extends DokuWikiTest {
$this->assertTrue($this->remote->hasAccess());
}
+ /**
+ * @expectedException RemoteAccessDeniedException
+ */
function test_hasAccessFail() {
global $conf;
$conf['remote'] = 0;
- $this->assertFalse($this->remote->hasAccess());
+ // the hasAccess() should throw a Exception to keep the same semantics with xmlrpc.php.
+ // because the user(xmlrpc) check remote before .--> (!$conf['remote']) die('XML-RPC server not enabled.');
+ // so it must be a Exception when get here.
+ $this->remote->hasAccess();
}
function test_hasAccessFailAcl() {
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php
deleted file mode 100644
index 15453b16d..000000000
--- a/_test/tests/inc/tar.test.php
+++ /dev/null
@@ -1,454 +0,0 @@
-<?php
-
-class Tar_TestCase extends DokuWikiTest {
- /**
- * file extensions that several tests use
- */
- protected $extensions = array('tar');
-
- public function setUp() {
- parent::setUp();
- if (extension_loaded('zlib')) {
- $this->extensions[] = 'tgz';
- }
- if (extension_loaded('bz2')) {
- $this->extensions[] = 'tbz';
- }
- }
-
- /*
- * dependency for tests needing zlib extension to pass
- */
- public function test_ext_zlib() {
- if (!extension_loaded('zlib')) {
- $this->markTestSkipped('skipping all zlib tests. Need zlib extension');
- }
- }
-
- /*
- * dependency for tests needing zlib extension to pass
- */
- public function test_ext_bz2() {
- if (!extension_loaded('bz2')) {
- $this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension');
- }
- }
-
- /**
- * simple test that checks that the given filenames and contents can be grepped from
- * the uncompressed tar stream
- *
- * No check for format correctness
- */
- public function test_createdynamic() {
- $tar = new Tar();
-
- $dir = dirname(__FILE__).'/tar';
- $tdir = ltrim($dir,'/');
-
- $tar->create();
- $tar->AddFile("$dir/testdata1.txt");
- $tar->AddFile("$dir/foobar/testdata2.txt", 'noway/testdata2.txt');
- $tar->addData('another/testdata3.txt', 'testcontent3');
-
- $data = $tar->getArchive();
-
- $this->assertTrue(strpos($data, 'testcontent1') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
-
- // fullpath might be too long to be stored as full path FS#2802
- $this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
-
- $this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
-
- // fullpath might be too long to be stored as full path FS#2802
- $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
- $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
-
- $this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
- }
-
- /**
- * simple test that checks that the given filenames and contents can be grepped from the
- * uncompressed tar file
- *
- * No check for format correctness
- */
- public function test_createfile() {
- $tar = new Tar();
-
- $dir = dirname(__FILE__).'/tar';
- $tdir = ltrim($dir,'/');
- $tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
-
- $tar->create($tmp, Tar::COMPRESS_NONE);
- $tar->AddFile("$dir/testdata1.txt");
- $tar->AddFile("$dir/foobar/testdata2.txt", 'noway/testdata2.txt');
- $tar->addData('another/testdata3.txt', 'testcontent3');
- $tar->close();
-
- $this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
- $data = file_get_contents($tmp);
-
- $this->assertTrue(strpos($data, 'testcontent1') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
-
- // fullpath might be too long to be stored as full path FS#2802
- $this->assertTrue(strpos($data, "$tdir") !== false, "Path in TAR '$tdir'");
- $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
-
- $this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
-
- // fullpath might be too long to be stored as full path FS#2802
- $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
- $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
-
- $this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
-
- @unlink($tmp);
- }
-
- /**
- * List the contents of the prebuilt TAR files
- */
- public function test_tarcontent() {
- $dir = dirname(__FILE__).'/tar';
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $content = $tar->contents();
-
- $this->assertCount(4, $content, "Contents of $file");
- $this->assertEquals('tar/testdata1.txt', $content[1]['filename'], "Contents of $file");
- $this->assertEquals(13, $content[1]['size'], "Contents of $file");
-
- $this->assertEquals('tar/foobar/testdata2.txt', $content[3]['filename'], "Contents of $file");
- $this->assertEquals(13, $content[1]['size'], "Contents of $file");
- }
- }
-
- /**
- * Extract the prebuilt tar files
- */
- public function test_tarextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $tar->extract($out);
-
- clearstatcache();
-
- $this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
-
- $this->assertFileExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/tar/foobar/testdata2.txt'), "Extracted $file");
-
- TestUtils::rdelete($out);
- }
- }
-
- /**
- * Extract the prebuilt tar files with component stripping
- */
- public function test_compstripextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $tar->extract($out, 1);
-
- clearstatcache();
-
- $this->assertFileExists($out.'/testdata1.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/testdata1.txt'), "Extracted $file");
-
- $this->assertFileExists($out.'/foobar/testdata2.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/foobar/testdata2.txt'), "Extracted $file");
-
- TestUtils::rdelete($out);
- }
- }
-
- /**
- * Extract the prebuilt tar files with prefix stripping
- */
- public function test_prefixstripextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $tar->extract($out, 'tar/foobar/');
-
- clearstatcache();
-
- $this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
-
- $this->assertFileExists($out.'/testdata2.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/testdata2.txt'), "Extracted $file");
-
- TestUtils::rdelete($out);
- }
- }
-
- /**
- * Extract the prebuilt tar files with include regex
- */
- public function test_includeextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $tar->extract($out, '', '', '/\/foobar\//');
-
- clearstatcache();
-
- $this->assertFileNotExists($out.'/tar/testdata1.txt', "Extracted $file");
-
- $this->assertFileExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/tar/foobar/testdata2.txt'), "Extracted $file");
-
- TestUtils::rdelete($out);
- }
- }
-
- /**
- * Extract the prebuilt tar files with exclude regex
- */
- public function test_excludeextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach($this->extensions as $ext) {
- $tar = new Tar();
- $file = "$dir/test.$ext";
-
- $tar->open($file);
- $tar->extract($out, '', '/\/foobar\//');
-
- clearstatcache();
-
- $this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
- $this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
-
- $this->assertFileNotExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
-
- TestUtils::rdelete($out);
- }
- }
-
- /**
- * Check the extension to compression guesser
- */
- public function test_filetype() {
- $tar = new Tar();
- $this->assertEquals(Tar::COMPRESS_NONE, $tar->filetype('foo'));
- $this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tgz'));
- $this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tGZ'));
- $this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tar.GZ'));
- $this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tar.gz'));
- $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tbz'));
- $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tBZ'));
- $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.BZ2'));
- $this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.bz2'));
- }
-
- /**
- * @depends test_ext_zlib
- */
- public function test_longpathextract() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- foreach(array('ustar', 'gnu') as $format) {
- $tar = new Tar();
- $tar->open("$dir/longpath-$format.tgz");
- $tar->extract($out);
-
- $this->assertFileExists($out.'/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/test.txt');
-
- TestUtils::rdelete($out);
- }
- }
-
- // FS#1442
- public function test_createlongfile() {
- $tar = new Tar();
- $tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
-
- $path = '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt';
-
- $tar->create($tmp, Tar::COMPRESS_NONE);
- $tar->addData($path, 'testcontent1');
- $tar->close();
-
- $this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
- $data = file_get_contents($tmp);
-
- // We should find the complete path and a longlink entry
- $this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
- $this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
- $this->assertTrue(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
-
- @unlink($tmp);
- }
-
- public function test_createlongpathustar() {
- $tar = new Tar();
- $tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
-
- $path = '';
- for($i=0; $i<11; $i++) $path .= '1234567890/';
- $path = rtrim($path,'/');
-
- $tar->create($tmp, Tar::COMPRESS_NONE);
- $tar->addData("$path/test.txt", 'testcontent1');
- $tar->close();
-
- $this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
- $data = file_get_contents($tmp);
-
- // We should find the path and filename separated, no longlink entry
- $this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
- $this->assertTrue(strpos($data, 'test.txt') !== false, 'filename in TAR');
- $this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
- $this->assertFalse(strpos($data, "$path/test.txt") !== false, 'full filename in TAR');
- $this->assertFalse(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
-
- @unlink($tmp);
- }
-
- public function test_createlongpathgnu() {
- $tar = new Tar();
- $tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
-
- $path = '';
- for($i=0; $i<20; $i++) $path .= '1234567890/';
- $path = rtrim($path,'/');
-
- $tar->create($tmp, Tar::COMPRESS_NONE);
- $tar->addData("$path/test.txt", 'testcontent1');
- $tar->close();
-
- $this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
- $data = file_get_contents($tmp);
-
- // We should find the complete path/filename and a longlink entry
- $this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
- $this->assertTrue(strpos($data, 'test.txt') !== false, 'filename in TAR');
- $this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
- $this->assertTrue(strpos($data, "$path/test.txt") !== false, 'full filename in TAR');
- $this->assertTrue(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
-
- @unlink($tmp);
- }
-
- /**
- * Extract a tarbomomb
- * @depends test_ext_zlib
- */
- public function test_tarbomb() {
- $dir = dirname(__FILE__).'/tar';
- $out = sys_get_temp_dir().'/dwtartest'.md5(time());
-
- $tar = new Tar();
-
- $tar->open("$dir/tarbomb.tgz");
- $tar->extract($out);
-
- clearstatcache();
-
- $this->assertFileExists($out.'/AAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.txt');
-
- TestUtils::rdelete($out);
- }
-
- /**
- * A single zero file should be just a header block + the footer
- */
- public function test_zerofile(){
- $dir = dirname(__FILE__).'/tar';
- $tar = new Tar();
- $tar->create();
- $tar->addFile("$dir/zero.txt", 'zero.txt');
- $file = $tar->getArchive(Tar::COMPRESS_NONE);
-
- $this->assertEquals(512*3, strlen($file)); // 1 header block + 2 footer blocks
- }
-
- public function test_zerodata(){
- $tar = new Tar();
- $tar->create();
- $tar->addData('zero.txt','');
- $file = $tar->getArchive(Tar::COMPRESS_NONE);
-
- $this->assertEquals(512*3, strlen($file)); // 1 header block + 2 footer blocks
- }
-
- /**
- * A file of exactly one block should be just a header block + data block + the footer
- */
- public function test_blockfile(){
- $dir = dirname(__FILE__).'/tar';
- $tar = new Tar();
- $tar->create();
- $tar->addFile("$dir/block.txt", 'block.txt');
- $file = $tar->getArchive(Tar::COMPRESS_NONE);
-
- $this->assertEquals(512*4, strlen($file)); // 1 header block + data block + 2 footer blocks
- }
-
- public function test_blockdata(){
- $tar = new Tar();
- $tar->create();
- $tar->addData('block.txt', str_pad('', 512, 'x'));
- $file = $tar->getArchive(Tar::COMPRESS_NONE);
-
- $this->assertEquals(512*4, strlen($file)); // 1 header block + data block + 2 footer blocks
- }
-
-
- public function test_cleanPath(){
- $tar = new Tar();
- $tests = array (
- '/foo/bar' => 'foo/bar',
- '/foo/bar/' => 'foo/bar',
- 'foo//bar' => 'foo/bar',
- 'foo/0/bar' => 'foo/0/bar',
- 'foo/../bar' => 'bar',
- 'foo/bang/bang/../../bar' => 'foo/bar',
- 'foo/../../bar' => 'bar',
- 'foo/.././../bar' => 'bar',
- );
-
- foreach($tests as $in => $out){
- $this->assertEquals($out, $tar->cleanPath($in), "Input: $in");
- }
- }
-}
diff --git a/_test/tests/inc/tar/block.txt b/_test/tests/inc/tar/block.txt
deleted file mode 100644
index 9b2f53080..000000000
--- a/_test/tests/inc/tar/block.txt
+++ /dev/null
@@ -1 +0,0 @@
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file
diff --git a/_test/tests/inc/tar/foobar/testdata2.txt b/_test/tests/inc/tar/foobar/testdata2.txt
deleted file mode 100644
index a7db15771..000000000
--- a/_test/tests/inc/tar/foobar/testdata2.txt
+++ /dev/null
@@ -1 +0,0 @@
-testcontent2
diff --git a/_test/tests/inc/tar/longpath-gnu.tgz b/_test/tests/inc/tar/longpath-gnu.tgz
deleted file mode 100644
index 6c937c8fe..000000000
--- a/_test/tests/inc/tar/longpath-gnu.tgz
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/longpath-ustar.tgz b/_test/tests/inc/tar/longpath-ustar.tgz
deleted file mode 100644
index 59efbff66..000000000
--- a/_test/tests/inc/tar/longpath-ustar.tgz
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/tarbomb.tgz b/_test/tests/inc/tar/tarbomb.tgz
deleted file mode 100644
index 8418d4073..000000000
--- a/_test/tests/inc/tar/tarbomb.tgz
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/test.tar b/_test/tests/inc/tar/test.tar
deleted file mode 100644
index 931866b0b..000000000
--- a/_test/tests/inc/tar/test.tar
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/test.tbz b/_test/tests/inc/tar/test.tbz
deleted file mode 100644
index 5a7374019..000000000
--- a/_test/tests/inc/tar/test.tbz
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/test.tgz b/_test/tests/inc/tar/test.tgz
deleted file mode 100644
index b00319649..000000000
--- a/_test/tests/inc/tar/test.tgz
+++ /dev/null
Binary files differ
diff --git a/_test/tests/inc/tar/testdata1.txt b/_test/tests/inc/tar/testdata1.txt
deleted file mode 100644
index ac65bb32e..000000000
--- a/_test/tests/inc/tar/testdata1.txt
+++ /dev/null
@@ -1 +0,0 @@
-testcontent1
diff --git a/_test/tests/inc/tar/zero.txt b/_test/tests/inc/tar/zero.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/_test/tests/inc/tar/zero.txt
+++ /dev/null
diff --git a/_test/tests/inc/template_include_page.test.php b/_test/tests/inc/template_include_page.test.php
index 47d4d46f1..7dd13ba23 100644
--- a/_test/tests/inc/template_include_page.test.php
+++ b/_test/tests/inc/template_include_page.test.php
@@ -1,40 +1,67 @@
<?php
-class template_include_page_test extends DokuWikiTest {
- function testNoSidebar() {
- global $ID;
+class template_pagetitle_test extends DokuWikiTest {
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertEquals('', $sidebar);
+ function test_localID() {
+ global $ID,$ACT;
+
+
+ $id = 'foo:bar';
+
+ $ACT = 'show';
+ $this->assertEquals('foo:bar', tpl_pagetitle($id, true));
}
- function testExistingSidebars() {
- global $ID;
+ function test_globalID() {
+ global $ID,$ACT;
+
- saveWikiText('sidebar', 'topsidebar-test', '');
+ $ID = 'foo:bar';
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $ACT = 'show';
+ $this->assertEquals('foo:bar', tpl_pagetitle(null, true));
+ }
+
+ function test_adminTitle() {
+ global $ID,$ACT;
- $ID = 'foo';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $ID = 'foo:bar';
+
+ $ACT = 'admin';
+ $this->assertEquals('Admin', tpl_pagetitle(null, true));
+ }
- saveWikiText('foo:bar:sidebar', 'bottomsidebar-test', '');
+ function test_adminPluginTitle() {
+ global $ID,$ACT,$INPUT,$conf;
- $ID = 'foo:bar:baz:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'bottomsidebar-test') > 0);
+ if (!plugin_load('admin','revert')) {
+ $this->markTestSkipped('Revert plugin not found, unable to test admin plugin titles');
+ return;
+ }
- $ID = 'foo:bar:test';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'bottomsidebar-test') > 0);
+ $ID = 'foo:bar';
+ $ACT = 'admin';
+ $conf['lang'] = 'en';
+ $INPUT->set('page','revert');
- $ID = 'foo';
- $sidebar = tpl_include_page('sidebar', false, true);
- $this->assertTrue(strpos($sidebar, 'topsidebar-test') > 0);
+ $this->assertEquals('Revert Manager', tpl_pagetitle(null, true));
}
+ function test_nonPageFunctionTitle() {
+ global $ID,$ACT;
+
+ $ID = 'foo:bar';
+
+ $ACT = 'index';
+ $this->assertEquals('Sitemap', tpl_pagetitle(null, true));
+ }
+
+ function test_pageFunctionTitle() {
+ global $ID,$ACT;
+
+ $ID = 'foo:bar';
+
+ $ACT = 'revisions';
+ $this->assertEquals('foo:bar - Old revisions', tpl_pagetitle(null, true));
+ }
}
diff --git a/_test/tests/lib/exe/js_js_compress.test.php b/_test/tests/lib/exe/js_js_compress.test.php
index b1ae2a84f..648ede07e 100644
--- a/_test/tests/lib/exe/js_js_compress.test.php
+++ b/_test/tests/lib/exe/js_js_compress.test.php
@@ -58,6 +58,18 @@ class js_js_compress_test extends DokuWikiTest {
$this->assertEquals(js_compress($text), 'text.replace(/"/,"//")');
}
+ function test_regex_after_and_with_slashes_outside_string(){
+ $text = 'if ( peng == bla && /pattern\//.test(url)) request = new Something();';
+ $this->assertEquals(js_compress($text),
+ 'if(peng==bla&&/pattern\//.test(url))request=new Something();');
+ }
+
+ function test_regex_after_or_with_slashes_outside_string(){
+ $text = 'if ( peng == bla || /pattern\//.test(url)) request = new Something();';
+ $this->assertEquals(js_compress($text),
+ 'if(peng==bla||/pattern\//.test(url))request=new Something();');
+ }
+
function test_dquot1(){
$text = 'var foo="Now what \\" \'do we//get /*here*/ ?";';
$this->assertEquals(js_compress($text), $text);
@@ -145,6 +157,72 @@ EOF;
$this->assertEquals($out, js_compress($text));
}
+ function test_plusplus1(){
+ $text = 'a = 5 + ++b;';
+ $this->assertEquals('a=5+ ++b;',js_compress($text));
+ }
+
+ function test_plusplus2(){
+ $text = 'a = 5+ ++b;';
+ $this->assertEquals('a=5+ ++b;',js_compress($text));
+ }
+
+ function test_plusplus3(){
+ $text = 'a = 5++ + b;';
+ $this->assertEquals('a=5++ +b;',js_compress($text));
+ }
+
+ function test_plusplus4(){
+ $text = 'a = 5++ +b;';
+ $this->assertEquals('a=5++ +b;',js_compress($text));
+ }
+
+ function test_minusminus1(){
+ $text = 'a = 5 - --b;';
+ $this->assertEquals('a=5- --b;',js_compress($text));
+ }
+
+ function test_minusminus2(){
+ $text = 'a = 5- --b;';
+ $this->assertEquals('a=5- --b;',js_compress($text));
+ }
+
+ function test_minusminus3(){
+ $text = 'a = 5-- - b;';
+ $this->assertEquals('a=5-- -b;',js_compress($text));
+ }
+
+ function test_minusminus4(){
+ $text = 'a = 5-- -b;';
+ $this->assertEquals('a=5-- -b;',js_compress($text));
+ }
+
+ function test_minusplus1(){
+ $text = 'a = 5-- +b;';
+ $this->assertEquals('a=5--+b;',js_compress($text));
+ }
+
+ function test_minusplus2(){
+ $text = 'a = 5-- + b;';
+ $this->assertEquals('a=5--+b;',js_compress($text));
+ }
+
+ function test_plusminus1(){
+ $text = 'a = 5++ - b;';
+ $this->assertEquals('a=5++-b;',js_compress($text));
+ }
+
+ function test_plusminus2(){
+ $text = 'a = 5++ -b;';
+ $this->assertEquals('a=5++-b;',js_compress($text));
+ }
+
+ function test_unusual_signs(){
+ $text='var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, radians = π / 180, degrees = 180 / π;';
+ $this->assertEquals(js_compress($text),
+ 'var π=Math.PI,τ=2*π,halfπ=π/2,ε=1e-6,ε2=ε*ε,radians=π/180,degrees=180/π;');
+ }
+
/**
* Test the files provided with the original JsStrip
*/
diff --git a/bin/dwpage.php b/bin/dwpage.php
index a777fd3e1..d7f6e9bb8 100755
--- a/bin/dwpage.php
+++ b/bin/dwpage.php
@@ -28,7 +28,8 @@ class PageCLI extends DokuCLI {
$options->registerOption(
'user',
'work as this user. defaults to current CLI user',
- 'u'
+ 'u',
+ 'username'
);
$options->setHelp(
'Utility to help command line Dokuwiki page editing, allow '.
@@ -239,6 +240,7 @@ class PageCLI extends DokuCLI {
if($this->force) $this->deleteLock($wiki_id);
$_SERVER['REMOTE_USER'] = $this->username;
+
if(checklock($wiki_id)) {
$this->error("Page $wiki_id is already locked by another user");
exit(1);
@@ -246,7 +248,6 @@ class PageCLI extends DokuCLI {
lock($wiki_id);
- $_SERVER['REMOTE_USER'] = '_'.$this->username.'_';
if(checklock($wiki_id) != $this->username) {
$this->error("Unable to obtain lock for $wiki_id ");
var_dump(checklock($wiki_id));
diff --git a/bin/gittool.php b/bin/gittool.php
index 6944dde57..cbadb5bfa 100755
--- a/bin/gittool.php
+++ b/bin/gittool.php
@@ -101,7 +101,7 @@ class GitToolCLI extends DokuCLI {
/**
* Tries to install the given extensions using git clone
*
- * @param $extensions
+ * @param array $extensions
*/
public function cmd_clone($extensions) {
$errors = array();
@@ -130,7 +130,7 @@ class GitToolCLI extends DokuCLI {
/**
* Tries to install the given extensions using git clone with fallback to install
*
- * @param $extensions
+ * @param array $extensions
*/
public function cmd_install($extensions) {
$errors = array();
@@ -206,12 +206,13 @@ class GitToolCLI extends DokuCLI {
* Install extension from the given download URL
*
* @param string $ext
- * @return bool
+ * @return bool|null
*/
private function downloadExtension($ext) {
/** @var helper_plugin_extension_extension $plugin */
$plugin = plugin_load('helper', 'extension_extension');
if(!$ext) die("extension plugin not available, can't continue");
+
$plugin->setExtension($ext);
$url = $plugin->getDownloadURL();
@@ -291,12 +292,13 @@ class GitToolCLI extends DokuCLI {
* Returns the repository for the given extension
*
* @param $extension
- * @return bool|string
+ * @return false|string
*/
private function getSourceRepo($extension) {
/** @var helper_plugin_extension_extension $ext */
$ext = plugin_load('helper', 'extension_extension');
if(!$ext) die("extension plugin not available, can't continue");
+
$ext->setExtension($extension);
$repourl = $ext->getSourcerepoURL();
diff --git a/bin/striplangs.php b/bin/striplangs.php
index 6335bc84c..82d27d462 100755
--- a/bin/striplangs.php
+++ b/bin/striplangs.php
@@ -26,7 +26,8 @@ class StripLangsCLI extends DokuCLI {
$options->registerOption(
'keep',
'Comma separated list of languages to keep in addition to English.',
- 'k'
+ 'k',
+ 'langcodes'
);
$options->registerOption(
'english-only',
diff --git a/bin/wantedpages.php b/bin/wantedpages.php
index 8fc4ba74f..54bfd4755 100755
--- a/bin/wantedpages.php
+++ b/bin/wantedpages.php
@@ -61,6 +61,13 @@ class WantedPagesCLI extends DokuCLI {
}
}
+ /**
+ * Determine directions of the search loop
+ *
+ * @param string $entry
+ * @param string $basepath
+ * @return int
+ */
protected function dir_filter($entry, $basepath) {
if($entry == '.' || $entry == '..') {
return WantedPagesCLI::DIR_CONTINUE;
@@ -77,6 +84,13 @@ class WantedPagesCLI extends DokuCLI {
return WantedPagesCLI::DIR_CONTINUE;
}
+ /**
+ * Collects recursively the pages in a namespace
+ *
+ * @param string $dir
+ * @return array
+ * @throws DokuCLI_Exception
+ */
protected function get_pages($dir) {
static $trunclen = null;
if(!$trunclen) {
@@ -108,6 +122,12 @@ class WantedPagesCLI extends DokuCLI {
return $pages;
}
+ /**
+ * Parse instructions and returns the non-existing links
+ *
+ * @param array $page array with page id and file path
+ * @return array
+ */
function internal_links($page) {
global $conf;
$instructions = p_get_instructions(file_get_contents($page['file']));
diff --git a/composer.json b/composer.json
new file mode 100644
index 000000000..3fe00cc92
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,6 @@
+{
+ "require": {
+ "splitbrain/php-archive": "~1.0",
+ "easybook/geshi": "~1.0"
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 000000000..9aa165902
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,111 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "This file is @generated automatically"
+ ],
+ "hash": "23ee0dd06136e2301c930e75055300d5",
+ "packages": [
+ {
+ "name": "easybook/geshi",
+ "version": "v1.0.8.15",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/easybook/geshi.git",
+ "reference": "54387de80bc7ee50397ffae39234626a48d2d45f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/easybook/geshi/zipball/54387de80bc7ee50397ffae39234626a48d2d45f",
+ "reference": "54387de80bc7ee50397ffae39234626a48d2d45f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">4.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "./"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Nigel McNie",
+ "email": "nigel@geshi.org"
+ },
+ {
+ "name": "Benny Baumann",
+ "email": "BenBE@geshi.org"
+ }
+ ],
+ "description": "GeSHi - Generic Syntax Highlighter. This is an unmodified port of GeSHi project code found on SourceForge.",
+ "homepage": "http://qbnz.com/highlighter",
+ "keywords": [
+ "highlight",
+ "highlighter",
+ "syntax"
+ ],
+ "time": "2015-06-18 14:56:28"
+ },
+ {
+ "name": "splitbrain/php-archive",
+ "version": "1.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/splitbrain/php-archive.git",
+ "reference": "6572e78ef9d064eeb5c74d4ffe61b473a4996b68"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/splitbrain/php-archive/zipball/6572e78ef9d064eeb5c74d4ffe61b473a4996b68",
+ "reference": "6572e78ef9d064eeb5c74d4ffe61b473a4996b68",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.5.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "splitbrain\\PHPArchive\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Andreas Gohr",
+ "email": "andi@splitbrain.org"
+ }
+ ],
+ "description": "Pure-PHP implementation to read and write TAR and ZIP archives",
+ "keywords": [
+ "archive",
+ "extract",
+ "tar",
+ "unpack",
+ "unzip",
+ "zip"
+ ],
+ "time": "2015-07-24 11:36:49"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
diff --git a/conf/interwiki.conf b/conf/interwiki.conf
index d961912e5..4dc3c80ee 100644
--- a/conf/interwiki.conf
+++ b/conf/interwiki.conf
@@ -1,37 +1,41 @@
-# Each URL may contain one of the placeholders {URL} or {NAME}
+# Each URL may contain one of these placeholders
# {URL} is replaced by the URL encoded representation of the wikiname
# this is the right thing to do in most cases
# {NAME} this is replaced by the wikiname as given in the document
-# no further encoding is done
+# only mandatory encoded is done, urlencoding if the link
+# is an external URL, or encoding as a wikiname if it is an
+# internal link (begins with a colon)
+# {SCHEME}
+# {HOST}
+# {PORT}
+# {PATH}
+# {QUERY} these placeholders will be replaced with the appropriate part
+# of the link when parsed as a URL
# If no placeholder is defined the urlencoded name is appended to the URL
# To prevent losing your added InterWiki shortcuts after an upgrade,
# you should add new ones to interwiki.local.conf
-wp http://en.wikipedia.org/wiki/{NAME}
-wpfr http://fr.wikipedia.org/wiki/{NAME}
-wpde http://de.wikipedia.org/wiki/{NAME}
-wpes http://es.wikipedia.org/wiki/{NAME}
-wppl http://pl.wikipedia.org/wiki/{NAME}
-wpjp http://ja.wikipedia.org/wiki/{NAME}
-wpmeta http://meta.wikipedia.org/wiki/{NAME}
-doku http://www.dokuwiki.org/
-dokubug http://bugs.dokuwiki.org/index.php?do=details&amp;task_id=
-rfc http://tools.ietf.org/html/rfc
+wp https://en.wikipedia.org/wiki/{NAME}
+wpfr https://fr.wikipedia.org/wiki/{NAME}
+wpde https://de.wikipedia.org/wiki/{NAME}
+wpes https://es.wikipedia.org/wiki/{NAME}
+wppl https://pl.wikipedia.org/wiki/{NAME}
+wpjp https://ja.wikipedia.org/wiki/{NAME}
+wpmeta https://meta.wikipedia.org/wiki/{NAME}
+doku https://www.dokuwiki.org/
+rfc https://tools.ietf.org/html/rfc
man http://man.cx/
-amazon http://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
-amazon.de http://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
-amazon.uk http://www.amazon.co.uk/exec/obidos/ASIN/
+amazon https://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
+amazon.de https://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
+amazon.uk https://www.amazon.co.uk/exec/obidos/ASIN/
paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=
-phpfn http://www.php.net/{NAME}
-coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}
-freecache http://freecache.org/{NAME}
-sb http://www.splitbrain.org/go/
+phpfn https://www.php.net/{NAME}
skype skype:{NAME}
-google.de http://www.google.de/search?q=
-go http://www.google.com/search?q={URL}&amp;btnI=lucky
+google.de https://www.google.de/search?q=
+go https://www.google.com/search?q={URL}&amp;btnI=lucky
user :user:{NAME}
-# To support VoIP/SIP links
+# To support VoIP/SIP/TEL links
callto callto://{NAME}
-
+tel tel:{NAME}
diff --git a/conf/mysql.conf.php.example b/conf/mysql.conf.php.example
index c67e77c45..8337f51b4 100644
--- a/conf/mysql.conf.php.example
+++ b/conf/mysql.conf.php.example
@@ -56,7 +56,7 @@ $conf['plugin']['authmysql']['TablesToLock']= array("users", "users AS u","group
* of the user. If the result table is empty or contains more than one
* row, access will be denied.
*
- * The plugin accesses the password as 'pass' so a alias might be necessary.
+ * The plugin accesses the password as 'pass' so an alias might be necessary.
*
* Following patters will be replaced:
* %{user} user name
@@ -107,10 +107,10 @@ $conf['plugin']['authmysql']['getGroups'] = "SELECT name as `group`
/* This statement should return a table containing all user login names
* that meet certain filter criteria. The filter expressions will be added
* case dependend by the plugin. At the end a sort expression will be added.
- * Important is that this list contains no double entries fo a user. Each
+ * Important is that this list contains no double entries for a user. Each
* user name is only allowed once in the table.
*
- * The login name will be accessed as 'user' to a alias might be neseccary.
+ * The login name will be accessed as 'user' to an alias might be neseccary.
* No patterns will be replaced in this statement but following patters
* will be replaced in the filter expressions:
* %{user} in FilterLogin user's login name
@@ -174,7 +174,7 @@ $conf['plugin']['authmysql']['delGroup'] = "DELETE FROM groups
WHERE gid='%{gid}'";
/* This statement should return the database index of a given user name.
- * The plugin will access the index with the name 'id' so a alias might be
+ * The plugin will access the index with the name 'id' so an alias might be
* necessary.
* following patters will be replaced:
* %{user} user name
@@ -240,7 +240,7 @@ $conf['plugin']['authmysql']['delUserGroup']= "DELETE FROM usergroup
AND gid='%{gid}'";
/* This statement should return the database index of a given group name.
- * The plugin will access the index with the name 'id' so a alias might
+ * The plugin will access the index with the name 'id' so an alias might
* be necessary.
*
* Following patters will be replaced:
diff --git a/conf/wordblock.conf b/conf/wordblock.conf
index fc939a4d4..3040fa08f 100644
--- a/conf/wordblock.conf
+++ b/conf/wordblock.conf
@@ -2,16 +2,12 @@
# patches welcome
#
https?:\/\/(\S*?)(-side-effects|top|pharm|pill|discount|discount-|deal|price|order|now|best|cheap|cheap-|online|buy|buy-|sale|sell)(\S*?)(cialis|viagra|prazolam|xanax|zanax|soma|vicodin|zenical|xenical|meridia|paxil|prozac|claritin|allegra|lexapro|wellbutrin|zoloft|retin|valium|levitra|phentermine)
-gay\s*sex
-bi\s*sex
-incest
+https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|penis|\brape\b)
zoosex
gang\s*bang
facials
ladyboy
-fetish
\btits\b
-\brape\b
bolea\.com
52crystal
baida\.org
diff --git a/data/deleted.files b/data/deleted.files
index cac352c9d..68fad3cda 100644
--- a/data/deleted.files
+++ b/data/deleted.files
@@ -2,6 +2,252 @@
# but were removed later. An up to date DokuWiki should not have any of
# the files installed
+# removed in 2015-08-10
+inc/TarLib.class.php
+inc/geshi.php
+inc/geshi/4cs.php
+inc/geshi/6502acme.php
+inc/geshi/6502kickass.php
+inc/geshi/6502tasm.php
+inc/geshi/68000devpac.php
+inc/geshi/abap.php
+inc/geshi/actionscript-french.php
+inc/geshi/actionscript.php
+inc/geshi/actionscript3.php
+inc/geshi/ada.php
+inc/geshi/algol68.php
+inc/geshi/apache.php
+inc/geshi/applescript.php
+inc/geshi/apt_sources.php
+inc/geshi/arm.php
+inc/geshi/asm.php
+inc/geshi/asp.php
+inc/geshi/asymptote.php
+inc/geshi/autoconf.php
+inc/geshi/autohotkey.php
+inc/geshi/autoit.php
+inc/geshi/avisynth.php
+inc/geshi/awk.php
+inc/geshi/bascomavr.php
+inc/geshi/bash.php
+inc/geshi/basic4gl.php
+inc/geshi/bf.php
+inc/geshi/bibtex.php
+inc/geshi/blitzbasic.php
+inc/geshi/bnf.php
+inc/geshi/boo.php
+inc/geshi/c.php
+inc/geshi/c_loadrunner.php
+inc/geshi/c_mac.php
+inc/geshi/caddcl.php
+inc/geshi/cadlisp.php
+inc/geshi/cfdg.php
+inc/geshi/cfm.php
+inc/geshi/chaiscript.php
+inc/geshi/cil.php
+inc/geshi/clojure.php
+inc/geshi/cmake.php
+inc/geshi/cobol.php
+inc/geshi/coffeescript.php
+inc/geshi/cpp-qt.php
+inc/geshi/cpp.php
+inc/geshi/csharp.php
+inc/geshi/css.php
+inc/geshi/cuesheet.php
+inc/geshi/d.php
+inc/geshi/dcl.php
+inc/geshi/dcpu16.php
+inc/geshi/dcs.php
+inc/geshi/delphi.php
+inc/geshi/diff.php
+inc/geshi/div.php
+inc/geshi/dos.php
+inc/geshi/dot.php
+inc/geshi/e.php
+inc/geshi/ecmascript.php
+inc/geshi/eiffel.php
+inc/geshi/email.php
+inc/geshi/epc.php
+inc/geshi/erlang.php
+inc/geshi/euphoria.php
+inc/geshi/f1.php
+inc/geshi/falcon.php
+inc/geshi/fo.php
+inc/geshi/fortran.php
+inc/geshi/freebasic.php
+inc/geshi/freeswitch.php
+inc/geshi/fsharp.php
+inc/geshi/gambas.php
+inc/geshi/gdb.php
+inc/geshi/genero.php
+inc/geshi/genie.php
+inc/geshi/gettext.php
+inc/geshi/glsl.php
+inc/geshi/gml.php
+inc/geshi/gnuplot.php
+inc/geshi/go.php
+inc/geshi/groovy.php
+inc/geshi/gwbasic.php
+inc/geshi/haskell.php
+inc/geshi/haxe.php
+inc/geshi/hicest.php
+inc/geshi/hq9plus.php
+inc/geshi/html4strict.php
+inc/geshi/html5.php
+inc/geshi/icon.php
+inc/geshi/idl.php
+inc/geshi/ini.php
+inc/geshi/inno.php
+inc/geshi/intercal.php
+inc/geshi/io.php
+inc/geshi/j.php
+inc/geshi/java.php
+inc/geshi/java5.php
+inc/geshi/javascript.php
+inc/geshi/jquery.php
+inc/geshi/kixtart.php
+inc/geshi/klonec.php
+inc/geshi/klonecpp.php
+inc/geshi/latex.php
+inc/geshi/lb.php
+inc/geshi/ldif.php
+inc/geshi/lisp.php
+inc/geshi/llvm.php
+inc/geshi/locobasic.php
+inc/geshi/logtalk.php
+inc/geshi/lolcode.php
+inc/geshi/lotusformulas.php
+inc/geshi/lotusscript.php
+inc/geshi/lscript.php
+inc/geshi/lsl2.php
+inc/geshi/lua.php
+inc/geshi/m68k.php
+inc/geshi/magiksf.php
+inc/geshi/make.php
+inc/geshi/mapbasic.php
+inc/geshi/matlab.php
+inc/geshi/mirc.php
+inc/geshi/mmix.php
+inc/geshi/modula2.php
+inc/geshi/modula3.php
+inc/geshi/mpasm.php
+inc/geshi/mxml.php
+inc/geshi/mysql.php
+inc/geshi/nagios.php
+inc/geshi/netrexx.php
+inc/geshi/newlisp.php
+inc/geshi/nsis.php
+inc/geshi/oberon2.php
+inc/geshi/objc.php
+inc/geshi/objeck.php
+inc/geshi/ocaml-brief.php
+inc/geshi/ocaml.php
+inc/geshi/octave.php
+inc/geshi/oobas.php
+inc/geshi/oorexx.php
+inc/geshi/oracle11.php
+inc/geshi/oracle8.php
+inc/geshi/oxygene.php
+inc/geshi/oz.php
+inc/geshi/parasail.php
+inc/geshi/parigp.php
+inc/geshi/pascal.php
+inc/geshi/pcre.php
+inc/geshi/per.php
+inc/geshi/perl.php
+inc/geshi/perl6.php
+inc/geshi/pf.php
+inc/geshi/php-brief.php
+inc/geshi/php.php
+inc/geshi/pic16.php
+inc/geshi/pike.php
+inc/geshi/pixelbender.php
+inc/geshi/pli.php
+inc/geshi/plsql.php
+inc/geshi/postgresql.php
+inc/geshi/povray.php
+inc/geshi/powerbuilder.php
+inc/geshi/powershell.php
+inc/geshi/proftpd.php
+inc/geshi/progress.php
+inc/geshi/prolog.php
+inc/geshi/properties.php
+inc/geshi/providex.php
+inc/geshi/purebasic.php
+inc/geshi/pycon.php
+inc/geshi/pys60.php
+inc/geshi/python.php
+inc/geshi/q.php
+inc/geshi/qbasic.php
+inc/geshi/rails.php
+inc/geshi/rebol.php
+inc/geshi/reg.php
+inc/geshi/rexx.php
+inc/geshi/robots.php
+inc/geshi/rpmspec.php
+inc/geshi/rsplus.php
+inc/geshi/ruby.php
+inc/geshi/sas.php
+inc/geshi/scala.php
+inc/geshi/scheme.php
+inc/geshi/scilab.php
+inc/geshi/sdlbasic.php
+inc/geshi/smalltalk.php
+inc/geshi/smarty.php
+inc/geshi/spark.php
+inc/geshi/sparql.php
+inc/geshi/sql.php
+inc/geshi/stonescript.php
+inc/geshi/systemverilog.php
+inc/geshi/tcl.php
+inc/geshi/teraterm.php
+inc/geshi/text.php
+inc/geshi/thinbasic.php
+inc/geshi/tsql.php
+inc/geshi/typoscript.php
+inc/geshi/unicon.php
+inc/geshi/upc.php
+inc/geshi/urbi.php
+inc/geshi/uscript.php
+inc/geshi/vala.php
+inc/geshi/vb.php
+inc/geshi/vbnet.php
+inc/geshi/vedit.php
+inc/geshi/verilog.php
+inc/geshi/vhdl.php
+inc/geshi/vim.php
+inc/geshi/visualfoxpro.php
+inc/geshi/visualprolog.php
+inc/geshi/whitespace.php
+inc/geshi/whois.php
+inc/geshi/winbatch.php
+inc/geshi/xbasic.php
+inc/geshi/xml.php
+inc/geshi/xorg_conf.php
+inc/geshi/xpp.php
+inc/geshi/yaml.php
+inc/geshi/z80.php
+inc/geshi/zxbasic.php
+inc/lang/ku/admin.txt
+inc/lang/ku/denied.txt
+inc/lang/ku/editrev.txt
+inc/lang/ku/locked.txt
+inc/lang/ku/login.txt
+inc/lang/ku/mailtext.txt
+inc/lang/ku/norev.txt
+inc/lang/ku/password.txt
+inc/lang/ku/read.txt
+inc/lang/ku/register.txt
+inc/lang/ku/revisions.txt
+inc/lang/ku/showrev.txt
+inc/lang/ku/stopwords.txt
+lib/images/interwiki/coral.gif
+lib/images/interwiki/dokubug.gif
+lib/images/interwiki/sb.gif
+lib/scripts/drag.js
+lib/scripts/jquery/jquery-ui-theme/images/animated-overlay.gif
+lib/scripts/tw-sack.js
+
# removed in 2014-05-05
lib/images/fileicons/audio.png
lib/plugins/acl/lang/hi/lang.php
diff --git a/data/media/wiki/dokuwiki-128.png b/data/media/wiki/dokuwiki-128.png
index b2306ac95..f3f1d66bd 100644
--- a/data/media/wiki/dokuwiki-128.png
+++ b/data/media/wiki/dokuwiki-128.png
Binary files differ
diff --git a/data/pages/wiki/dokuwiki.txt b/data/pages/wiki/dokuwiki.txt
index 0e08fdcd3..29843e5c6 100644
--- a/data/pages/wiki/dokuwiki.txt
+++ b/data/pages/wiki/dokuwiki.txt
@@ -57,7 +57,7 @@ All documentation and additional information besides the [[syntax|syntax descrip
===== Copyright =====
-2004-2013 (c) Andreas Gohr <andi@splitbrain.org>((Please do not contact me for help and support -- use the [[doku>mailinglist]] or [[http://forum.dokuwiki.org|forum]] instead)) and the DokuWiki Community
+2004-2015 (c) Andreas Gohr <andi@splitbrain.org>((Please do not contact me for help and support -- use the [[doku>mailinglist]] or [[http://forum.dokuwiki.org|forum]] instead)) and the DokuWiki Community
The DokuWiki engine is licensed under [[http://www.gnu.org/licenses/gpl.html|GNU General Public License]] Version 2. If you use DokuWiki in your company, consider [[doku>donate|donating]] a few bucks ;-).
diff --git a/data/pages/wiki/syntax.txt b/data/pages/wiki/syntax.txt
index 86ad815e4..bdfda9c46 100644
--- a/data/pages/wiki/syntax.txt
+++ b/data/pages/wiki/syntax.txt
@@ -83,9 +83,14 @@ Windows shares like [[\\server\share|this]] are recognized, too. Please note tha
Notes:
* For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone").
- * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Mozilla Knowledge Base]]. However, there will still be a JavaScript warning about trying to open a Windows Share. To remove this warning (for all users), put the following line in ''conf/userscript.js'':
-
- LANG.nosmblinks = '';
+ * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Mozilla Knowledge Base]]. However, there will still be a JavaScript warning about trying to open a Windows Share. To remove this warning (for all users), put the following line in ''conf/lang/en/lang.php'' (more details at [[doku>localization#changing_some_localized_texts_and_strings_in_your_installation|localization]]): <code - conf/lang/en/lang.php>
+<?php
+/**
+ * Customization of the english language file
+ * Copy only the strings that needs to be modified
+ */
+$lang['js']['nosmblinks'] = '';
+</code>
==== Image Links ====
@@ -170,6 +175,12 @@ DokuWiki can embed the following media formats directly.
If you specify a filename that is not a supported media format, then it will be displayed as a link instead.
+By adding ''?linkonly'' you provide a link to the media without displaying it inline
+
+ {{wiki:dokuwiki-128.png?linkonly}}
+
+{{wiki:dokuwiki-128.png?linkonly}} This is just a link to the image.
+
==== Fallback Formats ====
Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility.
@@ -261,17 +272,19 @@ There are three exceptions which do not come from that pattern file: multiplicat
Some times you want to mark some text to show it's a reply or comment. You can use the following syntax:
- I think we should do it
-
- > No we shouldn't
-
- >> Well, I say we should
-
- > Really?
-
- >> Yes!
-
- >>> Then lets do it!
+<code>
+I think we should do it
+
+> No we shouldn't
+
+>> Well, I say we should
+
+> Really?
+
+>> Yes!
+
+>>> Then lets do it!
+</code>
I think we should do it
@@ -317,7 +330,7 @@ As you can see, it's the cell separator before a cell which decides about the fo
^ Heading 4 | no colspan this time | |
^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 |
-You can have rowspans (vertically connected cells) by adding '':::'' into the cells below the one to which they should connect.
+You can have rowspans (vertically connected cells) by adding ''%%:::%%'' into the cells below the one to which they should connect.
^ Heading 1 ^ Heading 2 ^ Heading 3 ^
| Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 |
@@ -481,10 +494,13 @@ echo '</tr></table>';
| author | show item authors names |
| date | show item dates |
| description| show the item description. If [[doku>config:htmlok|HTML]] is disabled all tags will be stripped |
+| nosort | do not sort the items in the feed |
| //n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). |
The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. [[wiki:DokuWiki]] will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells [[wiki:DokuWiki]] to re-render the page if it is more than //refresh period// since the page was last rendered.
+By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the ''reverse'' parameter, or display the feed as is with ''nosort''.
+
**Example:**
{{rss>http://slashdot.org/index.rss 5 author date 1h }}
diff --git a/data/security.png b/data/security.png
index c4f1a9771..cea639eca 100644
--- a/data/security.png
+++ b/data/security.png
Binary files differ
diff --git a/doku.php b/doku.php
index 13e335381..0f4557fd0 100644
--- a/doku.php
+++ b/doku.php
@@ -8,13 +8,18 @@
* @global Input $INPUT
*/
-// update message version
-$updateVersion = 46.4;
+// update message version - always use a string to avoid localized floats!
+$updateVersion = "47";
// xdebug_start_profiling();
if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/');
+// define all DokuWiki globals here (needed within test requests but also helps to keep track)
+global $ACT, $INPUT, $QUERY, $ID, $REV, $DATE_AT, $IDX,
+ $DATE, $RANGE, $HIGH, $TEXT, $PRE, $SUF, $SUM, $INFO, $JSINFO;
+
+
if(isset($_SERVER['HTTP_X_DOKUWIKI_DO'])) {
$ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
} elseif(!empty($_REQUEST['idx'])) {
@@ -72,7 +77,7 @@ if($DATE_AT) {
$DATE_AT = null;
} else if ($rev_t === false) { //page did not exist
$rev_n = $pagelog->getRelativeRevision($DATE_AT,+1);
- msg(sprintf($lang['page_nonexist_rev'],
+ msg(sprintf($lang['page_nonexist_rev'],
strftime($conf['dformat'],$DATE_AT),
wl($ID, array('rev' => $rev_n)),
strftime($conf['dformat'],$rev_n)));
diff --git a/feed.php b/feed.php
index a63e22164..7ea2e235e 100644
--- a/feed.php
+++ b/feed.php
@@ -218,7 +218,7 @@ function rss_buildItems(&$rss, &$data, $opt) {
$date = $ditem['date'];
} elseif ($ditem['media']) {
$date = @filemtime(mediaFN($id));
- } elseif (@file_exists(wikiFN($id))) {
+ } elseif (file_exists(wikiFN($id))) {
$date = @filemtime(wikiFN($id));
} elseif($meta['date']['modified']) {
$date = $meta['date']['modified'];
@@ -306,7 +306,7 @@ function rss_buildItems(&$rss, &$data, $opt) {
$src_r = '';
$src_l = '';
- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)), 300)) {
+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)), 300)) {
$more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
$src_r = ml($id, $more, true, '&amp;', true);
}
@@ -355,7 +355,7 @@ function rss_buildItems(&$rss, &$data, $opt) {
break;
case 'html':
if($ditem['media']) {
- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {
+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
$more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
$src = ml($id, $more, true, '&amp;', true);
$content = '<img src="'.$src.'" alt="'.$id.'" />';
@@ -386,7 +386,7 @@ function rss_buildItems(&$rss, &$data, $opt) {
case 'abstract':
default:
if($ditem['media']) {
- if($size = media_image_preview_size($id, false, new JpegMeta(mediaFN($id)))) {
+ if($size = media_image_preview_size($id, '', new JpegMeta(mediaFN($id)))) {
$more = 'w='.$size[0].'&h='.$size[1].'&t='.@filemtime(mediaFN($id));
$src = ml($id, $more, true, '&amp;', true);
$content = '<img src="'.$src.'" alt="'.$id.'" />';
diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php
index 3c955cf88..210d1c0eb 100644
--- a/inc/DifferenceEngine.php
+++ b/inc/DifferenceEngine.php
@@ -14,6 +14,9 @@ class _DiffOp {
var $orig;
var $closing;
+ /**
+ * @return _DiffOp
+ */
function reverse() {
trigger_error("pure virtual", E_USER_ERROR);
}
@@ -104,6 +107,21 @@ class _DiffOp_Change extends _DiffOp {
*/
class _DiffEngine {
+ var $xchanged = array();
+ var $ychanged = array();
+ var $xv = array();
+ var $yv = array();
+ var $xind = array();
+ var $yind = array();
+ var $seq;
+ var $in_seq;
+ var $lcs;
+
+ /**
+ * @param array $from_lines
+ * @param array $to_lines
+ * @return _DiffOp[]
+ */
function diff($from_lines, $to_lines) {
$n_from = count($from_lines);
$n_to = count($to_lines);
@@ -495,9 +513,9 @@ class Diff {
* Constructor.
* Computes diff between sequences of strings.
*
- * @param $from_lines array An array of strings.
- * (Typically these are lines from a file.)
- * @param $to_lines array An array of strings.
+ * @param array $from_lines An array of strings.
+ * (Typically these are lines from a file.)
+ * @param array $to_lines An array of strings.
*/
function __construct($from_lines, $to_lines) {
$eng = new _DiffEngine;
@@ -512,8 +530,9 @@ class Diff {
*
* $diff = new Diff($lines1, $lines2);
* $rev = $diff->reverse();
- * @return object A Diff object representing the inverse of the
- * original diff.
+ *
+ * @return Diff A Diff object representing the inverse of the
+ * original diff.
*/
function reverse() {
$rev = $this;
@@ -631,19 +650,19 @@ class MappedDiff extends Diff {
* case-insensitve diffs, or diffs which ignore
* changes in white-space.
*
- * @param $from_lines array An array of strings.
- * (Typically these are lines from a file.)
+ * @param string[] $from_lines An array of strings.
+ * (Typically these are lines from a file.)
*
- * @param $to_lines array An array of strings.
+ * @param string[] $to_lines An array of strings.
*
- * @param $mapped_from_lines array This array should
- * have the same size number of elements as $from_lines.
- * The elements in $mapped_from_lines and
- * $mapped_to_lines are what is actually compared
- * when computing the diff.
+ * @param string[] $mapped_from_lines This array should
+ * have the same size number of elements as $from_lines.
+ * The elements in $mapped_from_lines and
+ * $mapped_to_lines are what is actually compared
+ * when computing the diff.
*
- * @param $mapped_to_lines array This array should
- * have the same number of elements as $to_lines.
+ * @param string[] $mapped_to_lines This array should
+ * have the same number of elements as $to_lines.
*/
function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) {
@@ -697,12 +716,13 @@ class DiffFormatter {
/**
* Format a diff.
*
- * @param $diff object A Diff object.
+ * @param Diff $diff A Diff object.
* @return string The formatted output.
*/
function format($diff) {
$xi = $yi = 1;
+ $x0 = $y0 = 0;
$block = false;
$context = array();
@@ -752,6 +772,13 @@ class DiffFormatter {
return $this->_end_diff();
}
+ /**
+ * @param int $xbeg
+ * @param int $xlen
+ * @param int $ybeg
+ * @param int $ylen
+ * @param array $edits
+ */
function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
$this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen));
foreach ($edits as $edit) {
@@ -779,6 +806,13 @@ class DiffFormatter {
return $val;
}
+ /**
+ * @param int $xbeg
+ * @param int $xlen
+ * @param int $ybeg
+ * @param int $ylen
+ * @return string
+ */
function _block_header($xbeg, $xlen, $ybeg, $ylen) {
if ($xlen > 1)
$xbeg .= "," . ($xbeg + $xlen - 1);
@@ -788,6 +822,9 @@ class DiffFormatter {
return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
}
+ /**
+ * @param string $header
+ */
function _start_block($header) {
echo $header;
}
@@ -896,6 +933,9 @@ class _HWLDF_WordAccumulator {
$this->_tag = $new_tag;
}
+ /**
+ * @param string $new_tag
+ */
function _flushLine($new_tag) {
$this->_flushGroup($new_tag);
if ($this->_line != '')
@@ -1055,6 +1095,10 @@ class TableDiffFormatter extends DiffFormatter {
$this->trailing_context_lines = 2;
}
+ /**
+ * @param Diff $diff
+ * @return string
+ */
function format($diff) {
// Preserve whitespaces by converting some to non-breaking spaces.
// Do not convert all of them to allow word-wrap.
@@ -1165,6 +1209,10 @@ class InlineDiffFormatter extends DiffFormatter {
$this->trailing_context_lines = 2;
}
+ /**
+ * @param Diff $diff
+ * @return string
+ */
function format($diff) {
// Preserve whitespaces by converting some to non-breaking spaces.
// Do not convert all of them to allow word-wrap.
diff --git a/inc/Form/CheckableElement.php b/inc/Form/CheckableElement.php
new file mode 100644
index 000000000..a57bbc1f6
--- /dev/null
+++ b/inc/Form/CheckableElement.php
@@ -0,0 +1,62 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class CheckableElement
+ *
+ * For Radio- and Checkboxes
+ *
+ * @package DokuForm
+ */
+class CheckableElement extends InputElement {
+
+ /**
+ * @param string $type The type of this element
+ * @param string $name The name of this form element
+ * @param string $label The label text for this element
+ */
+ public function __construct($type, $name, $label) {
+ parent::__construct($type, $name, $label);
+ // default value is 1
+ $this->attr('value', 1);
+ }
+
+ /**
+ * Handles the useInput flag and sets the checked attribute accordingly
+ */
+ protected function prefillInput() {
+ global $INPUT;
+ list($name, $key) = $this->getInputName();
+ $myvalue = $this->val();
+
+ if(!$INPUT->has($name)) return;
+
+ if($key === null) {
+ // no key - single value
+ $value = $INPUT->str($name);
+ if($value == $myvalue) {
+ $this->attr('checked', 'checked');
+ } else {
+ $this->rmattr('checked');
+ }
+ } else {
+ // we have an array, there might be several values in it
+ $input = $INPUT->arr($name);
+ if(isset($input[$key])) {
+ $this->rmattr('checked');
+
+ // values seem to be in another sub array
+ if(is_array($input[$key])) {
+ $input = $input[$key];
+ }
+
+ foreach($input as $value) {
+ if($value == $myvalue) {
+ $this->attr('checked', 'checked');
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/inc/Form/Element.php b/inc/Form/Element.php
new file mode 100644
index 000000000..7938ee009
--- /dev/null
+++ b/inc/Form/Element.php
@@ -0,0 +1,151 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class Element
+ *
+ * The basic building block of a form
+ *
+ * @package dokuwiki\Form
+ */
+abstract class Element {
+
+ /**
+ * @var array the attributes of this element
+ */
+ protected $attributes = array();
+
+ /**
+ * @var string The type of this element
+ */
+ protected $type;
+
+ /**
+ * @param string $type The type of this element
+ * @param array $attributes
+ */
+ public function __construct($type, $attributes = array()) {
+ $this->type = $type;
+ $this->attributes = $attributes;
+ }
+
+ /**
+ * Type of this element
+ *
+ * @return string
+ */
+ public function getType() {
+ return $this->type;
+ }
+
+ /**
+ * Gets or sets an attribute
+ *
+ * When no $value is given, the current content of the attribute is returned.
+ * An empty string is returned for unset attributes.
+ *
+ * When a $value is given, the content is set to that value and the Element
+ * itself is returned for easy chaining
+ *
+ * @param string $name Name of the attribute to access
+ * @param null|string $value New value to set
+ * @return string|$this
+ */
+ public function attr($name, $value = null) {
+ // set
+ if($value !== null) {
+ $this->attributes[$name] = $value;
+ return $this;
+ }
+
+ // get
+ if(isset($this->attributes[$name])) {
+ return $this->attributes[$name];
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Removes the given attribute if it exists
+ *
+ * @param $name
+ * @return $this
+ */
+ public function rmattr($name) {
+ if(isset($this->attributes[$name])) {
+ unset($this->attributes[$name]);
+ }
+ return $this;
+ }
+
+ /**
+ * Gets or adds a all given attributes at once
+ *
+ * @param array|null $attributes
+ * @return array|$this
+ */
+ public function attrs($attributes = null) {
+ // set
+ if($attributes) {
+ foreach((array) $attributes as $key => $val) {
+ $this->attr($key, $val);
+ }
+ return $this;
+ }
+ // get
+ return $this->attributes;
+ }
+
+ /**
+ * Adds a class to the class attribute
+ *
+ * This is the preferred method of setting the element's class
+ *
+ * @param string $class the new class to add
+ * @return $this
+ */
+ public function addClass($class) {
+ $classes = explode(' ', $this->attr('class'));
+ $classes[] = $class;
+ $classes = array_unique($classes);
+ $classes = array_filter($classes);
+ $this->attr('class', join(' ', $classes));
+ return $this;
+ }
+
+ /**
+ * Get or set the element's ID
+ *
+ * This is the preferred way of setting the element's ID
+ *
+ * @param null|string $id
+ * @return string|$this
+ */
+ public function id($id = null) {
+ if(strpos($id, '__') === false) {
+ throw new \InvalidArgumentException('IDs in DokuWiki have to contain two subsequent underscores');
+ }
+
+ return $this->attr('id', $id);
+ }
+
+ /**
+ * Get or set the element's value
+ *
+ * This is the preferred way of setting the element's value
+ *
+ * @param null|string $value
+ * @return string|$this
+ */
+ public function val($value = null) {
+ return $this->attr('value', $value);
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ abstract public function toHTML();
+}
diff --git a/inc/Form/FieldsetCloseElement.php b/inc/Form/FieldsetCloseElement.php
new file mode 100644
index 000000000..8f26717aa
--- /dev/null
+++ b/inc/Form/FieldsetCloseElement.php
@@ -0,0 +1,30 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class FieldsetCloseElement
+ *
+ * Closes an open Fieldset
+ *
+ * @package dokuwiki\Form
+ */
+class FieldsetCloseElement extends TagCloseElement {
+
+ /**
+ * @param array $attributes
+ */
+ public function __construct($attributes = array()) {
+ parent::__construct('', $attributes);
+ $this->type = 'fieldsetclose';
+ }
+
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '</fieldset>';
+ }
+}
diff --git a/inc/Form/FieldsetOpenElement.php b/inc/Form/FieldsetOpenElement.php
new file mode 100644
index 000000000..a7de461fa
--- /dev/null
+++ b/inc/Form/FieldsetOpenElement.php
@@ -0,0 +1,36 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class FieldsetOpenElement
+ *
+ * Opens a Fieldset with an optional legend
+ *
+ * @package dokuwiki\Form
+ */
+class FieldsetOpenElement extends TagOpenElement {
+
+ /**
+ * @param string $legend
+ * @param array $attributes
+ */
+ public function __construct($legend='', $attributes = array()) {
+ // this is a bit messy and we just do it for the nicer class hierarchy
+ // the parent would expect the tag in $value but we're storing the
+ // legend there, so we have to set the type manually
+ parent::__construct($legend, $attributes);
+ $this->type = 'fieldsetopen';
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ $html = '<fieldset '.buildAttributes($this->attrs()).'>';
+ $legend = $this->val();
+ if($legend) $html .= DOKU_LF.'<legend>'.hsc($legend).'</legend>';
+ return $html;
+ }
+}
diff --git a/inc/Form/Form.php b/inc/Form/Form.php
new file mode 100644
index 000000000..625557fa1
--- /dev/null
+++ b/inc/Form/Form.php
@@ -0,0 +1,367 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class Form
+ *
+ * Represents the whole Form. This is what you work on, and add Elements to
+ *
+ * @package dokuwiki\Form
+ */
+class Form extends Element {
+
+ /**
+ * @var array name value pairs for hidden values
+ */
+ protected $hidden = array();
+
+ /**
+ * @var Element[] the elements of the form
+ */
+ protected $elements = array();
+
+ /**
+ * Creates a new, empty form with some default attributes
+ *
+ * @param array $attributes
+ */
+ public function __construct($attributes = array()) {
+ global $ID;
+
+ parent::__construct('form', $attributes);
+
+ // use the current URL as default action
+ if(!$this->attr('action')) {
+ $get = $_GET;
+ if(isset($get['id'])) unset($get['id']);
+ $self = wl($ID, $get, false, '&'); //attributes are escaped later
+ $this->attr('action', $self);
+ }
+
+ // post is default
+ if(!$this->attr('method')) {
+ $this->attr('method', 'post');
+ }
+
+ // we like UTF-8
+ if(!$this->attr('accept-charset')) {
+ $this->attr('accept-charset', 'utf-8');
+ }
+
+ // add the security token by default
+ $this->setHiddenField('sectok', getSecurityToken());
+
+ // identify this as a new form based form in HTML
+ $this->addClass('doku_form');
+ }
+
+ /**
+ * Sets a hidden field
+ *
+ * @param $name
+ * @param $value
+ * @return $this
+ */
+ public function setHiddenField($name, $value) {
+ $this->hidden[$name] = $value;
+ return $this;
+ }
+
+ #region element query function
+
+ /**
+ * Returns the numbers of elements in the form
+ *
+ * @return int
+ */
+ public function elementCount() {
+ return count($this->elements);
+ }
+
+ /**
+ * Returns a reference to the element at a position.
+ * A position out-of-bounds will return either the
+ * first (underflow) or last (overflow) element.
+ *
+ * @param $pos
+ * @return Element
+ */
+ public function getElementAt($pos) {
+ if($pos < 0) $pos = count($this->elements) + $pos;
+ if($pos < 0) $pos = 0;
+ if($pos >= count($this->elements)) $pos = count($this->elements) - 1;
+ return $this->elements[$pos];
+ }
+
+ /**
+ * Gets the position of the first of a type of element
+ *
+ * @param string $type Element type to look for.
+ * @param int $offset search from this position onward
+ * @return false|int position of element if found, otherwise false
+ */
+ public function findPositionByType($type, $offset = 0) {
+ $len = $this->elementCount();
+ for($pos = $offset; $pos < $len; $pos++) {
+ if($this->elements[$pos]->getType() == $type) {
+ return $pos;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Gets the position of the first element matching the attribute
+ *
+ * @param string $name Name of the attribute
+ * @param string $value Value the attribute should have
+ * @param int $offset search from this position onward
+ * @return false|int position of element if found, otherwise false
+ */
+ public function findPositionByAttribute($name, $value, $offset = 0) {
+ $len = $this->elementCount();
+ for($pos = $offset; $pos < $len; $pos++) {
+ if($this->elements[$pos]->attr($name) == $value) {
+ return $pos;
+ }
+ }
+ return false;
+ }
+
+ #endregion
+
+ #region Element positioning functions
+
+ /**
+ * Adds or inserts an element to the form
+ *
+ * @param Element $element
+ * @param int $pos 0-based position in the form, -1 for at the end
+ * @return Element
+ */
+ public function addElement(Element $element, $pos = -1) {
+ if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
+ if($pos < 0) {
+ $this->elements[] = $element;
+ } else {
+ array_splice($this->elements, $pos, 0, array($element));
+ }
+ return $element;
+ }
+
+ /**
+ * Replaces an existing element with a new one
+ *
+ * @param Element $element the new element
+ * @param $pos 0-based position of the element to replace
+ */
+ public function replaceElement(Element $element, $pos) {
+ if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
+ array_splice($this->elements, $pos, 1, array($element));
+ }
+
+ /**
+ * Remove an element from the form completely
+ *
+ * @param $pos 0-based position of the element to remove
+ */
+ public function removeElement($pos) {
+ array_splice($this->elements, $pos, 1);
+ }
+
+ #endregion
+
+ #region Element adding functions
+
+ /**
+ * Adds a text input field
+ *
+ * @param $name
+ * @param $label
+ * @param int $pos
+ * @return InputElement
+ */
+ public function addTextInput($name, $label = '', $pos = -1) {
+ return $this->addElement(new InputElement('text', $name, $label), $pos);
+ }
+
+ /**
+ * Adds a password input field
+ *
+ * @param $name
+ * @param $label
+ * @param int $pos
+ * @return InputElement
+ */
+ public function addPasswordInput($name, $label = '', $pos = -1) {
+ return $this->addElement(new InputElement('password', $name, $label), $pos);
+ }
+
+ /**
+ * Adds a radio button field
+ *
+ * @param $name
+ * @param $label
+ * @param int $pos
+ * @return CheckableElement
+ */
+ public function addRadioButton($name, $label = '', $pos = -1) {
+ return $this->addElement(new CheckableElement('radio', $name, $label), $pos);
+ }
+
+ /**
+ * Adds a checkbox field
+ *
+ * @param $name
+ * @param $label
+ * @param int $pos
+ * @return CheckableElement
+ */
+ public function addCheckbox($name, $label = '', $pos = -1) {
+ return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
+ }
+
+ /**
+ * Adds a textarea field
+ *
+ * @param $name
+ * @param $label
+ * @param int $pos
+ * @return TextareaElement
+ */
+ public function addTextarea($name, $label = '', $pos = -1) {
+ return $this->addElement(new TextareaElement($name, $label), $pos);
+ }
+
+ /**
+ * Add fixed HTML to the form
+ *
+ * @param $html
+ * @param int $pos
+ * @return HTMLElement
+ */
+ public function addHTML($html, $pos = -1) {
+ return $this->addElement(new HTMLElement($html), $pos);
+ }
+
+ /**
+ * Add a closed HTML tag to the form
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagElement
+ */
+ public function addTag($tag, $pos = -1) {
+ return $this->addElement(new TagElement($tag), $pos);
+ }
+
+ /**
+ * Add an open HTML tag to the form
+ *
+ * Be sure to close it again!
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagOpenElement
+ */
+ public function addTagOpen($tag, $pos = -1) {
+ return $this->addElement(new TagOpenElement($tag), $pos);
+ }
+
+ /**
+ * Add a closing HTML tag to the form
+ *
+ * Be sure it had been opened before
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagCloseElement
+ */
+ public function addTagClose($tag, $pos = -1) {
+ return $this->addElement(new TagCloseElement($tag), $pos);
+ }
+
+ /**
+ * Open a Fieldset
+ *
+ * @param $legend
+ * @param int $pos
+ * @return FieldsetOpenElement
+ */
+ public function addFieldsetOpen($legend = '', $pos = -1) {
+ return $this->addElement(new FieldsetOpenElement($legend), $pos);
+ }
+
+ /**
+ * Close a fieldset
+ *
+ * @param int $pos
+ * @return TagCloseElement
+ */
+ public function addFieldsetClose($pos = -1) {
+ return $this->addElement(new FieldsetCloseElement(), $pos);
+ }
+
+ #endregion
+
+ /**
+ * Adjust the elements so that fieldset open and closes are matching
+ */
+ protected function balanceFieldsets() {
+ $lastclose = 0;
+ $isopen = false;
+ $len = count($this->elements);
+
+ for($pos = 0; $pos < $len; $pos++) {
+ $type = $this->elements[$pos]->getType();
+ if($type == 'fieldsetopen') {
+ if($isopen) {
+ //close previous fieldset
+ $this->addFieldsetClose($pos);
+ $lastclose = $pos + 1;
+ $pos++;
+ $len++;
+ }
+ $isopen = true;
+ } else if($type == 'fieldsetclose') {
+ if(!$isopen) {
+ // make sure there was a fieldsetopen
+ // either right after the last close or at the begining
+ $this->addFieldsetOpen('', $lastclose);
+ $len++;
+ $pos++;
+ }
+ $lastclose = $pos;
+ $isopen = false;
+ }
+ }
+
+ // close open fieldset at the end
+ if($isopen) {
+ $this->addFieldsetClose();
+ }
+ }
+
+ /**
+ * The HTML representation of the whole form
+ *
+ * @return string
+ */
+ public function toHTML() {
+ $this->balanceFieldsets();
+
+ $html = '<form ' . buildAttributes($this->attrs()) . '>' . DOKU_LF;
+
+ foreach($this->hidden as $name => $value) {
+ $html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />' . DOKU_LF;
+ }
+
+ foreach($this->elements as $element) {
+ $html .= $element->toHTML() . DOKU_LF;
+ }
+
+ $html .= '</form>' . DOKU_LF;
+
+ return $html;
+ }
+}
diff --git a/inc/Form/HTMLElement.php b/inc/Form/HTMLElement.php
new file mode 100644
index 000000000..591cf472f
--- /dev/null
+++ b/inc/Form/HTMLElement.php
@@ -0,0 +1,29 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class HTMLElement
+ *
+ * Holds arbitrary HTML that is added as is to the Form
+ *
+ * @package dokuwiki\Form
+ */
+class HTMLElement extends ValueElement {
+
+
+ /**
+ * @param string $html
+ */
+ public function __construct($html) {
+ parent::__construct('html', $html);
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return $this->val();
+ }
+}
diff --git a/inc/Form/InputElement.php b/inc/Form/InputElement.php
new file mode 100644
index 000000000..5908f7d11
--- /dev/null
+++ b/inc/Form/InputElement.php
@@ -0,0 +1,160 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class InputElement
+ *
+ * Base class for all input elements. Uses a wrapping label when label
+ * text is given.
+ *
+ * @todo figure out how to make wrapping or related label configurable
+ * @package dokuwiki\Form
+ */
+class InputElement extends Element {
+ /**
+ * @var Label
+ */
+ protected $label = null;
+
+ /**
+ * @var bool if the element should reflect posted values
+ */
+ protected $useInput = true;
+
+ /**
+ * @param string $type The type of this element
+ * @param string $name The name of this form element
+ * @param string $label The label text for this element
+ */
+ public function __construct($type, $name, $label = '') {
+ parent::__construct($type, array('name' => $name));
+ $this->attr('name', $name);
+ if($label) $this->label = new Label($label);
+ }
+
+ /**
+ * Returns the label element if there's one set
+ *
+ * @return Label|null
+ */
+ public function getLabel() {
+ return $this->label;
+ }
+
+ /**
+ * Should the user sent input be used to initialize the input field
+ *
+ * The default is true. Any set values will be overwritten by the INPUT
+ * provided values.
+ *
+ * @param bool $useinput
+ * @return $this
+ */
+ public function useInput($useinput) {
+ $this->useInput = (bool) $useinput;
+ return $this;
+ }
+
+ /**
+ * Get or set the element's ID
+ *
+ * @param null|string $id
+ * @return string|$this
+ */
+ public function id($id = null) {
+ if($this->label) $this->label->attr('for', $id);
+ return parent::id($id);
+ }
+
+ /**
+ * Adds a class to the class attribute
+ *
+ * This is the preferred method of setting the element's class
+ *
+ * @param string $class the new class to add
+ * @return $this
+ */
+ public function addClass($class) {
+ if($this->label) $this->label->addClass($class);
+ return parent::addClass($class);
+ }
+
+ /**
+ * Figures out how to access the value for this field from INPUT data
+ *
+ * The element's name could have been given as a simple string ('foo')
+ * or in array notation ('foo[bar]').
+ *
+ * Note: this function only handles one level of arrays. If your data
+ * is nested deeper, you should call useInput(false) and set the
+ * correct value yourself
+ *
+ * @return array name and array key (null if not an array)
+ */
+ protected function getInputName() {
+ $name = $this->attr('name');
+ parse_str("$name=1", $parsed);
+
+ $name = array_keys($parsed);
+ $name = array_shift($name);
+
+ if(is_array($parsed[$name])) {
+ $key = array_keys($parsed[$name]);
+ $key = array_shift($key);
+ } else {
+ $key = null;
+ }
+
+ return array($name, $key);
+ }
+
+ /**
+ * Handles the useInput flag and set the value attribute accordingly
+ */
+ protected function prefillInput() {
+ global $INPUT;
+
+ list($name, $key) = $this->getInputName();
+ if(!$INPUT->has($name)) return;
+
+ if($key === null) {
+ $value = $INPUT->str($name);
+ } else {
+ $value = $INPUT->arr($name);
+ if(isset($value[$key])) {
+ $value = $value[$key];
+ } else {
+ $value = '';
+ }
+ }
+ if($value !== '') {
+ $this->val($value);
+ }
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ protected function mainElementHTML() {
+ if($this->useInput) $this->prefillInput();
+ return '<input ' . buildAttributes($this->attrs()) . ' />';
+ }
+
+ /**
+ * The HTML representation of this element wrapped in a label
+ *
+ * @return string
+ */
+ public function toHTML() {
+ if($this->label) {
+ return '<label ' . buildAttributes($this->label->attrs()) . '>' . DOKU_LF .
+ '<span>' . hsc($this->label->val()) . '</span>' . DOKU_LF .
+ $this->mainElementHTML() . DOKU_LF .
+ '</label>';
+ } else {
+ return $this->mainElementHTML();
+ }
+ }
+}
diff --git a/inc/Form/Label.php b/inc/Form/Label.php
new file mode 100644
index 000000000..8dcd7cd5f
--- /dev/null
+++ b/inc/Form/Label.php
@@ -0,0 +1,27 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class Label
+ * @package dokuwiki\Form
+ */
+class Label extends ValueElement {
+
+ /**
+ * Creates a new Label
+ *
+ * @param string $label
+ */
+ public function __construct($label) {
+ parent::__construct('label', $label);
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '<label ' . buildAttributes($this->attrs()) . '>' . hsc($this->val()) . '</label>';
+ }
+}
diff --git a/inc/Form/LegacyForm.php b/inc/Form/LegacyForm.php
new file mode 100644
index 000000000..1b47ba204
--- /dev/null
+++ b/inc/Form/LegacyForm.php
@@ -0,0 +1,181 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class LegacyForm
+ *
+ * Provides a compatibility layer to the old Doku_Form API
+ *
+ * This can be used to work with the modern API on forms provided by old events for
+ * example. When you start new forms, just use Form\Form
+ *
+ * @package dokuwiki\Form
+ */
+class LegacyForm extends Form {
+
+ /**
+ * Creates a new modern form from an old legacy Doku_Form
+ *
+ * @param \Doku_Form $oldform
+ */
+ public function __construct(\Doku_Form $oldform) {
+ parent::__construct($oldform->params);
+
+ $this->hidden = $oldform->_hidden;
+
+ foreach($oldform->_content as $element) {
+ list($ctl, $attr) = $this->parseLegacyAttr($element);
+
+ if(is_array($element)) {
+ switch($ctl['elem']) {
+ case 'wikitext':
+ $this->addTextarea('wikitext')
+ ->attrs($attr)
+ ->id('wiki__text')
+ ->val($ctl['text'])
+ ->addClass($ctl['class']);
+ break;
+ case 'textfield':
+ $this->addTextInput($ctl['name'], $ctl['text'])
+ ->attrs($attr)
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'passwordfield':
+ $this->addPasswordInput($ctl['name'], $ctl['text'])
+ ->attrs($attr)
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'checkboxfield':
+ $this->addCheckbox($ctl['name'], $ctl['text'])
+ ->attrs($attr)
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'radiofield':
+ $this->addRadioButton($ctl['name'], $ctl['text'])
+ ->attrs($attr)
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'tag':
+ $this->addTag($ctl['tag'])
+ ->attrs($attr)
+ ->attr('name', $ctl['name'])
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'opentag':
+ $this->addTagOpen($ctl['tag'])
+ ->attrs($attr)
+ ->attr('name', $ctl['name'])
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'closetag':
+ $this->addTagClose($ctl['tag']);
+ break;
+ case 'openfieldset':
+ $this->addFieldsetOpen($ctl['legend'])
+ ->attrs($attr)
+ ->attr('name', $ctl['name'])
+ ->id($ctl['id'])
+ ->addClass($ctl['class']);
+ break;
+ case 'closefieldset':
+ $this->addFieldsetClose();
+ break;
+ case 'button':
+ case 'field':
+ case 'fieldright':
+ case 'filefield':
+ case 'menufield':
+ case 'listboxfield':
+ throw new \UnexpectedValueException('Unsupported legacy field ' . $ctl['elem']);
+ break;
+ default:
+ throw new \UnexpectedValueException('Unknown legacy field ' . $ctl['elem']);
+
+ }
+ } else {
+ $this->addHTML($element);
+ }
+ }
+
+ }
+
+ /**
+ * Parses out what is the elements attributes and what is control info
+ *
+ * @param array $legacy
+ * @return array
+ */
+ protected function parseLegacyAttr($legacy) {
+ $attributes = array();
+ $control = array();
+
+ foreach($legacy as $key => $val) {
+ if($key{0} == '_') {
+ $control[substr($key, 1)] = $val;
+ } elseif($key == 'name') {
+ $control[$key] = $val;
+ } elseif($key == 'id') {
+ $control[$key] = $val;
+ } else {
+ $attributes[$key] = $val;
+ }
+ }
+
+ return array($control, $attributes);
+ }
+
+ /**
+ * Translates our types to the legacy types
+ *
+ * @param string $type
+ * @return string
+ */
+ protected function legacyType($type) {
+ static $types = array(
+ 'text' => 'textfield',
+ 'password' => 'passwordfield',
+ 'checkbox' => 'checkboxfield',
+ 'radio' => 'radiofield',
+ 'tagopen' => 'opentag',
+ 'tagclose' => 'closetag',
+ 'fieldsetopen' => 'openfieldset',
+ 'fieldsetclose' => 'closefieldset',
+ );
+ if(isset($types[$type])) return $types[$type];
+ return $type;
+ }
+
+ /**
+ * Creates an old legacy form from this modern form's data
+ *
+ * @return \Doku_Form
+ */
+ public function toLegacy() {
+ $this->balanceFieldsets();
+
+ $legacy = new \Doku_Form($this->attrs());
+ $legacy->_hidden = $this->hidden;
+ foreach($this->elements as $element) {
+ if(is_a($element, 'dokuwiki\Form\HTMLElement')) {
+ $legacy->_content[] = $element->toHTML();
+ } elseif(is_a($element, 'dokuwiki\Form\InputElement')) {
+ /** @var InputElement $element */
+ $data = $element->attrs();
+ $data['_elem'] = $this->legacyType($element->getType());
+ $label = $element->getLabel();
+ if($label) {
+ $data['_class'] = $label->attr('class');
+ }
+ $legacy->_content[] = $data;
+ }
+ }
+
+ return $legacy;
+ }
+}
diff --git a/inc/Form/TagCloseElement.php b/inc/Form/TagCloseElement.php
new file mode 100644
index 000000000..dc0264c21
--- /dev/null
+++ b/inc/Form/TagCloseElement.php
@@ -0,0 +1,76 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class TagCloseElement
+ *
+ * Creates an HTML close tag. You have to make sure it has been opened
+ * before or this will produce invalid HTML
+ *
+ * @package dokuwiki\Form
+ */
+class TagCloseElement extends ValueElement {
+
+ /**
+ * @param string $tag
+ * @param array $attributes
+ */
+ public function __construct($tag, $attributes = array()) {
+ parent::__construct('tagclose', $tag, $attributes);
+ }
+
+ /**
+ * do not call this
+ *
+ * @param $class
+ * @return void
+ * @throws \BadMethodCallException
+ */
+ public function addClass($class) {
+ throw new \BadMethodCallException('You can\t add classes to closing tag');
+ }
+
+ /**
+ * do not call this
+ *
+ * @param $id
+ * @return void
+ * @throws \BadMethodCallException
+ */
+ public function id($id = null) {
+ throw new \BadMethodCallException('You can\t add ID to closing tag');
+ }
+
+ /**
+ * do not call this
+ *
+ * @param $name
+ * @param $value
+ * @return void
+ * @throws \BadMethodCallException
+ */
+ public function attr($name, $value = null) {
+ throw new \BadMethodCallException('You can\t add attributes to closing tag');
+ }
+
+ /**
+ * do not call this
+ *
+ * @param $attributes
+ * @return void
+ * @throws \BadMethodCallException
+ */
+ public function attrs($attributes = null) {
+ throw new \BadMethodCallException('You can\t add attributes to closing tag');
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '</'.$this->val().'>';
+ }
+
+}
diff --git a/inc/Form/TagElement.php b/inc/Form/TagElement.php
new file mode 100644
index 000000000..ea5144c9c
--- /dev/null
+++ b/inc/Form/TagElement.php
@@ -0,0 +1,29 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class TagElement
+ *
+ * Creates a self closing HTML tag
+ *
+ * @package dokuwiki\Form
+ */
+class TagElement extends ValueElement {
+
+ /**
+ * @param string $tag
+ * @param array $attributes
+ */
+ public function __construct($tag, $attributes = array()) {
+ parent::__construct('tag', $tag, $attributes);
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '<'.$this->val().' '.buildAttributes($this->attrs()).' />';
+ }
+}
diff --git a/inc/Form/TagOpenElement.php b/inc/Form/TagOpenElement.php
new file mode 100644
index 000000000..0afe97b45
--- /dev/null
+++ b/inc/Form/TagOpenElement.php
@@ -0,0 +1,30 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class TagOpenElement
+ *
+ * Creates an open HTML tag. You have to make sure you close it
+ * again or this will produce invalid HTML
+ *
+ * @package dokuwiki\Form
+ */
+class TagOpenElement extends ValueElement {
+
+ /**
+ * @param string $tag
+ * @param array $attributes
+ */
+ public function __construct($tag, $attributes = array()) {
+ parent::__construct('tagopen', $tag, $attributes);
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return '<'.$this->val().' '.buildAttributes($this->attrs()).'>';
+ }
+}
diff --git a/inc/Form/TextareaElement.php b/inc/Form/TextareaElement.php
new file mode 100644
index 000000000..9d461fdf5
--- /dev/null
+++ b/inc/Form/TextareaElement.php
@@ -0,0 +1,51 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class TextareaElement
+ * @package dokuwiki\Form
+ */
+class TextareaElement extends InputElement {
+
+ /**
+ * @var string the actual text within the area
+ */
+ protected $text;
+
+ /**
+ * @param string $name The name of this form element
+ * @param string $label The label text for this element
+ */
+ public function __construct($name, $label) {
+ parent::__construct('textarea', $name, $label);
+ $this->attr('dir', 'auto');
+ }
+
+ /**
+ * Get or set the element's value
+ *
+ * This is the preferred way of setting the element's value
+ *
+ * @param null|string $value
+ * @return string|$this
+ */
+ public function val($value = null) {
+ if($value !== null) {
+ $this->text = $value;
+ return $this;
+ }
+ return $this->text;
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ protected function mainElementHTML() {
+ if($this->useInput) $this->prefillInput();
+ return '<textarea ' . buildAttributes($this->attrs()) . '>' .
+ formText($this->val()) . '</textarea>';
+ }
+
+}
diff --git a/inc/Form/ValueElement.php b/inc/Form/ValueElement.php
new file mode 100644
index 000000000..9dc2fd0df
--- /dev/null
+++ b/inc/Form/ValueElement.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace dokuwiki\Form;
+
+/**
+ * Class ValueElement
+ *
+ * Just like an Element but it's value is not part of its attributes
+ *
+ * What the value is (tag name, content, etc) is defined by the actual implementations
+ *
+ * @package dokuwiki\Form
+ */
+abstract class ValueElement extends Element {
+
+ /**
+ * @var string holds the element's value
+ */
+ protected $value = '';
+
+ /**
+ * @param string $type
+ * @param array|string $value
+ * @param array $attributes
+ */
+ public function __construct($type, $value, $attributes = array()) {
+ parent::__construct($type, $attributes);
+ $this->val($value);
+ }
+
+ /**
+ * Get or set the element's value
+ *
+ * @param null|string $value
+ * @return string|$this
+ */
+ public function val($value = null) {
+ if($value !== null) {
+ $this->value = $value;
+ return $this;
+ }
+ return $this->value;
+ }
+
+}
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index cd4c7c4c5..092216c57 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -57,6 +57,12 @@ class DokuHTTPClient extends HTTPClient {
* @triggers HTTPCLIENT_REQUEST_SEND
* @author Andreas Gohr <andi@splitbrain.org>
*/
+ /**
+ * @param string $url
+ * @param string|array $data the post data either as array or raw data
+ * @param string $method
+ * @return bool
+ */
function sendRequest($url,$data='',$method='GET'){
$httpdata = array('url' => $url,
'data' => $data,
@@ -104,7 +110,7 @@ class HTTPClient {
var $header_regexp; // if set this RE must match against the headers, else abort
var $headers;
var $debug;
- var $start = 0; // for timings
+ var $start = 0.0; // for timings
var $keep_alive = true; // keep alive rocks
// don't set these, read on error
@@ -166,7 +172,8 @@ class HTTPClient {
*
* @param string $url The URL to fetch
* @param bool $sloppy304 Return body on 304 not modified
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function get($url,$sloppy304=false){
@@ -187,7 +194,8 @@ class HTTPClient {
* @param string $url The URL to fetch
* @param array $data Associative array of parameters
* @param bool $sloppy304 Return body on 304 not modified
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function dget($url,$data,$sloppy304=false){
@@ -207,7 +215,7 @@ class HTTPClient {
*
* @param string $url The URL to fetch
* @param array $data Associative array of parameters
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
* @author Andreas Gohr <andi@splitbrain.org>
*/
function post($url,$data){
@@ -229,6 +237,7 @@ class HTTPClient {
* @param mixed $data - the post data either as array or raw data
* @param string $method - HTTP Method usually GET or POST.
* @return bool - true on success
+ *
* @author Andreas Goetz <cpuidle@gmx.de>
* @author Andreas Gohr <andi@splitbrain.org>
*/
@@ -580,10 +589,25 @@ class HTTPClient {
$this->_debug('SSL Tunnel Response',$r_headers);
if(preg_match('/^HTTP\/1\.[01] 200/i',$r_headers)){
- if (stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
+ // set correct peer name for verification (enabled since PHP 5.6)
+ stream_context_set_option($socket, 'ssl', 'peer_name', $requestinfo['host']);
+
+ // because SSLv3 is mostly broken, we try TLS connections here first.
+ // according to https://github.com/splitbrain/dokuwiki/commit/c05ef534 we had problems with certain
+ // setups with this solution before, but we have no usable test for that and TLS should be the more
+ // common crypto by now
+ if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
+ $requesturl = $requestinfo['path'];
+ return true;
+ }
+
+ // if the above failed, this will most probably not work either, but we can try
+ if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
$requesturl = $requestinfo['path'];
return true;
}
+
+ throw new HTTPClientException('Failed to set up crypto for secure connection to '.$requestinfo['host'], -151);
}
throw new HTTPClientException('Failed to establish secure proxy connection', -150);
@@ -596,6 +620,7 @@ class HTTPClient {
* @param string $data The data to write
* @param string $message Description of what is being read
* @throws HTTPClientException
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _sendData($socket, $data, $message) {
@@ -640,6 +665,7 @@ class HTTPClient {
* @param bool $ignore_eof End-of-file is not an error if this is set
* @throws HTTPClientException
* @return string
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _readData($socket, $nbytes, $message, $ignore_eof = false) {
@@ -689,6 +715,7 @@ class HTTPClient {
* @param string $message Description of what is being read
* @throws HTTPClientException
* @return string
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _readLine($socket, $message) {
@@ -723,6 +750,9 @@ class HTTPClient {
* Uses _debug_text or _debug_html depending on the SAPI name
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $info
+ * @param mixed $var
*/
function _debug($info,$var=null){
if(!$this->debug) return;
@@ -736,8 +766,8 @@ class HTTPClient {
/**
* print debug info as HTML
*
- * @param $info
- * @param null $var
+ * @param string $info
+ * @param mixed $var
*/
function _debug_html($info, $var=null){
print '<b>'.$info.'</b> '.($this->_time() - $this->start).'s<br />';
@@ -753,8 +783,8 @@ class HTTPClient {
/**
* prints debug info as plain text
*
- * @param $info
- * @param null $var
+ * @param string $info
+ * @param mixed $var
*/
function _debug_text($info, $var=null){
print '*'.$info.'* '.($this->_time() - $this->start)."s\n";
@@ -764,6 +794,8 @@ class HTTPClient {
/**
* Return current timestamp in microsecond resolution
+ *
+ * @return float
*/
static function _time(){
list($usec, $sec) = explode(" ", microtime());
@@ -776,6 +808,9 @@ class HTTPClient {
* All Keys are lowercased.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string
+ * @return array
*/
function _parseHeaders($string){
$headers = array();
@@ -804,6 +839,9 @@ class HTTPClient {
* convert given header array to header string
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $headers
+ * @return string
*/
function _buildHeaders($headers){
$string = '';
@@ -818,6 +856,8 @@ class HTTPClient {
* get cookies as http header string
*
* @author Andreas Goetz <cpuidle@gmx.de>
+ *
+ * @return string
*/
function _getCookies(){
$headers = '';
@@ -833,6 +873,9 @@ class HTTPClient {
* Encode data for posting
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data
+ * @return string
*/
function _postEncode($data){
return http_build_query($data,'','&');
@@ -843,6 +886,9 @@ class HTTPClient {
*
* @fixme use of urlencode might be wrong here
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data
+ * @return string
*/
function _postMultipartEncode($data){
$boundary = '--'.$this->boundary;
diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php
index 979dc4d16..5ae1402b9 100644
--- a/inc/IXR_Library.php
+++ b/inc/IXR_Library.php
@@ -1,101 +1,146 @@
<?php
+
/**
- * IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002
+ * IXR - The Incutio XML-RPC Library
+ *
+ * Copyright (c) 2010, Incutio Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name of Incutio Ltd. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
*
- * @version 1.61
- * @author Simon Willison
- * @date 11th July 2003
- * @link http://scripts.incutio.com/xmlrpc/
- * @link http://scripts.incutio.com/xmlrpc/manual.php
- * @license Artistic License http://www.opensource.org/licenses/artistic-license.php
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @package IXR
+ * @since 1.5
+ *
+ * @copyright Incutio Ltd 2010 (http://www.incutio.com)
+ * @version 1.7.4 7th September 2010
+ * @author Simon Willison
+ * @link http://scripts.incutio.com/xmlrpc/ Site/manual
*
* Modified for DokuWiki
* @author Andreas Gohr <andi@splitbrain.org>
*/
-
-
class IXR_Value {
+
+ /** @var IXR_Value[]|IXR_Date|IXR_Base64|int|bool|double|string */
var $data;
+ /** @var string */
var $type;
- function IXR_Value ($data, $type = false) {
+
+ /**
+ * @param mixed $data
+ * @param bool $type
+ */
+ function __construct($data, $type = false) {
$this->data = $data;
- if (!$type) {
+ if(!$type) {
$type = $this->calculateType();
}
$this->type = $type;
- if ($type == 'struct') {
- /* Turn all the values in the array in to new IXR_Value objects */
- foreach ($this->data as $key => $value) {
+ if($type == 'struct') {
+ // Turn all the values in the array in to new IXR_Value objects
+ foreach($this->data as $key => $value) {
$this->data[$key] = new IXR_Value($value);
}
}
- if ($type == 'array') {
- for ($i = 0, $j = count($this->data); $i < $j; $i++) {
+ if($type == 'array') {
+ for($i = 0, $j = count($this->data); $i < $j; $i++) {
$this->data[$i] = new IXR_Value($this->data[$i]);
}
}
}
+
+ /**
+ * @return string
+ */
function calculateType() {
- if ($this->data === true || $this->data === false) {
+ if($this->data === true || $this->data === false) {
return 'boolean';
}
- if (is_integer($this->data)) {
+ if(is_integer($this->data)) {
return 'int';
}
- if (is_double($this->data)) {
+ if(is_double($this->data)) {
return 'double';
}
+
// Deal with IXR object types base64 and date
- if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
+ if(is_object($this->data) && is_a($this->data, 'IXR_Date')) {
return 'date';
}
- if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
+ if(is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
return 'base64';
}
- // If it is a normal PHP object convert it in to a struct
- if (is_object($this->data)) {
+ // If it is a normal PHP object convert it in to a struct
+ if(is_object($this->data)) {
$this->data = get_object_vars($this->data);
return 'struct';
}
- if (!is_array($this->data)) {
+ if(!is_array($this->data)) {
return 'string';
}
- /* We have an array - is it an array or a struct ? */
- if ($this->isStruct($this->data)) {
+
+ // We have an array - is it an array or a struct?
+ if($this->isStruct($this->data)) {
return 'struct';
} else {
return 'array';
}
}
+
+ /**
+ * @return bool|string
+ */
function getXml() {
- /* Return XML for this value */
- switch ($this->type) {
+ // Return XML for this value
+ switch($this->type) {
case 'boolean':
- return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
+ return '<boolean>' . (($this->data) ? '1' : '0') . '</boolean>';
break;
case 'int':
- return '<int>'.$this->data.'</int>';
+ return '<int>' . $this->data . '</int>';
break;
case 'double':
- return '<double>'.$this->data.'</double>';
+ return '<double>' . $this->data . '</double>';
break;
case 'string':
- return '<string>'.htmlspecialchars($this->data).'</string>';
+ return '<string>' . htmlspecialchars($this->data) . '</string>';
break;
case 'array':
- $return = '<array><data>'."\n";
- foreach ($this->data as $item) {
- $return .= ' <value>'.$item->getXml()."</value>\n";
+ $return = '<array><data>' . "\n";
+ foreach($this->data as $item) {
+ $return .= ' <value>' . $item->getXml() . "</value>\n";
}
$return .= '</data></array>';
return $return;
break;
case 'struct':
- $return = '<struct>'."\n";
- foreach ($this->data as $name => $value) {
+ $return = '<struct>' . "\n";
+ foreach($this->data as $name => $value) {
$return .= " <member><name>$name</name><value>";
- $return .= $value->getXml()."</value></member>\n";
+ $return .= $value->getXml() . "</value></member>\n";
}
$return .= '</struct>';
return $return;
@@ -107,11 +152,17 @@ class IXR_Value {
}
return false;
}
+
+ /**
+ * Checks whether or not the supplied array is a struct or not
+ *
+ * @param array $array
+ * @return boolean
+ */
function isStruct($array) {
- /* Nasty function to check if an array is a struct or not */
$expected = 0;
- foreach ($array as $key => $value) {
- if ((string)$key != (string)$expected) {
+ foreach($array as $key => $value) {
+ if((string) $key != (string) $expected) {
return true;
}
$expected++;
@@ -120,18 +171,25 @@ class IXR_Value {
}
}
-
+/**
+ * IXR_MESSAGE
+ *
+ * @package IXR
+ * @since 1.5
+ *
+ */
class IXR_Message {
var $message;
- var $messageType; // methodCall / methodResponse / fault
+ var $messageType; // methodCall / methodResponse / fault
var $faultCode;
var $faultString;
var $methodName;
var $params;
+
// Current variable stacks
- var $_arraystructs = array(); // The stack used to keep track of the current array/struct
+ var $_arraystructs = array(); // The stack used to keep track of the current array/struct
var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
- var $_currentStructName = array(); // A stack as well
+ var $_currentStructName = array(); // A stack as well
var $_param;
var $_value;
var $_currentTag;
@@ -139,12 +197,23 @@ class IXR_Message {
var $_lastseen;
// The XML parser
var $_parser;
- function IXR_Message ($message) {
- $this->message = $message;
+
+ /**
+ * @param string $message
+ */
+ function __construct($message) {
+ $this->message =& $message;
}
+
+ /**
+ * @return bool
+ */
function parse() {
// first remove the XML declaration
- $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
+ // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
+ $header = preg_replace('/<\?xml.*?\?' . '>/', '', substr($this->message, 0, 100), 1);
+ $this->message = substr_replace($this->message, $header, 0, 100);
+
// workaround for a bug in PHP/libxml2, see http://bugs.php.net/bug.php?id=45996
$this->message = str_replace('&lt;', '&#60;', $this->message);
$this->message = str_replace('&gt;', '&#62;', $this->message);
@@ -152,7 +221,7 @@ class IXR_Message {
$this->message = str_replace('&apos;', '&#39;', $this->message);
$this->message = str_replace('&quot;', '&#34;', $this->message);
$this->message = str_replace("\x0b", ' ', $this->message); //vertical tab
- if (trim($this->message) == '') {
+ if(trim($this->message) == '') {
return false;
}
$this->_parser = xml_parser_create();
@@ -162,23 +231,40 @@ class IXR_Message {
xml_set_object($this->_parser, $this);
xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
xml_set_character_data_handler($this->_parser, 'cdata');
- if (!xml_parse($this->_parser, $this->message)) {
- /* die(sprintf('XML error: %s at line %d',
- xml_error_string(xml_get_error_code($this->_parser)),
- xml_get_current_line_number($this->_parser))); */
- return false;
- }
+ $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
+ $final = false;
+ do {
+ if(strlen($this->message) <= $chunk_size) {
+ $final = true;
+ }
+ $part = substr($this->message, 0, $chunk_size);
+ $this->message = substr($this->message, $chunk_size);
+ if(!xml_parse($this->_parser, $part, $final)) {
+ return false;
+ }
+ if($final) {
+ break;
+ }
+ } while(true);
xml_parser_free($this->_parser);
+
// Grab the error messages, if any
- if ($this->messageType == 'fault') {
+ if($this->messageType == 'fault') {
$this->faultCode = $this->params[0]['faultCode'];
$this->faultString = $this->params[0]['faultString'];
}
return true;
}
+
+ /**
+ * @param $parser
+ * @param string $tag
+ * @param $attr
+ */
function tag_open($parser, $tag, $attr) {
- $this->currentTag = $tag;
$this->_currentTagContents = '';
+ $this->_currentTag = $tag;
+
switch($tag) {
case 'methodCall':
case 'methodResponse':
@@ -186,7 +272,7 @@ class IXR_Message {
$this->messageType = $tag;
break;
/* Deal with stacks of arrays and structs */
- case 'data': // data is to all intents and puposes more interesting than array
+ case 'data': // data is to all intents and purposes more interesting than array
$this->_arraystructstypes[] = 'array';
$this->_arraystructs[] = array();
break;
@@ -197,50 +283,53 @@ class IXR_Message {
}
$this->_lastseen = $tag;
}
+
+ /**
+ * @param $parser
+ * @param string $cdata
+ */
function cdata($parser, $cdata) {
$this->_currentTagContents .= $cdata;
}
+
+ /**
+ * @param $parser
+ * @param $tag
+ */
function tag_close($parser, $tag) {
+ $value = null;
$valueFlag = false;
switch($tag) {
case 'int':
case 'i4':
- $value = (int)trim($this->_currentTagContents);
- $this->_currentTagContents = '';
+ $value = (int) trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'double':
- $value = (double)trim($this->_currentTagContents);
- $this->_currentTagContents = '';
+ $value = (double) trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'string':
- $value = (string)$this->_currentTagContents;
- $this->_currentTagContents = '';
+ $value = (string) $this->_currentTagContents;
$valueFlag = true;
break;
case 'dateTime.iso8601':
$value = new IXR_Date(trim($this->_currentTagContents));
- // $value = $iso->getTimestamp();
- $this->_currentTagContents = '';
$valueFlag = true;
break;
case 'value':
// "If no type is indicated, the type is string."
- if($this->_lastseen == 'value'){
- $value = (string)$this->_currentTagContents;
- $this->_currentTagContents = '';
+ if($this->_lastseen == 'value') {
+ $value = (string) $this->_currentTagContents;
$valueFlag = true;
}
break;
case 'boolean':
- $value = (boolean)trim($this->_currentTagContents);
- $this->_currentTagContents = '';
+ $value = (boolean) trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'base64':
$value = base64_decode($this->_currentTagContents);
- $this->_currentTagContents = '';
$valueFlag = true;
break;
/* Deal with stacks of arrays and structs */
@@ -255,75 +344,94 @@ class IXR_Message {
break;
case 'name':
$this->_currentStructName[] = trim($this->_currentTagContents);
- $this->_currentTagContents = '';
break;
case 'methodName':
$this->methodName = trim($this->_currentTagContents);
- $this->_currentTagContents = '';
break;
}
- if ($valueFlag) {
- /*
- if (!is_array($value) && !is_object($value)) {
- $value = trim($value);
- }
- */
- if (count($this->_arraystructs) > 0) {
+
+ if($valueFlag) {
+ if(count($this->_arraystructs) > 0) {
// Add value to struct or array
- if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
+ if($this->_arraystructstypes[count($this->_arraystructstypes) - 1] == 'struct') {
// Add to struct
- $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
+ $this->_arraystructs[count($this->_arraystructs) - 1][$this->_currentStructName[count($this->_currentStructName) - 1]] = $value;
} else {
// Add to array
- $this->_arraystructs[count($this->_arraystructs)-1][] = $value;
+ $this->_arraystructs[count($this->_arraystructs) - 1][] = $value;
}
} else {
- // Just add as a paramater
+ // Just add as a parameter
$this->params[] = $value;
}
}
+ $this->_currentTagContents = '';
$this->_lastseen = $tag;
}
}
-
+/**
+ * IXR_Server
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_Server {
var $data;
+ /** @var array */
var $callbacks = array();
var $message;
+ /** @var array */
var $capabilities;
- function IXR_Server($callbacks = false, $data = false) {
+
+ /**
+ * @param array|bool $callbacks
+ * @param bool $data
+ * @param bool $wait
+ */
+ function __construct($callbacks = false, $data = false, $wait = false) {
$this->setCapabilities();
- if ($callbacks) {
+ if($callbacks) {
$this->callbacks = $callbacks;
}
$this->setCallbacks();
- $this->serve($data);
+
+ if(!$wait) {
+ $this->serve($data);
+ }
}
+
+ /**
+ * @param bool|string $data
+ */
function serve($data = false) {
- if (!$data) {
+ if(!$data) {
$postData = trim(http_get_raw_post_data());
- if (!$postData) {
+ if(!$postData) {
+ header('Content-Type: text/plain'); // merged from WP #9093
die('XML-RPC server accepts POST requests only.');
}
$data = $postData;
}
$this->message = new IXR_Message($data);
- if (!$this->message->parse()) {
+ if(!$this->message->parse()) {
$this->error(-32700, 'parse error. not well formed');
}
- if ($this->message->messageType != 'methodCall') {
+ if($this->message->messageType != 'methodCall') {
$this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
}
$result = $this->call($this->message->methodName, $this->message->params);
+
// Is the result an error?
- if (is_a($result, 'IXR_Error')) {
+ if(is_a($result, 'IXR_Error')) {
$this->error($result);
}
+
// Encode the result
$r = new IXR_Value($result);
$resultxml = $r->getXml();
+
// Create the XML
$xml = <<<EOD
<methodResponse>
@@ -340,16 +448,23 @@ EOD;
// Send it
$this->output($xml);
}
+
+ /**
+ * @param string $methodname
+ * @param array $args
+ * @return IXR_Error|mixed
+ */
function call($methodname, $args) {
- if (!$this->hasMethod($methodname)) {
- return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
+ if(!$this->hasMethod($methodname)) {
+ return new IXR_Error(-32601, 'server error. requested method ' . $methodname . ' does not exist.');
}
$method = $this->callbacks[$methodname];
+
// Perform the callback and send the response
# Removed for DokuWiki to have a more consistent interface
# if (count($args) == 1) {
- # // If only one paramater just send that instead of the whole array
+ # // If only one parameter just send that instead of the whole array
# $args = $args[0];
# }
@@ -359,16 +474,16 @@ EOD;
$args = (array) $args;
// Are we dealing with a function or a method?
- if (substr($method, 0, 5) == 'this:') {
+ if(is_string($method) && substr($method, 0, 5) == 'this:') {
// It's a class method - check it exists
$method = substr($method, 5);
- if (!method_exists($this, $method)) {
- return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
+ if(!method_exists($this, $method)) {
+ return new IXR_Error(-32601, 'server error. requested class method "' . $method . '" does not exist.');
}
// Call the method
#$result = $this->$method($args);
- $result = call_user_func_array(array(&$this,$method),$args);
- } elseif (substr($method, 0, 7) == 'plugin:') {
+ $result = call_user_func_array(array(&$this, $method), $args);
+ } elseif(substr($method, 0, 7) == 'plugin:') {
list($pluginname, $callback) = explode(':', substr($method, 7), 2);
if(!plugin_isdisabled($pluginname)) {
$plugin = plugin_load('action', $pluginname);
@@ -378,31 +493,49 @@ EOD;
}
} else {
// It's a function - does it exist?
- if (!function_exists($method)) {
- return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
+ if(is_array($method)) {
+ if(!is_callable(array($method[0], $method[1]))) {
+ return new IXR_Error(-32601, 'server error. requested object method "' . $method[1] . '" does not exist.');
+ }
+ } else if(!function_exists($method)) {
+ return new IXR_Error(-32601, 'server error. requested function "' . $method . '" does not exist.');
}
+
// Call the function
- #$result = $method($args);
- $result = call_user_func_array($method,$args);
+ $result = call_user_func($method, $args);
}
return $result;
}
+ /**
+ * @param int $error
+ * @param string|bool $message
+ */
function error($error, $message = false) {
// Accepts either an error object or an error code and message
- if ($message && !is_object($error)) {
+ if($message && !is_object($error)) {
$error = new IXR_Error($error, $message);
}
$this->output($error->getXml());
}
+
+ /**
+ * @param string $xml
+ */
function output($xml) {
header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0"?>', "\n", $xml;
exit;
}
+
+ /**
+ * @param string $method
+ * @return bool
+ */
function hasMethod($method) {
return in_array($method, array_keys($this->callbacks));
}
+
function setCapabilities() {
// Initialises capabilities array
$this->capabilities = array(
@@ -420,31 +553,45 @@ EOD;
),
);
}
+
+ /**
+ * @return mixed
+ */
function getCapabilities() {
return $this->capabilities;
}
+
function setCallbacks() {
$this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
$this->callbacks['system.listMethods'] = 'this:listMethods';
$this->callbacks['system.multicall'] = 'this:multiCall';
}
+
+ /**
+ * @return array
+ */
function listMethods() {
// Returns a list of methods - uses array_reverse to ensure user defined
// methods are listed before server defined methods
return array_reverse(array_keys($this->callbacks));
}
+
+ /**
+ * @param array $methodcalls
+ * @return array
+ */
function multiCall($methodcalls) {
// See http://www.xmlrpc.com/discuss/msgReader$1208
$return = array();
- foreach ($methodcalls as $call) {
+ foreach($methodcalls as $call) {
$method = $call['methodName'];
$params = $call['params'];
- if ($method == 'system.multicall') {
+ if($method == 'system.multicall') {
$result = new IXR_Error(-32800, 'Recursive calls to system.multicall are forbidden');
} else {
$result = $this->call($method, $params);
}
- if (is_a($result, 'IXR_Error')) {
+ if(is_a($result, 'IXR_Error')) {
$return[] = array(
'faultCode' => $result->code,
'faultString' => $result->message
@@ -457,11 +604,25 @@ EOD;
}
}
+/**
+ * IXR_Request
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_Request {
+ /** @var string */
var $method;
+ /** @var array */
var $args;
+ /** @var string */
var $xml;
- function IXR_Request($method, $args) {
+
+ /**
+ * @param string $method
+ * @param array $args
+ */
+ function __construct($method, $args) {
$this->method = $method;
$this->args = $args;
$this->xml = <<<EOD
@@ -471,7 +632,7 @@ class IXR_Request {
<params>
EOD;
- foreach ($this->args as $arg) {
+ foreach($this->args as $arg) {
$this->xml .= '<param><value>';
$v = new IXR_Value($arg);
$this->xml .= $v->getXml();
@@ -479,15 +640,28 @@ EOD;
}
$this->xml .= '</params></methodCall>';
}
+
+ /**
+ * @return int
+ */
function getLength() {
return strlen($this->xml);
}
+
+ /**
+ * @return string
+ */
function getXml() {
return $this->xml;
}
}
/**
+ * IXR_Client
+ *
+ * @package IXR
+ * @since 1.5
+ *
* Changed for DokuWiki to use DokuHTTPClient
*
* This should be compatible to the original class, but uses DokuWiki's
@@ -498,19 +672,34 @@ EOD;
*/
class IXR_Client extends DokuHTTPClient {
var $posturl = '';
+ /** @var IXR_Message|bool */
var $message = false;
+
+ // Storage place for an error message
+ /** @var IXR_Error|bool */
var $xmlerror = false;
- function IXR_Client($server, $path = false, $port = 80) {
+ /**
+ * @param string $server
+ * @param string|bool $path
+ * @param int $port
+ * @param int $timeout
+ */
+ function __construct($server, $path = false, $port = 80, $timeout = 15) {
parent::__construct();
- if (!$path) {
+ if(!$path) {
// Assume we have been given a URL instead
$this->posturl = $server;
- }else{
- $this->posturl = 'http://'.$server.':'.$port.$path;
+ } else {
+ $this->posturl = 'http://' . $server . ':' . $port . $path;
}
+ $this->timeout = $timeout;
}
+ /**
+ * parameters: method and arguments
+ * @return bool success or error
+ */
function query() {
$args = func_get_args();
$method = array_shift($args);
@@ -518,55 +707,87 @@ class IXR_Client extends DokuHTTPClient {
$xml = $request->getXml();
$this->headers['Content-Type'] = 'text/xml';
- if(!$this->sendRequest($this->posturl,$xml,'POST')){
- $this->xmlerror = new IXR_Error(-32300, 'transport error - '.$this->error);
+ if(!$this->sendRequest($this->posturl, $xml, 'POST')) {
+ $this->xmlerror = new IXR_Error(-32300, 'transport error - ' . $this->error);
return false;
}
// Check HTTP Response code
- if($this->status < 200 || $this->status > 206){
- $this->xmlerror = new IXR_Error(-32300, 'transport error - HTTP status '.$this->status);
+ if($this->status < 200 || $this->status > 206) {
+ $this->xmlerror = new IXR_Error(-32300, 'transport error - HTTP status ' . $this->status);
return false;
}
// Now parse what we've got back
$this->message = new IXR_Message($this->resp_body);
- if (!$this->message->parse()) {
+ if(!$this->message->parse()) {
// XML error
$this->xmlerror = new IXR_Error(-32700, 'parse error. not well formed');
return false;
}
+
// Is the message a fault?
- if ($this->message->messageType == 'fault') {
+ if($this->message->messageType == 'fault') {
$this->xmlerror = new IXR_Error($this->message->faultCode, $this->message->faultString);
return false;
}
+
// Message must be OK
return true;
}
+
+ /**
+ * @return mixed
+ */
function getResponse() {
// methodResponses can only have one param - return that
return $this->message->params[0];
}
+
+ /**
+ * @return bool
+ */
function isError() {
return (is_object($this->xmlerror));
}
+
+ /**
+ * @return int
+ */
function getErrorCode() {
return $this->xmlerror->code;
}
+
+ /**
+ * @return string
+ */
function getErrorMessage() {
return $this->xmlerror->message;
}
}
-
+/**
+ * IXR_Error
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_Error {
var $code;
var $message;
- function IXR_Error($code, $message) {
+
+ /**
+ * @param int $code
+ * @param string $message
+ */
+ function __construct($code, $message) {
$this->code = $code;
- $this->message = $message;
+ $this->message = htmlspecialchars($message);
}
+
+ /**
+ * @return string
+ */
function getXml() {
$xml = <<<EOD
<methodResponse>
@@ -591,67 +812,115 @@ EOD;
}
}
-
+/**
+ * IXR_Date
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_Date {
- var $year;
- var $month;
- var $day;
- var $hour;
- var $minute;
- var $second;
- function IXR_Date($time) {
+
+ /** @var DateTime */
+ protected $date;
+
+ /**
+ * @param int|string $time
+ */
+ public function __construct($time) {
// $time can be a PHP timestamp or an ISO one
- if (is_numeric($time)) {
+ if(is_numeric($time)) {
$this->parseTimestamp($time);
} else {
$this->parseIso($time);
}
}
- function parseTimestamp($timestamp) {
- $this->year = gmdate('Y', $timestamp);
- $this->month = gmdate('m', $timestamp);
- $this->day = gmdate('d', $timestamp);
- $this->hour = gmdate('H', $timestamp);
- $this->minute = gmdate('i', $timestamp);
- $this->second = gmdate('s', $timestamp);
+
+ /**
+ * Parse unix timestamp
+ *
+ * @param int $timestamp
+ */
+ protected function parseTimestamp($timestamp) {
+ $this->date = new DateTime('@' . $timestamp);
}
- function parseIso($iso) {
- if(preg_match('/^(\d\d\d\d)-?(\d\d)-?(\d\d)([T ](\d\d):(\d\d)(:(\d\d))?)?/',$iso,$match)){
- $this->year = (int) $match[1];
- $this->month = (int) $match[2];
- $this->day = (int) $match[3];
- $this->hour = (int) $match[5];
- $this->minute = (int) $match[6];
- $this->second = (int) $match[8];
- }
+
+ /**
+ * Parses less or more complete iso dates and much more, if no timezone given assumes UTC
+ *
+ * @param string $iso
+ */
+ protected function parseIso($iso) {
+ $this->date = new DateTime($iso, new DateTimeZone("UTC"));
}
- function getIso() {
- return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second;
+
+ /**
+ * Returns date in ISO 8601 format
+ *
+ * @return string
+ */
+ public function getIso() {
+ return $this->date->format(DateTime::ISO8601);
}
- function getXml() {
- return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
+
+ /**
+ * Returns date in valid xml
+ *
+ * @return string
+ */
+ public function getXml() {
+ return '<dateTime.iso8601>' . $this->getIso() . '</dateTime.iso8601>';
}
+
+ /**
+ * Returns Unix timestamp
+ *
+ * @return int
+ */
function getTimestamp() {
- return gmmktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
+ return $this->date->getTimestamp();
}
}
-
+/**
+ * IXR_Base64
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_Base64 {
var $data;
- function IXR_Base64($data) {
+
+ /**
+ * @param string $data
+ */
+ function __construct($data) {
$this->data = $data;
}
+
+ /**
+ * @return string
+ */
function getXml() {
- return '<base64>'.base64_encode($this->data).'</base64>';
+ return '<base64>' . base64_encode($this->data) . '</base64>';
}
}
-
+/**
+ * IXR_IntrospectionServer
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_IntrospectionServer extends IXR_Server {
+ /** @var array[] */
var $signatures;
+ /** @var string[] */
var $help;
- function IXR_IntrospectionServer() {
+
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->setCallbacks();
$this->setCapabilities();
$this->capabilities['introspection'] = array(
@@ -683,82 +952,102 @@ class IXR_IntrospectionServer extends IXR_Server {
'Returns a documentation string for the specified method'
);
}
+
+ /**
+ * @param string $method
+ * @param string $callback
+ * @param string[] $args
+ * @param string $help
+ */
function addCallback($method, $callback, $args, $help) {
$this->callbacks[$method] = $callback;
$this->signatures[$method] = $args;
$this->help[$method] = $help;
}
+
+ /**
+ * @param string $methodname
+ * @param array $args
+ * @return IXR_Error|mixed
+ */
function call($methodname, $args) {
// Make sure it's in an array
- if ($args && !is_array($args)) {
+ if($args && !is_array($args)) {
$args = array($args);
}
+
// Over-rides default call method, adds signature check
- if (!$this->hasMethod($methodname)) {
- return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
+ if(!$this->hasMethod($methodname)) {
+ return new IXR_Error(-32601, 'server error. requested method "' . $this->message->methodName . '" not specified.');
}
$method = $this->callbacks[$methodname];
$signature = $this->signatures[$methodname];
$returnType = array_shift($signature);
// Check the number of arguments. Check only, if the minimum count of parameters is specified. More parameters are possible.
// This is a hack to allow optional parameters...
- if (count($args) < count($signature)) {
+ if(count($args) < count($signature)) {
// print 'Num of args: '.count($args).' Num in signature: '.count($signature);
return new IXR_Error(-32602, 'server error. wrong number of method parameters');
}
+
// Check the argument types
$ok = true;
$argsbackup = $args;
- for ($i = 0, $j = count($args); $i < $j; $i++) {
+ for($i = 0, $j = count($args); $i < $j; $i++) {
$arg = array_shift($args);
$type = array_shift($signature);
- switch ($type) {
+ switch($type) {
case 'int':
case 'i4':
- if (is_array($arg) || !is_int($arg)) {
+ if(is_array($arg) || !is_int($arg)) {
$ok = false;
}
break;
case 'base64':
case 'string':
- if (!is_string($arg)) {
+ if(!is_string($arg)) {
$ok = false;
}
break;
case 'boolean':
- if ($arg !== false && $arg !== true) {
+ if($arg !== false && $arg !== true) {
$ok = false;
}
break;
case 'float':
case 'double':
- if (!is_float($arg)) {
+ if(!is_float($arg)) {
$ok = false;
}
break;
case 'date':
case 'dateTime.iso8601':
- if (!is_a($arg, 'IXR_Date')) {
+ if(!is_a($arg, 'IXR_Date')) {
$ok = false;
}
break;
}
- if (!$ok) {
+ if(!$ok) {
return new IXR_Error(-32602, 'server error. invalid method parameters');
}
}
// It passed the test - run the "real" method call
return parent::call($methodname, $argsbackup);
}
+
+ /**
+ * @param string $method
+ * @return array|IXR_Error
+ */
function methodSignature($method) {
- if (!$this->hasMethod($method)) {
- return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
+ if(!$this->hasMethod($method)) {
+ return new IXR_Error(-32601, 'server error. requested method "' . $method . '" not specified.');
}
// We should be returning an array of types
$types = $this->signatures[$method];
$return = array();
- foreach ($types as $type) {
- switch ($type) {
+ foreach($types as $type) {
+ switch($type) {
case 'string':
$return[] = 'string';
break;
@@ -788,18 +1077,40 @@ class IXR_IntrospectionServer extends IXR_Server {
}
return $return;
}
+
+ /**
+ * @param string $method
+ * @return mixed
+ */
function methodHelp($method) {
return $this->help[$method];
}
}
-
+/**
+ * IXR_ClientMulticall
+ *
+ * @package IXR
+ * @since 1.5
+ */
class IXR_ClientMulticall extends IXR_Client {
+
+ /** @var array[] */
var $calls = array();
- function IXR_ClientMulticall($server, $path = false, $port = 80) {
- parent::IXR_Client($server, $path, $port);
+
+ /**
+ * @param string $server
+ * @param string|bool $path
+ * @param int $port
+ */
+ function __construct($server, $path = false, $port = 80) {
+ parent::__construct($server, $path, $port);
//$this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
}
+
+ /**
+ * Add a call
+ */
function addCall() {
$args = func_get_args();
$methodName = array_shift($args);
@@ -809,6 +1120,10 @@ class IXR_ClientMulticall extends IXR_Client {
);
$this->calls[] = $struct;
}
+
+ /**
+ * @return bool
+ */
function query() {
// Prepare multicall, then call the parent::query() method
return parent::query('system.multicall', $this->calls);
diff --git a/inc/Input.class.php b/inc/Input.class.php
index 94da2a10e..199994d8d 100644
--- a/inc/Input.class.php
+++ b/inc/Input.class.php
@@ -83,7 +83,6 @@ class Input {
*
* @see isset
* @param string $name Parameter name
- * @return bool
*/
public function remove($name) {
if(isset($this->access[$name])) {
@@ -132,7 +131,7 @@ class Input {
* @param string $name Parameter name
* @param mixed $default If parameter is not set, initialize with this value
* @param bool $nonempty Init with $default if parameter is set but empty()
- * @return &mixed
+ * @return mixed (reference)
*/
public function &ref($name, $default = '', $nonempty = false) {
if(!isset($this->access[$name]) || ($nonempty && empty($this->access[$name]))) {
@@ -146,7 +145,7 @@ class Input {
* Access a request parameter as int
*
* @param string $name Parameter name
- * @param mixed $default Default to return if parameter isn't set or is an array
+ * @param int $default Default to return if parameter isn't set or is an array
* @param bool $nonempty Return $default if parameter is set but empty()
* @return int
*/
@@ -164,7 +163,7 @@ class Input {
* Access a request parameter as string
*
* @param string $name Parameter name
- * @param mixed $default Default to return if parameter isn't set or is an array
+ * @param string $default Default to return if parameter isn't set or is an array
* @param bool $nonempty Return $default if parameter is set but empty()
* @return string
*/
@@ -246,7 +245,7 @@ class Input {
*
* This function returns the $INPUT object itself for easy chaining
*
- * @param $name
+ * @param string $name
* @return Input
*/
public function extract($name){
diff --git a/inc/JSON.php b/inc/JSON.php
index 7f89005ff..e01488e14 100644
--- a/inc/JSON.php
+++ b/inc/JSON.php
@@ -119,7 +119,7 @@ class JSON {
* JSON_LOOSE_TYPE - loose typing
* "{...}" syntax creates associative arrays in decode.
*/
- function JSON($use=JSON_STRICT_TYPE) {
+ function __construct($use=JSON_STRICT_TYPE) {
$this->use = $use;
}
diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php
index a35ec3ed0..1fa4f25ce 100644
--- a/inc/JpegMeta.php
+++ b/inc/JpegMeta.php
@@ -42,6 +42,7 @@
class JpegMeta {
var $_fileName;
var $_fp = null;
+ var $_fpout = null;
var $_type = 'unknown';
var $_markers;
@@ -53,7 +54,7 @@ class JpegMeta {
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
*/
- function JpegMeta($fileName) {
+ function __construct($fileName) {
$this->_fileName = $fileName;
@@ -132,6 +133,9 @@ class JpegMeta {
* through one function
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array|string $fields field name or array with field names
+ * @return bool|string
*/
function getField($fields) {
if(!is_array($fields)) $fields = array($fields);
@@ -177,6 +181,10 @@ class JpegMeta {
* through one function
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $field field name
+ * @param string $value
+ * @return bool success or fail
*/
function setField($field, $value) {
if(strtolower(substr($field,0,5)) == 'iptc.'){
@@ -193,6 +201,9 @@ class JpegMeta {
* through one function
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $field field name
+ * @return bool
*/
function deleteField($field) {
if(strtolower(substr($field,0,5)) == 'iptc.'){
@@ -208,6 +219,9 @@ class JpegMeta {
* Return a date field
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $field
+ * @return false|string
*/
function getDateField($field) {
if (!isset($this->_info['dates'])) {
@@ -225,6 +239,9 @@ class JpegMeta {
* Return a file info field
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $field field name
+ * @return false|string
*/
function getFileField($field) {
if (!isset($this->_info['file'])) {
@@ -243,6 +260,8 @@ class JpegMeta {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @todo handle makernotes
+ *
+ * @return false|string
*/
function getCamera(){
$make = $this->getField(array('Exif.Make','Exif.TIFFMake'));
@@ -256,6 +275,8 @@ class JpegMeta {
* Return shutter speed as a ratio
*
* @author Joe Lapp <joe.lapp@pobox.com>
+ *
+ * @return string
*/
function getShutterSpeed() {
if (!isset($this->_info['exif'])) {
@@ -274,6 +295,9 @@ class JpegMeta {
* Return an EXIF field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return false|string
*/
function getExifField($field) {
if (!isset($this->_info['exif'])) {
@@ -295,6 +319,9 @@ class JpegMeta {
* Return an XMP field
*
* @author Hakan Sandell <hakan.sandell@mydata.se>
+ *
+ * @param string $field field name
+ * @return false|string
*/
function getXmpField($field) {
if (!isset($this->_info['xmp'])) {
@@ -316,6 +343,9 @@ class JpegMeta {
* Return an Adobe Field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return false|string
*/
function getAdobeField($field) {
if (!isset($this->_info['adobe'])) {
@@ -337,6 +367,9 @@ class JpegMeta {
* Return an IPTC field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return false|string
*/
function getIPTCField($field) {
if (!isset($this->_info['iptc'])) {
@@ -359,6 +392,10 @@ class JpegMeta {
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
* @author Joe Lapp <joe.lapp@pobox.com>
+ *
+ * @param string $field field name
+ * @param string $value
+ * @return bool
*/
function setExifField($field, $value) {
if (!isset($this->_info['exif'])) {
@@ -389,6 +426,10 @@ class JpegMeta {
* Set an Adobe Field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @param string $value
+ * @return bool
*/
function setAdobeField($field, $value) {
if (!isset($this->_info['adobe'])) {
@@ -413,6 +454,10 @@ class JpegMeta {
* dimensions
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param int $maxwidth
+ * @param int $maxheight
+ * @return float|int
*/
function getResizeRatio($maxwidth,$maxheight=0){
if(!$maxheight) $maxheight = $maxwidth;
@@ -442,6 +487,10 @@ class JpegMeta {
* Set an IPTC field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @param string $value
+ * @return bool
*/
function setIPTCField($field, $value) {
if (!isset($this->_info['iptc'])) {
@@ -465,6 +514,9 @@ class JpegMeta {
* Delete an EXIF field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return bool
*/
function deleteExifField($field) {
if (!isset($this->_info['exif'])) {
@@ -486,6 +538,9 @@ class JpegMeta {
* Delete an Adobe field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return bool
*/
function deleteAdobeField($field) {
if (!isset($this->_info['adobe'])) {
@@ -507,6 +562,9 @@ class JpegMeta {
* Delete an IPTC field
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $field field name
+ * @return bool
*/
function deleteIPTCField($field) {
if (!isset($this->_info['iptc'])) {
@@ -527,12 +585,12 @@ class JpegMeta {
/**
* Get the image's title, tries various fields
*
- * @param int $max maximum number chars (keeps words)
+ * @param int $max maximum number chars (keeps words)
+ * @return false|string
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function getTitle($max=80){
- $cap = '';
-
// try various fields
$cap = $this->getField(array('Iptc.Headline',
'Iptc.Caption',
@@ -555,11 +613,14 @@ class JpegMeta {
* Gather various date fields
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @return array|bool
*/
function getDates() {
$this->_parseAll();
if ($this->_markers == null) {
if (@isset($this->_info['file']['UnixTime'])) {
+ $dates = array();
$dates['FileModified'] = $this->_info['file']['UnixTime'];
$dates['Time'] = $this->_info['file']['UnixTime'];
$dates['TimeSource'] = 'FileModified';
@@ -690,6 +751,8 @@ class JpegMeta {
* Get the image width, tries various fields
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @return false|string
*/
function getWidth() {
if (!isset($this->_info['sof'])) {
@@ -719,6 +782,8 @@ class JpegMeta {
* Get the image height, tries various fields
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @return false|string
*/
function getHeight() {
if (!isset($this->_info['sof'])) {
@@ -748,6 +813,8 @@ class JpegMeta {
* Get an dimension string for use in img tag
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @return false|string
*/
function getDimStr() {
if ($this->_markers == null) {
@@ -764,6 +831,9 @@ class JpegMeta {
* Checks for an embedded thumbnail
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $which possible values: 'any', 'exif' or 'adobe'
+ * @return false|string
*/
function hasThumbnail($which = 'any') {
if (($which == 'any') || ($which == 'exif')) {
@@ -805,6 +875,9 @@ class JpegMeta {
* Send embedded thumbnail to browser
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
+ *
+ * @param string $which possible values: 'any', 'exif' or 'adobe'
+ * @return bool
*/
function sendThumbnail($which = 'any') {
$data = null;
@@ -855,12 +928,15 @@ class JpegMeta {
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $fileName file name or empty string for a random name
+ * @return bool
*/
function save($fileName = "") {
if ($fileName == "") {
$tmpName = tempnam(dirname($this->_fileName),'_metatemp_');
$this->_writeJPEG($tmpName);
- if (@file_exists($tmpName)) {
+ if (file_exists($tmpName)) {
return io_rename($tmpName, $this->_fileName);
}
} else {
@@ -1030,6 +1106,10 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param string $outputName
+ */
function _writeJPEG($outputName) {
$this->_parseAll();
@@ -1162,6 +1242,12 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $marker
+ * @param integer $length
+ * @param integer $origLength
+ */
function _writeJPEGMarker($marker, $length, &$data, $origLength) {
if ($length <= 0) {
return false;
@@ -1334,7 +1420,6 @@ class JpegMeta {
return false;
}
- $pos = 0;
$this->_info['jfif'] = array();
$vmaj = $this->_getByte($data, 5);
@@ -1420,7 +1505,6 @@ class JpegMeta {
break;
default:
return false;
- break;
}
$this->_info['sof']['Format'] = $format;
@@ -1491,6 +1575,7 @@ class JpegMeta {
* Parses XMP nodes by recursion
*
* @author Hakan Sandell <hakan.sandell@mydata.se>
+ * @param integer $count
*/
function _parseXmpNode($values, &$i, &$meta, $count) {
if ($values[$i]['type'] == 'close') return;
@@ -1594,6 +1679,12 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $base
+ * @param boolean $isBigEndian
+ * @param string $mode
+ */
function _readIFD($data, $base, $offset, $isBigEndian, $mode) {
$EXIFTags = $this->_exifTagNames($mode);
@@ -1849,6 +1940,12 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $offsetBase
+ * @param boolean $isBigEndian
+ * @param boolean $hasNext
+ */
function _writeIFD(&$data, $pos, $offsetBase, &$entries, $isBigEndian, $hasNext) {
$tiffData = null;
$tiffDataOffsetPos = -1;
@@ -1905,6 +2002,11 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param boolean $isBigEndian
+ * @param string $mode
+ */
function & _getIFDEntries($isBigEndian, $mode) {
$EXIFNames = $this->_exifTagNames($mode);
$EXIFTags = $this->_exifNameTags($mode);
@@ -2413,6 +2515,10 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _write8BIM(&$data, $pos, $type, $header, &$value) {
$signature = "8BIM";
@@ -2473,6 +2579,10 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _writeIPTCEntry(&$data, $pos, $type, &$value) {
$pos = $this->_putShort($data, $pos, 0x1C02);
$pos = $this->_putByte($data, $pos, $type);
@@ -2833,11 +2943,19 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _getByte(&$data, $pos) {
return ord($data{$pos});
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _putByte(&$data, $pos, $val) {
$val = intval($val);
@@ -2873,6 +2991,10 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _getLong(&$data, $pos, $bigEndian = true) {
if ($bigEndian) {
return (ord($data{$pos}) << 24)
@@ -2888,6 +3010,10 @@ class JpegMeta {
}
/*************************************************************/
+
+ /**
+ * @param integer $pos
+ */
function _putLong(&$data, $pos, $val, $bigEndian = true) {
$val = intval($val);
diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php
index e90b45f99..087d82c99 100644
--- a/inc/Mailer.class.php
+++ b/inc/Mailer.class.php
@@ -108,6 +108,9 @@ class Mailer {
/**
* Callback function to automatically embed images referenced in HTML templates
+ *
+ * @param array $matches
+ * @return string placeholder
*/
protected function autoembed_cb($matches) {
static $embeds = 0;
@@ -130,7 +133,7 @@ class Mailer {
* If an empy value is passed, the header is removed
*
* @param string $header the header name (no trailing colon!)
- * @param string $value the value of the header
+ * @param string|string[] $value the value of the header
* @param bool $clean remove all non-ASCII chars and line feeds?
*/
public function setHeader($header, $value, $clean = true) {
@@ -160,6 +163,8 @@ class Mailer {
*
* Whatever is set here is directly passed to PHP's mail() command as last
* parameter. Depending on the PHP setup this might break mailing alltogether
+ *
+ * @param string $param
*/
public function setParameters($param) {
$this->sendparam = $param;
@@ -177,7 +182,7 @@ class Mailer {
* @param string $text plain text body
* @param array $textrep replacements to apply on the text part
* @param array $htmlrep replacements to apply on the HTML part, leave null to use $textrep
- * @param array $html the HTML body, leave null to create it from $text
+ * @param string $html the HTML body, leave null to create it from $text
* @param bool $wrap wrap the HTML in the default header/Footer
*/
public function setBody($text, $textrep = null, $htmlrep = null, $html = null, $wrap = true) {
@@ -265,6 +270,8 @@ class Mailer {
* Placeholders can be used to reference embedded attachments
*
* You probably want to use setBody() instead
+ *
+ * @param string $html
*/
public function setHTML($html) {
$this->html = $html;
@@ -274,6 +281,8 @@ class Mailer {
* Set the plain text part of the mail
*
* You probably want to use setBody() instead
+ *
+ * @param string $text
*/
public function setText($text) {
$this->text = $text;
@@ -283,7 +292,7 @@ class Mailer {
* Add the To: recipients
*
* @see cleanAddress
- * @param string|array $address Multiple adresses separated by commas or as array
+ * @param string|string[] $address Multiple adresses separated by commas or as array
*/
public function to($address) {
$this->setHeader('To', $address, false);
@@ -293,7 +302,7 @@ class Mailer {
* Add the Cc: recipients
*
* @see cleanAddress
- * @param string|array $address Multiple adresses separated by commas or as array
+ * @param string|string[] $address Multiple adresses separated by commas or as array
*/
public function cc($address) {
$this->setHeader('Cc', $address, false);
@@ -303,7 +312,7 @@ class Mailer {
* Add the Bcc: recipients
*
* @see cleanAddress
- * @param string|array $address Multiple adresses separated by commas or as array
+ * @param string|string[] $address Multiple adresses separated by commas or as array
*/
public function bcc($address) {
$this->setHeader('Bcc', $address, false);
@@ -340,8 +349,8 @@ class Mailer {
* Example:
* cc("föö <foo@bar.com>, me@somewhere.com","TBcc");
*
- * @param string|array $addresses Multiple adresses separated by commas or as array
- * @return bool|string the prepared header (can contain multiple lines)
+ * @param string|string[] $addresses Multiple adresses separated by commas or as array
+ * @return false|string the prepared header (can contain multiple lines)
*/
public function cleanAddress($addresses) {
// No named recipients for To: in Windows (see FS#652)
@@ -418,6 +427,8 @@ class Mailer {
* Prepare the mime multiparts for all attachments
*
* Replaces placeholders in the HTML with the correct CIDs
+ *
+ * @return string mime multiparts
*/
protected function prepareAttachments() {
$mime = '';
@@ -565,9 +576,9 @@ class Mailer {
/**
* Returns a complete, EOL terminated header line, wraps it if necessary
*
- * @param $key
- * @param $val
- * @return string
+ * @param string $key
+ * @param string $val
+ * @return string line
*/
protected function wrappedHeaderLine($key, $val){
return wordwrap("$key: $val", 78, MAILHEADER_EOL.' ').MAILHEADER_EOL;
diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php
index db6a3a77c..0701c4116 100644
--- a/inc/PassHash.class.php
+++ b/inc/PassHash.class.php
@@ -16,8 +16,9 @@ class PassHash {
* match true is is returned else false
*
* @author Andreas Gohr <andi@splitbrain.org>
- * @param $clear string Clear-Text password
- * @param $hash string Hash to compare against
+ *
+ * @param string $clear Clear-Text password
+ * @param string $hash Hash to compare against
* @return bool
*/
function verify_hash($clear, $hash) {
@@ -49,7 +50,7 @@ class PassHash {
} elseif(preg_match('/^md5\$(.{5})\$/', $hash, $m)) {
$method = 'djangomd5';
$salt = $m[1];
- } elseif(preg_match('/^\$2a\$(.{2})\$/', $hash, $m)) {
+ } elseif(preg_match('/^\$2(a|y)\$(.{2})\$/', $hash, $m)) {
$method = 'bcrypt';
$salt = $hash;
} elseif(substr($hash, 0, 6) == '{SSHA}') {
@@ -109,9 +110,9 @@ class PassHash {
* If $salt is not null, the value is kept, but the lenght restriction is
* applied (unless, $cut is false).
*
- * @param string &$salt The salt, pass null if you want one generated
- * @param int $len The length of the salt
- * @param bool $cut Apply length restriction to existing salt?
+ * @param string|null &$salt The salt, pass null if you want one generated
+ * @param int $len The length of the salt
+ * @param bool $cut Apply length restriction to existing salt?
*/
public function init_salt(&$salt, $len = 32, $cut = true) {
if(is_null($salt)) {
@@ -135,6 +136,7 @@ class PassHash {
* @author Andreas Gohr <andi@splitbrain.org>
* @author <mikey_nich at hotmail dot com>
* @link http://de.php.net/manual/en/function.crypt.php#73619
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @return string Hashed password
@@ -175,6 +177,7 @@ class PassHash {
*
* @author <mikey_nich at hotmail dot com>
* @link http://de.php.net/manual/en/function.crypt.php#73619
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @param string $magic The hash identifier (apr1 or 1)
@@ -337,6 +340,7 @@ class PassHash {
* an exception.
*
* @link http://www.openwall.com/phpass/
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @param string $magic The hash identifier (P or H)
@@ -404,6 +408,7 @@ class PassHash {
* This is used by the Django Python framework
*
* @link http://docs.djangoproject.com/en/dev/topics/auth/#passwords
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @return string Hashed password
@@ -420,6 +425,7 @@ class PassHash {
* This is used by the Django Python framework
*
* @link http://docs.djangoproject.com/en/dev/topics/auth/#passwords
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @return string Hashed password
@@ -486,6 +492,7 @@ class PassHash {
* method 'A' is not supported.
*
* @link http://www.mediawiki.org/wiki/Manual_talk:User_table#user_password_column
+ *
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @return string Hashed password
@@ -511,7 +518,6 @@ class PassHash {
* @param string $data Message to be hashed.
* @param string $key Shared secret key used for generating the HMAC variant of the message digest.
* @param bool $raw_output When set to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
- *
* @return string
*/
public static function hmac($algo, $data, $key, $raw_output = false) {
@@ -545,9 +551,8 @@ class PassHash {
/**
* Use DokuWiki's secure random generator if available
*
- * @param $min
- * @param $max
- *
+ * @param int $min
+ * @param int $max
* @return int
*/
protected function random($min, $max){
diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php
index ffa03ee93..c0e6869f1 100644
--- a/inc/RemoteAPICore.php
+++ b/inc/RemoteAPICore.php
@@ -13,6 +13,11 @@ class RemoteAPICore {
$this->api = $api;
}
+ /**
+ * Returns details about the core methods
+ *
+ * @return array
+ */
function __getRemoteInfo() {
return array(
'dokuwiki.getVersion' => array(
@@ -158,19 +163,27 @@ class RemoteAPICore {
);
}
+ /**
+ * @return string
+ */
function getVersion() {
return getVersion();
}
+ /**
+ * @return int unix timestamp
+ */
function getTime() {
return time();
}
/**
* Return a raw wiki page
+ *
* @param string $id wiki page id
- * @param string $rev revision number of the page
- * @return page text.
+ * @param int|string $rev revision timestamp of the page or empty string
+ * @return string page text.
+ * @throws RemoteAccessDeniedException if no permission for page
*/
function rawPage($id,$rev=''){
$id = $this->resolvePageId($id);
@@ -189,8 +202,11 @@ class RemoteAPICore {
* Return a media file
*
* @author Gina Haeussge <osd@foosel.net>
+ *
* @param string $id file id
- * @return media file
+ * @return mixed media file
+ * @throws RemoteAccessDeniedException no permission for media
+ * @throws RemoteException not exist
*/
function getAttachment($id){
$id = cleanID($id);
@@ -211,6 +227,9 @@ class RemoteAPICore {
* Return info about a media file
*
* @author Gina Haeussge <osd@foosel.net>
+ *
+ * @param string $id page id
+ * @return array
*/
function getAttachmentInfo($id){
$id = cleanID($id);
@@ -230,6 +249,11 @@ class RemoteAPICore {
/**
* Return a wiki page rendered to html
+ *
+ * @param string $id page id
+ * @param string|int $rev revision timestamp or empty string
+ * @return null|string html
+ * @throws RemoteAccessDeniedException no access to page
*/
function htmlPage($id,$rev=''){
$id = $this->resolvePageId($id);
@@ -241,6 +265,8 @@ class RemoteAPICore {
/**
* List all pages - we use the indexer list here
+ *
+ * @return array
*/
function listPages(){
$list = array();
@@ -265,6 +291,12 @@ class RemoteAPICore {
/**
* List all pages in the given namespace (and below)
+ *
+ * @param string $ns
+ * @param array $opts
+ * $opts['depth'] recursion level, 0 for all
+ * $opts['hash'] do md5 sum of content?
+ * @return array
*/
function readNamespace($ns,$opts){
global $conf;
@@ -281,9 +313,12 @@ class RemoteAPICore {
/**
* List all pages in the given namespace (and below)
+ *
+ * @param string $query
+ * @return array
*/
function search($query){
- $regex = '';
+ $regex = array();
$data = ft_pageSearch($query,$regex);
$pages = array();
@@ -314,6 +349,8 @@ class RemoteAPICore {
/**
* Returns the wiki title.
+ *
+ * @return string
*/
function getTitle(){
global $conf;
@@ -328,6 +365,15 @@ class RemoteAPICore {
* a regular expression matching their name.
*
* @author Gina Haeussge <osd@foosel.net>
+ *
+ * @param string $ns
+ * @param array $options
+ * $options['depth'] recursion level, 0 for all
+ * $options['showmsg'] shows message if invalid media id is used
+ * $options['pattern'] check given pattern
+ * $options['hash'] add hashes to result list
+ * @return array
+ * @throws RemoteAccessDeniedException no access to the media files
*/
function listAttachments($ns, $options = array()) {
global $conf;
@@ -359,6 +405,9 @@ class RemoteAPICore {
/**
* Return a list of backlinks
+ *
+ * @param string $id page id
+ * @return array
*/
function listBackLinks($id){
return ft_backlinks($this->resolvePageId($id));
@@ -366,6 +415,12 @@ class RemoteAPICore {
/**
* Return some basic data about a page
+ *
+ * @param string $id page id
+ * @param string|int $rev revision timestamp or empty string
+ * @return array
+ * @throws RemoteAccessDeniedException no access for page
+ * @throws RemoteException page not exist
*/
function pageInfo($id,$rev=''){
$id = $this->resolvePageId($id);
@@ -395,6 +450,13 @@ class RemoteAPICore {
* Save a wiki page
*
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param string $id page id
+ * @param string $text wiki text
+ * @param array $params parameters: summary, minor edit
+ * @return bool
+ * @throws RemoteAccessDeniedException no write access for page
+ * @throws RemoteException no id, empty new page or locked
*/
function putPage($id, $text, $params) {
global $TEXT;
@@ -451,6 +513,11 @@ class RemoteAPICore {
/**
* Appends text to a wiki page.
+ *
+ * @param string $id page id
+ * @param string $text wiki text
+ * @param array $params such as summary,minor
+ * @return bool|string
*/
function appendPage($id, $text, $params) {
$currentpage = $this->rawPage($id);
@@ -464,6 +531,12 @@ class RemoteAPICore {
* Uploads a file to the wiki.
*
* Michael Klier <chi@chimeric.de>
+ *
+ * @param string $id page id
+ * @param string $file
+ * @param array $params such as overwrite
+ * @return false|string
+ * @throws RemoteException
*/
function putAttachment($id, $file, $params) {
$id = cleanID($id);
@@ -493,6 +566,11 @@ class RemoteAPICore {
* Deletes a file from the wiki.
*
* @author Gina Haeussge <osd@foosel.net>
+ *
+ * @param string $id page id
+ * @return int
+ * @throws RemoteAccessDeniedException no permissions
+ * @throws RemoteException file in use or not deleted
*/
function deleteAttachment($id){
$id = cleanID($id);
@@ -511,6 +589,9 @@ class RemoteAPICore {
/**
* Returns the permissions of a given wiki page
+ *
+ * @param string $id page id
+ * @return int permission level
*/
function aclCheck($id) {
$id = $this->resolvePageId($id);
@@ -521,6 +602,10 @@ class RemoteAPICore {
* Lists all links contained in a wiki page
*
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param string $id page id
+ * @return array
+ * @throws RemoteAccessDeniedException no read access for page
*/
function listLinks($id) {
$id = $this->resolvePageId($id);
@@ -571,6 +656,10 @@ class RemoteAPICore {
*
* @author Michael Hamann <michael@content-space.de>
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param int $timestamp unix timestamp
+ * @return array
+ * @throws RemoteException no valid timestamp
*/
function getRecentChanges($timestamp) {
if(strlen($timestamp) != 10) {
@@ -596,7 +685,7 @@ class RemoteAPICore {
return $changes;
} else {
// in case we still have nothing at this point
- return new RemoteException('There are no changes in the specified timeframe', 321);
+ throw new RemoteException('There are no changes in the specified timeframe', 321);
}
}
@@ -605,6 +694,10 @@ class RemoteAPICore {
*
* @author Michael Hamann <michael@content-space.de>
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param int $timestamp unix timestamp
+ * @return array
+ * @throws RemoteException no valid timestamp
*/
function getRecentMediaChanges($timestamp) {
if(strlen($timestamp) != 10)
@@ -637,6 +730,12 @@ class RemoteAPICore {
* Returns a list of available revisions of a given wiki page
*
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param string $id page id
+ * @param int $first skip the first n changelog lines
+ * @return array
+ * @throws RemoteAccessDeniedException no read access for page
+ * @throws RemoteException empty id
*/
function pageVersions($id, $first) {
$id = $this->resolvePageId($id);
@@ -681,6 +780,7 @@ class RemoteAPICore {
$pagelog->setChunkSize(1024);
$info = $pagelog->getRevisionInfo($time);
if(!empty($info)) {
+ $data = array();
$data['user'] = $info['user'];
$data['ip'] = $info['ip'];
$data['type'] = $info['type'];
@@ -713,6 +813,9 @@ class RemoteAPICore {
*
* Returns an associative array with the keys locked, lockfail, unlocked and
* unlockfail, each containing lists of pages.
+ *
+ * @param array[] $set list pages with array('lock' => array, 'unlock' => array)
+ * @return array
*/
function setLocks($set){
$locked = array();
@@ -747,13 +850,27 @@ class RemoteAPICore {
);
}
+ /**
+ * Return API version
+ *
+ * @return int
+ */
function getAPIVersion(){
return DOKU_API_VERSION;
}
+ /**
+ * Login
+ *
+ * @param string $user
+ * @param string $pass
+ * @return int
+ */
function login($user,$pass){
global $conf;
+ /** @var DokuWiki_Auth_Plugin $auth */
global $auth;
+
if(!$conf['useacl']) return 0;
if(!$auth) return 0;
@@ -774,6 +891,11 @@ class RemoteAPICore {
return $ok;
}
+ /**
+ * Log off
+ *
+ * @return int
+ */
function logoff(){
global $conf;
global $auth;
@@ -785,6 +907,12 @@ class RemoteAPICore {
return 1;
}
+ /**
+ * Resolve page id
+ *
+ * @param string $id page id
+ * @return string
+ */
private function resolvePageId($id) {
$id = cleanID($id);
if(empty($id)) {
diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php
index 6332746a6..037990e96 100644
--- a/inc/Sitemapper.php
+++ b/inc/Sitemapper.php
@@ -24,6 +24,8 @@ class Sitemapper {
* @author Andreas Gohr
* @link https://www.google.com/webmasters/sitemaps/docs/en/about.html
* @link http://www.sitemaps.org/
+ *
+ * @return bool
*/
public static function generate(){
global $conf;
@@ -31,7 +33,7 @@ class Sitemapper {
$sitemap = Sitemapper::getFilePath();
- if(@file_exists($sitemap)){
+ if(file_exists($sitemap)){
if(!is_writable($sitemap)) return false;
}else{
if(!is_writable(dirname($sitemap))) return false;
@@ -53,7 +55,7 @@ class Sitemapper {
foreach($pages as $id){
//skip hidden, non existing and restricted files
if(isHiddenPage($id)) continue;
- if(auth_aclcheck($id,'','') < AUTH_READ) continue;
+ if(auth_aclcheck($id,'',array()) < AUTH_READ) continue;
$item = SitemapItem::createFromID($id);
if ($item !== null)
$items[] = $item;
@@ -75,6 +77,7 @@ class Sitemapper {
*
* @param $items array The SitemapItems that shall be included in the sitemap.
* @return string The sitemap XML.
+ *
* @author Michael Hamann
*/
private static function getXML($items) {
@@ -95,6 +98,7 @@ class Sitemapper {
* Helper function for getting the path to the sitemap file.
*
* @return string The path to the sitemap file.
+ *
* @author Michael Hamann
*/
public static function getFilePath() {
@@ -123,6 +127,8 @@ class Sitemapper {
* urls to ping using the SITEMAP_PING event.
*
* @author Michael Hamann
+ *
+ * @return bool
*/
public static function pingSearchEngines() {
//ping search engines...
@@ -168,9 +174,9 @@ class SitemapItem {
/**
* Create a new item.
*
- * @param $url string The url of the item
- * @param $lastmod int Timestamp of the last modification
- * @param $changefreq string How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
+ * @param string $url The url of the item
+ * @param int $lastmod Timestamp of the last modification
+ * @param string $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
*/
public function __construct($url, $lastmod, $changefreq = null, $priority = null) {
@@ -183,9 +189,9 @@ class SitemapItem {
/**
* Helper function for creating an item for a wikipage id.
*
- * @param $id string A wikipage id.
- * @param $changefreq string How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
- * @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
+ * @param string $id A wikipage id.
+ * @param string $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
+ * @param float|string $priority The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
* @return SitemapItem The sitemap item.
*/
public static function createFromID($id, $changefreq = null, $priority = null) {
diff --git a/inc/Tar.class.php b/inc/Tar.class.php
index 903f7f35c..57c280d79 100644
--- a/inc/Tar.class.php
+++ b/inc/Tar.class.php
@@ -43,6 +43,7 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Bouchon <tarlib@bouchon.org> (Maxg)
* @license GPL 2
+ * @deprecated 2015-05-15 - use splitbrain\PHPArchive\Tar instead
*/
class Tar {
@@ -53,6 +54,7 @@ class Tar {
protected $file = '';
protected $comptype = Tar::COMPRESS_AUTO;
+ /** @var resource|int */
protected $fh;
protected $memory = '';
protected $closed = true;
@@ -105,6 +107,9 @@ class Tar {
*
* The archive is closed afer reading the contents, because rewinding is not possible in bzip2 streams.
* Reopen the file with open() again if you want to do additional operations
+ *
+ * @return array
+ * @throws TarIOException
*/
public function contents() {
if($this->closed || !$this->file) throw new TarIOException('Can not read from a closed archive');
@@ -270,6 +275,7 @@ class Tar {
* Add a file to the current TAR archive using an existing file in the filesystem
*
* @todo handle directory adding
+ *
* @param string $file the original file
* @param string $name the name to use for the file in the archive
* @throws TarIOException
@@ -377,6 +383,10 @@ class Tar {
* Returns the created in-memory archive data
*
* This implicitly calls close() on the Archive
+ *
+ * @param int $comptype
+ * @param int $complevel
+ * @return mixed|string
*/
public function getArchive($comptype = Tar::COMPRESS_AUTO, $complevel = 9) {
$this->close();
@@ -395,7 +405,7 @@ class Tar {
* Note: It more memory effective to specify the filename in the create() function and
* let the library work on the new file directly.
*
- * @param $file
+ * @param string $file
* @param int $comptype
* @param int $complevel
* @throws TarIOException
@@ -522,7 +532,7 @@ class Tar {
* Decode the given tar file header
*
* @param string $block a 512 byte block containign the header data
- * @return array|bool
+ * @return false|array
*/
protected function parseHeader($block) {
if(!$block || strlen($block) != 512) return false;
@@ -536,6 +546,7 @@ class Tar {
$header = @unpack("a100filename/a8perm/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix", $block);
if(!$header) return false;
+ $return = array();
$return['checksum'] = OctDec(trim($header['checksum']));
if($return['checksum'] != $chks) return false;
@@ -570,7 +581,7 @@ class Tar {
/**
* Cleans up a path and removes relative parts, also strips leading slashes
*
- * @param string $p_dir
+ * @param string $path
* @return string
*/
public function cleanPath($path) {
@@ -590,7 +601,7 @@ class Tar {
/**
* Checks if the given compression type is available and throws an exception if not
*
- * @param $comptype
+ * @param int $comptype
* @throws TarIllegalCompressionException
*/
protected function compressioncheck($comptype) {
@@ -624,8 +635,14 @@ class Tar {
}
}
+/**
+ * Class TarIOException
+ */
class TarIOException extends Exception {
}
+/**
+ * Class TarIllegalCompressionException
+ */
class TarIllegalCompressionException extends Exception {
}
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php
deleted file mode 100644
index dd319a79a..000000000
--- a/inc/TarLib.class.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-/**
- * This is a compatibility wrapper around the new Tar class
- *
- * Use of this library is strongly discouraged. Only basic extraction is wrapped,
- * everything else will fail.
- *
- * @deprecated 2012-11-06
- */
-class TarLib {
-
- const COMPRESS_GZIP = 1;
- const COMPRESS_BZIP = 2;
- const COMPRESS_AUTO = 3;
- const COMPRESS_NONE = 0;
- const TARLIB_VERSION = '1.2';
- const FULL_ARCHIVE = -1;
- const ARCHIVE_DYNAMIC = 0;
- const ARCHIVE_RENAMECOMP = 5;
- const COMPRESS_DETECT = -1;
-
- private $file = '';
- private $tar;
-
- public $_result = true;
-
- function __construct($file, $comptype = TarLib::COMPRESS_AUTO, $complevel = 9) {
- dbg_deprecated('class Tar');
-
- if(!$file) $this->error('__construct', '$file');
-
- $this->file = $file;
- switch($comptype) {
- case TarLib::COMPRESS_AUTO:
- case TarLib::COMPRESS_DETECT:
- $comptype = Tar::COMPRESS_AUTO;
- break;
- case TarLib::COMPRESS_GZIP:
- $comptype = Tar::COMPRESS_GZIP;
- break;
- case TarLib::COMPRESS_BZIP:
- $comptype = Tar::COMPRESS_BZIP;
- break;
- default:
- $comptype = Tar::COMPRESS_NONE;
- }
-
- $this->complevel = $complevel;
-
- try {
- $this->tar = new Tar();
- $this->tar->open($file, $comptype);
- } catch(Exception $e) {
- $this->_result = false;
- }
- }
-
- function Extract($p_what = TarLib::FULL_ARCHIVE, $p_to = '.', $p_remdir = '', $p_mode = 0755) {
- if($p_what != TarLib::FULL_ARCHIVE) {
- $this->error('Extract', 'Ep_what');
- return 0;
- }
-
- try {
- $this->tar->extract($p_to, $p_remdir);
- } catch(Exception $e) {
- return 0;
- }
- return 1;
- }
-
- function error($func, $param = '') {
- $error = 'TarLib is deprecated and should no longer be used.';
-
- if($param) {
- $error .= "In this compatibility wrapper, the function '$func' does not accept your value for".
- "the parameter '$param' anymore.";
- } else {
- $error .= "The function '$func' no longer exists in this compatibility wrapper.";
- }
-
- msg($error, -1);
- }
-
- function __call($name, $arguments) {
- $this->error($name);
- }
-} \ No newline at end of file
diff --git a/inc/ZipLib.class.php b/inc/ZipLib.class.php
index 918d38579..1358ca45e 100644
--- a/inc/ZipLib.class.php
+++ b/inc/ZipLib.class.php
@@ -6,6 +6,7 @@
* @link http://forum.maxg.info
*
* Modified for Dokuwiki
+ * @deprecated 2015-05-15 - use splitbrain\PHPArchive\Zip instead
* @author Christopher Smith <chris@jalakai.co.uk>
*/
class ZipLib {
@@ -16,6 +17,10 @@ class ZipLib {
var $old_offset = 0;
var $dirs = Array(".");
+ /**
+ * @param string $zip_name filename path to file
+ * @return array|int
+ */
function get_List($zip_name) {
$zip = @fopen($zip_name, 'rb');
if(!$zip) return(0);
@@ -24,10 +29,12 @@ class ZipLib {
@rewind($zip);
@fseek($zip, $centd['offset']);
+ $ret = array();
for ($i=0; $i<$centd['entries']; $i++) {
$header = $this->ReadCentralFileHeaders($zip);
$header['index'] = $i;
+ $info = array();
$info['filename'] = $header['filename'];
$info['stored_filename'] = $header['stored_filename'];
$info['size'] = $header['size'];
@@ -45,9 +52,15 @@ class ZipLib {
return $ret;
}
+ /**
+ * @param array $files array filled with array(string filename, string data)
+ * @param bool $compact
+ * @return array
+ */
function Add($files,$compact) {
if(!is_array($files[0])) $files=Array($files);
+ $ret = array();
for($i=0;$files[$i];$i++){
$fn = $files[$i];
if(!in_Array(dirname($fn[0]),$this->dirs))
@@ -60,6 +73,10 @@ class ZipLib {
/**
* Zips recursively the $folder directory, from the $basedir directory
+ *
+ * @param string $folder filename path to file
+ * @param string|null $basedir
+ * @param string|null $parent
*/
function Compress($folder, $basedir=null, $parent=null) {
$full_path = $basedir."/".$parent.$folder;
@@ -70,6 +87,7 @@ class ZipLib {
}
$dir = new DirectoryIterator($full_path);
foreach($dir as $file) {
+ /** @var DirectoryIterator $file */
if(!$file->isDot()) {
$filename = $file->getFilename();
if($file->isDir()) {
@@ -84,6 +102,8 @@ class ZipLib {
/**
* Returns the Zip file
+ *
+ * @return string
*/
function get_file() {
$data = implode('', $this -> datasec);
@@ -94,6 +114,9 @@ class ZipLib {
pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\x00\x00";
}
+ /**
+ * @param string $name the name of the directory
+ */
function add_dir($name) {
$name = str_replace("\\", "/", $name);
$fr = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00";
@@ -117,8 +140,13 @@ class ZipLib {
/**
* Add a file named $name from a string $data
+ *
+ * @param string $data
+ * @param string $name filename
+ * @param bool $compact
+ * @return bool
*/
- function add_File($data, $name, $compact = 1) {
+ function add_File($data, $name, $compact = true) {
$name = str_replace('\\', '/', $name);
$dtime = dechex($this->DosTime());
@@ -166,6 +194,9 @@ class ZipLib {
return true;
}
+ /**
+ * @return int
+ */
function DosTime() {
$timearray = getdate();
if ($timearray['year'] < 1980) {
@@ -186,10 +217,14 @@ class ZipLib {
/**
* Extract a zip file $zn to the $to directory
+ *
+ * @param string $zn filename
+ * @param string $to filename path to file
+ * @param array $index
+ * @return array|int
*/
function Extract ( $zn, $to, $index = Array(-1) ) {
if(!@is_dir($to)) $this->_mkdir($to);
- $ok = 0;
$zip = @fopen($zn,'rb');
if(!$zip) return(-1);
$cdir = $this->ReadCentralDir($zip,$zn);
@@ -203,6 +238,7 @@ class ZipLib {
return(-1);
}
+ $stat = array();
for ($i=0; $i<$cdir['entries']; $i++) {
@fseek($zip, $pos_entry);
$header = $this->ReadCentralFileHeaders($zip);
@@ -218,6 +254,11 @@ class ZipLib {
return $stat;
}
+ /**
+ * @param resource $zip
+ * @param array $header
+ * @return array
+ */
function ReadFileHeader($zip, $header) {
$binary_data = fread($zip, 30);
$data = unpack('vchk/vid/vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $binary_data);
@@ -254,6 +295,10 @@ class ZipLib {
return $header;
}
+ /**
+ * @param resource $zip
+ * @return array
+ */
function ReadCentralFileHeaders($zip){
$binary_data = fread($zip, 46);
$header = unpack('vchkid/vid/vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $binary_data);
@@ -295,6 +340,11 @@ class ZipLib {
return $header;
}
+ /**
+ * @param resource $zip
+ * @param string $zip_name filename path to file
+ * @return array
+ */
function ReadCentralDir($zip,$zip_name) {
$size = filesize($zip_name);
if ($size < 277){
@@ -320,6 +370,7 @@ class ZipLib {
$data=unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size',
fread($zip, 18));
+ $centd = array();
if ($data['comment_size'] != 0){
$centd['comment'] = fread($zip, $data['comment_size']);
} else {
@@ -334,6 +385,12 @@ class ZipLib {
return $centd;
}
+ /**
+ * @param array $header
+ * @param string $to filename path to file
+ * @param resource $zip
+ * @return bool|int
+ */
function ExtractFile($header,$to,$zip) {
$header = $this->readfileheader($zip, $header);
@@ -414,14 +471,20 @@ class ZipLib {
* centralize mkdir calls and use dokuwiki io functions
*
* @author Christopher Smith <chris@jalakai.co.uk>
+ *
+ * @param string $d filename path to file
+ * @return bool|int|string
*/
function _mkdir($d) {
return io_mkdir_p($d);
}
-
+ /**
+ * @param string $zn
+ * @param string $name
+ * @return null|string
+ */
function ExtractStr($zn, $name) {
- $ok = 0;
$zip = @fopen($zn,'rb');
if(!$zip) return(null);
$cdir = $this->ReadCentralDir($zip,$zn);
@@ -445,8 +508,13 @@ class ZipLib {
return null;
}
+ /**
+ * @param array $header
+ * @param resource $zip
+ * @return null|string
+ */
function ExtractStrFile($header,$zip) {
- $hdr = $this->readfileheader($zip);
+ $hdr = $this->readfileheader($zip, $header);
$binary_data = '';
if (!($header['external']==0x41FF0010) && !($header['external']==16)) {
if ($header['compression']==0) {
@@ -484,6 +552,10 @@ class ZipLib {
return null;
}
+ /**
+ * @param string $val
+ * @return int|string
+ */
function _ret_bytes($val) {
$val = trim($val);
$last = $val{strlen($val)-1};
diff --git a/inc/actions.php b/inc/actions.php
index ef09a0dc7..b0753b22e 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -162,20 +162,9 @@ function act_dispatch(){
if($ACT == 'admin'){
// retrieve admin plugin name from $_REQUEST['page']
if (($page = $INPUT->str('page', '', true)) != '') {
- $pluginlist = plugin_list('admin');
- if (in_array($page, $pluginlist)) {
- // attempt to load the plugin
-
- if (($plugin = plugin_load('admin',$page)) !== null){
- /** @var DokuWiki_Admin_Plugin $plugin */
- if($plugin->forAdminOnly() && !$INFO['isadmin']){
- // a manager tried to load a plugin that's for admins only
- $INPUT->remove('page');
- msg('For admins only',-1);
- }else{
- $plugin->handle();
- }
- }
+ /** @var $plugin DokuWiki_Admin_Plugin */
+ if ($plugin = plugin_getRequestAdminPlugin()){
+ $plugin->handle();
}
}
}
@@ -200,6 +189,7 @@ function act_dispatch(){
global $license;
//call template FIXME: all needed vars available?
+ $headers = array();
$headers[] = 'Content-Type: text/html; charset=utf-8';
trigger_event('ACTION_HEADERS_SEND',$headers,'act_sendheaders');
@@ -221,6 +211,9 @@ function act_sendheaders($headers) {
* Sanitize the action command
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array|string $act
+ * @return string
*/
function act_clean($act){
// check if the action was given as array key
@@ -245,6 +238,9 @@ function act_clean($act){
* Add all allowed commands here.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array|string $act
+ * @return string
*/
function act_validate($act) {
global $conf;
@@ -284,10 +280,12 @@ function act_validate($act) {
* Run permissionchecks
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_permcheck($act){
global $INFO;
- global $conf;
if(in_array($act,array('save','preview','edit','recover'))){
if($INFO['exists']){
@@ -330,6 +328,9 @@ function act_permcheck($act){
* Handle 'draftdel'
*
* Deletes the draft for the current page and user
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_draftdel($act){
global $INFO;
@@ -342,6 +343,9 @@ function act_draftdel($act){
* Saves a draft on preview
*
* @todo this currently duplicates code from ajax.php :-/
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_draftsave($act){
global $INFO;
@@ -372,6 +376,9 @@ function act_draftsave($act){
* returns a new action.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_save($act){
global $ID;
@@ -394,7 +401,7 @@ function act_save($act){
return 'conflict';
//save it
- saveWikiText($ID,con($PRE,$TEXT,$SUF,1),$SUM,$INPUT->bool('minor')); //use pretty mode for con
+ saveWikiText($ID,con($PRE,$TEXT,$SUF,true),$SUM,$INPUT->bool('minor')); //use pretty mode for con
//unlock it
unlock($ID);
@@ -410,6 +417,9 @@ function act_save($act){
* Revert to a certain revision
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_revert($act){
global $ID;
@@ -457,6 +467,9 @@ function act_revert($act){
* Do a redirect after receiving post data
*
* Tries to add the section id as hash mark after section editing
+ *
+ * @param string $id page id
+ * @param string $preact action command before redirect
*/
function act_redirect($id,$preact){
global $PRE;
@@ -478,7 +491,7 @@ function act_redirect($id,$preact){
/**
* Execute the redirect
*
- * @param array $opts id and fragment for the redirect
+ * @param array $opts id and fragment for the redirect and the preact
*/
function act_redirect_execute($opts){
$go = wl($opts['id'],'',true);
@@ -492,6 +505,9 @@ function act_redirect_execute($opts){
* Handle 'login', 'logout'
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_auth($act){
global $ID;
@@ -527,6 +543,9 @@ function act_auth($act){
* Handle 'edit', 'preview', 'recover'
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_edit($act){
global $ID;
@@ -591,6 +610,9 @@ function act_edit($act){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Klier <chi@chimeric.de>
+ *
+ * @param string $act action command
+ * @return string action command
*/
function act_export($act){
global $ID;
@@ -600,7 +622,6 @@ function act_export($act){
$pre = '';
$post = '';
- $output = '';
$headers = array();
// search engines: never cache exported docs! (Google only currently)
@@ -644,7 +665,7 @@ function act_export($act){
$output = p_wiki_xhtml($ID,$REV,false);
break;
default:
- $output = p_cached_output(wikiFN($ID,$REV), $mode);
+ $output = p_cached_output(wikiFN($ID,$REV), $mode, $ID);
$headers = p_get_metadata($ID,"format $mode");
break;
}
@@ -672,6 +693,8 @@ function act_export($act){
* Handle sitemap delivery
*
* @author Michael Hamann <michael@content-space.de>
+ *
+ * @param string $act action command
*/
function act_sitemap($act) {
global $conf;
@@ -720,6 +743,10 @@ function act_sitemap($act) {
* Throws exception on error.
*
* @author Adrian Lang <lang@cosmocode.de>
+ *
+ * @param string $act action command
+ * @return string action command
+ * @throws Exception if (un)subscribing fails
*/
function act_subscription($act){
global $lang;
@@ -779,6 +806,9 @@ function act_subscription($act){
* default action for the event ACTION_HANDLE_SUBSCRIBE.
*
* @author Adrian Lang <lang@cosmocode.de>
+ *
+ * @param array &$params the parameters: target, style and action
+ * @throws Exception
*/
function subscription_handle_post(&$params) {
global $INFO;
diff --git a/inc/auth.php b/inc/auth.php
index 4b1e6ce31..e04a6ca1a 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -127,6 +127,7 @@ function auth_setup() {
* Loads the ACL setup and handle user wildcards
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @return array
*/
function auth_loadACL() {
@@ -173,7 +174,7 @@ function auth_loadACL() {
/**
* Event hook callback for AUTH_LOGIN_CHECK
*
- * @param $evdata
+ * @param array $evdata
* @return bool
*/
function auth_login_wrapper($evdata) {
@@ -280,8 +281,9 @@ function auth_login($user, $pass, $sticky = false, $silent = false) {
* token is correct. Will exit with a 401 Status if not.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $token The authentication token
- * @return boolean true (or will exit on failure)
+ * @return boolean|null true (or will exit on failure)
*/
function auth_validateToken($token) {
if(!$token || $token != $_SESSION[DOKU_COOKIE]['auth']['token']) {
@@ -307,6 +309,7 @@ function auth_validateToken($token) {
* NOTE: this is completely unrelated to the getSecurityToken() function
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @return string The auth token
*/
function auth_createToken() {
@@ -350,6 +353,7 @@ function auth_browseruid() {
* and stored in this file.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param bool $addsession if true, the sessionid is added to the salt
* @param bool $secure if security is more important than keeping the old value
* @return string
@@ -377,6 +381,7 @@ function auth_cookiesalt($addsession = false, $secure = false) {
* @author Mark Seecof
* @author Michael Hamann <michael@content-space.de>
* @link http://www.php.net/manual/de/function.mt-rand.php#83655
+ *
* @param int $length number of bytes to get
* @return string binary random strings
*/
@@ -443,6 +448,7 @@ function auth_randombytes($length) {
*
* @author Michael Samuel
* @author Michael Hamann <michael@content-space.de>
+ *
* @param int $min
* @param int $max
* @return int
@@ -514,6 +520,7 @@ function auth_decrypt($ciphertext, $secret) {
* off. It also clears session data.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param bool $keepbc - when true, the breadcrumb data is not cleared
*/
function auth_logoff($keepbc = false) {
@@ -554,6 +561,7 @@ function auth_logoff($keepbc = false) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @see auth_isadmin
+ *
* @param string $user Username
* @param array $groups List of groups the user is in
* @param bool $adminonly when true checks if user is admin
@@ -598,6 +606,7 @@ function auth_ismanager($user = null, $groups = null, $adminonly = false) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @see auth_ismanager()
+ *
* @param string $user Username
* @param array $groups List of groups the user is in
* @return bool
@@ -612,9 +621,9 @@ function auth_isadmin($user = null, $groups = null) {
*
* Note: all input should NOT be nameencoded.
*
- * @param $memberlist string commaseparated list of allowed users and groups
- * @param $user string user to match against
- * @param $groups array groups the user is member of
+ * @param string $memberlist commaseparated list of allowed users and groups
+ * @param string $user user to match against
+ * @param array $groups groups the user is member of
* @return bool true for membership acknowledged
*/
function auth_isMember($memberlist, $user, array $groups) {
@@ -677,6 +686,7 @@ function auth_quickaclcheck($id) {
* Returns the maximum rights a user has for the given ID or its namespace
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @triggers AUTH_ACL_CHECK
* @param string $id page ID (needs to be resolved and cleaned)
* @param string $user Username
@@ -699,6 +709,7 @@ function auth_aclcheck($id, $user, $groups) {
* DO NOT CALL DIRECTLY, use auth_aclcheck() instead
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param array $data event data
* @return int permission level
*/
@@ -728,28 +739,23 @@ function auth_aclcheck_cb($data) {
$user = utf8_strtolower($user);
$groups = array_map('utf8_strtolower', $groups);
}
- $user = $auth->cleanUser($user);
+ $user = auth_nameencode($auth->cleanUser($user));
$groups = array_map(array($auth, 'cleanGroup'), (array) $groups);
- $user = auth_nameencode($user);
//prepend groups with @ and nameencode
- $cnt = count($groups);
- for($i = 0; $i < $cnt; $i++) {
- $groups[$i] = '@'.auth_nameencode($groups[$i]);
+ foreach($groups as &$group) {
+ $group = '@'.auth_nameencode($group);
}
$ns = getNS($id);
$perm = -1;
- if($user || count($groups)) {
- //add ALL group
- $groups[] = '@ALL';
- //add User
- if($user) $groups[] = $user;
- } else {
- $groups[] = '@ALL';
- }
-
+ //add ALL group
+ $groups[] = '@ALL';
+
+ //add User
+ if($user) $groups[] = $user;
+
//check exact match first
$matches = preg_grep('/^'.preg_quote($id, '/').'[ \t]+([^ \t]+)[ \t]+/', $AUTH_ACL);
if(count($matches)) {
@@ -831,6 +837,10 @@ function auth_aclcheck_cb($data) {
*
* @author Andreas Gohr <gohr@cosmocode.de>
* @see rawurldecode()
+ *
+ * @param string $name
+ * @param bool $skip_group
+ * @return string
*/
function auth_nameencode($name, $skip_group = false) {
global $cache_authname;
@@ -912,6 +922,7 @@ function auth_pwgen($foruser = '') {
* Sends a password to the given user
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $user Login name of the user
* @param string $password The new password in clear text
* @return bool true on success
@@ -947,6 +958,7 @@ function auth_sendPassword($user, $password) {
* This registers a new user - Data is read directly from $_POST
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @return bool true on success, false on any error
*/
function register() {
@@ -989,7 +1001,7 @@ function register() {
//okay try to create the user
if(!$auth->triggerUserMod('create', array($login, $pass, $fullname, $email))) {
- msg($lang['reguexists'], -1);
+ msg($lang['regfail'], -1);
return false;
}
@@ -1081,17 +1093,18 @@ function updateprofile() {
}
}
- if($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) {
- // update cookie and session with the changed data
- if($changes['pass']) {
- list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
- $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true));
- auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
- }
- return true;
+ if(!$auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) {
+ msg($lang['proffail'], -1);
+ return false;
}
- return false;
+ // update cookie and session with the changed data
+ if($changes['pass']) {
+ list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
+ $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true));
+ auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
+ }
+ return true;
}
/**
@@ -1128,6 +1141,7 @@ function auth_deleteprofile(){
}
}
+ $deleted = array();
$deleted[] = $INPUT->server->str('REMOTE_USER');
if($auth->triggerUserMod('delete', array($deleted))) {
// force and immediate logout including removing the sticky cookie
@@ -1171,7 +1185,7 @@ function act_resendpwd() {
// we're in token phase - get user info from token
$tfile = $conf['cachedir'].'/'.$token{0}.'/'.$token.'.pwauth';
- if(!@file_exists($tfile)) {
+ if(!file_exists($tfile)) {
msg($lang['resendpwdbadauth'], -1);
$INPUT->remove('pwauth');
return false;
@@ -1203,7 +1217,7 @@ function act_resendpwd() {
// change it
if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
- msg('error modifying user data', -1);
+ msg($lang['proffail'], -1);
return false;
}
@@ -1211,7 +1225,7 @@ function act_resendpwd() {
$pass = auth_pwgen($user);
if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
- msg('error modifying user data', -1);
+ msg($lang['proffail'], -1);
return false;
}
@@ -1278,6 +1292,7 @@ function act_resendpwd() {
* is chosen.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $clear The clear text password
* @param string $method The hashing method
* @param string $salt A salt, null for random
@@ -1302,6 +1317,7 @@ function auth_cryptPassword($clear, $method = '', $salt = null) {
* Verifies a cleartext password against a crypted hash
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $clear The clear text password
* @param string $crypt The hash to compare with
* @return bool true if both match
diff --git a/inc/blowfish.php b/inc/blowfish.php
index bcf5804a2..7499515bc 100644
--- a/inc/blowfish.php
+++ b/inc/blowfish.php
@@ -356,7 +356,7 @@ class Horde_Cipher_blowfish
* Encrypt a block on data.
*
* @param String $block The data to encrypt
- * @param optional String $key The key to use
+ * @param String $key optional The key to use
*
* @return String the encrypted output
*/
@@ -404,8 +404,8 @@ class Horde_Cipher_blowfish
/**
* Decrypt a block on data.
*
- * @param String $block The data to decrypt
- * @param optional String $key The key to use
+ * @param String $block The data to decrypt
+ * @param String $key optional The key to use
*
* @return String the decrypted output
*/
@@ -452,6 +452,7 @@ class Horde_Cipher_blowfish
/**
* Converts a text key into an array.
*
+ * @param string $key
* @return array The key.
*/
function _formatKey($key) {
@@ -464,8 +465,8 @@ class Horde_Cipher_blowfish
/**
* Encryption using blowfish algorithm
*
- * @param string original data
- * @param string the secret
+ * @param string $data original data
+ * @param string $secret the secret
*
* @return string the encrypted result
*
@@ -493,8 +494,8 @@ function PMA_blowfish_encrypt($data, $secret) {
/**
* Decryption using blowfish algorithm
*
- * @param string encrypted data
- * @param string the secret
+ * @param string $encdata encrypted data
+ * @param string $secret the secret
*
* @return string original data
*
diff --git a/inc/cache.php b/inc/cache.php
index 6817e771b..9375dc86b 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -26,7 +26,7 @@ class cache {
* @param string $key primary identifier
* @param string $ext file extension
*/
- public function cache($key,$ext) {
+ public function __construct($key,$ext) {
$this->key = $key;
$this->ext = $ext;
$this->cache = getCacheName($key,$ext);
@@ -50,7 +50,7 @@ class cache {
$this->_addDependencies();
if ($this->_event) {
- return $this->_stats(trigger_event($this->_event,$this,array($this,'_useCache')));
+ return $this->_stats(trigger_event($this->_event, $this, array($this,'_useCache')));
} else {
return $this->_stats($this->_useCache());
}
@@ -188,12 +188,12 @@ class cache_parser extends cache {
* @param string $file source file for cache
* @param string $mode input mode
*/
- public function cache_parser($id, $file, $mode) {
+ public function __construct($id, $file, $mode) {
if ($id) $this->page = $id;
$this->file = $file;
$this->mode = $mode;
- parent::cache($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
+ parent::__construct($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
}
/**
@@ -203,7 +203,7 @@ class cache_parser extends cache {
*/
public function _useCache() {
- if (!@file_exists($this->file)) return false; // source exists?
+ if (!file_exists($this->file)) return false; // source exists?
return parent::_useCache();
}
@@ -308,15 +308,15 @@ class cache_instructions extends cache_parser {
* @param string $id page id
* @param string $file source file for cache
*/
- public function cache_instructions($id, $file) {
- parent::cache_parser($id, $file, 'i');
+ public function __construct($id, $file) {
+ parent::__construct($id, $file, 'i');
}
/**
* retrieve the cached data
*
* @param bool $clean true to clean line endings, false to leave line endings alone
- * @return string cache contents
+ * @return array cache contents
*/
public function retrieveCache($clean=true) {
$contents = io_readFile($this->cache, false);
@@ -326,7 +326,7 @@ class cache_instructions extends cache_parser {
/**
* cache $instructions
*
- * @param string $instructions the instruction to be cached
+ * @param array $instructions the instruction to be cached
* @return bool true on success, false otherwise
*/
public function storeCache($instructions) {
diff --git a/inc/changelog.php b/inc/changelog.php
index 6af336fc2..f4731021c 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -83,17 +83,19 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
'extra' => str_replace($strip, '', $extra)
);
+ $wasCreated = ($type===DOKU_CHANGE_TYPE_CREATE);
+ $wasReverted = ($type===DOKU_CHANGE_TYPE_REVERT);
// update metadata
if (!$wasRemoved) {
$oldmeta = p_read_metadata($id);
$meta = array();
- if (!$INFO['exists'] && empty($oldmeta['persistent']['date']['created'])){ // newly created
+ if ($wasCreated && empty($oldmeta['persistent']['date']['created'])){ // newly created
$meta['date']['created'] = $created;
if ($user){
$meta['creator'] = $INFO['userinfo']['name'];
$meta['user'] = $user;
}
- } elseif (!$INFO['exists'] && !empty($oldmeta['persistent']['date']['created'])) { // re-created / restored
+ } elseif (($wasCreated || $wasReverted) && !empty($oldmeta['persistent']['date']['created'])) { // re-created / restored
$meta['date']['created'] = $oldmeta['persistent']['date']['created'];
$meta['date']['modified'] = $created; // use the files ctime here
$meta['creator'] = $oldmeta['persistent']['creator'];
@@ -349,7 +351,7 @@ function _handleRecent($line,$ns,$flags,&$seen){
// check existance
if($flags & RECENTS_SKIP_DELETED){
$fn = (($flags & RECENTS_MEDIA_CHANGES) ? mediaFN($recent['id']) : wikiFN($recent['id']));
- if(!@file_exists($fn)) return false;
+ if(!file_exists($fn)) return false;
}
return $recent;
@@ -496,14 +498,14 @@ abstract class ChangeLog {
if($first < 0) {
$first = 0;
- } else if(@file_exists($this->getFilename())) {
+ } else if(file_exists($this->getFilename())) {
// skip current revision if the page exists
$first = max($first + 1, 0);
}
$file = $this->getChangelogFilename();
- if(!@file_exists($file)) {
+ if(!file_exists($file)) {
return $revs;
}
if(filesize($file) < $this->chunk_size || $this->chunk_size == 0) {
@@ -725,13 +727,15 @@ abstract class ChangeLog {
* If file larger than $chuncksize, only chunck is read that could contain $rev.
*
* @param int $rev revision timestamp
- * @return array(fp, array(changeloglines), $head, $tail, $eof)|bool
- * returns false when not succeed. fp only defined for chuck reading, needs closing.
+ * @return array|false
+ * if success returns array(fp, array(changeloglines), $head, $tail, $eof)
+ * where fp only defined for chuck reading, needs closing.
+ * otherwise false
*/
protected function readloglines($rev) {
$file = $this->getChangelogFilename();
- if(!@file_exists($file)) {
+ if(!file_exists($file)) {
return false;
}
@@ -845,18 +849,17 @@ abstract class ChangeLog {
public function isCurrentRevision($rev) {
return $rev == @filemtime($this->getFilename());
}
-
+
/**
- * Return an existing revision for a specific date which is
+ * Return an existing revision for a specific date which is
* the current one or younger or equal then the date
*
- * @param string $id
* @param number $date_at timestamp
* @return string revision ('' for current)
*/
function getLastRevisionAt($date_at){
//requested date_at(timestamp) younger or equal then modified_time($this->id) => load current
- if($date_at >= @filemtime($this->getFilename())) {
+ if($date_at >= @filemtime($this->getFilename())) {
return '';
} else if ($rev = $this->getRelativeRevision($date_at+1, -1)) { //+1 to get also the requested date revision
return $rev;
@@ -1045,6 +1048,12 @@ class MediaChangelog extends ChangeLog {
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id
+ * @param int $rev
+ * @param int $chunk_size
+ * @param bool $media
+ * @return array|bool
*/
function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
dbg_deprecated('class PageChangeLog or class MediaChangelog');
diff --git a/inc/cli.php b/inc/cli.php
index 25bfddf7d..14e2c0c8d 100644
--- a/inc/cli.php
+++ b/inc/cli.php
@@ -108,7 +108,7 @@ abstract class DokuCLI {
/**
* Print an error message
*
- * @param $string
+ * @param string $string
*/
public function error($string) {
$this->colors->ptln("E: $string", 'red', STDERR);
@@ -117,7 +117,7 @@ abstract class DokuCLI {
/**
* Print a success message
*
- * @param $string
+ * @param string $string
*/
public function success($string) {
$this->colors->ptln("S: $string", 'green', STDERR);
@@ -126,7 +126,7 @@ abstract class DokuCLI {
/**
* Print an info message
*
- * @param $string
+ * @param string $string
*/
public function info($string) {
$this->colors->ptln("I: $string", 'cyan', STDERR);
@@ -199,8 +199,8 @@ class DokuCLI_Colors {
/**
* Convenience function to print a line in a given color
*
- * @param $line
- * @param $color
+ * @param string $line
+ * @param string $color
* @param resource $channel
*/
public function ptln($line, $color, $channel = STDOUT) {
@@ -470,8 +470,8 @@ class DokuCLI_Options {
* Can only be used after parseOptions() has been run
*
* @param string $option
- * @param mixed $default what to return if the option was not set
- * @return mixed
+ * @param bool|string $default what to return if the option was not set
+ * @return bool|string
*/
public function getOpt($option, $default = false) {
if(isset($this->options[$option])) return $this->options[$option];
@@ -593,8 +593,8 @@ class DokuCLI_Options {
/**
* Displays text in multiple word wrapped columns
*
- * @param array $widths list of column widths (in characters)
- * @param array $texts list of texts for each column
+ * @param int[] $widths list of column widths (in characters)
+ * @param string[] $texts list of texts for each column
* @return string
*/
private function tableFormat($widths, $texts) {
@@ -640,6 +640,11 @@ class DokuCLI_Exception extends Exception {
const E_OPT_ABIGUOUS = 4; //Option abiguous
const E_ARG_READ = 5; //Could not read argv
+ /**
+ * @param string $message The Exception message to throw.
+ * @param int $code The Exception code
+ * @param Exception $previous The previous exception used for the exception chaining.
+ */
public function __construct($message = "", $code = 0, Exception $previous = null) {
if(!$code) $code = DokuCLI_Exception::E_ANY;
parent::__construct($message, $code, $previous);
diff --git a/inc/cliopts.php b/inc/cliopts.php
index c75a5a93b..d7d06119a 100644
--- a/inc/cliopts.php
+++ b/inc/cliopts.php
@@ -36,9 +36,9 @@ if (version_compare(phpversion(), '4.3.0', '<') || php_sapi_name() == 'cgi') {
// PHP ini settings
set_time_limit(0);
- ini_set('track_errors', true);
- ini_set('html_errors', false);
- ini_set('magic_quotes_runtime', false);
+ ini_set('track_errors', "1");
+ ini_set('html_errors', "0");
+ ini_set('magic_quotes_runtime', "0");
// Define stream constants
define('STDIN', fopen('php://stdin', 'r'));
@@ -78,7 +78,7 @@ class Doku_Cli_Opts {
* @param string $bin_file executing file name - this MUST be passed the __FILE__ constant
* @param string $short_options short options
* @param array $long_options (optional) long options
- * @return Doku_Cli_Opts_Container or Doku_Cli_Opts_Error
+ * @return Doku_Cli_Opts_Container|Doku_Cli_Opts_Error
*/
function & getOptions($bin_file, $short_options, $long_options = null) {
$args = Doku_Cli_Opts::readPHPArgv();
@@ -447,7 +447,7 @@ class Doku_Cli_Opts_Error {
var $code;
var $msg;
- function Doku_Cli_Opts_Error($code, $msg) {
+ function __construct($code, $msg) {
$this->code = $code;
$this->msg = $msg;
}
@@ -468,7 +468,7 @@ class Doku_Cli_Opts_Container {
var $options = array();
var $args = array();
- function Doku_Cli_Opts_Container($options) {
+ function __construct($options) {
foreach ( $options[0] as $option ) {
if ( false !== ( strpos($option[0], '--') ) ) {
$opt_name = substr($option[0], 2);
diff --git a/inc/common.php b/inc/common.php
index 11b8a7e26..e14bd7af4 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -49,7 +49,7 @@ function ptln($string, $indent = 0) {
*
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @param $string string being stripped
+ * @param string $string being stripped
* @return string
*/
function stripctl($string) {
@@ -62,6 +62,7 @@ function stripctl($string) {
* @author Andreas Gohr <andi@splitbrain.org>
* @link http://en.wikipedia.org/wiki/Cross-site_request_forgery
* @link http://christ1an.blogspot.com/2007/04/preventing-csrf-efficiently.html
+ *
* @return string
*/
function getSecurityToken() {
@@ -95,7 +96,7 @@ function checkSecurityToken($token = null) {
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param bool $print if true print the field, otherwise html of the field is returned
- * @return void|string html of hidden form field
+ * @return string html of hidden form field
*/
function formSecurityToken($print = true) {
$ret = '<div class="no"><input type="hidden" name="sectok" value="'.getSecurityToken().'" /></div>'."\n";
@@ -120,6 +121,7 @@ function basicinfo($id, $htmlClient=true){
global $INPUT;
// set info about manager/admin status.
+ $info = array();
$info['isadmin'] = false;
$info['ismanager'] = false;
if($INPUT->server->has('REMOTE_USER')) {
@@ -186,7 +188,7 @@ function pageinfo() {
$info['locked'] = checklock($ID);
$info['filepath'] = fullpath(wikiFN($ID));
- $info['exists'] = @file_exists($info['filepath']);
+ $info['exists'] = file_exists($info['filepath']);
$info['currentrev'] = @filemtime($info['filepath']);
if($REV) {
//check if current revision was meant
@@ -200,7 +202,7 @@ function pageinfo() {
} else {
//really use old revision
$info['filepath'] = fullpath(wikiFN($ID, $REV));
- $info['exists'] = @file_exists($info['filepath']);
+ $info['exists'] = file_exists($info['filepath']);
}
}
$info['rev'] = $REV;
@@ -254,7 +256,7 @@ function pageinfo() {
// draft
$draft = getCacheName($info['client'].$ID, '.draft');
- if(@file_exists($draft)) {
+ if(file_exists($draft)) {
if(@filemtime($draft) < @filemtime(wikiFN($ID))) {
// remove stale draft
@unlink($draft);
@@ -335,7 +337,7 @@ function buildAttributes($params, $skipempty = false) {
*
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @return array(pageid=>name, ... )
+ * @return string[] with the data: array(pageid=>name, ... )
*/
function breadcrumbs() {
// we prepare the breadcrumbs early for quick session closing
@@ -350,7 +352,7 @@ function breadcrumbs() {
$crumbs = isset($_SESSION[DOKU_COOKIE]['bc']) ? $_SESSION[DOKU_COOKIE]['bc'] : array();
//we only save on show and existing wiki documents
$file = wikiFN($ID);
- if($ACT != 'show' || !@file_exists($file)) {
+ if($ACT != 'show' || !file_exists($file)) {
$_SESSION[DOKU_COOKIE]['bc'] = $crumbs;
return $crumbs;
}
@@ -688,6 +690,7 @@ function checkwordblock($text = '') {
}
if(count($re) && preg_match('#('.join('|', $re).')#si', $text, $matches)) {
// prepare event data
+ $data = array();
$data['matches'] = $matches;
$data['userinfo']['ip'] = $INPUT->server->str('REMOTE_ADDR');
if($INPUT->server->str('REMOTE_USER')) {
@@ -850,7 +853,7 @@ function checklock($id) {
$lock = wikiLockFN($id);
//no lockfile
- if(!@file_exists($lock)) return false;
+ if(!file_exists($lock)) return false;
//lockfile expired
if((time() - filemtime($lock)) > $conf['locktime']) {
@@ -904,7 +907,7 @@ function unlock($id) {
global $INPUT;
$lock = wikiLockFN($id);
- if(@file_exists($lock)) {
+ if(file_exists($lock)) {
@list($ip, $session) = explode("\n", io_readFile($lock));
if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || $session == session_id()) {
@unlink($lock);
@@ -971,7 +974,7 @@ function rawLocale($id, $ext = 'txt') {
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $id page id
- * @param string $rev timestamp when a revision of wikitext is desired
+ * @param string|int $rev timestamp when a revision of wikitext is desired
* @return string
*/
function rawWiki($id, $rev = '') {
@@ -1007,13 +1010,13 @@ function pageTemplate($id) {
// if the before event did not set a template file, try to find one
if(empty($data['tplfile'])) {
$path = dirname(wikiFN($id));
- if(@file_exists($path.'/_template.txt')) {
+ if(file_exists($path.'/_template.txt')) {
$data['tplfile'] = $path.'/_template.txt';
} else {
// search upper namespaces for templates
$len = strlen(rtrim($conf['datadir'], '/'));
while(strlen($path) >= $len) {
- if(@file_exists($path.'/__template.txt')) {
+ if(file_exists($path.'/__template.txt')) {
$data['tplfile'] = $path.'/__template.txt';
break;
}
@@ -1111,7 +1114,7 @@ function parsePageTemplate(&$data) {
* @param string $range in form "from-to"
* @param string $id page id
* @param string $rev optional, the revision timestamp
- * @return array with three slices
+ * @return string[] with three slices
*/
function rawWikiSlices($range, $id, $rev = '') {
$text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
@@ -1122,6 +1125,7 @@ function rawWikiSlices($range, $id, $rev = '') {
$from = !$from ? 0 : ($from - 1);
$to = !$to ? strlen($text) : ($to - 1);
+ $slices = array();
$slices[0] = substr($text, 0, $from);
$slices[1] = substr($text, $from, $to - $from);
$slices[2] = substr($text, $to);
@@ -1193,13 +1197,13 @@ function saveWikiText($id, $text, $summary, $minor = false) {
$file = wikiFN($id);
$old = @filemtime($file); // from page
$wasRemoved = (trim($text) == ''); // check for empty or whitespace only
- $wasCreated = !@file_exists($file);
+ $wasCreated = !file_exists($file);
$wasReverted = ($REV == true);
$pagelog = new PageChangeLog($id, 1024);
$newRev = false;
$oldRev = $pagelog->getRevisions(-1, 1); // from changelog
$oldRev = (int) (empty($oldRev) ? 0 : $oldRev[0]);
- if(!@file_exists(wikiFN($id, $old)) && @file_exists($file) && $old >= $oldRev) {
+ if(!file_exists(wikiFN($id, $old)) && file_exists($file) && $old >= $oldRev) {
// add old revision to the attic if missing
saveOldRevision($id);
// add a changelog entry if this edit came from outside dokuwiki
@@ -1281,7 +1285,7 @@ function saveWikiText($id, $text, $summary, $minor = false) {
*/
function saveOldRevision($id) {
$oldf = wikiFN($id);
- if(!@file_exists($oldf)) return '';
+ if(!file_exists($oldf)) return '';
$date = filemtime($oldf);
$newf = wikiFN($id, $date);
io_writeWikiPage($newf, rawWiki($id), $id, $date);
@@ -1296,7 +1300,7 @@ function saveOldRevision($id) {
* @param int|string $rev Old page revision
* @param string $summary What changed
* @param boolean $minor Is this a minor edit?
- * @param array $replace Additional string substitutions, @KEY@ to be replaced by value
+ * @param string[] $replace Additional string substitutions, @KEY@ to be replaced by value
* @return bool
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -1376,8 +1380,8 @@ function getGoogleQuery() {
/**
* Return the human readable size of a file
*
- * @param int $size A file size
- * @param int $dec A number of decimal places
+ * @param int $size A file size
+ * @param int $dec A number of decimal places
* @return string human readable size
*
* @author Martin Benjamin <b.martin@cybernet.ch>
@@ -1460,7 +1464,7 @@ function dformat($dt = null, $format = '') {
* @author <ungu at terong dot com>
* @link http://www.php.net/manual/en/function.date.php#54072
*
- * @param int $int_date: current date in UNIX timestamp
+ * @param int $int_date current date in UNIX timestamp
* @return string
*/
function date_iso8601($int_date) {
@@ -1739,7 +1743,7 @@ function license_img($type) {
$try[] = 'lib/images/license/'.$type.'/cc.png';
}
foreach($try as $src) {
- if(@file_exists(DOKU_INC.$src)) return $src;
+ if(file_exists(DOKU_INC.$src)) return $src;
}
return '';
}
@@ -1803,17 +1807,6 @@ function send_redirect($url) {
// always close the session
session_write_close();
- // work around IE bug
- // http://www.ianhoar.com/2008/11/16/internet-explorer-6-and-redirected-anchor-links/
- @list($url, $hash) = explode('#', $url);
- if($hash) {
- if(strpos($url, '?')) {
- $url = $url.'&#'.$hash;
- } else {
- $url = $url.'?&#'.$hash;
- }
- }
-
// check if running on IIS < 6 with CGI-PHP
if($INPUT->server->has('SERVER_SOFTWARE') && $INPUT->server->has('GATEWAY_INTERFACE') &&
(strpos($INPUT->server->str('GATEWAY_INTERFACE'), 'CGI') !== false) &&
@@ -1824,6 +1817,8 @@ function send_redirect($url) {
} else {
header('Location: '.$url);
}
+
+ if(defined('DOKU_UNITTEST')) return; // no exits during unit tests
exit;
}
@@ -1880,6 +1875,7 @@ function get_doku_pref($pref, $default) {
/**
* Add a preference to the DokuWiki cookie
* (remembering $_COOKIE['DOKU_PREFS'] is urlencoded)
+ * Remove it by setting $val to false
*
* @param string $pref preference key
* @param string $val preference value
@@ -1896,12 +1892,17 @@ function set_doku_pref($pref, $val) {
$enc_pref = rawurlencode($pref);
for($i = 0; $i < $cnt; $i += 2) {
if($parts[$i] == $enc_pref) {
- $parts[$i + 1] = rawurlencode($val);
+ if ($val !== false) {
+ $parts[$i + 1] = rawurlencode($val);
+ } else {
+ unset($parts[$i]);
+ unset($parts[$i + 1]);
+ }
break;
}
}
$cookieVal = implode('#', $parts);
- } else if (!$orig) {
+ } else if (!$orig && $val !== false) {
$cookieVal = ($_COOKIE['DOKU_PREFS'] ? $_COOKIE['DOKU_PREFS'].'#' : '').rawurlencode($pref).'#'.rawurlencode($val);
}
@@ -1914,7 +1915,7 @@ function set_doku_pref($pref, $val) {
/**
* Strips source mapping declarations from given text #601
*
- * @param &string $text reference to the CSS or JavaScript code to clean
+ * @param string &$text reference to the CSS or JavaScript code to clean
*/
function stripsourcemaps(&$text){
$text = preg_replace('/^(\/\/|\/\*)[@#]\s+sourceMappingURL=.*?(\*\/)?$/im', '\\1\\2', $text);
diff --git a/inc/compatibility.php b/inc/compatibility.php
index 2738c9bb1..cb865a2d7 100644
--- a/inc/compatibility.php
+++ b/inc/compatibility.php
@@ -41,12 +41,42 @@ if(!function_exists('gzopen') && function_exists('gzopen64')) {
*
* @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
*
- * @param string $filename
- * @param string $mode
- * @param int $use_include_path
+ * @param string $filename
+ * @param string $mode
+ * @param int $use_include_path
* @return mixed
*/
function gzopen($filename, $mode, $use_include_path = 0) {
return gzopen64($filename, $mode, $use_include_path);
}
+}
+
+if(!function_exists('gzseek') && function_exists('gzseek64')) {
+ /**
+ * work around for PHP compiled against certain zlib versions #865
+ *
+ * @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
+ *
+ * @param resource $zp
+ * @param int $offset
+ * @param int $whence
+ * @return int
+ */
+ function gzseek($zp, $offset, $whence = SEEK_SET) {
+ return gzseek64($zp, $offset, $whence);
+ }
+}
+
+if(!function_exists('gztell') && function_exists('gztell64')) {
+ /**
+ * work around for PHP compiled against certain zlib versions #865
+ *
+ * @link http://stackoverflow.com/questions/23417519/php-zlib-gzopen-not-exists
+ *
+ * @param resource $zp
+ * @return int
+ */
+ function gztell($zp) {
+ return gztell64($zp);
+ }
} \ No newline at end of file
diff --git a/inc/config_cascade.php b/inc/config_cascade.php
index 1d9f67edb..a6dfadc80 100644
--- a/inc/config_cascade.php
+++ b/inc/config_cascade.php
@@ -49,13 +49,13 @@ $config_cascade = array_merge(
'local' => array(DOKU_CONF . 'wordblock.local.conf'),
),
'userstyle' => array(
- 'screen' => DOKU_CONF . 'userstyle.css',
- 'print' => DOKU_CONF . 'userprint.css',
- 'feed' => DOKU_CONF . 'userfeed.css',
- 'all' => DOKU_CONF . 'userall.css',
+ 'screen' => array(DOKU_CONF . 'userstyle.css', DOKU_CONF . 'userstyle.less'),
+ 'print' => array(DOKU_CONF . 'userprint.css', DOKU_CONF . 'userprint.less'),
+ 'feed' => array(DOKU_CONF . 'userfeed.css', DOKU_CONF . 'userfeed.less'),
+ 'all' => array(DOKU_CONF . 'userall.css', DOKU_CONF . 'userall.less')
),
'userscript' => array(
- 'default' => DOKU_CONF . 'userscript.js'
+ 'default' => array(DOKU_CONF . 'userscript.js')
),
'acl' => array(
'default' => DOKU_CONF . 'acl.auth.php',
diff --git a/inc/confutils.php b/inc/confutils.php
index 31371d41f..8b61a8d5b 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -6,6 +6,12 @@
* @author Harry Fuecks <hfuecks@gmail.com>
*/
+/*
+ * line prefix used to negate single value config items
+ * (scheme.conf & stopwords.conf), e.g.
+ * !gopher
+ */
+const DOKU_CONF_NEGATION = '!';
/**
* Returns the (known) extension and mimetype of a given filename
@@ -14,6 +20,10 @@
* are returned.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $file file name
+ * @param bool $knownonly
+ * @return array with extension, mimetype and if it should be downloaded
*/
function mimetype($file, $knownonly=true){
$mtypes = getMimeTypes(); // known mimetypes
@@ -45,6 +55,7 @@ function getMimeTypes() {
static $mime = null;
if ( !$mime ) {
$mime = retrieveConfig('mime','confToHash');
+ $mime = array_filter($mime);
}
return $mime;
}
@@ -58,6 +69,7 @@ function getAcronyms() {
static $acronyms = null;
if ( !$acronyms ) {
$acronyms = retrieveConfig('acronyms','confToHash');
+ $acronyms = array_filter($acronyms, 'strlen');
}
return $acronyms;
}
@@ -71,6 +83,7 @@ function getSmileys() {
static $smileys = null;
if ( !$smileys ) {
$smileys = retrieveConfig('smileys','confToHash');
+ $smileys = array_filter($smileys, 'strlen');
}
return $smileys;
}
@@ -84,6 +97,7 @@ function getEntities() {
static $entities = null;
if ( !$entities ) {
$entities = retrieveConfig('entities','confToHash');
+ $entities = array_filter($entities, 'strlen');
}
return $entities;
}
@@ -97,9 +111,11 @@ function getInterwiki() {
static $wikis = null;
if ( !$wikis ) {
$wikis = retrieveConfig('interwiki','confToHash',array(true));
+ $wikis = array_filter($wikis, 'strlen');
+
+ //add sepecial case 'this'
+ $wikis['this'] = DOKU_URL.'{NAME}';
}
- //add sepecial case 'this'
- $wikis['this'] = DOKU_URL.'{NAME}';
return $wikis;
}
@@ -110,7 +126,7 @@ function getInterwiki() {
function getWordblocks() {
static $wordblocks = null;
if ( !$wordblocks ) {
- $wordblocks = retrieveConfig('wordblock','file');
+ $wordblocks = retrieveConfig('wordblock','file',null,'array_merge_with_removal');
}
return $wordblocks;
}
@@ -123,11 +139,11 @@ function getWordblocks() {
function getSchemes() {
static $schemes = null;
if ( !$schemes ) {
- $schemes = retrieveConfig('scheme','file');
+ $schemes = retrieveConfig('scheme','file',null,'array_merge_with_removal');
+ $schemes = array_map('trim', $schemes);
+ $schemes = preg_replace('/^#.*/', '', $schemes);
+ $schemes = array_filter($schemes);
}
- $schemes = array_map('trim', $schemes);
- $schemes = preg_replace('/^#.*/', '', $schemes);
- $schemes = array_filter($schemes);
return $schemes;
}
@@ -190,9 +206,14 @@ function confToHash($file,$lower=false) {
* @param string $type the configuration settings to be read, must correspond to a key/array in $config_cascade
* @param callback $fn the function used to process the configuration file into an array
* @param array $params optional additional params to pass to the callback
+ * @param callback $combine the function used to combine arrays of values read from different configuration files;
+ * the function takes two parameters,
+ * $combined - the already read & merged configuration values
+ * $new - array of config values from the config cascade file being currently processed
+ * and returns an array of the merged configuration values.
* @return array configuration values
*/
-function retrieveConfig($type,$fn,$params=null) {
+function retrieveConfig($type,$fn,$params=null,$combine='array_merge') {
global $config_cascade;
if(!is_array($params)) $params = array();
@@ -202,9 +223,9 @@ function retrieveConfig($type,$fn,$params=null) {
foreach (array('default','local','protected') as $config_group) {
if (empty($config_cascade[$type][$config_group])) continue;
foreach ($config_cascade[$type][$config_group] as $file) {
- if (@file_exists($file)) {
+ if (file_exists($file)) {
$config = call_user_func_array($fn,array_merge(array($file),$params));
- $combined = array_merge($combined, $config);
+ $combined = $combine($combined, $config);
}
}
}
@@ -343,4 +364,27 @@ function conf_decodeString($str) {
return $str;
}
}
+
+/**
+ * array combination function to remove negated values (prefixed by !)
+ *
+ * @param array $current
+ * @param array $new
+ *
+ * @return array the combined array, numeric keys reset
+ */
+function array_merge_with_removal($current, $new) {
+ foreach ($new as $val) {
+ if (substr($val,0,1) == DOKU_CONF_NEGATION) {
+ $idx = array_search(trim(substr($val,1)),$current);
+ if ($idx !== false) {
+ unset($current[$idx]);
+ }
+ } else {
+ $current[] = trim($val);
+ }
+ }
+
+ return array_slice($current,0);
+}
//Setup VIM: ex: et ts=4 :
diff --git a/inc/events.php b/inc/events.php
index 318a7617e..35d55d0e3 100644
--- a/inc/events.php
+++ b/inc/events.php
@@ -27,8 +27,11 @@ class Doku_Event {
/**
* event constructor
+ *
+ * @param string $name
+ * @param mixed $data
*/
- function Doku_Event($name, &$data) {
+ function __construct($name, &$data) {
$this->name = $name;
$this->data =& $data;
@@ -120,14 +123,18 @@ class Doku_Event {
* stop any further processing of the event by event handlers
* this function does not prevent the default action taking place
*/
- function stopPropagation() { $this->_continue = false; }
+ function stopPropagation() {
+ $this->_continue = false;
+ }
/**
* preventDefault
*
* prevent the default action taking place
*/
- function preventDefault() { $this->_default = false; }
+ function preventDefault() {
+ $this->_default = false;
+ }
}
/**
@@ -146,7 +153,7 @@ class Doku_Event_Handler {
* constructor, loads all action plugins and calls their register() method giving them
* an opportunity to register any hooks they require
*/
- function Doku_Event_Handler() {
+ function __construct() {
// load action plugins
/** @var DokuWiki_Action_Plugin $plugin */
@@ -165,13 +172,13 @@ class Doku_Event_Handler {
*
* register a hook for an event
*
- * @param $event string name used by the event, (incl '_before' or '_after' for triggers)
- * @param $advise string
- * @param $obj object object in whose scope method is to be executed,
+ * @param string $event string name used by the event, (incl '_before' or '_after' for triggers)
+ * @param string $advise
+ * @param object $obj object in whose scope method is to be executed,
* if NULL, method is assumed to be a globally available function
- * @param $method string event handler function
- * @param $param mixed data passed to the event handler
- * @param $seq int sequence number for ordering hook execution (ascending)
+ * @param string $method event handler function
+ * @param mixed $param data passed to the event handler
+ * @param int $seq sequence number for ordering hook execution (ascending)
*/
function register_hook($event, $advise, $obj, $method, $param=null, $seq=0) {
$seq = (int)$seq;
@@ -216,14 +223,14 @@ class Doku_Event_Handler {
*
* function wrapper to process (create, trigger and destroy) an event
*
- * @param $name string name for the event
- * @param $data mixed event data
- * @param $action callback (optional, default=NULL) default action, a php callback function
- * @param $canPreventDefault bool (optional, default=true) can hooks prevent the default action
+ * @param string $name name for the event
+ * @param mixed $data event data
+ * @param callback $action (optional, default=NULL) default action, a php callback function
+ * @param bool $canPreventDefault (optional, default=true) can hooks prevent the default action
*
* @return mixed the event results value after all event processing is complete
- * by default this is the return value of the default action however
- * it can be set or modified by event handler hooks
+ * by default this is the return value of the default action however
+ * it can be set or modified by event handler hooks
*/
function trigger_event($name, &$data, $action=null, $canPreventDefault=true) {
diff --git a/inc/farm.php b/inc/farm.php
index cee61816c..87fcdade8 100644
--- a/inc/farm.php
+++ b/inc/farm.php
@@ -135,12 +135,12 @@ $config_cascade = array(
),
),
'userstyle' => array(
- 'screen' => DOKU_CONF.'userstyle.css',
- 'print' => DOKU_CONF.'userprint.css',
- 'feed' => DOKU_CONF.'userfeed.css',
- 'all' => DOKU_CONF.'userall.css',
+ 'screen' => array(DOKU_CONF . 'userstyle.css', DOKU_CONF . 'userstyle.less'),
+ 'print' => array(DOKU_CONF . 'userprint.css', DOKU_CONF . 'userprint.less'),
+ 'feed' => array(DOKU_CONF . 'userfeed.css', DOKU_CONF . 'userfeed.less'),
+ 'all' => array(DOKU_CONF . 'userall.css', DOKU_CONF . 'userall.less')
),
'userscript' => array(
- 'default' => DOKU_CONF.'userscript.js'
+ 'default' => array(DOKU_CONF . 'userscript.js')
),
);
diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php
index b90da5724..fe444b39b 100644
--- a/inc/feedcreator.class.php
+++ b/inc/feedcreator.class.php
@@ -129,6 +129,9 @@ class FeedItem extends HtmlDescribable {
// var $source;
}
+/**
+ * Class EnclosureItem
+ */
class EnclosureItem extends HtmlDescribable {
/*
*
@@ -226,7 +229,7 @@ class FeedHtmlField {
* Creates a new instance of FeedHtmlField.
* @param string $parFieldContent: if given, sets the rawFieldContent property
*/
- function FeedHtmlField($parFieldContent) {
+ function __construct($parFieldContent) {
if ($parFieldContent) {
$this->rawFieldContent = $parFieldContent;
}
@@ -482,6 +485,8 @@ class FeedCreator extends HtmlDescribable {
var $additionalElements = Array();
+ var $_timeout;
+
/**
* Adds an FeedItem to the feed.
*
@@ -505,7 +510,7 @@ class FeedCreator extends HtmlDescribable {
* @param int $length the maximum length the string should be truncated to
* @return string the truncated string
*/
- function iTrunc($string, $length) {
+ static function iTrunc($string, $length) {
if (strlen($string)<=$length) {
return $string;
}
@@ -604,6 +609,8 @@ class FeedCreator extends HtmlDescribable {
/**
* @since 1.4
* @access private
+ *
+ * @param string $filename
*/
function _redirect($filename) {
// attention, heavily-commented-out-area
@@ -697,7 +704,7 @@ class FeedDate {
* Accepts RFC 822, ISO 8601 date formats as well as unix time stamps.
* @param mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used.
*/
- function FeedDate($dateString="") {
+ function __construct($dateString="") {
if ($dateString=="") $dateString = date("r");
if (is_numeric($dateString)) {
@@ -878,7 +885,10 @@ class RSSCreator091 extends FeedCreator {
*/
var $RSSVersion;
- function RSSCreator091() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->_setRSSVersion("0.91");
$this->contentType = "application/rss+xml";
}
@@ -886,6 +896,8 @@ class RSSCreator091 extends FeedCreator {
/**
* Sets this RSS feed's version number.
* @access private
+ *
+ * @param $version
*/
function _setRSSVersion($version) {
$this->RSSVersion = $version;
@@ -1034,7 +1046,10 @@ class RSSCreator091 extends FeedCreator {
*/
class RSSCreator20 extends RSSCreator091 {
- function RSSCreator20() {
+ /**
+ * Constructor
+ */
+ function __construct() {
parent::_setRSSVersion("2.0");
}
@@ -1051,7 +1066,10 @@ class RSSCreator20 extends RSSCreator091 {
*/
class PIECreator01 extends FeedCreator {
- function PIECreator01() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->encoding = "utf-8";
}
@@ -1113,7 +1131,10 @@ class PIECreator01 extends FeedCreator {
*/
class AtomCreator10 extends FeedCreator {
- function AtomCreator10() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->contentType = "application/atom+xml";
$this->encoding = "utf-8";
}
@@ -1200,7 +1221,10 @@ class AtomCreator10 extends FeedCreator {
*/
class AtomCreator03 extends FeedCreator {
- function AtomCreator03() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->contentType = "application/atom+xml";
$this->encoding = "utf-8";
}
@@ -1272,12 +1296,19 @@ class AtomCreator03 extends FeedCreator {
* @author Kai Blankenhorn <kaib@bitfolge.de>
*/
class MBOXCreator extends FeedCreator {
-
- function MBOXCreator() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->contentType = "text/plain";
$this->encoding = "utf-8";
}
+ /**
+ * @param string $input
+ * @param int $line_max
+ * @return string
+ */
function qp_enc($input = "", $line_max = 76) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split("/(?:\r\n|\r|\n)/", $input);
@@ -1363,7 +1394,10 @@ class MBOXCreator extends FeedCreator {
*/
class OPMLCreator extends FeedCreator {
- function OPMLCreator() {
+ /**
+ * Constructor
+ */
+ function __construct() {
$this->encoding = "utf-8";
}
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php
index c61c54503..b8e75eaec 100644
--- a/inc/fetch.functions.php
+++ b/inc/fetch.functions.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* Functions used by lib/exe/fetch.php
* (not included by other parts of dokuwiki)
@@ -16,6 +16,7 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Gerry Weissbach <dokuwiki@gammaproduction.de>
+ *
* @param string $file local file to send
* @param string $mime mime type of the file
* @param bool $dl set to true to force a browser download
@@ -46,18 +47,15 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
// cache publically
header('Expires: '.gmdate("D, d M Y H:i:s", $expires).' GMT');
header('Cache-Control: public, proxy-revalidate, no-transform, max-age='.$maxage);
- header('Pragma: public');
} else {
// cache in browser
header('Expires: '.gmdate("D, d M Y H:i:s", $expires).' GMT');
header('Cache-Control: private, no-transform, max-age='.$maxage);
- header('Pragma: no-cache');
}
} else {
// no cache at all
header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
header('Cache-Control: no-cache, no-transform');
- header('Pragma: no-cache');
}
//send important headers first, script stops here if '304 Not Modified' response
@@ -71,9 +69,9 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
//download or display?
if($dl) {
- header('Content-Disposition: attachment; filename="'.utf8_basename($orig).'";');
+ header('Content-Disposition: attachment;'.rfc2231_encode('filename', utf8_basename($orig)).';');
} else {
- header('Content-Disposition: inline; filename="'.utf8_basename($orig).'";');
+ header('Content-Disposition: inline;'.rfc2231_encode('filename', utf8_basename($orig)).';');
}
//use x-sendfile header to pass the delivery to compatible webservers
@@ -90,18 +88,44 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
}
/**
+ * Try an rfc2231 compatible encoding. This ensures correct
+ * interpretation of filenames outside of the ASCII set.
+ * This seems to be needed for file names with e.g. umlauts that
+ * would otherwise decode wrongly in IE.
+ *
+ * There is no additional checking, just the encoding and setting the key=value for usage in headers
+ *
+ * @author Gerry Weissbach <gerry.w@gammaproduction.de>
+ * @param string $name name of the field to be set in the header() call
+ * @param string $value value of the field to be set in the header() call
+ * @param string $charset used charset for the encoding of value
+ * @param string $lang language used.
+ * @return string in the format " name=value" for values WITHOUT special characters
+ * @return string in the format " name*=charset'lang'value" for values WITH special characters
+ */
+function rfc2231_encode($name, $value, $charset='utf-8', $lang='en') {
+ $internal = preg_replace_callback('/[\x00-\x20*\'%()<>@,;:\\\\"\/[\]?=\x80-\xFF]/', function($match) { return rawurlencode($match[0]); }, $value);
+ if ( $value != $internal ) {
+ return ' '.$name.'*='.$charset."'".$lang."'".$internal;
+ } else {
+ return ' '.$name.'="'.$value.'"';
+ }
+}
+
+/**
* Check for media for preconditions and return correct status code
*
* READ: MEDIA, MIME, EXT, CACHE
* WRITE: MEDIA, FILE, array( STATUS, STATUSMESSAGE )
*
* @author Gerry Weissbach <gerry.w@gammaproduction.de>
+ *
* @param string $media reference to the media id
* @param string $file reference to the file variable
* @param string $rev
* @param int $width
* @param int $height
- * @return array(STATUS, STATUSMESSAGE)
+ * @return array as array(STATUS, STATUSMESSAGE)
*/
function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) {
global $MIME, $EXT, $CACHE, $INPUT;
@@ -136,7 +160,7 @@ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) {
}
//check file existance
- if(!@file_exists($file)) {
+ if(!file_exists($file)) {
return array(404, 'Not Found');
}
@@ -149,6 +173,9 @@ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) {
* Resolves named constants
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $cache
+ * @return int cachetime in seconds
*/
function calc_cache($cache) {
global $conf;
diff --git a/inc/form.php b/inc/form.php
index fadc71d3e..91a171555 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -52,9 +52,10 @@ class Doku_Form {
* @param bool|string $action (optional, deprecated) submit URL, defaults to cu