summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-01-23 20:33:32 +0100
committerMichael Hamann <michael@content-space.de>2011-01-23 20:33:32 +0100
commitfc756e0d4d88b37c01a9155e675a549430b00593 (patch)
tree7adc185d2c349788961ff7cb8f9bcb25afbce485
parent8605afb1b4e2a6a9e11e21a7bf0775bbb0d5af03 (diff)
parent820923f1328bcfe6002831570eb65238411c5b70 (diff)
downloadrpg-fc756e0d4d88b37c01a9155e675a549430b00593.tar.gz
rpg-fc756e0d4d88b37c01a9155e675a549430b00593.tar.bz2
Merge branch 'master' into indexer_improvements
Conflicts: inc/fulltext.php inc/indexer.php lib/exe/indexer.php
-rw-r--r--.gitignore2
-rw-r--r--_test/cases/inc/IXR_Library_IXR_Message.test.php2
-rw-r--r--_test/cases/inc/IXR_Library_date.test.php2
-rw-r--r--_test/cases/inc/auth_aclcheck.test.php2
-rw-r--r--_test/cases/inc/auth_admincheck.test.php90
-rw-r--r--_test/cases/inc/auth_nameencode.test.php2
-rw-r--r--_test/cases/inc/auth_password.test.php12
-rw-r--r--_test/cases/inc/common_clientip.test.php2
-rw-r--r--_test/cases/inc/common_obfuscate.test.php2
-rw-r--r--_test/cases/inc/common_pagetemplate.test.php2
-rw-r--r--_test/cases/inc/indexer_idx_indexlengths.test.php2
-rw-r--r--_test/cases/inc/init_fullpath.test.php2
-rw-r--r--_test/cases/inc/init_getbaseurl.test.php27
-rw-r--r--_test/cases/inc/mail_isvalid.test.php2
-rw-r--r--_test/cases/inc/mail_quoted_printable_encode.php2
-rw-r--r--_test/cases/inc/mail_send.php2
-rw-r--r--_test/cases/inc/pageutils_clean_id.test.php2
-rw-r--r--_test/cases/inc/pageutils_getid.test.php2
-rw-r--r--_test/cases/inc/pageutils_resolve_id.test.php2
-rw-r--r--_test/cases/inc/pageutils_resolve_pageid.test.php2
-rw-r--r--_test/cases/inc/parser/xhtml_links.test.php4
-rw-r--r--_test/cases/inc/safefn.test.php2
-rw-r--r--_test/cases/inc/utf8_correctidx.test.php2
-rw-r--r--_test/cases/inc/utf8_html.test.php2
-rw-r--r--_test/cases/inc/utf8_romanize.test.php2
-rw-r--r--_test/cases/inc/utf8_stripspecials.test.php2
-rw-r--r--_test/cases/inc/utf8_substr.test.php2
-rw-r--r--_test/cases/inc/utf8_unicode.test.php2
-rw-r--r--_test/cases/inc/utf8_utf16be.test.php2
-rw-r--r--_test/cases/lib/exe/css_css_compress.test.php2
-rw-r--r--_test/cases/lib/exe/css_css_loadfile.test.php57
-rw-r--r--_test/cases/lib/exe/js_js_compress.test.php2
-rwxr-xr-xbin/indexer.php2
-rw-r--r--bin/striplangs.php148
-rw-r--r--conf/acronyms.conf5
-rw-r--r--conf/dokuwiki.php3
-rw-r--r--conf/interwiki.conf1
-rw-r--r--doku.php5
-rw-r--r--feed.php74
-rw-r--r--inc/DifferenceEngine.php284
-rw-r--r--inc/EmailAddressValidator.php42
-rw-r--r--inc/FeedParser.php1
-rw-r--r--inc/HTTPClient.php110
-rw-r--r--inc/IXR_Library.php9
-rw-r--r--inc/JSON.php15
-rw-r--r--inc/SimplePie.php9790
-rw-r--r--inc/TarLib.class.php2
-rw-r--r--inc/actions.php24
-rw-r--r--inc/adLDAP.php118
-rw-r--r--inc/auth.php178
-rw-r--r--inc/auth/ad.class.php4
-rw-r--r--inc/auth/basic.class.php2
-rw-r--r--inc/auth/ldap.class.php2
-rw-r--r--inc/auth/mysql.class.php2
-rw-r--r--inc/auth/pgsql.class.php2
-rw-r--r--inc/auth/plain.class.php2
-rw-r--r--inc/cache.php31
-rw-r--r--inc/changelog.php5
-rw-r--r--inc/common.php18
-rw-r--r--inc/confutils.php2
-rw-r--r--inc/feedcreator.class.php2
-rw-r--r--inc/form.php20
-rw-r--r--inc/fulltext.php9
-rw-r--r--inc/html.php15
-rw-r--r--inc/infoutils.php4
-rw-r--r--inc/init.php25
-rw-r--r--inc/io.php2
-rw-r--r--inc/lang/ar/lang.php129
-rw-r--r--inc/lang/cs/lang.php4
-rw-r--r--inc/lang/cs/subscr_form.txt2
-rw-r--r--inc/lang/de-informal/lang.php74
-rw-r--r--inc/lang/de-informal/subscr_digest.txt6
-rw-r--r--inc/lang/de-informal/subscr_single.txt12
-rw-r--r--inc/lang/de/lang.php6
-rw-r--r--inc/lang/de/subscr_digest.txt4
-rw-r--r--inc/lang/de/subscr_single.txt12
-rw-r--r--inc/lang/en/lang.php2
-rw-r--r--inc/lang/et/lang.php2
-rw-r--r--inc/lang/he/conflict.txt6
-rw-r--r--inc/lang/he/denied.txt2
-rw-r--r--inc/lang/he/draft.txt4
-rw-r--r--inc/lang/he/edit.txt2
-rw-r--r--inc/lang/he/editrev.txt2
-rw-r--r--inc/lang/he/index.txt4
-rw-r--r--inc/lang/he/install.html16
-rw-r--r--inc/lang/he/lang.php328
-rw-r--r--inc/lang/he/mailtext.txt20
-rw-r--r--inc/lang/he/password.txt8
-rw-r--r--inc/lang/he/pwconfirm.txt8
-rw-r--r--inc/lang/he/read.txt2
-rw-r--r--inc/lang/he/register.txt2
-rw-r--r--inc/lang/he/registermail.txt10
-rw-r--r--inc/lang/he/resendpwd.txt4
-rw-r--r--inc/lang/he/subscr_digest.txt20
-rw-r--r--inc/lang/he/subscr_single.txt22
-rw-r--r--inc/lang/km/lang.php2
-rw-r--r--inc/lang/ko/adminplugins.txt1
-rw-r--r--inc/lang/ko/edit.txt2
-rw-r--r--inc/lang/ko/lang.php80
-rw-r--r--inc/lang/ko/register.txt2
-rw-r--r--inc/lang/ko/subscr_digest.txt18
-rw-r--r--inc/lang/ko/subscr_form.txt3
-rw-r--r--inc/lang/ko/subscr_list.txt15
-rw-r--r--inc/lang/ko/subscr_single.txt21
-rw-r--r--inc/lang/ku/lang.php2
-rw-r--r--inc/lang/la/conflict.txt6
-rw-r--r--inc/lang/la/editrev.txt2
-rw-r--r--inc/lang/la/index.txt2
-rw-r--r--inc/lang/la/install.html8
-rw-r--r--inc/lang/la/lang.php51
-rw-r--r--inc/lang/la/norev.txt4
-rw-r--r--inc/lang/la/showrev.txt2
-rw-r--r--inc/lang/la/subscr_digest.txt2
-rw-r--r--inc/lang/la/subscr_form.txt2
-rw-r--r--inc/lang/la/subscr_list.txt2
-rw-r--r--inc/lang/la/subscr_single.txt2
-rw-r--r--inc/lang/mg/lang.php2
-rw-r--r--inc/lang/ru/conflict.txt2
-rw-r--r--inc/lang/ru/draft.txt2
-rw-r--r--inc/lang/ru/edit.txt2
-rw-r--r--inc/lang/ru/editrev.txt2
-rw-r--r--inc/lang/ru/install.html4
-rw-r--r--inc/lang/ru/lang.php42
-rw-r--r--inc/lang/ru/norev.txt2
-rw-r--r--inc/lang/ru/password.txt7
-rw-r--r--inc/lang/ru/preview.txt2
-rw-r--r--inc/lang/ru/pwconfirm.txt2
-rw-r--r--inc/lang/ru/revisions.txt2
-rw-r--r--inc/lang/ru/searchpage.txt2
-rw-r--r--inc/lang/ru/showrev.txt2
-rw-r--r--inc/lang/ru/subscr_digest.txt2
-rw-r--r--inc/lang/ru/subscr_list.txt7
-rw-r--r--inc/lang/ru/subscr_single.txt10
-rw-r--r--inc/lang/sl/admin.txt3
-rw-r--r--inc/lang/sl/adminplugins.txt1
-rw-r--r--inc/lang/sl/draft.txt5
-rw-r--r--inc/lang/sl/lang.php130
-rw-r--r--inc/lang/sl/subscr_digest.txt20
-rw-r--r--inc/lang/sl/subscr_form.txt3
-rw-r--r--inc/lang/sl/subscr_list.txt17
-rw-r--r--inc/lang/sl/updateprofile.txt3
-rw-r--r--inc/lang/sl/uploadmail.txt13
-rw-r--r--inc/lang/tr/lang.php8
-rw-r--r--inc/lang/vi/lang.php2
-rw-r--r--inc/mail.php15
-rw-r--r--inc/pageutils.php20
-rw-r--r--inc/parser/handler.php2
-rw-r--r--inc/parser/lexer.php2
-rw-r--r--inc/parser/metadata.php7
-rw-r--r--inc/parser/parser.php7
-rw-r--r--inc/parser/renderer.php2
-rw-r--r--inc/parser/xhtml.php6
-rw-r--r--inc/parser/xhtmlsummary.php2
-rw-r--r--inc/parserutils.php73
-rw-r--r--inc/plugin.php11
-rw-r--r--inc/search.php2
-rw-r--r--inc/subscription.php2
-rw-r--r--inc/template.php28
-rw-r--r--inc/toolbar.php2
-rw-r--r--install.php3
-rw-r--r--lib/exe/ajax.php458
-rw-r--r--lib/exe/css.php31
-rw-r--r--lib/exe/fetch.php2
-rw-r--r--lib/exe/indexer.php48
-rw-r--r--lib/exe/js.php2
-rw-r--r--lib/exe/opensearch.php2
-rw-r--r--lib/exe/xmlrpc.php45
-rw-r--r--lib/images/interwiki/paypal.gifbin0 -> 942 bytes
-rw-r--r--lib/images/interwiki/sb.gifbin886 -> 1000 bytes
-rw-r--r--lib/plugins/acl/admin.php2
-rw-r--r--lib/plugins/acl/lang/de-informal/lang.php1
-rw-r--r--lib/plugins/acl/lang/de/lang.php2
-rw-r--r--lib/plugins/acl/lang/en/lang.php2
-rw-r--r--lib/plugins/acl/lang/et/lang.php2
-rw-r--r--lib/plugins/acl/lang/he/lang.php1
-rw-r--r--lib/plugins/acl/lang/ko/lang.php1
-rw-r--r--lib/plugins/acl/lang/la/help.txt4
-rw-r--r--lib/plugins/acl/lang/la/lang.php19
-rw-r--r--lib/plugins/acl/lang/ru/help.txt16
-rw-r--r--lib/plugins/acl/lang/ru/lang.php2
-rw-r--r--lib/plugins/acl/lang/sl/lang.php15
-rw-r--r--lib/plugins/acl/lang/tr/lang.php5
-rw-r--r--lib/plugins/acl/lang/vi/lang.php2
-rw-r--r--lib/plugins/admin.php2
-rw-r--r--lib/plugins/config/lang/ar/lang.php9
-rw-r--r--lib/plugins/config/lang/cs/intro.txt2
-rw-r--r--lib/plugins/config/lang/cs/lang.php10
-rw-r--r--lib/plugins/config/lang/de-informal/lang.php2
-rw-r--r--lib/plugins/config/lang/de/lang.php3
-rw-r--r--lib/plugins/config/lang/en/lang.php1
-rw-r--r--lib/plugins/config/lang/he/lang.php1
-rw-r--r--lib/plugins/config/lang/ko/lang.php8
-rw-r--r--lib/plugins/config/lang/la/intro.txt4
-rw-r--r--lib/plugins/config/lang/la/lang.php23
-rw-r--r--lib/plugins/config/lang/ru/intro.txt4
-rw-r--r--lib/plugins/config/lang/ru/lang.php49
-rw-r--r--lib/plugins/config/lang/sl/lang.php1
-rw-r--r--lib/plugins/config/lang/tr/lang.php5
-rw-r--r--lib/plugins/config/settings/config.class.php25
-rw-r--r--lib/plugins/config/settings/config.metadata.php8
-rw-r--r--lib/plugins/info/syntax.php2
-rw-r--r--lib/plugins/plugin/lang/cs/lang.php4
-rw-r--r--lib/plugins/plugin/lang/de-informal/lang.php1
-rw-r--r--lib/plugins/plugin/lang/de/lang.php2
-rw-r--r--lib/plugins/plugin/lang/en/lang.php2
-rw-r--r--lib/plugins/plugin/lang/he/lang.php1
-rw-r--r--lib/plugins/plugin/lang/ko/lang.php1
-rw-r--r--lib/plugins/plugin/lang/la/admin_plugin.txt2
-rw-r--r--lib/plugins/plugin/lang/la/lang.php3
-rw-r--r--lib/plugins/plugin/lang/pt-br/admin_plugin.txt2
-rw-r--r--lib/plugins/plugin/lang/ru/lang.php8
-rw-r--r--lib/plugins/plugin/lang/sl/lang.php1
-rw-r--r--lib/plugins/plugin/lang/tr/lang.php5
-rw-r--r--lib/plugins/popularity/action.php57
-rw-r--r--lib/plugins/popularity/admin.php277
-rw-r--r--lib/plugins/popularity/helper.php291
-rw-r--r--lib/plugins/popularity/lang/ar/lang.php5
-rw-r--r--lib/plugins/popularity/lang/ar/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/cs/intro.txt2
-rw-r--r--lib/plugins/popularity/lang/de-informal/lang.php6
-rw-r--r--lib/plugins/popularity/lang/de-informal/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/de/lang.php7
-rw-r--r--lib/plugins/popularity/lang/de/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/en/lang.php9
-rw-r--r--lib/plugins/popularity/lang/en/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/es/lang.php5
-rw-r--r--lib/plugins/popularity/lang/es/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/he/lang.php1
-rw-r--r--lib/plugins/popularity/lang/ko/lang.php1
-rw-r--r--lib/plugins/popularity/lang/la/intro.txt9
-rw-r--r--lib/plugins/popularity/lang/la/lang.php6
-rw-r--r--lib/plugins/popularity/lang/la/submitted.txt3
-rw-r--r--lib/plugins/popularity/lang/ru/intro.txt6
-rw-r--r--lib/plugins/popularity/lang/ru/lang.php5
-rw-r--r--lib/plugins/popularity/lang/sl/lang.php1
-rw-r--r--lib/plugins/popularity/lang/tr/lang.php5
-rw-r--r--lib/plugins/popularity/plugin.info.txt7
-rw-r--r--lib/plugins/revert/admin.php2
-rw-r--r--lib/plugins/revert/lang/cs/intro.txt2
-rw-r--r--lib/plugins/revert/lang/de-informal/lang.php1
-rw-r--r--lib/plugins/revert/lang/de/lang.php2
-rw-r--r--lib/plugins/revert/lang/en/lang.php2
-rw-r--r--lib/plugins/revert/lang/he/lang.php1
-rw-r--r--lib/plugins/revert/lang/ko/lang.php1
-rw-r--r--lib/plugins/revert/lang/la/intro.txt2
-rw-r--r--lib/plugins/revert/lang/la/lang.php1
-rw-r--r--lib/plugins/revert/lang/ru/intro.txt2
-rw-r--r--lib/plugins/revert/lang/sl/lang.php1
-rw-r--r--lib/plugins/revert/lang/tr/lang.php5
-rw-r--r--lib/plugins/syntax.php13
-rw-r--r--lib/plugins/usermanager/lang/cs/lang.php2
-rw-r--r--lib/plugins/usermanager/lang/de-informal/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/de/lang.php2
-rw-r--r--lib/plugins/usermanager/lang/he/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/ko/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/la/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/ru/lang.php4
-rw-r--r--lib/plugins/usermanager/lang/sl/lang.php18
-rw-r--r--lib/plugins/usermanager/lang/tr/lang.php5
-rw-r--r--lib/scripts/ajax.js126
-rw-r--r--lib/tpl/default/rtl.css3
261 files changed, 10092 insertions, 4305 deletions
diff --git a/.gitignore b/.gitignore
index 2d7f2df97..4fb846732 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,8 @@
/conf/user*.css
/conf/user*.js
/conf/words.aspell
+/conf/lang/*
+/conf/plugin_lang/*
.htaccess
*.swp
*.bak
diff --git a/_test/cases/inc/IXR_Library_IXR_Message.test.php b/_test/cases/inc/IXR_Library_IXR_Message.test.php
index 2a8133230..bc9be572d 100644
--- a/_test/cases/inc/IXR_Library_IXR_Message.test.php
+++ b/_test/cases/inc/IXR_Library_IXR_Message.test.php
@@ -136,4 +136,4 @@ class ixr_library_ixr_message_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/IXR_Library_date.test.php b/_test/cases/inc/IXR_Library_date.test.php
index a2b6154d8..28fa86486 100644
--- a/_test/cases/inc/IXR_Library_date.test.php
+++ b/_test/cases/inc/IXR_Library_date.test.php
@@ -31,4 +31,4 @@ class ixr_library_date_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_aclcheck.test.php b/_test/cases/inc/auth_aclcheck.test.php
index d8a8f285a..ff092c2de 100644
--- a/_test/cases/inc/auth_aclcheck.test.php
+++ b/_test/cases/inc/auth_aclcheck.test.php
@@ -228,4 +228,4 @@ class auth_acl_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_admincheck.test.php b/_test/cases/inc/auth_admincheck.test.php
index f14d6369e..a71c8801a 100644
--- a/_test/cases/inc/auth_admincheck.test.php
+++ b/_test/cases/inc/auth_admincheck.test.php
@@ -3,20 +3,47 @@
require_once DOKU_INC.'inc/init.php';
require_once DOKU_INC.'inc/auth.php';
+class auth_admin_test_AuthInSensitive extends auth_basic {
+ function isCaseSensitive(){
+ return false;
+ }
+}
+
class auth_admin_test extends UnitTestCase {
+ private $oldauth;
+
+ function setup() {
+ global $auth;
+ $this->oldauth = $auth;
+ parent::setup();
+ }
+
+ function setSensitive() {
+ global $auth;
+ $auth = new auth_basic;
+ }
+
+ function setInSensitive() {
+ global $auth;
+ $auth = new auth_admin_test_AuthInSensitive;
+ }
+
function teardown() {
+ global $auth;
global $conf;
global $AUTH_ACL;
unset($conf);
unset($AUTH_ACL);
-
+ $auth = $this->oldauth;
+ parent::teardown();
}
- function test_ismanager(){
+ function test_ismanager_insensitive(){
+ $this->setInSensitive();
global $conf;
- $conf['superuser'] = 'john,@admin';
- $conf['manager'] = 'john,@managers,doe';
+ $conf['superuser'] = 'john,@admin,@Mötly Görls, Dörte';
+ $conf['manager'] = 'john,@managers,doe, @Mötly Böys, Dänny';
// anonymous user
$this->assertEqual(auth_ismanager('jill', null,false), false);
@@ -25,12 +52,19 @@ class auth_admin_test extends UnitTestCase {
$this->assertEqual(auth_ismanager('john', null,false), true);
$this->assertEqual(auth_ismanager('doe', null,false), true);
+ $this->assertEqual(auth_ismanager('dörte', null,false), true);
+ $this->assertEqual(auth_ismanager('dänny', null,false), true);
+
// admin or manager groups
$this->assertEqual(auth_ismanager('jill', array('admin'),false), true);
$this->assertEqual(auth_ismanager('jill', array('managers'),false), true);
+
+ $this->assertEqual(auth_ismanager('jill', array('mötly görls'),false), true);
+ $this->assertEqual(auth_ismanager('jill', array('mötly böys'),false), true);
}
- function test_isadmin(){
+ function test_isadmin_insensitive(){
+ $this->setInSensitive();
global $conf;
$conf['superuser'] = 'john,@admin,doe,@roots';
@@ -48,6 +82,50 @@ class auth_admin_test extends UnitTestCase {
$this->assertEqual(auth_ismanager('doe', array('admin'),true), true);
}
+ function test_ismanager_sensitive(){
+ $this->setSensitive();
+ global $conf;
+ $conf['superuser'] = 'john,@admin,@Mötly Görls, Dörte';
+ $conf['manager'] = 'john,@managers,doe, @Mötly Böys, Dänny';
+
+ // anonymous user
+ $this->assertEqual(auth_ismanager('jill', null,false), false);
+
+ // admin or manager users
+ $this->assertEqual(auth_ismanager('john', null,false), true);
+ $this->assertEqual(auth_ismanager('doe', null,false), true);
+
+ $this->assertEqual(auth_ismanager('dörte', null,false), false);
+ $this->assertEqual(auth_ismanager('dänny', null,false), false);
+
+ // admin or manager groups
+ $this->assertEqual(auth_ismanager('jill', array('admin'),false), true);
+ $this->assertEqual(auth_ismanager('jill', array('managers'),false), true);
+
+ $this->assertEqual(auth_ismanager('jill', array('mötly görls'),false), false);
+ $this->assertEqual(auth_ismanager('jill', array('mötly böys'),false), false);
+ }
+
+ function test_isadmin_sensitive(){
+ $this->setSensitive();
+ global $conf;
+ $conf['superuser'] = 'john,@admin,doe,@roots';
+
+ // anonymous user
+ $this->assertEqual(auth_ismanager('jill', null,true), false);
+
+ // admin user
+ $this->assertEqual(auth_ismanager('john', null,true), true);
+ $this->assertEqual(auth_ismanager('Doe', null,true), false);
+
+ // admin groups
+ $this->assertEqual(auth_ismanager('jill', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('jill', array('roots'),true), true);
+ $this->assertEqual(auth_ismanager('john', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('doe', array('admin'),true), true);
+ $this->assertEqual(auth_ismanager('Doe', array('admin'),true), true);
+ }
+
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_nameencode.test.php b/_test/cases/inc/auth_nameencode.test.php
index 28ab6dc4a..56806a862 100644
--- a/_test/cases/inc/auth_nameencode.test.php
+++ b/_test/cases/inc/auth_nameencode.test.php
@@ -47,4 +47,4 @@ class auth_nameencode_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/auth_password.test.php b/_test/cases/inc/auth_password.test.php
index 1ba731c7e..140c7c23e 100644
--- a/_test/cases/inc/auth_password.test.php
+++ b/_test/cases/inc/auth_password.test.php
@@ -15,6 +15,9 @@ class auth_password_test extends UnitTestCase {
'crypt' => 'ablvoGr1hvZ5k',
'mysql' => '4a1fa3780bd6fd55',
'my411' => '*e5929347e25f82e19e4ebe92f1dc6b6e7c2dbd29',
+ 'kmd5' => 'a579299436d7969791189acadd86fcb716',
+ 'pmd5' => '$P$abcdefgh1RC6Fd32heUzl7EYCG9uGw.',
+ 'hmd5' => '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.',
);
@@ -22,7 +25,7 @@ class auth_password_test extends UnitTestCase {
foreach($this->passes as $method => $hash){
$info = "testing method $method";
$this->signal('failinfo',$info);
- $this->assertEqual(auth_cryptPassword('foo'.$method,$method,'abcdefgh'),$hash);
+ $this->assertEqual(auth_cryptPassword('foo'.$method,$method,'abcdefgh12345678912345678912345678'),$hash);
}
}
@@ -38,6 +41,11 @@ class auth_password_test extends UnitTestCase {
$this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/'));
}
+ function test_verifyPassword_fixedpmd5(){
+ $this->assertTrue(auth_verifyPassword('test12345','$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
+ $this->assertTrue(auth_verifyPassword('test12345','$H$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0'));
+ }
+
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_clientip.test.php b/_test/cases/inc/common_clientip.test.php
index 4df463539..68c108165 100644
--- a/_test/cases/inc/common_clientip.test.php
+++ b/_test/cases/inc/common_clientip.test.php
@@ -152,4 +152,4 @@ class common_clientIP_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_obfuscate.test.php b/_test/cases/inc/common_obfuscate.test.php
index 3e1e1a72f..31321bea1 100644
--- a/_test/cases/inc/common_obfuscate.test.php
+++ b/_test/cases/inc/common_obfuscate.test.php
@@ -25,4 +25,4 @@ class common_obfuscate_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/common_pagetemplate.test.php b/_test/cases/inc/common_pagetemplate.test.php
index ecba0f966..2db8b64ae 100644
--- a/_test/cases/inc/common_pagetemplate.test.php
+++ b/_test/cases/inc/common_pagetemplate.test.php
@@ -16,4 +16,4 @@ class common_pagetemplate_test extends UnitTestCase {
error_reporting($old);
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/indexer_idx_indexlengths.test.php b/_test/cases/inc/indexer_idx_indexlengths.test.php
index 8565639be..a0f7c9224 100644
--- a/_test/cases/inc/indexer_idx_indexlengths.test.php
+++ b/_test/cases/inc/indexer_idx_indexlengths.test.php
@@ -57,4 +57,4 @@ class indexer_idx_indexlengths_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/init_fullpath.test.php b/_test/cases/inc/init_fullpath.test.php
index 63394b09d..aa63b0ce9 100644
--- a/_test/cases/inc/init_fullpath.test.php
+++ b/_test/cases/inc/init_fullpath.test.php
@@ -86,4 +86,4 @@ class init_fullpath_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/init_getbaseurl.test.php b/_test/cases/inc/init_getbaseurl.test.php
index edd370d61..a22172feb 100644
--- a/_test/cases/inc/init_getbaseurl.test.php
+++ b/_test/cases/inc/init_getbaseurl.test.php
@@ -275,6 +275,31 @@ class init_getBaseURL_test extends UnitTestCase {
$this->assertEqual(getBaseURL(true),$correct_result);
}
}
+
+ /**
+ * Absolute URL with IPv6 domain name.
+ * lighttpd, fastcgi
+ *
+ * data provided by Michael Hamann <michael@content-space.de>
+ */
+ function test12() {
+ global $conf;
+ $conf['basedir'] = '';
+ $conf['baseurl'] = '';
+ $conf['canonical'] = 0;
+
+ $_SERVER['DOCUMENT_ROOT'] = '/srv/http/';
+ $_SERVER['HTTP_HOST'] = '[fd00::6592:39ed:a2ed:2c78]';
+ $_SERVER['SCRIPT_FILENAME'] = '/srv/http/~michitux/dokuwiki/doku.php';
+ $_SERVER['REQUEST_URI'] = '/~michitux/dokuwiki/doku.php?do=debug';
+ $_SERVER['SCRIPT_NAME'] = '/~michitux/dokuwiki/doku.php';
+ $_SERVER['PATH_INFO'] = null;
+ $_SERVER['PATH_TRANSLATED'] = null;
+ $_SERVER['PHP_SELF'] = '/~michitux/dokuwiki/doku.php';
+ $_SERVER['SERVER_PORT'] = '80';
+ $_SERVER['SERVER_NAME'] = '[fd00';
+ $this->assertEqual(getBaseURL(true), 'http://[fd00::6592:39ed:a2ed:2c78]/~michitux/dokuwiki/');
+ }
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/_test/cases/inc/mail_isvalid.test.php b/_test/cases/inc/mail_isvalid.test.php
index 374204679..4e047499f 100644
--- a/_test/cases/inc/mail_isvalid.test.php
+++ b/_test/cases/inc/mail_isvalid.test.php
@@ -80,4 +80,4 @@ class mail_isvalid extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/mail_quoted_printable_encode.php b/_test/cases/inc/mail_quoted_printable_encode.php
index c9cb040f1..a5a36e35b 100644
--- a/_test/cases/inc/mail_quoted_printable_encode.php
+++ b/_test/cases/inc/mail_quoted_printable_encode.php
@@ -41,4 +41,4 @@ class mail_quotedprintable_encode extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/mail_send.php b/_test/cases/inc/mail_send.php
index 5c2b0e896..e41c501fe 100644
--- a/_test/cases/inc/mail_send.php
+++ b/_test/cases/inc/mail_send.php
@@ -46,4 +46,4 @@ class mail_send extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_clean_id.test.php b/_test/cases/inc/pageutils_clean_id.test.php
index 9c03ce334..01fa7dc1c 100644
--- a/_test/cases/inc/pageutils_clean_id.test.php
+++ b/_test/cases/inc/pageutils_clean_id.test.php
@@ -144,4 +144,4 @@ class init_clean_id_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_getid.test.php b/_test/cases/inc/pageutils_getid.test.php
index e3932a579..7fccc3a60 100644
--- a/_test/cases/inc/pageutils_getid.test.php
+++ b/_test/cases/inc/pageutils_getid.test.php
@@ -103,4 +103,4 @@ class init_getID_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_resolve_id.test.php b/_test/cases/inc/pageutils_resolve_id.test.php
index 64b4033cd..9aa4ee8b7 100644
--- a/_test/cases/inc/pageutils_resolve_id.test.php
+++ b/_test/cases/inc/pageutils_resolve_id.test.php
@@ -42,4 +42,4 @@ class init_resolve_id_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/pageutils_resolve_pageid.test.php b/_test/cases/inc/pageutils_resolve_pageid.test.php
index ab282b57a..d9ea89869 100644
--- a/_test/cases/inc/pageutils_resolve_pageid.test.php
+++ b/_test/cases/inc/pageutils_resolve_pageid.test.php
@@ -60,4 +60,4 @@ class init_resolve_pageid_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php
index 6a74445b0..0ad96c793 100644
--- a/_test/cases/inc/parser/xhtml_links.test.php
+++ b/_test/cases/inc/parser/xhtml_links.test.php
@@ -12,7 +12,7 @@ class xhtml_links_test extends UnitTestCase {
$p = new Doku_Renderer_xhtml();
$p->emaillink('foo@example.com','<script>alert(\'"alert"\');</script>');
- $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="mail JSnocheck" title="foo [at] example [dot] com">&lt;script&gt;alert(&#039;&quot;alert&quot;&#039;);&lt;/script&gt;</a>';
+ $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="mail" title="foo [at] example [dot] com">&lt;script&gt;alert(&#039;&quot;alert&quot;&#039;);&lt;/script&gt;</a>';
$this->assertEqual($p->doc,$expect);
}
@@ -36,7 +36,7 @@ class xhtml_links_test extends UnitTestCase {
$p = new Doku_Renderer_xhtml();
$p->emaillink('foo@example.com',$image);
- $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="media JSnocheck" title="foo [at] example [dot] com"><img src="'.DOKU_BASE.'lib/exe/fetch.php/img.gif?w=10&amp;h=20&amp;cache=nocache" class="media" title="Some Image" alt="Some Image" width="10" height="20" /></a>';
+ $expect = '<a href="mailto:foo%20%5Bat%5D%20example%20%5Bdot%5D%20com" class="media" title="foo [at] example [dot] com"><img src="'.DOKU_BASE.'lib/exe/fetch.php/img.gif?w=10&amp;h=20&amp;cache=nocache" class="media" title="Some Image" alt="Some Image" width="10" height="20" /></a>';
$this->assertEqual($p->doc,$expect);
}
diff --git a/_test/cases/inc/safefn.test.php b/_test/cases/inc/safefn.test.php
index b93914bf8..c789875ba 100644
--- a/_test/cases/inc/safefn.test.php
+++ b/_test/cases/inc/safefn.test.php
@@ -32,4 +32,4 @@ class safeFN_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_correctidx.test.php b/_test/cases/inc/utf8_correctidx.test.php
index d95ce9ae0..20f6ba3a3 100644
--- a/_test/cases/inc/utf8_correctidx.test.php
+++ b/_test/cases/inc/utf8_correctidx.test.php
@@ -75,4 +75,4 @@ class utf8_correctidx_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_html.test.php b/_test/cases/inc/utf8_html.test.php
index 57c9df259..3e6d35bc7 100644
--- a/_test/cases/inc/utf8_html.test.php
+++ b/_test/cases/inc/utf8_html.test.php
@@ -69,4 +69,4 @@ class utf8_html_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_romanize.test.php b/_test/cases/inc/utf8_romanize.test.php
index 9aade570b..950c8842a 100644
--- a/_test/cases/inc/utf8_romanize.test.php
+++ b/_test/cases/inc/utf8_romanize.test.php
@@ -33,4 +33,4 @@ class utf8_romanize_test extends UnitTestCase {
$this->assertEqual("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_stripspecials.test.php b/_test/cases/inc/utf8_stripspecials.test.php
index a42507a3c..85df75fa1 100644
--- a/_test/cases/inc/utf8_stripspecials.test.php
+++ b/_test/cases/inc/utf8_stripspecials.test.php
@@ -24,4 +24,4 @@ class utf8_stripspecials extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_substr.test.php b/_test/cases/inc/utf8_substr.test.php
index f3bf1b154..2806d34f1 100644
--- a/_test/cases/inc/utf8_substr.test.php
+++ b/_test/cases/inc/utf8_substr.test.php
@@ -40,4 +40,4 @@ class utf8_substr_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_unicode.test.php b/_test/cases/inc/utf8_unicode.test.php
index 453aad216..424f47d11 100644
--- a/_test/cases/inc/utf8_unicode.test.php
+++ b/_test/cases/inc/utf8_unicode.test.php
@@ -57,4 +57,4 @@ class utf8_unicode_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/inc/utf8_utf16be.test.php b/_test/cases/inc/utf8_utf16be.test.php
index 3a346da51..d8b8746f2 100644
--- a/_test/cases/inc/utf8_utf16be.test.php
+++ b/_test/cases/inc/utf8_utf16be.test.php
@@ -25,4 +25,4 @@ class utf8_utf16be_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/_test/cases/lib/exe/css_css_compress.test.php b/_test/cases/lib/exe/css_css_compress.test.php
index 026caad3c..527071bbe 100644
--- a/_test/cases/lib/exe/css_css_compress.test.php
+++ b/_test/cases/lib/exe/css_css_compress.test.php
@@ -65,4 +65,4 @@ class css_css_compress_test extends UnitTestCase {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/_test/cases/lib/exe/css_css_loadfile.test.php b/_test/cases/lib/exe/css_css_loadfile.test.php
new file mode 100644
index 000000000..a444d0086
--- /dev/null
+++ b/_test/cases/lib/exe/css_css_loadfile.test.php
@@ -0,0 +1,57 @@
+<?php
+
+require_once DOKU_INC.'lib/exe/css.php';
+
+class css_css_loadfile_test extends UnitTestCase {
+ public function setUp() {
+ $this->file = tempnam('/tmp', 'css');
+ parent::setUp();
+ }
+
+ private function csstest($input, $output = null, $location = 'http://www.example.com/') {
+ io_saveFile($this->file, $input);
+ $this->assertEqual(css_loadfile($this->file, $location), (is_null($output) ? $input : $output));
+ }
+
+ public function test_url_relative() {
+ $this->csstest('#test { background: url("test/test.png"); }', '#test { background: url("http://www.example.com/test/test.png"); }');
+ $this->csstest('#test { background: url(\'test/test.png\'); }', '#test { background: url(\'http://www.example.com/test/test.png\'); }');
+ }
+
+ public function test_url_absolute() {
+ $this->csstest('#test { background: url("/test/test.png"); }');
+ $this->csstest('#test { background: url(\'/test/test.png\'); }');
+ }
+
+ public function test_url_with_protocol() {
+ $this->csstest('#test { background: url("http://www.test.com/test/test.png"); }');
+ $this->csstest('#test { background: url("https://www.test.com/test/test.png"); }');
+ $this->csstest('#test { background: url(\'http://www.test.com/test/test.png\'); }');
+ $this->csstest('#test { background: url(\'https://www.test.com/test/test.png\'); }');
+ }
+
+ public function test_import_relative() {
+ $this->csstest('@import "test/test.png";', '@import "http://www.example.com/test/test.png";');
+ $this->csstest('@import \'test/test.png\';', '@import \'http://www.example.com/test/test.png\';');
+ }
+
+ public function test_import_absolute() {
+ $this->csstest('@import "/test/test.png";');
+ $this->csstest('@import \'/test/test.png\';');
+ }
+
+ public function test_import_with_protocol() {
+ $this->csstest('@import "http://www.test.com/test/test.png";');
+ $this->csstest('@import "https://www.test.com/test/test.png";');
+ $this->csstest('@import \'http://www.test.com/test/test.png\';');
+ $this->csstest('@import \'https://www.test.com/test/test.png\';');
+ }
+
+ public function tearDown() {
+ unlink($this->file);
+ unset($this->file);
+ parent::tearDown();
+ }
+}
+
+//Setup VIM: ex: et ts=4 sw=4 :
diff --git a/_test/cases/lib/exe/js_js_compress.test.php b/_test/cases/lib/exe/js_js_compress.test.php
index 9051dfb01..76b51e5ab 100644
--- a/_test/cases/lib/exe/js_js_compress.test.php
+++ b/_test/cases/lib/exe/js_js_compress.test.php
@@ -120,4 +120,4 @@ class js_js_compress_test extends UnitTestCase {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/bin/indexer.php b/bin/indexer.php
index 0d523df6e..85e990bbe 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -186,4 +186,4 @@ function _quietecho($msg) {
if(!$QUIET) echo $msg;
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/bin/striplangs.php b/bin/striplangs.php
new file mode 100644
index 000000000..288859c6a
--- /dev/null
+++ b/bin/striplangs.php
@@ -0,0 +1,148 @@
+#!/usr/bin/php
+<?php
+/**
+ * Strip unwanted languages from the DokuWiki install
+ *
+ * @author Martin 'E.T.' Misuth <et.github@ethome.sk>
+ */
+if ('cli' != php_sapi_name()) die();
+
+#------------------------------------------------------------------------------
+if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
+require_once DOKU_INC.'inc/cliopts.php';
+
+#------------------------------------------------------------------------------
+function usage($show_examples = false) {
+ print "Usage: striplangs.php [-h [-x]] [-e] [-k lang1[,lang2]..[,langN]]
+
+ Removes all languages from the instalation, besides the ones
+ after the -k option. English language is never removed!
+
+ OPTIONS
+ -h, --help get this help
+ -x, --examples get also usage examples
+ -k, --keep comma separated list of languages, -e is always implied
+ -e, --english keeps english, dummy to use without -k";
+ if ( $show_examples ) {
+ print "\n
+ EXAMPLES
+ Strips all languages, but keeps 'en' and 'de':
+ striplangs -k de
+
+ Strips all but 'en','ca-valencia','cs','de','is','sk':
+ striplangs --keep ca-valencia,cs,de,is,sk
+
+ Strips all but 'en':
+ striplangs -e
+
+ No option specified, prints usage and throws error:
+ striplangs\n";
+ }
+}
+
+function getSuppliedArgument($OPTS, $short, $long) {
+ $arg = $OPTS->get($short);
+ if ( is_null($arg) ) {
+ $arg = $OPTS->get($long);
+ }
+ return $arg;
+}
+
+function processPlugins($path, $keep_langs) {
+ if (is_dir($path)) {
+ $entries = scandir($path);
+
+ foreach ($entries as $entry) {
+ if ($entry != "." && $entry != "..") {
+ if ( is_dir($path.'/'.$entry) ) {
+
+ $plugin_langs = $path.'/'.$entry.'/lang';
+
+ if ( is_dir( $plugin_langs ) ) {
+ stripDirLangs($plugin_langs, $keep_langs);
+ }
+ }
+ }
+ }
+ }
+}
+
+function stripDirLangs($path, $keep_langs) {
+ $dir = dir($path);
+
+ while(($cur_dir = $dir->read()) !== false) {
+ if( $cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) {
+
+ if ( !in_array($cur_dir, $keep_langs, true ) ) {
+ killDir($path.'/'.$cur_dir);
+ }
+ }
+ }
+ $dir->close();
+}
+
+function killDir($dir) {
+ if (is_dir($dir)) {
+ $entries = scandir($dir);
+
+ foreach ($entries as $entry) {
+ if ($entry != "." && $entry != "..") {
+ if ( is_dir($dir.'/'.$entry) ) {
+ killDir($dir.'/'.$entry);
+ } else {
+ unlink($dir.'/'.$entry);
+ }
+ }
+ }
+ reset($entries);
+ rmdir($dir);
+ }
+}
+#------------------------------------------------------------------------------
+
+// handle options
+$short_opts = 'hxk:e';
+$long_opts = array('help', 'examples', 'keep=','english');
+
+$OPTS = Doku_Cli_Opts::getOptions(__FILE__, $short_opts, $long_opts);
+
+if ( $OPTS->isError() ) {
+ fwrite( STDERR, $OPTS->getMessage() . "\n");
+ exit(1);
+}
+
+// handle '--examples' option
+$show_examples = ( $OPTS->has('x') or $OPTS->has('examples') ) ? true : false;
+
+// handle '--help' option
+if ( $OPTS->has('h') or $OPTS->has('help') ) {
+ usage($show_examples);
+ exit(0);
+}
+
+// handle both '--keep' and '--english' options
+if ( $OPTS->has('k') or $OPTS->has('keep') ) {
+ $preserved_langs = getSuppliedArgument($OPTS,'k','keep');
+ $langs = explode(',', $preserved_langs);
+
+ // ! always enforce 'en' lang when using '--keep' (DW relies on it)
+ if ( !isset($langs['en']) ) {
+ $langs[]='en';
+ }
+} elseif ( $OPTS->has('e') or $OPTS->has('english') ) {
+ // '--english' was specified strip everything besides 'en'
+ $langs = array ('en');
+} else {
+ // no option was specified, print usage but don't do anything as
+ // this run might not be intented
+ usage();
+ print "\n
+ ERROR
+ No option specified, use either -h -x to get more info,
+ or -e to strip every language besides english.\n";
+ exit(1);
+}
+
+// Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
+stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $langs);
+processPlugins(realpath(dirname(__FILE__).'/../lib/plugins'), $langs);
diff --git a/conf/acronyms.conf b/conf/acronyms.conf
index 13708d2df..172b9974d 100644
--- a/conf/acronyms.conf
+++ b/conf/acronyms.conf
@@ -71,8 +71,8 @@ MHz Megahertz
MIME Multipurpose Internet Mail Extension
MIT Massachusetts Institute of Technology
MML Mathematical Markup Language
-MP3 Motion Picture Experts Group Layer 3
-MPEG Motion Picture Experts Group
+MP3 Moving Picture Experts Group Layer 3
+MPEG Moving Picture Experts Group
MSDN Microsoft Developer Network
MS Microsoft
MSIE Microsoft Internet Explorer
@@ -101,6 +101,7 @@ POP Post Office Protocol
QoS Quality of Service
RAID Redundant Array of Inexpensive Disks
RDF Resource Description Framework
+RFC Request for Comments
ROTFL Rolling on the floor laughing
RPC Remote Procedure Call
RSS Rich Site Summary
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index f10c70e58..629e7c0c6 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -99,6 +99,7 @@ $conf['fetchsize'] = 0; //maximum size (bytes) fetch.php may do
$conf['notify'] = ''; //send change info to this email (leave blank for nobody)
$conf['registernotify'] = ''; //send info about newly registered users to this email (leave blank for nobody)
$conf['mailfrom'] = ''; //use this email when sending mails
+$conf['mailprefix'] = ''; //use this as prefix of outgoing mails
$conf['gzip_output'] = 0; //use gzip content encodeing for the output xhtml (if allowed by browser)
$conf['gdlib'] = 2; //the GDlib version (0, 1 or 2) 2 tries to autodetect
$conf['im_convert'] = ''; //path to ImageMagicks convert (will be used instead of GD)
@@ -121,7 +122,7 @@ $conf['rss_linkto'] = 'diff'; //what page RSS entries link to:
// 'page' - the revised page itself
// 'rev' - page showing all revisions
// 'current' - most recent revision of page
-$conf['rss_content'] = 'abstract'; // what to put in the items by deafult?
+$conf['rss_content'] = 'abstract'; // what to put in the items by default?
// 'abstract' - plain text, first paragraph or so
// 'diff' - plain text unified diff wrapped in <pre> tags
// 'htmldiff' - diff as HTML table
diff --git a/conf/interwiki.conf b/conf/interwiki.conf
index 0e855f626..702696792 100644
--- a/conf/interwiki.conf
+++ b/conf/interwiki.conf
@@ -21,6 +21,7 @@ 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/
+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}
diff --git a/doku.php b/doku.php
index 1303f1ade..6cd0c0e0c 100644
--- a/doku.php
+++ b/doku.php
@@ -7,7 +7,7 @@
*/
// update message version
-$updateVersion = 29;
+$updateVersion = 30;
// xdebug_start_profiling();
@@ -29,7 +29,10 @@ require_once(DOKU_INC.'inc/init.php');
//import variables
$QUERY = trim($_REQUEST['id']);
$ID = getID();
+
+// deprecated 2011-01-14
$NS = getNS($ID);
+
$REV = $_REQUEST['rev'];
$IDX = $_REQUEST['idx'];
$DATE = $_REQUEST['date'];
diff --git a/feed.php b/feed.php
index 0980dfaa8..615d1597d 100644
--- a/feed.php
+++ b/feed.php
@@ -24,7 +24,7 @@ $cache = new cache($key, '.feed');
// prepare cache depends
$depends['files'] = getConfigFiles('main');
$depends['age'] = $conf['rss_update'];
-$depends['purge'] = ($_REQUEST['purge']) ? true : false;
+$depends['purge'] = isset($_REQUEST['purge']);
// check cacheage and deliver if nothing has changed since last
// time or the update interval has not passed, also handles conditional requests
@@ -55,18 +55,20 @@ $image->link = DOKU_URL;
$rss->image = $image;
$data = null;
-if($opt['feed_mode'] == 'list'){
- $data = rssListNamespace($opt);
-}elseif($opt['feed_mode'] == 'search'){
- $data = rssSearch($opt);
-}else{
+$modes = array('list' => 'rssListNamespace',
+ 'search' => 'rssSearch',
+ 'recent' => 'rssRecentChanges');
+if (isset($modes[$opt['feed_mode']])) {
+ $data = $modes[$opt['feed_mode']]($opt);
+} else {
$eventData = array(
'opt' => &$opt,
'data' => &$data,
);
$event = new Doku_Event('FEED_MODE_UNKNOWN', $eventData);
if ($event->advise_before(true)) {
- $data = rssRecentChanges($opt);
+ echo sprintf('<error>Unknown feed mode %s</error>', hsc($opt['feed_mode']));
+ exit;
}
$event->advise_after();
}
@@ -83,29 +85,53 @@ print $feed;
// ---------------------------------------------------------------- //
/**
- * Get URL parameters and config options and return a initialized option array
+ * Get URL parameters and config options and return an initialized option array
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function rss_parseOptions(){
global $conf;
- $opt['items'] = (int) $_REQUEST['num'];
- $opt['feed_type'] = $_REQUEST['type'];
- $opt['feed_mode'] = $_REQUEST['mode'];
- $opt['show_minor'] = $_REQUEST['minor'];
- $opt['namespace'] = $_REQUEST['ns'];
- $opt['link_to'] = $_REQUEST['linkto'];
- $opt['item_content'] = $_REQUEST['content'];
- $opt['search_query'] = $_REQUEST['q'];
-
- if(!$opt['feed_type']) $opt['feed_type'] = $conf['rss_type'];
- if(!$opt['item_content']) $opt['item_content'] = $conf['rss_content'];
- if(!$opt['link_to']) $opt['link_to'] = $conf['rss_linkto'];
- if(!$opt['items']) $opt['items'] = $conf['recent'];
+ $opt = array();
+
+ foreach(array(
+ // Basic feed properties
+ // Plugins may probably want to add new values to these
+ // properties for implementing own feeds
+
+ // One of: list, search, recent
+ 'feed_mode' => array('mode', 'recent'),
+ // One of: diff, page, rev, current
+ 'link_to' => array('linkto', $conf['rss_linkto']),
+ // One of: abstract, diff, htmldiff, html
+ 'item_content' => array('content', $conf['rss_content']),
+
+ // Special feed properties
+ // These are only used by certain feed_modes
+
+ // String, used for feed title, in list and rc mode
+ 'namespace' => array('ns', null),
+ // Positive integer, only used in rc mode
+ 'items' => array('num', $conf['recent']),
+ // Boolean, only used in rc mode
+ 'show_minor' => array('minor', false),
+ // String, only used in search mode
+ 'search_query' => array('q', null),
+
+ ) as $name => $val) {
+ $opt[$name] = (isset($_REQUEST[$val[0]]) && !empty($_REQUEST[$val[0]]))
+ ? $_REQUEST[$val[0]] : $val[1];
+ }
+
+ $opt['items'] = max(0, (int) $opt['items']);
+ $opt['show_minor'] = (bool) $opt['show_minor'];
+
$opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none');
- switch ($opt['feed_type']){
+ $type = valid_input_set('type', array('rss','rss2','atom','atom1','rss1',
+ 'default' => $conf['rss_type']),
+ $_REQUEST);
+ switch ($type){
case 'rss':
$opt['feed_type'] = 'RSS0.91';
$opt['mime_type'] = 'text/xml';
@@ -279,7 +305,7 @@ function rss_buildItems(&$rss,&$data,$opt){
}
// add category
- if($meta['subject']){
+ if(isset($meta['subject'])) {
$item->category = $meta['subject'];
}else{
$cat = getNS($id);
@@ -349,4 +375,4 @@ function rssSearch($opt){
return $data;
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php
index 7b14e4463..dd096a55a 100644
--- a/inc/DifferenceEngine.php
+++ b/inc/DifferenceEngine.php
@@ -30,7 +30,7 @@ class _DiffOp {
class _DiffOp_Copy extends _DiffOp {
var $type = 'copy';
- function _DiffOp_Copy ($orig, $closing = false) {
+ function _DiffOp_Copy($orig, $closing = false) {
if (!is_array($closing))
$closing = $orig;
$this->orig = $orig;
@@ -45,7 +45,7 @@ class _DiffOp_Copy extends _DiffOp {
class _DiffOp_Delete extends _DiffOp {
var $type = 'delete';
- function _DiffOp_Delete ($lines) {
+ function _DiffOp_Delete($lines) {
$this->orig = $lines;
$this->closing = false;
}
@@ -58,7 +58,7 @@ class _DiffOp_Delete extends _DiffOp {
class _DiffOp_Add extends _DiffOp {
var $type = 'add';
- function _DiffOp_Add ($lines) {
+ function _DiffOp_Add($lines) {
$this->closing = $lines;
$this->orig = false;
}
@@ -71,7 +71,7 @@ class _DiffOp_Add extends _DiffOp {
class _DiffOp_Change extends _DiffOp {
var $type = 'change';
- function _DiffOp_Change ($orig, $closing) {
+ function _DiffOp_Change($orig, $closing) {
$this->orig = $orig;
$this->closing = $closing;
}
@@ -104,7 +104,7 @@ class _DiffOp_Change extends _DiffOp {
*/
class _DiffEngine {
- function diff ($from_lines, $to_lines) {
+ function diff($from_lines, $to_lines) {
$n_from = count($from_lines);
$n_to = count($to_lines);
@@ -135,7 +135,7 @@ class _DiffEngine {
$xhash[$from_lines[$xi]] = 1;
for ($yi = $skip; $yi < $n_to - $endskip; $yi++) {
$line = $to_lines[$yi];
- if ( ($this->ychanged[$yi] = empty($xhash[$line])) )
+ if (($this->ychanged[$yi] = empty($xhash[$line])))
continue;
$yhash[$line] = 1;
$this->yv[] = $line;
@@ -143,7 +143,7 @@ class _DiffEngine {
}
for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
$line = $from_lines[$xi];
- if ( ($this->xchanged[$xi] = empty($yhash[$line])) )
+ if (($this->xchanged[$xi] = empty($yhash[$line])))
continue;
$this->xv[] = $line;
$this->xind[] = $xi;
@@ -165,8 +165,7 @@ class _DiffEngine {
// Skip matching "snake".
$copy = array();
- while ( $xi < $n_from && $yi < $n_to
- && !$this->xchanged[$xi] && !$this->ychanged[$yi]) {
+ while ($xi < $n_from && $yi < $n_to && !$this->xchanged[$xi] && !$this->ychanged[$yi]) {
$copy[] = $from_lines[$xi++];
++$yi;
}
@@ -210,15 +209,14 @@ class _DiffEngine {
* match. The caller must trim matching lines from the beginning and end
* of the portions it is going to specify.
*/
- function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) {
+ function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) {
$flip = false;
if ($xlim - $xoff > $ylim - $yoff) {
// Things seems faster (I'm not sure I understand why)
// when the shortest sequence in X.
$flip = true;
- list ($xoff, $xlim, $yoff, $ylim)
- = array( $yoff, $ylim, $xoff, $xlim);
+ list ($xoff, $xlim, $yoff, $ylim) = array($yoff, $ylim, $xoff, $xlim);
}
if ($flip)
@@ -284,7 +282,7 @@ class _DiffEngine {
return array($this->lcs, $seps);
}
- function _lcs_pos ($ypos) {
+ function _lcs_pos($ypos) {
$end = $this->lcs;
if ($end == 0 || $ypos > $this->seq[$end]) {
$this->seq[++$this->lcs] = $ypos;
@@ -295,7 +293,7 @@ class _DiffEngine {
$beg = 1;
while ($beg < $end) {
$mid = (int)(($beg + $end) / 2);
- if ( $ypos > $this->seq[$mid] )
+ if ($ypos > $this->seq[$mid])
$beg = $mid + 1;
else
$end = $mid;
@@ -321,17 +319,15 @@ class _DiffEngine {
* Note that XLIM, YLIM are exclusive bounds.
* All line numbers are origin-0 and discarded lines are not counted.
*/
- function _compareseq ($xoff, $xlim, $yoff, $ylim) {
+ function _compareseq($xoff, $xlim, $yoff, $ylim) {
// Slide down the bottom initial diagonal.
- while ($xoff < $xlim && $yoff < $ylim
- && $this->xv[$xoff] == $this->yv[$yoff]) {
+ while ($xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff]) {
++$xoff;
++$yoff;
}
// Slide up the top initial diagonal.
- while ($xlim > $xoff && $ylim > $yoff
- && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {
+ while ($xlim > $xoff && $ylim > $yoff && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {
--$xlim;
--$ylim;
}
@@ -379,7 +375,7 @@ class _DiffEngine {
*
* This is extracted verbatim from analyze.c (GNU diffutils-2.7).
*/
- function _shift_boundaries ($lines, &$changed, $other_changed) {
+ function _shift_boundaries($lines, &$changed, $other_changed) {
$i = 0;
$j = 0;
@@ -519,7 +515,7 @@ class Diff {
* @return object A Diff object representing the inverse of the
* original diff.
*/
- function reverse () {
+ function reverse() {
$rev = $this;
$rev->edits = array();
foreach ($this->edits as $edit) {
@@ -533,7 +529,7 @@ class Diff {
*
* @return bool True iff two sequences were identical.
*/
- function isEmpty () {
+ function isEmpty() {
foreach ($this->edits as $edit) {
if ($edit->type != 'copy')
return false;
@@ -548,7 +544,7 @@ class Diff {
*
* @return int The length of the LCS.
*/
- function lcs () {
+ function lcs() {
$lcs = 0;
foreach ($this->edits as $edit) {
if ($edit->type == 'copy')
@@ -598,7 +594,7 @@ class Diff {
*
* This is here only for debugging purposes.
*/
- function _check ($from_lines, $to_lines) {
+ function _check($from_lines, $to_lines) {
if (serialize($from_lines) != serialize($this->orig()))
trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
if (serialize($to_lines) != serialize($this->closing()))
@@ -612,7 +608,7 @@ class Diff {
$prevtype = 'none';
foreach ($this->edits as $edit) {
- if ( $prevtype == $edit->type )
+ if ($prevtype == $edit->type)
trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
$prevtype = $edit->type;
}
@@ -649,8 +645,7 @@ class MappedDiff extends Diff {
* @param $mapped_to_lines array This array should
* have the same number of elements as $to_lines.
*/
- function MappedDiff($from_lines, $to_lines,
- $mapped_from_lines, $mapped_to_lines) {
+ function MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) {
assert(count($from_lines) == count($mapped_from_lines));
assert(count($to_lines) == count($mapped_to_lines));
@@ -727,9 +722,7 @@ class DiffFormatter {
$context = array_slice($edit->orig, 0, $ntrail);
$block[] = new _DiffOp_Copy($context);
}
- $this->_block($x0, $ntrail + $xi - $x0,
- $y0, $ntrail + $yi - $y0,
- $block);
+ $this->_block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block);
$block = false;
}
}
@@ -754,9 +747,7 @@ class DiffFormatter {
}
if (is_array($block))
- $this->_block($x0, $xi - $x0,
- $y0, $yi - $y0,
- $block);
+ $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block);
return $this->_end_diff();
}
@@ -836,17 +827,21 @@ class DiffFormatter {
define('NBSP', "\xC2\xA0"); // utf-8 non-breaking space.
class _HWLDF_WordAccumulator {
- function _HWLDF_WordAccumulator () {
+ function _HWLDF_WordAccumulator() {
$this->_lines = array();
$this->_line = '';
$this->_group = '';
$this->_tag = '';
}
- function _flushGroup ($new_tag) {
+ function _flushGroup($new_tag) {
if ($this->_group !== '') {
if ($this->_tag == 'mark')
$this->_line .= '<strong>'.$this->_group.'</strong>';
+ elseif ($this->_tag == 'add')
+ $this->_line .= '<span class="diff-addedline">'.$this->_group.'</span>';
+ elseif ($this->_tag == 'del')
+ $this->_line .= '<span class="diff-deletedline"><del>'.$this->_group.'</del></span>';
else
$this->_line .= $this->_group;
}
@@ -854,14 +849,14 @@ class _HWLDF_WordAccumulator {
$this->_tag = $new_tag;
}
- function _flushLine ($new_tag) {
+ function _flushLine($new_tag) {
$this->_flushGroup($new_tag);
if ($this->_line != '')
$this->_lines[] = $this->_line;
$this->_line = '';
}
- function addWords ($words, $tag = '') {
+ function addWords($words, $tag = '') {
if ($tag != $this->_tag)
$this->_flushGroup($tag);
@@ -887,46 +882,80 @@ class _HWLDF_WordAccumulator {
class WordLevelDiff extends MappedDiff {
- function WordLevelDiff ($orig_lines, $closing_lines) {
+ function WordLevelDiff($orig_lines, $closing_lines) {
list ($orig_words, $orig_stripped) = $this->_split($orig_lines);
list ($closing_words, $closing_stripped) = $this->_split($closing_lines);
- $this->MappedDiff($orig_words, $closing_words,
- $orig_stripped, $closing_stripped);
+ $this->MappedDiff($orig_words, $closing_words, $orig_stripped, $closing_stripped);
}
function _split($lines) {
- if (!preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xs',
- implode("\n", $lines),
- $m)) {
+ if (!preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xsu',
+ implode("\n", $lines), $m)) {
return array(array(''), array(''));
- }
- return array($m[0], $m[1]);
- }
+ }
+ return array($m[0], $m[1]);
+ }
- function orig () {
- $orig = new _HWLDF_WordAccumulator;
+ function orig() {
+ $orig = new _HWLDF_WordAccumulator;
- foreach ($this->edits as $edit) {
+ foreach ($this->edits as $edit) {
if ($edit->type == 'copy')
- $orig->addWords($edit->orig);
+ $orig->addWords($edit->orig);
elseif ($edit->orig)
- $orig->addWords($edit->orig, 'mark');
- }
- return $orig->getLines();
- }
+ $orig->addWords($edit->orig, 'mark');
+ }
+ return $orig->getLines();
+ }
- function closing () {
- $closing = new _HWLDF_WordAccumulator;
+ function closing() {
+ $closing = new _HWLDF_WordAccumulator;
- foreach ($this->edits as $edit) {
- if ($edit->type == 'copy')
- $closing->addWords($edit->closing);
- elseif ($edit->closing)
- $closing->addWords($edit->closing, 'mark');
- }
- return $closing->getLines();
- }
+ foreach ($this->edits as $edit) {
+ if ($edit->type == 'copy')
+ $closing->addWords($edit->closing);
+ elseif ($edit->closing)
+ $closing->addWords($edit->closing, 'mark');
+ }
+ return $closing->getLines();
+ }
+}
+
+class InlineWordLevelDiff extends MappedDiff {
+
+ function InlineWordLevelDiff($orig_lines, $closing_lines) {
+ list ($orig_words, $orig_stripped) = $this->_split($orig_lines);
+ list ($closing_words, $closing_stripped) = $this->_split($closing_lines);
+
+ $this->MappedDiff($orig_words, $closing_words, $orig_stripped, $closing_stripped);
+ }
+
+ function _split($lines) {
+ if (!preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xs',
+ implode("\n", $lines), $m)) {
+ return array(array(''), array(''));
+ }
+ return array($m[0], $m[1]);
+ }
+
+ function inline() {
+ $orig = new _HWLDF_WordAccumulator;
+ foreach ($this->edits as $edit) {
+ if ($edit->type == 'copy')
+ $orig->addWords($edit->orig);
+ elseif ($edit->type == 'change'){
+ $orig->addWords($edit->orig, 'del');
+ $orig->addWords($edit->closing, 'add');
+ } elseif ($edit->type == 'delete')
+ $orig->addWords($edit->orig, 'del');
+ elseif ($edit->type == 'add')
+ $orig->addWords($edit->closing, 'add');
+ elseif ($edit->orig)
+ $orig->addWords($edit->orig, 'del');
+ }
+ return $orig->getLines();
+ }
}
/**
@@ -986,78 +1015,147 @@ class TableDiffFormatter extends DiffFormatter {
return $text;
}
- function _block_header( $xbeg, $xlen, $ybeg, $ylen ) {
+ function _block_header($xbeg, $xlen, $ybeg, $ylen) {
global $lang;
$l1 = $lang['line'].' '.$xbeg;
$l2 = $lang['line'].' '.$ybeg;
- $r = '<tr><td class="diff-blockheader" colspan="2">'.$l1.":</td>\n" .
- '<td class="diff-blockheader" colspan="2">'.$l2.":</td></tr>\n";
+ $r = '<tr><td class="diff-blockheader" colspan="2">'.$l1.":</td>\n".
+ ' <td class="diff-blockheader" colspan="2">'.$l2.":</td>\n".
+ "</tr>\n";
return $r;
}
- function _start_block( $header ) {
- print( $header );
+ function _start_block($header) {
+ print($header);
}
function _end_block() {
}
- function _lines( $lines, $prefix=' ', $color="white" ) {
+ function _lines($lines, $prefix=' ', $color="white") {
}
- function addedLine( $line ) {
- return '<td>+</td><td class="diff-addedline">' .
- $line.'</td>';
-
+ function addedLine($line) {
+ return '<td>+</td><td class="diff-addedline">' . $line.'</td>';
}
- function deletedLine( $line ) {
- return '<td>-</td><td class="diff-deletedline">' .
- $line.'</td>';
+ function deletedLine($line) {
+ return '<td>-</td><td class="diff-deletedline">' . $line.'</td>';
}
function emptyLine() {
return '<td colspan="2">&nbsp;</td>';
}
- function contextLine( $line ) {
+ function contextLine($line) {
return '<td> </td><td class="diff-context">'.$line.'</td>';
}
function _added($lines) {
foreach ($lines as $line) {
- print( '<tr>' . $this->emptyLine() .
- $this->addedLine( $line ) . "</tr>\n" );
+ print('<tr>' . $this->emptyLine() . $this->addedLine($line) . "</tr>\n");
}
}
function _deleted($lines) {
foreach ($lines as $line) {
- print( '<tr>' . $this->deletedLine( $line ) .
- $this->emptyLine() . "</tr>\n" );
+ print('<tr>' . $this->deletedLine($line) . $this->emptyLine() . "</tr>\n");
}
}
- function _context( $lines ) {
+ function _context($lines) {
foreach ($lines as $line) {
- print( '<tr>' . $this->contextLine( $line ) .
- $this->contextLine( $line ) . "</tr>\n" );
+ print('<tr>' . $this->contextLine($line) . $this->contextLine($line) . "</tr>\n");
}
}
- function _changed( $orig, $closing ) {
- $diff = new WordLevelDiff( $orig, $closing );
+ function _changed($orig, $closing) {
+ $diff = new WordLevelDiff($orig, $closing);
$del = $diff->orig();
$add = $diff->closing();
- while ( $line = array_shift( $del ) ) {
- $aline = array_shift( $add );
- print( '<tr>' . $this->deletedLine( $line ) .
- $this->addedLine( $aline ) . "</tr>\n" );
+ while ($line = array_shift($del)) {
+ $aline = array_shift($add);
+ print('<tr>' . $this->deletedLine($line) . $this->addedLine($aline) . "</tr>\n");
}
- $this->_added( $add ); # If any leftovers
+ $this->_added($add); # If any leftovers
+ }
+}
+
+/**
+ * Inline style diff formatter.
+ *
+ */
+class InlineDiffFormatter extends DiffFormatter {
+
+ function InlineDiffFormatter() {
+ $this->leading_context_lines = 2;
+ $this->trailing_context_lines = 2;
+ }
+
+ function format($diff) {
+ // Preserve whitespaces by converting some to non-breaking spaces.
+ // Do not convert all of them to allow word-wrap.
+ $val = parent::format($diff);
+ $val = str_replace(' ','&nbsp; ', $val);
+ $val = preg_replace('/ (?=<)|(?<=[ >]) /', '&nbsp;', $val);
+ return $val;
+ }
+
+ function _pre($text){
+ $text = htmlspecialchars($text);
+ return $text;
+ }
+
+ function _block_header($xbeg, $xlen, $ybeg, $ylen) {
+ global $lang;
+ if ($xlen != 1)
+ $xbeg .= "," . $xlen;
+ if ($ylen != 1)
+ $ybeg .= "," . $ylen;
+ $r = '<tr><td class="diff-blockheader">@@ '.$lang['line']." -$xbeg +$ybeg @@";
+ $r .= ' <span class="diff-deletedline"><del>'.$lang['deleted'].'</del></span>';
+ $r .= ' <span class="diff-addedline">'.$lang['created'].'</span>';
+ $r .= "</td></tr>\n";
+ return $r;
+ }
+
+ function _start_block($header) {
+ print($header."\n");
+ }
+
+ function _end_block() {
+ }
+
+ function _lines($lines, $prefix=' ', $color="white") {
+ }
+
+ function _added($lines) {
+ foreach ($lines as $line) {
+ print('<tr><td class="diff-addedline">'. $line . "</td></tr>\n");
+ }
+ }
+
+ function _deleted($lines) {
+ foreach ($lines as $line) {
+ print('<tr><td class="diff-deletedline"><del>' . $line . "</del></td></tr>\n");
+ }
+ }
+
+ function _context($lines) {
+ foreach ($lines as $line) {
+ print('<tr><td class="diff-context">'.$line."</td></tr>\n");
+ }
+ }
+
+ function _changed($orig, $closing) {
+ $diff = new InlineWordLevelDiff($orig, $closing);
+ $add = $diff->inline();
+
+ foreach ($add as $line)
+ print('<tr><td>'.$line."</td></tr>\n");
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/EmailAddressValidator.php b/inc/EmailAddressValidator.php
index 2ce2093e2..31b34cc58 100644
--- a/inc/EmailAddressValidator.php
+++ b/inc/EmailAddressValidator.php
@@ -5,21 +5,38 @@
* @author Dave Child <dave@addedbytes.com>
* @link http://code.google.com/p/php-email-address-validation/
* @license http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN r10 + Issue 15 fix
*/
class EmailAddressValidator {
+ /**
+ * Set true to allow addresses like me@localhost
+ */
+ public $allowLocalAddresses = false;
/**
* Check email address validity
* @param strEmailAddress Email address to be checked
* @return True if email is valid, false if not
*/
- function check_email_address($strEmailAddress) {
+ public function check_email_address($strEmailAddress) {
+
+ // If magic quotes is "on", email addresses with quote marks will
+ // fail validation because of added escape characters. Uncommenting
+ // the next three lines will allow for this issue.
+ //if (get_magic_quotes_gpc()) {
+ // $strEmailAddress = stripslashes($strEmailAddress);
+ //}
// Control characters are not allowed
if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $strEmailAddress)) {
return false;
}
+ // Check email length - min 3 (a@a), max 256
+ if (!$this->check_text_length($strEmailAddress, 3, 256)) {
+ return false;
+ }
+
// Split it into sections using last instance of "@"
$intAtSymbol = strrpos($strEmailAddress, '@');
if ($intAtSymbol === false) {
@@ -31,10 +48,15 @@ class EmailAddressValidator {
// Count the "@" symbols. Only one is allowed, except where
// contained in quote marks in the local part. Quickest way to
- // check this is to remove anything in quotes.
- $arrTempAddress[0] = preg_replace('/"[^"]+"/'
+ // check this is to remove anything in quotes. We also remove
+ // characters escaped with backslash, and the backslash
+ // character.
+ $arrTempAddress[0] = preg_replace('/\./'
,''
,$arrEmailAddress[0]);
+ $arrTempAddress[0] = preg_replace('/"[^"]+"/'
+ ,''
+ ,$arrTempAddress[0]);
$arrTempAddress[1] = $arrEmailAddress[1];
$strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];
// Then check - should be no "@" symbols.
@@ -63,7 +85,7 @@ class EmailAddressValidator {
* @param strLocalPortion Text to be checked
* @return True if local portion is valid, false if not
*/
- function check_local_portion($strLocalPortion) {
+ protected function check_local_portion($strLocalPortion) {
// Local portion can only be from 1 to 64 characters, inclusive.
// Please note that servers are encouraged to accept longer local
// parts than 64 characters.
@@ -94,7 +116,7 @@ class EmailAddressValidator {
* @param strDomainPortion Text to be checked
* @return True if domain portion is valid, false if not
*/
- function check_domain_portion($strDomainPortion) {
+ protected function check_domain_portion($strDomainPortion) {
// Total domain can only be from 1 to 255 characters, inclusive
if (!$this->check_text_length($strDomainPortion, 1, 255)) {
return false;
@@ -109,7 +131,7 @@ class EmailAddressValidator {
return true;
} else {
$arrDomainPortion = explode('.', $strDomainPortion);
- if (sizeof($arrDomainPortion) < 2) {
+ if (!$this->allowLocalAddresses && sizeof($arrDomainPortion) < 2) {
return false; // Not enough parts to domain
}
for ($i = 0, $max = sizeof($arrDomainPortion); $i < $max; $i++) {
@@ -121,6 +143,11 @@ class EmailAddressValidator {
.'([A-Za-z0-9]+))$/', $arrDomainPortion[$i])) {
return false;
}
+ if ($i == $max - 1) { // TLD cannot be only numbers
+ if (strlen(preg_replace('/[0-9]/', '', $arrDomainPortion[$i])) <= 0) {
+ return false;
+ }
+ }
}
}
return true;
@@ -133,7 +160,7 @@ class EmailAddressValidator {
* @param intMaximum Maximum acceptable length
* @return True if string is within bounds (inclusive), false if not
*/
- function check_text_length($strText, $intMinimum, $intMaximum) {
+ protected function check_text_length($strText, $intMinimum, $intMaximum) {
// Minimum and maximum are both inclusive
$intTextLength = strlen($strText);
if (($intTextLength < $intMinimum) || ($intTextLength > $intMaximum)) {
@@ -142,5 +169,6 @@ class EmailAddressValidator {
return true;
}
}
+
}
diff --git a/inc/FeedParser.php b/inc/FeedParser.php
index 9d00e7abf..b98350da7 100644
--- a/inc/FeedParser.php
+++ b/inc/FeedParser.php
@@ -49,6 +49,7 @@ class FeedParser_File extends SimplePie_File {
*/
function FeedParser_File($url, $timeout=10, $redirects=5,
$headers=null, $useragent=null, $force_fsockopen=false) {
+ parent::__construct();
$this->http = new DokuHTTPClient();
$this->success = $this->http->sendRequest($url);
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index e68679bde..1cb16714d 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -71,6 +71,7 @@ class DokuHTTPClient extends HTTPClient {
* @link http://www.splitbrain.org/go/videodb
* @author Andreas Goetz <cpuidle@gmx.de>
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Tobias Sarnowski <sarnowski@new-thoughts.org>
*/
class HTTPClient {
//set these if you like
@@ -86,13 +87,14 @@ class HTTPClient {
var $headers;
var $debug;
var $start = 0; // for timings
+ var $keep_alive = true; // keep alive rocks
// don't set these, read on error
var $error;
var $redirect_count;
// read these after a successful request
- var $resp_status;
+ var $status;
var $resp_body;
var $resp_headers;
@@ -108,6 +110,9 @@ class HTTPClient {
var $proxy_ssl; //boolean set to true if your proxy needs SSL
var $proxy_except; // regexp of URLs to exclude from proxy
+ // list of kept alive connections
+ static $connections = array();
+
// what we use as boundary on multipart/form-data posts
var $boundary = '---DokuWikiHTTPClient--4523452351';
@@ -222,7 +227,7 @@ class HTTPClient {
$path = $uri['path'];
if(empty($path)) $path = '/';
if(!empty($uri['query'])) $path .= '?'.$uri['query'];
- $port = $uri['port'];
+ if(isset($uri['port']) && !empty($uri['port'])) $port = $uri['port'];
if(isset($uri['user'])) $this->user = $uri['user'];
if(isset($uri['pass'])) $this->pass = $uri['pass'];
@@ -235,7 +240,7 @@ class HTTPClient {
}else{
$request_url = $path;
$server = $server;
- if (empty($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
+ if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
}
// add SSL stream prefix if needed - needs SSL support in PHP
@@ -247,7 +252,11 @@ class HTTPClient {
if($uri['port']) $headers['Host'].= ':'.$uri['port'];
$headers['User-Agent'] = $this->agent;
$headers['Referer'] = $this->referer;
- $headers['Connection'] = 'Close';
+ if ($this->keep_alive) {
+ $headers['Connection'] = 'Keep-Alive';
+ } else {
+ $headers['Connection'] = 'Close';
+ }
if($method == 'POST'){
if(is_array($data)){
if($headers['Content-Type'] == 'multipart/form-data'){
@@ -273,15 +282,33 @@ class HTTPClient {
// stop time
$start = time();
- // open socket
- $socket = @fsockopen($server,$port,$errno, $errstr, $this->timeout);
- if (!$socket){
- $this->status = -100;
- $this->error = "Could not connect to $server:$port\n$errstr ($errno)";
- return false;
+ // already connected?
+ $connectionId = $this->_uniqueConnectionId($server,$port);
+ $this->_debug('connection pool', $this->connections);
+ $socket = null;
+ if (isset($this->connections[$connectionId])) {
+ $this->_debug('reusing connection', $connectionId);
+ $socket = $this->connections[$connectionId];
+ }
+ if (is_null($socket) || feof($socket)) {
+ $this->_debug('opening connection', $connectionId);
+ // open socket
+ $socket = @fsockopen($server,$port,$errno, $errstr, $this->timeout);
+ if (!$socket){
+ $this->status = -100;
+ $this->error = "Could not connect to $server:$port\n$errstr ($errno)";
+ return false;
+ }
+ //set non blocking
+ stream_set_blocking($socket,0);
+
+ // keep alive?
+ if ($this->keep_alive) {
+ $this->connections[$connectionId] = $socket;
+ } else {
+ unset($this->connections[$connectionId]);
+ }
}
- //set non blocking
- stream_set_blocking($socket,0);
// build request
$request = "$method $request_url HTTP/".$this->http.HTTP_NL;
@@ -300,6 +327,7 @@ class HTTPClient {
if($ret === false){
$this->status = -100;
$this->error = 'Failed writing to socket';
+ unset($this->connections[$connectionId]);
return false;
}
$written += $ret;
@@ -311,10 +339,12 @@ class HTTPClient {
if(time()-$start > $this->timeout){
$this->status = -100;
$this->error = sprintf('Timeout while reading headers (%.3fs)',$this->_time() - $this->start);
+ unset($this->connections[$connectionId]);
return false;
}
if(feof($socket)){
$this->error = 'Premature End of File (socket)';
+ unset($this->connections[$connectionId]);
return false;
}
$r_headers .= fgets($socket,1024);
@@ -327,6 +357,7 @@ class HTTPClient {
if($match[1] > $this->max_bodysize){
$this->error = 'Reported content length exceeds allowed response size';
if ($this->max_bodysize_abort)
+ unset($this->connections[$connectionId]);
return false;
}
}
@@ -334,6 +365,7 @@ class HTTPClient {
// get Status
if (!preg_match('/^HTTP\/(\d\.\d)\s*(\d+).*?\n/', $r_headers, $m)) {
$this->error = 'Server returned bad answer';
+ unset($this->connections[$connectionId]);
return false;
}
$this->status = $m[2];
@@ -359,6 +391,11 @@ class HTTPClient {
// check server status code to follow redirect
if($this->status == 301 || $this->status == 302 ){
+ // close the connection because we don't handle content retrieval here
+ // that's the easiest way to clean up the connection
+ fclose($socket);
+ unset($this->connections[$connectionId]);
+
if (empty($this->resp_headers['location'])){
$this->error = 'Redirect but no Location Header found';
return false;
@@ -386,6 +423,7 @@ class HTTPClient {
// check if headers are as expected
if($this->header_regexp && !preg_match($this->header_regexp,$r_headers)){
$this->error = 'The received headers did not match the given regexp';
+ unset($this->connections[$connectionId]);
return false;
}
@@ -397,11 +435,13 @@ class HTTPClient {
do {
if(feof($socket)){
$this->error = 'Premature End of File (socket)';
+ unset($this->connections[$connectionId]);
return false;
}
if(time()-$start > $this->timeout){
$this->status = -100;
$this->error = sprintf('Timeout while reading chunk (%.3fs)',$this->_time() - $this->start);
+ unset($this->connections[$connectionId]);
return false;
}
$byte = fread($socket,1);
@@ -418,10 +458,12 @@ class HTTPClient {
if($this->max_bodysize && strlen($r_body) > $this->max_bodysize){
$this->error = 'Allowed response size exceeded';
- if ($this->max_bodysize_abort)
+ if ($this->max_bodysize_abort){
+ unset($this->connections[$connectionId]);
return false;
- else
+ } else {
break;
+ }
}
} while ($chunk_size);
}else{
@@ -430,16 +472,19 @@ class HTTPClient {
if(time()-$start > $this->timeout){
$this->status = -100;
$this->error = sprintf('Timeout while reading response (%.3fs)',$this->_time() - $this->start);
+ unset($this->connections[$connectionId]);
return false;
}
$r_body .= fread($socket,4096);
$r_size = strlen($r_body);
if($this->max_bodysize && $r_size > $this->max_bodysize){
$this->error = 'Allowed response size exceeded';
- if ($this->max_bodysize_abort)
+ if ($this->max_bodysize_abort) {
+ unset($this->connections[$connectionId]);
return false;
- else
+ } else {
break;
+ }
}
if(isset($this->resp_headers['content-length']) &&
!isset($this->resp_headers['transfer-encoding']) &&
@@ -450,9 +495,13 @@ class HTTPClient {
}
}
- // close socket
- $status = socket_get_status($socket);
- fclose($socket);
+ if (!$this->keep_alive ||
+ (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {
+ // close socket
+ $status = socket_get_status($socket);
+ fclose($socket);
+ unset($this->connections[$connectionId]);
+ }
// decode gzip if needed
if(isset($this->resp_headers['content-encoding']) &&
@@ -506,12 +555,13 @@ class HTTPClient {
*/
function _parseHeaders($string){
$headers = array();
- $lines = explode("\n",$string);
- foreach($lines as $line){
- list($key,$val) = explode(':',$line,2);
- $key = strtolower(trim($key));
- $val = trim($val);
- if(empty($val)) continue;
+ if (!preg_match_all('/^\s*([\w-]+)\s*:\s*([\S \t]+)\s*$/m', $string,
+ $matches, PREG_SET_ORDER)) {
+ return $headers;
+ }
+ foreach($matches as $match){
+ list(, $key, $val) = $match;
+ $key = strtolower($key);
if(isset($headers[$key])){
if(is_array($headers[$key])){
$headers[$key][] = $val;
@@ -598,6 +648,14 @@ class HTTPClient {
return $out;
}
+ /**
+ * Generates a unique identifier for a connection.
+ *
+ * @return string unique identifier
+ */
+ function _uniqueConnectionId($server, $port) {
+ return "$server:$port";
+ }
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php
index c7f83a6d6..c8255e6d9 100644
--- a/inc/IXR_Library.php
+++ b/inc/IXR_Library.php
@@ -395,13 +395,8 @@ EOD;
$this->output($error->getXml());
}
function output($xml) {
- $xml = '<?xml version="1.0"?>'."\n".$xml;
- $length = strlen($xml);
- header('Connection: close');
- header('Content-Length: '.$length);
- header('Content-Type: text/xml');
- header('Date: '.date('r'));
- echo $xml;
+ header('Content-Type: text/xml; charset=utf-8');
+ echo '<?xml version="1.0"?>', "\n", $xml;
exit;
}
function hasMethod($method) {
diff --git a/inc/JSON.php b/inc/JSON.php
index d1fbd404a..2dea44003 100644
--- a/inc/JSON.php
+++ b/inc/JSON.php
@@ -112,6 +112,16 @@ define('JSON_STRICT_TYPE', 11);
* @deprecated
*/
class JSON {
+
+ /**
+ * Disables the use of PHP5's native json_decode()
+ *
+ * You shouldn't change this usually because the native function is much
+ * faster. However, this non-native will also parse slightly broken JSON
+ * which might be handy when talking to a non-conform endpoint
+ */
+ public $skipnative = false;
+
/**
* constructs a new JSON instance
*
@@ -366,7 +376,10 @@ class JSON {
* @access public
*/
function decode($str) {
- if (function_exists('json_decode')) return json_decode($str);
+ if (!$this->skipnative && function_exists('json_decode')){
+ return json_decode($str,($this->use == JSON_LOOSE_TYPE));
+ }
+
$str = $this->reduce_string($str);
switch (strtolower($str)) {
diff --git a/inc/SimplePie.php b/inc/SimplePie.php
index 99c9f3226..d35443165 100644
--- a/inc/SimplePie.php
+++ b/inc/SimplePie.php
@@ -5,7 +5,7 @@
* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
- * Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon
+ * Copyright (c) 2004-2009, Ryan Parman and Geoffrey Sneddon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,8 +33,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version "Razzleberry"
- * @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon
+ * @version 1.2.1-dev
+ * @copyright 2004-2009 Ryan Parman, Geoffrey Sneddon
* @author Ryan Parman
* @author Geoffrey Sneddon
* @link http://simplepie.org/ SimplePie
@@ -51,18 +51,18 @@ define('SIMPLEPIE_NAME', 'SimplePie');
/**
* SimplePie Version
*/
-define('SIMPLEPIE_VERSION', '1.0.1');
+define('SIMPLEPIE_VERSION', '1.2.1-dev');
/**
* SimplePie Build
* @todo Hardcode for release (there's no need to have to call SimplePie_Misc::parse_date() only every load of simplepie.inc)
*/
-define('SIMPLEPIE_BUILD', 20070719221955);
+define('SIMPLEPIE_BUILD', gmdate('YmdHis', SimplePie_Misc::parse_date(substr('$Date$', 7, 25)) ? SimplePie_Misc::parse_date(substr('$Date$', 7, 25)) : filemtime(__FILE__)));
/**
* SimplePie Website URL
*/
-define('SIMPLEPIE_URL', 'http://simplepie.org/');
+define('SIMPLEPIE_URL', 'http://simplepie.org');
/**
* SimplePie Useragent
@@ -243,9 +243,24 @@ define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32);
define('SIMPLEPIE_CONSTRUCT_ALL', 63);
/**
+ * Don't change case
+ */
+define('SIMPLEPIE_SAME_CASE', 1);
+
+/**
+ * Change to lowercase
+ */
+define('SIMPLEPIE_LOWERCASE', 2);
+
+/**
+ * Change to uppercase
+ */
+define('SIMPLEPIE_UPPERCASE', 4);
+
+/**
* PCRE for HTML attributes
*/
-define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)(?:\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[a-z0-9\-._:]*)))?)*)\s*');
+define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*');
/**
* PCRE for XML attributes
@@ -288,6 +303,12 @@ define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/');
define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
/**
+ * RSS 2.0 Namespace
+ * (Stupid, I know, but I'm certain it will confuse people less with support.)
+ */
+define('SIMPLEPIE_NAMESPACE_RSS_20', '');
+
+/**
* DC 1.0 Namespace
*/
define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/');
@@ -313,6 +334,11 @@ define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss');
define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');
/**
+ * Wrong Media RSS Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');
+
+/**
* iTunes RSS Namespace
*/
define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
@@ -333,14 +359,39 @@ define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignment
define('SIMPLEPIE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>='));
/**
+ * No file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_NONE', 0);
+
+/**
+ * Remote file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1);
+
+/**
+ * Local file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2);
+
+/**
+ * fsockopen() file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4);
+
+/**
+ * cURL file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_CURL', 8);
+
+/**
+ * file_get_contents() file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16);
+
+/**
* SimplePie
*
* @package SimplePie
- * @version "Razzleberry"
- * @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon
- * @author Ryan Parman
- * @author Geoffrey Sneddon
- * @todo Option for type of fetching (cache, not modified header, fetch, etc.)
*/
class SimplePie
{
@@ -407,6 +458,14 @@ class SimplePie
var $force_fsockopen = false;
/**
+ * @var bool Force the given data/URL to be treated as a feed no matter what
+ * it appears like
+ * @see SimplePie::force_feed()
+ * @access private
+ */
+ var $force_feed = false;
+
+ /**
* @var bool Enable/Disable XML dump
* @see SimplePie::enable_xml_dump()
* @access private
@@ -562,6 +621,20 @@ class SimplePie
var $restriction_class = 'SimplePie_Restriction';
/**
+ * @var string Class used for content-type sniffing
+ * @see SimplePie::set_content_type_sniffer_class()
+ * @access private
+ */
+ var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer';
+
+ /**
+ * @var string Class used for item sources.
+ * @see SimplePie::set_source_class()
+ * @access private
+ */
+ var $source_class = 'SimplePie_Source';
+
+ /**
* @var mixed Set javascript query string parameter (false, or
* anything type-cast to false, disables this feature)
* @see SimplePie::set_javascript()
@@ -577,6 +650,13 @@ class SimplePie
var $max_checked_feeds = 10;
/**
+ * @var array All the feeds found during the autodiscovery process
+ * @see SimplePie::get_all_discovered_feeds()
+ * @access private
+ */
+ var $all_discovered_feeds = array();
+
+ /**
* @var string Web-accessible path to the handler_favicon.php file.
* @see SimplePie::set_favicon_handler()
* @access private
@@ -611,6 +691,13 @@ class SimplePie
var $config_settings = null;
/**
+ * @var integer Stores the number of items to return per-feed with multifeeds.
+ * @see SimplePie::set_item_limit()
+ * @access private
+ */
+ var $item_limit = 0;
+
+ /**
* @var array Stores the default attributes to be stripped by strip_attributes().
* @see SimplePie::strip_attributes()
* @access private
@@ -678,6 +765,45 @@ class SimplePie
}
/**
+ * Remove items that link back to this before destroying this object
+ */
+ function __destruct()
+ {
+ if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
+ {
+ if (!empty($this->data['items']))
+ {
+ foreach ($this->data['items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['items']);
+ }
+ if (!empty($this->data['ordered_items']))
+ {
+ foreach ($this->data['ordered_items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['ordered_items']);
+ }
+ }
+ }
+
+ /**
+ * Force the given data/URL to be treated as a feed no matter what it
+ * appears like
+ *
+ * @access public
+ * @since 1.1
+ * @param bool $enable Force the given data/URL to be treated as a feed
+ */
+ function force_feed($enable = false)
+ {
+ $this->force_feed = (bool) $enable;
+ }
+
+ /**
* This is the URL of the feed you want to parse.
*
* This allows you to enter the URL of the feed you want to parse, or the
@@ -718,7 +844,7 @@ class SimplePie
*/
function set_file(&$file)
{
- if (SimplePie_Misc::is_a($file, 'SimplePie_File'))
+ if (is_a($file, 'SimplePie_File'))
{
$this->feed_url = $file->url;
$this->file =& $file;
@@ -741,7 +867,7 @@ class SimplePie
*/
function set_raw_data($data)
{
- $this->raw_data = trim($data);
+ $this->raw_data = $data;
}
/**
@@ -1157,6 +1283,44 @@ class SimplePie
}
/**
+ * Allows you to change which class SimplePie uses for content-type sniffing.
+ * Useful when you are overloading or extending SimplePie's default classes.
+ *
+ * @access public
+ * @param string $class Name of custom class.
+ * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
+ * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
+ */
+ function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer')
+ {
+ if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Content_Type_Sniffer'))
+ {
+ $this->content_type_sniffer_class = $class;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Allows you to change which class SimplePie uses item sources.
+ * Useful when you are overloading or extending SimplePie's default classes.
+ *
+ * @access public
+ * @param string $class Name of custom class.
+ * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
+ * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
+ */
+ function set_source_class($class = 'SimplePie_Source')
+ {
+ if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Source'))
+ {
+ $this->source_class = $class;
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Allows you to override the default user agent string.
*
* @access public
@@ -1294,7 +1458,7 @@ class SimplePie
*/
function set_favicon_handler($page = false, $qs = 'i')
{
- if ($page != false)
+ if ($page !== false)
{
$this->favicon_handler = $page . '?' . $qs . '=';
}
@@ -1313,7 +1477,7 @@ class SimplePie
*/
function set_image_handler($page = false, $qs = 'i')
{
- if ($page != false)
+ if ($page !== false)
{
$this->sanitize->set_image_handler($page . '?' . $qs . '=');
}
@@ -1323,47 +1487,44 @@ class SimplePie
}
}
+ /**
+ * Set the limit for items returned per-feed with multifeeds.
+ *
+ * @access public
+ * @param integer $limit The maximum number of items to return.
+ */
+ function set_item_limit($limit = 0)
+ {
+ $this->item_limit = (int) $limit;
+ }
+
function init()
{
- if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.1.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre'))
+ // Check absolute bare minimum requirements.
+ if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre'))
{
return false;
}
- if (isset($_GET[$this->javascript]))
+ // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader.
+ elseif (!extension_loaded('xmlreader'))
{
- if (function_exists('ob_gzhandler'))
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
{
- ob_start('ob_gzhandler');
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
}
- header('Content-type: text/javascript; charset: UTF-8');
- header('Cache-Control: must-revalidate');
- header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
- ?>
-function embed_odeo(link) {
- document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>');
-}
-
-function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
- if (placeholder != '') {
- document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
- }
- else {
- document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
- }
-}
-
-function embed_flash(bgcolor, width, height, link, loop, type) {
- document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
-}
-
-function embed_flv(width, height, link, placeholder, loop, player) {
- document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>');
-}
+ if (!$xml_is_sane)
+ {
+ return false;
+ }
+ }
-function embed_wmedia(width, height, link) {
- document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
-}
- <?php
+ if (isset($_GET[$this->javascript]))
+ {
+ SimplePie_Misc::output_javascript();
exit;
}
@@ -1383,7 +1544,7 @@ function embed_wmedia(width, height, link) {
// Decide whether to enable caching
if ($this->cache && $parsed_feed_url['scheme'] !== '')
{
- $cache = new $this->cache_class($this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc');
+ $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc');
}
// If it's enabled and we don't want an XML dump, use the cache
if ($cache && !$this->xml_dump)
@@ -1393,13 +1554,13 @@ function embed_wmedia(width, height, link) {
if (!empty($this->data))
{
// If the cache is for an outdated build of SimplePie
- if (!isset($this->data['build']) || $this->data['build'] != SIMPLEPIE_BUILD)
+ if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD)
{
$cache->unlink();
$this->data = array();
}
// If we've hit a collision just rerun it with caching disabled
- elseif (isset($this->data['url']) && $this->data['url'] != $this->feed_url)
+ elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url)
{
$cache = false;
$this->data = array();
@@ -1411,7 +1572,7 @@ function embed_wmedia(width, height, link) {
if ($cache->mtime() + $this->autodiscovery_cache_duration > time())
{
// Do not need to do feed autodiscovery yet.
- if ($this->data['feed_url'] == $this->data['url'])
+ if ($this->data['feed_url'] === $this->data['url'])
{
$cache->unlink();
$this->data = array();
@@ -1436,12 +1597,12 @@ function embed_wmedia(width, height, link) {
}
if (isset($this->data['headers']['etag']))
{
- $headers['if-none-match'] = $this->data['headers']['etag'];
+ $headers['if-none-match'] = '"' . $this->data['headers']['etag'] . '"';
}
$file = new $this->file_class($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen);
if ($file->success)
{
- if ($file->status_code == 304)
+ if ($file->status_code === 304)
{
$cache->touch();
return true;
@@ -1473,7 +1634,7 @@ function embed_wmedia(width, height, link) {
// If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.
if (!isset($file))
{
- if (SimplePie_Misc::is_a($this->file, 'SimplePie_File') && $this->file->url == $this->feed_url)
+ if (is_a($this->file, 'SimplePie_File') && $this->file->url === $this->feed_url)
{
$file =& $this->file;
}
@@ -1483,7 +1644,7 @@ function embed_wmedia(width, height, link) {
}
}
// If the file connection has an error, set SimplePie::error to that and quit
- if (!$file->success)
+ if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
{
$this->error = $file->error;
if (!empty($this->data))
@@ -1496,148 +1657,150 @@ function embed_wmedia(width, height, link) {
}
}
- // Check if the supplied URL is a feed, if it isn't, look for it.
- $locate = new $this->locator_class($file, $this->timeout, $this->useragent, $this->file_class, $this->max_checked_feeds);
- if (!$locate->is_feed($file))
+ if (!$this->force_feed)
{
- // We need to unset this so that if SimplePie::set_file() has been called that object is untouched
- unset($file);
- if ($file = $locate->find($this->autodiscovery))
+ // Check if the supplied URL is a feed, if it isn't, look for it.
+ $locate = new $this->locator_class($file, $this->timeout, $this->useragent, $this->file_class, $this->max_checked_feeds, $this->content_type_sniffer_class);
+ if (!$locate->is_feed($file))
{
- if ($cache)
+ // We need to unset this so that if SimplePie::set_file() has been called that object is untouched
+ unset($file);
+ if ($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))
{
- if (!$cache->save(array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD)))
+ if ($cache)
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
+ $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD);
+ if (!$cache->save($this))
+ {
+ trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
+ $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc');
}
- $cache = new $this->cache_class($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc');
+ $this->feed_url = $file->url;
+ }
+ else
+ {
+ $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed.";
+ SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
+ return false;
}
- $this->feed_url = $file->url;
- }
- else
- {
- $this->error = "A feed could not be found at $this->feed_url";
- SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
- return false;
}
+ $locate = null;
}
- $locate = null;
$headers = $file->headers;
- $data = trim($file->body);
- unset($file);
+ $data = $file->body;
+ $sniffer = new $this->content_type_sniffer_class($file);
+ $sniffed = $sniffer->get_type();
}
else
{
$data = $this->raw_data;
}
+ // Set up array of possible encodings
+ $encodings = array();
+
// First check to see if input has been overridden.
if ($this->input_encoding !== false)
{
- $encoding = $this->input_encoding;
- }
- // Second try HTTP headers
- elseif (isset($headers['content-type']) && preg_match('/;[\x09\x20]*charset=([^;]*)/i', $headers['content-type'], $charset))
- {
- $encoding = $charset[1];
- }
- // Then prolog, if at the very start of the document
- elseif (preg_match("/^<\?xml[\x20\x9\xD\xA]+version([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"1.0\"|'1.0'|\"1.1\"|'1.1')[\x20\x9\xD\xA]+encoding([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"[A-Za-z][A-Za-z0-9._\-]*\"|'[A-Za-z][A-Za-z0-9._\-]*')([\x20\x9\xD\xA]+standalone([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"(yes|no)\"|'(yes|no)'))?([\x20\x9\xD\xA]+)?\?>/", $data, $prolog))
- {
- $encoding = substr($prolog[6], 1, -1);
- }
- // UTF-32 Big Endian BOM
- elseif (strpos($data, "\x0\x0\xFE\xFF") === 0)
- {
- $encoding = 'UTF-32be';
- }
- // UTF-32 Little Endian BOM
- elseif (strpos($data, "\xFF\xFE\x0\x0") === 0)
- {
- $encoding = 'UTF-32';
- }
- // UTF-16 Big Endian BOM
- elseif (strpos($data, "\xFE\xFF") === 0)
- {
- $encoding = 'UTF-16be';
- }
- // UTF-16 Little Endian BOM
- elseif (strpos($data, "\xFF\xFE") === 0)
- {
- $encoding = 'UTF-16le';
- }
- // UTF-8 BOM
- elseif (strpos($data, "\xEF\xBB\xBF") === 0)
- {
- $encoding = 'UTF-8';
- }
- // Fallback to the default (US-ASCII for text/xml, ISO-8859-1 for text/* MIME types, UTF-8 otherwise)
- elseif (isset($headers['content-type']) && strtolower(SimplePie_Misc::parse_mime($headers['content-type'])) == 'text/xml')
- {
- $encoding = 'US-ASCII';
- }
- elseif (isset($headers['content-type']) && SimplePie_Misc::stripos(SimplePie_Misc::parse_mime($headers['content-type']), 'text/') === 0)
- {
- $encoding = 'ISO-8859-1';
- }
- else
- {
- $encoding = 'UTF-8';
+ $encodings[] = $this->input_encoding;
}
- // Change the encoding to UTF-8 (as we always use UTF-8 internally)
- if ($encoding != 'UTF-8')
+ $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity');
+ $text_types = array('text/xml', 'text/xml-external-parsed-entity');
+
+ // RFC 3023 (only applies to sniffed content)
+ if (isset($sniffed))
{
- $data = SimplePie_Misc::change_encoding($data, $encoding, 'UTF-8');
+ if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml')
+ {
+ if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset))
+ {
+ $encodings[] = strtoupper($charset[1]);
+ }
+ $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data));
+ $encodings[] = 'UTF-8';
+ }
+ elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml')
+ {
+ if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset))
+ {
+ $encodings[] = $charset[1];
+ }
+ $encodings[] = 'US-ASCII';
+ }
+ // Text MIME-type default
+ elseif (substr($sniffed, 0, 5) === 'text/')
+ {
+ $encodings[] = 'US-ASCII';
+ }
}
- // Strip illegal characters
- $data = SimplePie_Misc::utf8_bad_replace($data);
+ // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1
+ $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data));
+ $encodings[] = 'UTF-8';
+ $encodings[] = 'ISO-8859-1';
+
+ // There's no point in trying an encoding twice
+ $encodings = array_unique($encodings);
- $parser = new $this->parser_class();
- $parser->pre_process($data, 'UTF-8');
- // If we want the XML, just output that and quit
+ // If we want the XML, just output that with the most likely encoding and quit
if ($this->xml_dump)
{
- header('Content-type: text/xml; charset=UTF-8');
+ header('Content-type: text/xml; charset=' . $encodings[0]);
echo $data;
exit;
}
- // If it's parsed fine
- elseif ($parser->parse($data))
+
+ // Loop through each possible encoding, till we return something, or run out of possibilities
+ foreach ($encodings as $encoding)
{
- unset($data);
- $this->data = $parser->get_data();
- if (isset($this->data['child']))
+ // Change the encoding to UTF-8 (as we always use UTF-8 internally)
+ if ($utf8_data = SimplePie_Misc::change_encoding($data, $encoding, 'UTF-8'))
{
- if (isset($headers))
- {
- $this->data['headers'] = $headers;
- }
- $this->data['build'] = SIMPLEPIE_BUILD;
+ // Create new parser
+ $parser = new $this->parser_class();
- // Cache the file if caching is enabled
- if ($cache && !$cache->save($this->data))
+ // If it's parsed fine
+ if ($parser->parse($utf8_data, 'UTF-8'))
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
+ $this->data = $parser->get_data();
+ if ($this->get_type() & ~SIMPLEPIE_TYPE_NONE)
+ {
+ if (isset($headers))
+ {
+ $this->data['headers'] = $headers;
+ }
+ $this->data['build'] = SIMPLEPIE_BUILD;
+
+ // Cache the file if caching is enabled
+ if ($cache && !$cache->save($this))
+ {
+ trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
+ return true;
+ }
+ else
+ {
+ $this->error = "A feed could not be found at $this->feed_url. This does not appear to be a valid RSS or Atom feed.";
+ SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
+ return false;
+ }
}
- return true;
- }
- else
- {
- $this->error = "A feed could not be found at $this->feed_url";
- SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
- return false;
}
}
- // If we have an error, just set SimplePie::error to it and quit
+ if (isset($parser))
+ {
+ // We have an error, just set SimplePie_Misc::error to it and quit
+ $this->error = sprintf('This XML document is invalid, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
+ }
else
{
- $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
- SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
- return false;
+ $this->error = 'The data could not be converted to UTF-8. You MUST have either the iconv or mbstring extension installed. Upgrading to PHP 5.x (which includes iconv) is highly recommended.';
}
+ SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
+ return false;
}
elseif (!empty($this->multifeed_url))
{
@@ -1730,18 +1893,18 @@ function embed_wmedia(width, height, link) {
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_090;
}
}
- elseif (isset($this->data['child']['']['rss']))
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss']))
{
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL;
- if (isset($this->data['child']['']['rss'][0]['attribs']['']['version']))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
{
- switch (trim($this->data['child']['']['rss'][0]['attribs']['']['version']))
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
{
case '0.91':
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091;
- if (isset($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data']))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
{
- switch (trim($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data']))
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
{
case '0':
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE;
@@ -1783,6 +1946,7 @@ function embed_wmedia(width, height, link) {
/**
* Returns the URL for the favicon of the feed's website.
*
+ * @todo Cache atom:icon
* @access public
* @since 1.0
*/
@@ -1798,26 +1962,36 @@ function embed_wmedia(width, height, link) {
if ($this->cache && $this->favicon_handler)
{
- $cache = new $this->cache_class($this->cache_location, call_user_func($this->cache_name_function, $favicon), 'spi');
+ $favicon_filename = call_user_func($this->cache_name_function, $favicon);
+ $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, $favicon_filename, 'spi');
if ($cache->load())
{
- return $this->sanitize($this->favicon_handler . rawurlencode($favicon), SIMPLEPIE_CONSTRUCT_IRI);
+ return $this->sanitize($this->favicon_handler . $favicon_filename, SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
$file = new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
- if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
+ if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
{
- if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
+ $sniffer = new $this->content_type_sniffer_class($file);
+ if (substr($sniffer->get_type(), 0, 6) === 'image/')
{
- return $this->sanitize($this->favicon_handler . rawurlencode($favicon), SIMPLEPIE_CONSTRUCT_IRI);
+ if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
+ {
+ return $this->sanitize($this->favicon_handler . $favicon_filename, SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ else
+ {
+ trigger_error("$cache->name is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI);
+ }
}
+ // not an image
else
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
- return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI);
+ return false;
}
}
}
@@ -1863,7 +2037,7 @@ function embed_wmedia(width, height, link) {
{
if ($this->feed_url !== null)
{
- return 'outlook' . $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI);
+ return $this->sanitize('outlook' . SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
@@ -1908,12 +2082,12 @@ function embed_wmedia(width, height, link) {
{
if ($this->subscribe_url())
{
- $return = $this->sanitize($feed_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->subscribe_url());
+ $return = $feed_url . rawurlencode($this->feed_url);
if ($site_url !== null && $this->get_link() !== null)
{
- $return .= $this->sanitize($site_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_link());
+ $return .= $site_url . rawurlencode($this->get_link());
}
- return $return;
+ return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
@@ -1928,7 +2102,7 @@ function embed_wmedia(width, height, link) {
function subscribe_bloglines()
{
- return urldecode($this->subscribe_service('http://www.bloglines.com/sub/'));
+ return $this->subscribe_service('http://www.bloglines.com/sub/');
}
function subscribe_eskobo()
@@ -2022,9 +2196,9 @@ function embed_wmedia(width, height, link) {
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if (isset($this->data['child']['']['rss'][0]['child'][$namespace][$tag]))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))
{
- return $this->data['child']['']['rss'][0]['child'][$namespace][$tag];
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag];
}
}
return null;
@@ -2062,7 +2236,7 @@ function embed_wmedia(width, height, link) {
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if ($channel = $this->get_feed_tags('', 'channel'))
+ if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))
{
if (isset($channel[0]['child'][$namespace][$tag]))
{
@@ -2098,7 +2272,7 @@ function embed_wmedia(width, height, link) {
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if ($image = $this->get_channel_tags('', 'image'))
+ if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image'))
{
if (isset($image[0]['child'][$namespace][$tag]))
{
@@ -2119,10 +2293,6 @@ function embed_wmedia(width, height, link) {
{
return $this->get_link();
}
- elseif (isset($this->data['headers']['content-location']))
- {
- return SimplePie_Misc::absolutize_url($this->data['headers']['content-location'], $this->subscribe_url());
- }
else
{
return $this->subscribe_url();
@@ -2152,7 +2322,7 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'title'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
@@ -2170,6 +2340,230 @@ function embed_wmedia(width, height, link) {
}
}
+ function get_category($key = 0)
+ {
+ $categories = $this->get_categories();
+ if (isset($categories[$key]))
+ {
+ return $categories[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_categories()
+ {
+ $categories = array();
+
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['attribs']['']['term']))
+ {
+ $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = new $this->category_class($term, $scheme, $label);
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
+ {
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = new $this->category_class($term, $scheme, null);
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
+ {
+ $categories[] = new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
+ {
+ $categories[] = new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+
+ if (!empty($categories))
+ {
+ return SimplePie_Misc::array_unique($categories);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_author($key = 0)
+ {
+ $authors = $this->get_authors();
+ if (isset($authors[$key]))
+ {
+ return $authors[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_authors()
+ {
+ $authors = array();
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $authors[] = new $this->author_class($name, $uri, $email);
+ }
+ }
+ if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $authors[] = new $this->author_class($name, $url, $email);
+ }
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
+ {
+ $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
+ {
+ $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
+ {
+ $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+
+ if (!empty($authors))
+ {
+ return SimplePie_Misc::array_unique($authors);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = new $this->author_class($name, $uri, $email);
+ }
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = new $this->author_class($name, $url, $email);
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return SimplePie_Misc::array_unique($contributors);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
function get_link($key = 0, $rel = 'alternate')
{
$links = $this->get_links($rel);
@@ -2227,7 +2621,7 @@ function embed_wmedia(width, height, link) {
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_channel_tags('', 'link'))
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
@@ -2247,7 +2641,7 @@ function embed_wmedia(width, height, link) {
$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
}
}
- elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
{
$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
}
@@ -2265,6 +2659,11 @@ function embed_wmedia(width, height, link) {
}
}
+ function get_all_discovered_feeds()
+ {
+ return $this->all_discovered_feeds;
+ }
+
function get_description()
{
if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
@@ -2283,9 +2682,9 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'description'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
{
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
}
elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
{
@@ -2315,7 +2714,11 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'copyright'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
@@ -2335,7 +2738,7 @@ function embed_wmedia(width, height, link) {
function get_language()
{
- if ($return = $this->get_channel_tags('', 'language'))
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
@@ -2371,11 +2774,12 @@ function embed_wmedia(width, height, link) {
function get_latitude()
{
+
if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
{
return (float) $return[0]['data'];
}
- elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match))
+ elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
{
return (float) $match[1];
}
@@ -2395,7 +2799,7 @@ function embed_wmedia(width, height, link) {
{
return (float) $return[0]['data'];
}
- elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match))
+ elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
{
return (float) $match[2];
}
@@ -2415,7 +2819,7 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- elseif ($return = $this->get_image_tags('', 'title'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
@@ -2455,7 +2859,7 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
- elseif ($return = $this->get_image_tags('', 'url'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
@@ -2475,7 +2879,7 @@ function embed_wmedia(width, height, link) {
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
- elseif ($return = $this->get_image_tags('', 'link'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
@@ -2487,11 +2891,11 @@ function embed_wmedia(width, height, link) {
function get_image_width()
{
- if ($return = $this->get_image_tags('', 'width'))
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))
{
return round($return[0]['data']);
}
- elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url'))
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return 88.0;
}
@@ -2503,11 +2907,11 @@ function embed_wmedia(width, height, link) {
function get_image_height()
{
- if ($return = $this->get_image_tags('', 'height'))
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height'))
{
return round($return[0]['data']);
}
- elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url'))
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return 31.0;
}
@@ -2519,8 +2923,9 @@ function embed_wmedia(width, height, link) {
function get_item_quantity($max = 0)
{
+ $max = (int) $max;
$qty = count($this->get_items());
- if ($max == 0)
+ if ($max === 0)
{
return $qty;
}
@@ -2545,50 +2950,54 @@ function embed_wmedia(width, height, link) {
function get_items($start = 0, $end = 0)
{
- if (!empty($this->multifeed_objects))
+ if (!isset($this->data['items']))
{
- return SimplePie::merge_items($this->multifeed_objects, $start, $end);
- }
- elseif (!isset($this->data['items']))
- {
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
+ if (!empty($this->multifeed_objects))
{
- $keys = array_keys($items);
- foreach ($keys as $key)
- {
- $this->data['items'][] = new $this->item_class($this, $items[$key]);
- }
+ $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);
}
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
+ else
{
- $keys = array_keys($items);
- foreach ($keys as $key)
+ $this->data['items'] = array();
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
{
- $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
{
- $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
{
- $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_channel_tags('', 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
{
- $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ }
+ }
+ if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = new $this->item_class($this, $items[$key]);
+ }
}
}
}
@@ -2596,7 +3005,7 @@ function embed_wmedia(width, height, link) {
if (!empty($this->data['items']))
{
// If we want to order it by date, check if all items have a date, and then sort it
- if ($this->order_by_date)
+ if ($this->order_by_date && empty($this->multifeed_objects))
{
if (!isset($this->data['ordered_items']))
{
@@ -2624,7 +3033,7 @@ function embed_wmedia(width, height, link) {
}
// Slice the data as desired
- if ($end == 0)
+ if ($end === 0)
{
return array_slice($items, $start);
}
@@ -2639,21 +3048,27 @@ function embed_wmedia(width, height, link) {
}
}
+ /**
+ * @static
+ */
function sort_items($a, $b)
{
return $a->get_date('U') <= $b->get_date('U');
}
- function merge_items($urls, $start = 0, $end = 0)
+ /**
+ * @static
+ */
+ function merge_items($urls, $start = 0, $end = 0, $limit = 0)
{
if (is_array($urls) && sizeof($urls) > 0)
{
$items = array();
foreach ($urls as $arg)
{
- if (SimplePie_Misc::is_a($arg, 'SimplePie'))
+ if (is_a($arg, 'SimplePie'))
{
- $items = array_merge($items, $arg->get_items());
+ $items = array_merge($items, $arg->get_items(0, $limit));
}
else
{
@@ -2676,7 +3091,7 @@ function embed_wmedia(width, height, link) {
usort($items, array('SimplePie', 'sort_items'));
}
- if ($end == 0)
+ if ($end === 0)
{
return array_slice($items, $start);
}
@@ -2709,6 +3124,17 @@ class SimplePie_Item
return md5(serialize($this->data));
}
+ /**
+ * Remove items that link back to this before destroying this object
+ */
+ function __destruct()
+ {
+ if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
+ {
+ unset($this->feed);
+ }
+ }
+
function get_item_tags($namespace, $tag)
{
if (isset($this->data['child'][$namespace][$tag]))
@@ -2738,78 +3164,85 @@ class SimplePie_Item
function get_id($hash = false)
{
- if ($hash)
+ if (!$hash)
{
- return $this->__toString();
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif ($return = $this->get_item_tags('', 'guid'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif (($return = $this->get_permalink()) !== null)
- {
- return $return;
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (($return = $this->get_permalink()) !== null)
+ {
+ return $return;
+ }
+ elseif (($return = $this->get_title()) !== null)
+ {
+ return $return;
+ }
}
- elseif (($return = $this->get_title()) !== null)
+ if ($this->get_permalink() !== null || $this->get_title() !== null)
{
- return $return;
+ return md5($this->get_permalink() . $this->get_title());
}
else
{
- return $this->__toString();
+ return md5(serialize($this->data));
}
}
function get_title()
{
- if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
- {
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
- {
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
- }
- elseif ($return = $this->get_item_tags('', 'title'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
- {
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
+ if (!isset($this->data['title']))
{
- return null;
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $this->data['title'] = null;
+ }
}
+ return $this->data['title'];
}
function get_description($description_only = false)
@@ -2826,7 +3259,7 @@ class SimplePie_Item
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_item_tags('', 'description'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
}
@@ -2916,9 +3349,20 @@ class SimplePie_Item
}
$categories[] = new $this->feed->category_class($term, $scheme, $label);
}
- foreach ((array) $this->get_item_tags('', 'category') as $category)
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
- $categories[] = new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = new $this->feed->category_class($term, $scheme, null);
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
@@ -2952,9 +3396,77 @@ class SimplePie_Item
}
}
- /**
- * @todo Atom inheritance (item author, source author, feed author)
- */
+ function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = new $this->feed->author_class($name, $uri, $email);
+ }
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = new $this->feed->author_class($name, $url, $email);
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return SimplePie_Misc::array_unique($contributors);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
function get_authors()
{
$authors = array();
@@ -2991,18 +3503,18 @@ class SimplePie_Item
}
if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
{
- $uri = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
}
if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
{
$email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- if ($name !== null || $email !== null || $uri !== null)
+ if ($name !== null || $email !== null || $url !== null)
{
$authors[] = new $this->feed->author_class($name, $url, $email);
}
}
- if ($author = $this->get_item_tags('', 'author'))
+ if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))
{
$authors[] = new $this->feed->author_class(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
}
@@ -3023,6 +3535,34 @@ class SimplePie_Item
{
return SimplePie_Misc::array_unique($authors);
}
+ elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
+ {
+ return $authors;
+ }
+ elseif ($authors = $this->feed->get_authors())
+ {
+ return $authors;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_copyright()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
else
{
return null;
@@ -3053,7 +3593,7 @@ class SimplePie_Item
{
$this->data['date']['raw'] = $return[0]['data'];
}
- elseif ($return = $this->get_item_tags('', 'pubDate'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
{
$this->data['date']['raw'] = $return[0]['data'];
}
@@ -3068,7 +3608,8 @@ class SimplePie_Item
if (!empty($this->data['date']['raw']))
{
- $this->data['date']['parsed'] = SimplePie_Misc::parse_date($this->data['date']['raw']);
+ $parser = SimplePie_Parse_Date::get();
+ $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
}
else
{
@@ -3173,13 +3714,13 @@ class SimplePie_Item
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_item_tags('', 'link'))
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_item_tags('', 'guid'))
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
{
- if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) == 'true')
+ if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
@@ -3200,7 +3741,7 @@ class SimplePie_Item
$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
}
}
- elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
{
$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
}
@@ -3241,7 +3782,6 @@ class SimplePie_Item
* At this point, we're pretty much assuming that all enclosures for an item are the same content. Anything else is too complicated to properly support.
*
* @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4).
- * @todo Add support for itunes: tags. These should be relatively simple compared to media:.
* @todo If an element exists at a level, but it's value is empty, we should fall back to the value from the parent (if it exists).
*/
function get_enclosures()
@@ -3767,7 +4307,7 @@ class SimplePie_Item
$restriction_relationship = 'allow';
$restriction_type = null;
$restriction_value = 'itunes';
- if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes')
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
{
$restriction_relationship = 'deny';
}
@@ -3803,7 +4343,7 @@ class SimplePie_Item
$restriction_relationship = 'allow';
$restriction_type = null;
$restriction_value = 'itunes';
- if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes')
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
{
$restriction_relationship = 'deny';
}
@@ -3856,624 +4396,657 @@ class SimplePie_Item
// Clear the memory
unset($parent);
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
// If we have media:group tags, loop through them.
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)
{
- // If we have media:content tags, loop through them.
- foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
+ if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
{
- if (isset($content['attribs']['']['url']))
+ // If we have media:content tags, loop through them.
+ foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
{
- // Attributes
- $bitrate = null;
- $channels = null;
- $duration = null;
- $expression = null;
- $framerate = null;
- $height = null;
- $javascript = null;
- $lang = null;
- $length = null;
- $medium = null;
- $samplingrate = null;
- $type = null;
- $url = null;
- $width = null;
-
- // Elements
- $captions = null;
- $categories = null;
- $copyrights = null;
- $credits = null;
- $description = null;
- $hashes = null;
- $keywords = null;
- $player = null;
- $ratings = null;
- $restrictions = null;
- $thumbnails = null;
- $title = null;
-
- // Start checking the attributes of media:content
- if (isset($content['attribs']['']['bitrate']))
- {
- $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['channels']))
+ if (isset($content['attribs']['']['url']))
{
- $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['duration']))
- {
- $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
- {
- $duration = $duration_parent;
- }
- if (isset($content['attribs']['']['expression']))
- {
- $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['framerate']))
- {
- $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['height']))
- {
- $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['lang']))
- {
- $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['fileSize']))
- {
- $length = ceil($content['attribs']['']['fileSize']);
- }
- if (isset($content['attribs']['']['medium']))
- {
- $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['samplingrate']))
- {
- $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['type']))
- {
- $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($content['attribs']['']['width']))
- {
- $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
+ // Start checking the attributes of media:content
+ if (isset($content['attribs']['']['bitrate']))
+ {
+ $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['channels']))
+ {
+ $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['duration']))
+ {
+ $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $duration = $duration_parent;
+ }
+ if (isset($content['attribs']['']['expression']))
+ {
+ $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['framerate']))
+ {
+ $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['height']))
+ {
+ $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['lang']))
+ {
+ $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['fileSize']))
+ {
+ $length = ceil($content['attribs']['']['fileSize']);
+ }
+ if (isset($content['attribs']['']['medium']))
+ {
+ $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['samplingrate']))
+ {
+ $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['type']))
+ {
+ $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['width']))
+ {
+ $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
- // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
+ // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
- // CAPTIONS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
+ // CAPTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
{
- $caption_type = null;
- $caption_lang = null;
- $caption_startTime = null;
- $caption_endTime = null;
- $caption_text = null;
- if (isset($caption['attribs']['']['type']))
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
{
- $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($caption['attribs']['']['lang']))
- {
- $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
}
- if (isset($caption['attribs']['']['start']))
+ if (is_array($captions))
{
- $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $captions = array_values(SimplePie_Misc::array_unique($captions));
}
- if (isset($caption['attribs']['']['end']))
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
{
- $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
}
- if (isset($caption['data']))
+ if (is_array($captions))
{
- $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $captions = array_values(SimplePie_Misc::array_unique($captions));
}
- $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
}
- if (is_array($captions))
+ else
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = $captions_parent;
}
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
+
+ // CATEGORIES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
{
- $caption_type = null;
- $caption_lang = null;
- $caption_startTime = null;
- $caption_endTime = null;
- $caption_text = null;
- if (isset($caption['attribs']['']['type']))
- {
- $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($caption['attribs']['']['lang']))
- {
- $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($caption['attribs']['']['start']))
- {
- $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($caption['attribs']['']['end']))
+ foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
{
- $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = new $this->feed->category_class($term, $scheme, $label);
}
- if (isset($caption['data']))
+ }
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
+ {
+ foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
{
- $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = new $this->feed->category_class($term, $scheme, $label);
}
- $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
}
- if (is_array($captions))
+ if (is_array($categories) && is_array($categories_parent))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
+ }
+ elseif (is_array($categories))
+ {
+ $categories = array_values(SimplePie_Misc::array_unique($categories));
+ }
+ elseif (is_array($categories_parent))
+ {
+ $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
}
- }
- else
- {
- $captions = $captions_parent;
- }
- // CATEGORIES
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
- {
- foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
+ // COPYRIGHTS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
{
- $term = null;
- $scheme = null;
- $label = null;
- if (isset($category['data']))
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
{
- $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- if (isset($category['attribs']['']['scheme']))
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
{
- $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- else
+ $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
{
- $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ $copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- if (isset($category['attribs']['']['label']))
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
{
- $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
+ $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
}
- }
- if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
- {
- foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
+ else
{
- $term = null;
- $scheme = null;
- $label = null;
- if (isset($category['data']))
+ $copyrights = $copyrights_parent;
+ }
+
+ // CREDITS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
{
- $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
}
- if (isset($category['attribs']['']['scheme']))
+ if (is_array($credits))
{
- $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $credits = array_values(SimplePie_Misc::array_unique($credits));
}
- else
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
{
- $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
}
- if (isset($category['attribs']['']['label']))
+ if (is_array($credits))
{
- $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $credits = array_values(SimplePie_Misc::array_unique($credits));
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
}
- }
- if (is_array($categories) && is_array($categories_parent))
- {
- $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
- }
- elseif (is_array($categories))
- {
- $categories = array_values(SimplePie_Misc::array_unique($categories));
- }
- elseif (is_array($categories_parent))
- {
- $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
- }
-
- // COPYRIGHTS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
- {
- $copyright_url = null;
- $copyright_label = null;
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
+ else
{
- $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $credits = $credits_parent;
}
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
+
+ // DESCRIPTION
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
{
- $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
- {
- $copyright_url = null;
- $copyright_label = null;
- if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
{
- $copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
+ else
{
- $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $description = $description_parent;
}
- $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
- }
- else
- {
- $copyrights = $copyrights_parent;
- }
- // CREDITS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
+ // HASHES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
{
- $credit_role = null;
- $credit_scheme = null;
- $credit_name = null;
- if (isset($credit['attribs']['']['role']))
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
{
- $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes[] = $algo.':'.$value;
}
- if (isset($credit['attribs']['']['scheme']))
+ if (is_array($hashes))
{
- $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $hashes = array_values(SimplePie_Misc::array_unique($hashes));
}
- else
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
{
- $credit_scheme = 'urn:ebu';
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes[] = $algo.':'.$value;
}
- if (isset($credit['data']))
+ if (is_array($hashes))
{
- $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $hashes = array_values(SimplePie_Misc::array_unique($hashes));
}
- $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
}
- if (is_array($credits))
+ else
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $hashes = $hashes_parent;
}
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
+
+ // KEYWORDS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
{
- $credit_role = null;
- $credit_scheme = null;
- $credit_name = null;
- if (isset($credit['attribs']['']['role']))
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
{
- $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords[] = trim($word);
+ }
+ unset($temp);
}
- if (isset($credit['attribs']['']['scheme']))
+ if (is_array($keywords))
{
- $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $keywords = array_values(SimplePie_Misc::array_unique($keywords));
}
- else
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
+ {
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
{
- $credit_scheme = 'urn:ebu';
+ $temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords[] = trim($word);
+ }
+ unset($temp);
}
- if (isset($credit['data']))
+ if (is_array($keywords))
{
- $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $keywords = array_values(SimplePie_Misc::array_unique($keywords));
}
- $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
}
- if (is_array($credits))
+ else
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $keywords = $keywords_parent;
}
- }
- else
- {
- $credits = $credits_parent;
- }
- // DESCRIPTION
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
- {
- $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
- {
- $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
- {
- $description = $description_parent;
- }
-
- // HASHES
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
+ // PLAYER
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
{
- $value = null;
- $algo = null;
- if (isset($hash['data']))
- {
- $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($hash['attribs']['']['algo']))
- {
- $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
- {
- $algo = 'md5';
- }
- $hashes[] = $algo.':'.$value;
+ $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
}
- if (is_array($hashes))
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
}
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
+ else
{
- $value = null;
- $algo = null;
- if (isset($hash['data']))
- {
- $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($hash['attribs']['']['algo']))
+ $player = $player_parent;
+ }
+
+ // RATINGS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
{
- $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
}
- else
+ if (is_array($ratings))
{
- $algo = 'md5';
+ $ratings = array_values(SimplePie_Misc::array_unique($ratings));
}
- $hashes[] = $algo.':'.$value;
}
- if (is_array($hashes))
- {
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
- }
- }
- else
- {
- $hashes = $hashes_parent;
- }
-
- // KEYWORDS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
- {
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
{
- $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
- foreach ($temp as $word)
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
{
- $keywords[] = trim($word);
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
}
- unset($temp);
- }
- if (is_array($keywords))
- {
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
- }
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
- {
- if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
- {
- $temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
- foreach ($temp as $word)
+ if (is_array($ratings))
{
- $keywords[] = trim($word);
+ $ratings = array_values(SimplePie_Misc::array_unique($ratings));
}
- unset($temp);
}
- if (is_array($keywords))
+ else
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $ratings = $ratings_parent;
}
- }
- else
- {
- $keywords = $keywords_parent;
- }
- // PLAYER
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
- {
- $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
- {
- $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
- }
- else
- {
- $player = $player_parent;
- }
-
- // RATINGS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
+ // RESTRICTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
{
- $rating_scheme = null;
- $rating_value = null;
- if (isset($rating['attribs']['']['scheme']))
- {
- $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
{
- $rating_scheme = 'urn:simple';
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
}
- if (isset($rating['data']))
+ if (is_array($restrictions))
{
- $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
}
- $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
}
- if (is_array($ratings))
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
- }
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
- {
- $rating_scheme = null;
- $rating_value = null;
- if (isset($rating['attribs']['']['scheme']))
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
{
- $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
- {
- $rating_scheme = 'urn:simple';
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
}
- if (isset($rating['data']))
+ if (is_array($restrictions))
{
- $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
}
- $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
}
- if (is_array($ratings))
+ else
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $restrictions = $restrictions_parent;
}
- }
- else
- {
- $ratings = $ratings_parent;
- }
- // RESTRICTIONS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
+ // THUMBNAILS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
{
- $restriction_relationship = null;
- $restriction_type = null;
- $restriction_value = null;
- if (isset($restriction['attribs']['']['relationship']))
- {
- $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- if (isset($restriction['attribs']['']['type']))
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
{
- $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
}
- if (isset($restriction['data']))
+ if (is_array($thumbnails))
{
- $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
}
- $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
- }
- if (is_array($restrictions))
- {
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
}
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
{
- $restriction_relationship = null;
- $restriction_type = null;
- $restriction_value = null;
- if (isset($restriction['attribs']['']['relationship']))
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
{
- $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
}
- if (isset($restriction['attribs']['']['type']))
+ if (is_array($thumbnails))
{
- $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
}
- if (isset($restriction['data']))
- {
- $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
}
- if (is_array($restrictions))
+ else
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $thumbnails = $thumbnails_parent;
}
- }
- else
- {
- $restrictions = $restrictions_parent;
- }
- // THUMBNAILS
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
- {
- foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
+ // TITLES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
{
- $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- if (is_array($thumbnails))
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- }
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
- {
- foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
+ else
{
- $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ $title = $title_parent;
}
- if (is_array($thumbnails))
- {
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
- }
- }
- else
- {
- $thumbnails = $thumbnails_parent;
- }
- // TITLES
- if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
- {
- $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);
}
- elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
- {
- $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
- }
- else
- {
- $title = $title_parent;
- }
-
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);
}
}
}
@@ -4884,7 +5457,7 @@ class SimplePie_Item
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
{
- if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure')
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
{
// Attributes
$bitrate = null;
@@ -4919,7 +5492,7 @@ class SimplePie_Item
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
{
- if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure')
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
{
// Attributes
$bitrate = null;
@@ -4952,7 +5525,7 @@ class SimplePie_Item
}
}
- if ($enclosure = $this->get_item_tags('', 'enclosure'))
+ if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))
{
if (isset($enclosure[0]['attribs']['']['url']))
{
@@ -4986,6 +5559,13 @@ class SimplePie_Item
$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
}
}
+
+ if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
+ {
+ // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
+ $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
+ }
+
$this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures']));
}
if (!empty($this->data['enclosures']))
@@ -5004,7 +5584,7 @@ class SimplePie_Item
{
return (float) $return[0]['data'];
}
- elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match))
+ elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
{
return (float) $match[1];
}
@@ -5024,7 +5604,7 @@ class SimplePie_Item
{
return (float) $return[0]['data'];
}
- elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match))
+ elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
{
return (float) $match[2];
}
@@ -5034,6 +5614,18 @@ class SimplePie_Item
}
}
+ function get_source()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))
+ {
+ return new $this->feed->source_class($this, $return[0]);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
/**
* Creates the add_to_* methods' return data
*
@@ -5043,16 +5635,20 @@ class SimplePie_Item
* (and suffix to the item permalink)
* @return mixed URL if feed exists, false otherwise
*/
- function add_to_service($item_url, $title_url = null)
+ function add_to_service($item_url, $title_url = null, $summary_url = null)
{
if ($this->get_permalink() !== null)
{
- $return = $this->sanitize($item_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_permalink());
+ $return = $item_url . rawurlencode($this->get_permalink());
if ($title_url !== null && $this->get_title() !== null)
{
- $return .= $this->sanitize($title_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_title());
+ $return .= $title_url . rawurlencode($this->get_title());
}
- return $return;
+ if ($summary_url !== null && $this->get_description() !== null)
+ {
+ $return .= $summary_url . rawurlencode($this->get_description());
+ }
+ return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
@@ -5072,12 +5668,12 @@ class SimplePie_Item
function add_to_delicious()
{
- return $this->add_to_service('http://del.icio.us/post/?v=3&url=', '&title=');
+ return $this->add_to_service('http://del.icio.us/post/?v=4&url=', '&title=');
}
function add_to_digg()
{
- return $this->add_to_service('http://digg.com/submit?phase=2&URL=');
+ return $this->add_to_service('http://digg.com/submit?url=', '&title=', '&bodytext=');
}
function add_to_furl()
@@ -5131,6 +5727,557 @@ class SimplePie_Item
}
}
+class SimplePie_Source
+{
+ var $item;
+ var $data = array();
+
+ function SimplePie_Source($item, $data)
+ {
+ $this->item = $item;
+ $this->data = $data;
+ }
+
+ function __toString()
+ {
+ return md5(serialize($this->data));
+ }
+
+ function get_source_tags($namespace, $tag)
+ {
+ if (isset($this->data['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][$namespace][$tag];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_base($element = array())
+ {
+ return $this->item->get_base($element);
+ }
+
+ function sanitize($data, $type, $base = '')
+ {
+ return $this->item->sanitize($data, $type, $base);
+ }
+
+ function get_item()
+ {
+ return $this->item;
+ }
+
+ function get_title()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_category($key = 0)
+ {
+ $categories = $this->get_categories();
+ if (isset($categories[$key]))
+ {
+ return $categories[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_categories()
+ {
+ $categories = array();
+
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['attribs']['']['term']))
+ {
+ $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = new $this->item->feed->category_class($term, $scheme, $label);
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
+ {
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = new $this->item->feed->category_class($term, $scheme, null);
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
+ {
+ $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
+ {
+ $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+
+ if (!empty($categories))
+ {
+ return SimplePie_Misc::array_unique($categories);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_author($key = 0)
+ {
+ $authors = $this->get_authors();
+ if (isset($authors[$key]))
+ {
+ return $authors[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_authors()
+ {
+ $authors = array();
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $authors[] = new $this->item->feed->author_class($name, $uri, $email);
+ }
+ }
+ if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $authors[] = new $this->item->feed->author_class($name, $url, $email);
+ }
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
+ {
+ $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
+ {
+ $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
+ {
+ $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ }
+
+ if (!empty($authors))
+ {
+ return SimplePie_Misc::array_unique($authors);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = new $this->item->feed->author_class($name, $uri, $email);
+ }
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = new $this->item->feed->author_class($name, $url, $email);
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return SimplePie_Misc::array_unique($contributors);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_link($key = 0, $rel = 'alternate')
+ {
+ $links = $this->get_links($rel);
+ if (isset($links[$key]))
+ {
+ return $links[$key];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Added for parity between the parent-level and the item/entry-level.
+ */
+ function get_permalink()
+ {
+ return $this->get_link(0);
+ }
+
+ function get_links($rel = 'alternate')
+ {
+ if (!isset($this->data['links']))
+ {
+ $this->data['links'] = array();
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ }
+ }
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+
+ }
+ }
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+
+ $keys = array_keys($this->data['links']);
+ foreach ($keys as $key)
+ {
+ if (SimplePie_Misc::is_isegment_nz_nc($key))
+ {
+ if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
+ $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
+ }
+ else
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
+ }
+ }
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ {
+ $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
+ }
+ $this->data['links'][$key] = array_unique($this->data['links'][$key]);
+ }
+ }
+
+ if (isset($this->data['links'][$rel]))
+ {
+ return $this->data['links'][$rel];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_description()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_copyright()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_language()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['xml_lang']))
+ {
+ return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_latitude()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[1];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_longitude()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[2];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ function get_image_url()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))
+ {
+ return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
+
class SimplePie_Author
{
var $name;
@@ -5851,11 +6998,11 @@ class SimplePie_Enclosure
$mime = $mime[0];
// Process values for 'auto'
- if ($width == 'auto')
+ if ($width === 'auto')
{
- if ($mime == 'video')
+ if ($mime === 'video')
{
- if ($height == 'auto')
+ if ($height === 'auto')
{
$width = 480;
}
@@ -5874,15 +7021,15 @@ class SimplePie_Enclosure
}
}
- if ($height == 'auto')
+ if ($height === 'auto')
{
- if ($mime == 'audio')
+ if ($mime === 'audio')
{
$height = 0;
}
- elseif ($mime == 'video')
+ elseif ($mime === 'video')
{
- if ($width == 'auto')
+ if ($width === 'auto')
{
if ($widescreen)
{
@@ -5907,17 +7054,17 @@ class SimplePie_Enclosure
$height = 376;
}
}
- elseif ($mime == 'audio')
+ elseif ($mime === 'audio')
{
$height = 0;
}
// Set proper placeholder value
- if ($mime == 'audio')
+ if ($mime === 'audio')
{
$placeholder = $audio;
}
- elseif ($mime == 'video')
+ elseif ($mime === 'video')
{
$placeholder = $video;
}
@@ -5936,7 +7083,7 @@ class SimplePie_Enclosure
}
// Odeo Feed MP3's
- if ($handler == 'odeo')
+ if ($handler === 'odeo')
{
if ($native)
{
@@ -5949,7 +7096,7 @@ class SimplePie_Enclosure
}
// Flash
- elseif ($handler == 'flash')
+ elseif ($handler === 'flash')
{
if ($native)
{
@@ -5963,7 +7110,7 @@ class SimplePie_Enclosure
// Flash Media Player file types.
// Preferred handler for MP3 file types.
- elseif ($handler == 'fmedia' || ($handler == 'mp3' && $mediaplayer != ''))
+ elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
{
$height += 20;
if ($native)
@@ -5978,15 +7125,17 @@ class SimplePie_Enclosure
// QuickTime 7 file types. Need to test with QuickTime 6.
// Only handle MP3's if the Flash Media Player is not present.
- elseif ($handler == 'quicktime' || ($handler == 'mp3' && $mediaplayer == ''))
+ elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
{
$height += 16;
if ($native)
{
- if ($placeholder != ""){
+ if ($placeholder !== '')
+ {
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
- else {
+ else
+ {
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
}
@@ -5997,7 +7146,7 @@ class SimplePie_Enclosure
}
// Windows Media
- elseif ($handler == 'wmedia')
+ elseif ($handler === 'wmedia')
{
$height += 45;
if ($native)
@@ -6019,14 +7168,14 @@ class SimplePie_Enclosure
function get_real_type($find_handler = false)
{
// If it's Odeo, let's get it out of the way.
- if (substr(strtolower($this->get_link()), 0, 15) == 'http://odeo.com')
+ if (substr(strtolower($this->get_link()), 0, 15) === 'http://odeo.com')
{
return 'odeo';
}
// Mime-types by handler.
$types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash
- $types_fmedia = array('video/flv', 'video/x-flv'); // Flash Media Player
+ $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player
$types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime
$types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media
$types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3
@@ -6236,9 +7385,9 @@ class SimplePie_Caption
function get_language()
{
- if ($this->language !== null)
+ if ($this->lang !== null)
{
- return $this->language;
+ return $this->lang;
}
else
{
@@ -6496,7 +7645,7 @@ class SimplePie_File
var $status_code;
var $redirects = 0;
var $error;
- var $method;
+ var $method = SIMPLEPIE_FILE_SOURCE_NONE;
function SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
{
@@ -6519,9 +7668,9 @@ class SimplePie_File
{
$headers = array();
}
- if (!$force_fsockopen && extension_loaded('curl'))
+ if (!$force_fsockopen && function_exists('curl_exec'))
{
- $this->method = 'curl';
+ $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL;
$fp = curl_init();
$headers2 = array();
foreach ($headers as $key => $value)
@@ -6547,7 +7696,7 @@ class SimplePie_File
}
$this->headers = curl_exec($fp);
- if (curl_errno($fp) == 23 || curl_errno($fp) == 61)
+ if (curl_errno($fp) === 23 || curl_errno($fp) === 61)
{
curl_setopt($fp, CURLOPT_ENCODING, 'none');
$this->headers = curl_exec($fp);
@@ -6569,17 +7718,10 @@ class SimplePie_File
$this->headers = $parser->headers;
$this->body = $parser->body;
$this->status_code = $parser->status_code;
- if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
{
$this->redirects++;
- if (isset($this->headers['content-location']))
- {
- $location = SimplePie_Misc::absolutize_url($this->headers['location'], SimplePie_Misc::absolutize_url($this->headers['content-location'], $url));
- }
- else
- {
- $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
- }
+ $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);
}
}
@@ -6587,9 +7729,9 @@ class SimplePie_File
}
else
{
- $this->method = 'fsockopen';
+ $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;
$url_parts = parse_url($url);
- if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) == 'https')
+ if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')
{
$url_parts['host'] = "ssl://$url_parts[host]";
$url_parts['port'] = 443;
@@ -6598,7 +7740,7 @@ class SimplePie_File
{
$url_parts['port'] = 80;
}
- $fp = fsockopen($url_parts['host'], $url_parts['port'], $errno, $errstr, $timeout);
+ $fp = @fsockopen($url_parts['host'], $url_parts['port'], $errno, $errstr, $timeout);
if (!$fp)
{
$this->error = 'fsockopen error: ' . $errstr;
@@ -6606,14 +7748,7 @@ class SimplePie_File
}
else
{
- if (function_exists('stream_set_timeout'))
- {
- stream_set_timeout($fp, $timeout);
- }
- else
- {
- socket_set_timeout($fp, $timeout);
- }
+ stream_set_timeout($fp, $timeout);
if (isset($url_parts['path']))
{
if (isset($url_parts['query']))
@@ -6632,9 +7767,9 @@ class SimplePie_File
$out = "GET $get HTTP/1.0\r\n";
$out .= "Host: $url_parts[host]\r\n";
$out .= "User-Agent: $useragent\r\n";
- if (function_exists('gzinflate'))
+ if (extension_loaded('zlib'))
{
- $out .= "Accept-Encoding: gzip,deflate\r\n";
+ $out .= "Accept-Encoding: x-gzip,gzip,deflate\r\n";
}
if (isset($url_parts['user']) && isset($url_parts['pass']))
@@ -6648,27 +7783,13 @@ class SimplePie_File
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
- if (function_exists('stream_get_meta_data'))
- {
- $info = stream_get_meta_data($fp);
- }
- else
- {
- $info = socket_get_status($fp);
- }
+ $info = stream_get_meta_data($fp);
$this->headers = '';
while (!$info['eof'] && !$info['timed_out'])
{
$this->headers .= fread($fp, 1160);
- if (function_exists('stream_get_meta_data'))
- {
- $info = stream_get_meta_data($fp);
- }
- else
- {
- $info = socket_get_status($fp);
- }
+ $info = stream_get_meta_data($fp);
}
if (!$info['timed_out'])
{
@@ -6678,26 +7799,47 @@ class SimplePie_File
$this->headers = $parser->headers;
$this->body = $parser->body;
$this->status_code = $parser->status_code;
- if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
{
$this->redirects++;
- if (isset($this->headers['content-location']))
- {
- $location = SimplePie_Misc::absolutize_url($this->headers['location'], SimplePie_Misc::absolutize_url($this->headers['content-location'], $url));
- }
- else
- {
- $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
- }
+ $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen);
}
- if (isset($this->headers['content-encoding']) && ($this->headers['content-encoding'] == 'gzip' || $this->headers['content-encoding'] == 'deflate'))
+ if (isset($this->headers['content-encoding']))
{
- if (substr($this->body, 0, 8) == "\x1f\x8b\x08\x00\x00\x00\x00\x00")
+ // Hey, we act dumb elsewhere, so let's do that here too
+ switch (strtolower(trim($this->headers['content-encoding'], "\x09\x0A\x0D\x20")))
{
- $this->body = substr($this->body, 10);
+ case 'gzip':
+ case 'x-gzip':
+ $decoder = new SimplePie_gzdecode($this->body);
+ if (!$decoder->parse())
+ {
+ $this->error = 'Unable to decode HTTP "gzip" stream';
+ $this->success = false;
+ }
+ else
+ {
+ $this->body = $decoder->data;
+ }
+ break;
+
+ case 'deflate':
+ if (($body = gzuncompress($this->body)) === false)
+ {
+ if (($body = gzinflate($this->body)) === false)
+ {
+ $this->error = 'Unable to decode HTTP "deflate" stream';
+ $this->success = false;
+ }
+ }
+ $this->body = $body;
+ break;
+
+ default:
+ $this->error = 'Unknown content coding';
+ $this->success = false;
}
- $this->body = gzinflate($this->body);
}
}
}
@@ -6710,33 +7852,15 @@ class SimplePie_File
}
}
}
- elseif (function_exists('file_get_contents'))
+ else
{
- $this->method = 'file_get_contents';
+ $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS;
if (!$this->body = file_get_contents($url))
{
$this->error = 'file_get_contents could not read the file';
$this->success = false;
}
}
- else
- {
- $this->method = 'fopen';
- if (($fp = fopen($url, 'rb')) === false)
- {
- $this->error = 'failed to open stream: No such file or directory';
- $this->success = false;
- }
- else
- {
- $this->body = '';
- while (!feof($fp))
- {
- $this->body .= fread($fp, 8192);
- }
- fclose($fp);
- }
- }
}
}
@@ -6744,7 +7868,6 @@ class SimplePie_File
* HTTP Response Parser
*
* @package SimplePie
- * @todo Support HTTP Requests
*/
class SimplePie_HTTP_Parser
{
@@ -6752,17 +7875,17 @@ class SimplePie_HTTP_Parser
* HTTP Version
*
* @access public
- * @var string
+ * @var float
*/
- var $http_version = '';
+ var $http_version = 0.0;
/**
* Status code
*
* @access public
- * @var string
+ * @var int
*/
- var $status_code = '';
+ var $status_code = 0;
/**
* Reason phrase
@@ -6794,7 +7917,7 @@ class SimplePie_HTTP_Parser
* @access private
* @var string
*/
- var $state = 'start';
+ var $state = 'http_version';
/**
* Input data
@@ -6815,8 +7938,8 @@ class SimplePie_HTTP_Parser
/**
* Current position of the pointer
*
- * @access private
* @var int
+ * @access private
*/
var $position = 0;
@@ -6856,13 +7979,13 @@ class SimplePie_HTTP_Parser
*/
function parse()
{
- while ($this->state && $this->state != 'emit' && $this->has_data())
+ while ($this->state && $this->state !== 'emit' && $this->has_data())
{
$state = $this->state;
$this->$state();
}
$this->data = '';
- if ($this->state == 'emit')
+ if ($this->state === 'emit' || $this->state === 'body')
{
return true;
}
@@ -6870,6 +7993,7 @@ class SimplePie_HTTP_Parser
{
$this->http_version = '';
$this->status_code = '';
+ $this->reason = '';
$this->headers = array();
$this->body = '';
return false;
@@ -6895,92 +8019,133 @@ class SimplePie_HTTP_Parser
*/
function is_linear_whitespace()
{
- return (bool) (strspn($this->data, "\x09\x20", $this->position, 1)
- || (substr($this->data, $this->position, 2) == "\r\n" && strspn($this->data, "\x09\x20", $this->position + 2, 1))
- || (strspn($this->data, "\r\n", $this->position, 1) && strspn($this->data, "\x09\x20", $this->position + 1, 1)));
+ return (bool) ($this->data[$this->position] === "\x09"
+ || $this->data[$this->position] === "\x20"
+ || ($this->data[$this->position] === "\x0A"
+ && isset($this->data[$this->position + 1])
+ && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20")));
}
/**
- * The starting state of the state machine, see if the data is a response or request
+ * Parse the HTTP version
*
* @access private
*/
- function start()
+ function http_version()
{
- $this->state = 'http_version_response';
+ if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/')
+ {
+ $len = strspn($this->data, '0123456789.', 5);
+ $this->http_version = substr($this->data, 5, $len);
+ $this->position += 5 + $len;
+ if (substr_count($this->http_version, '.') <= 1)
+ {
+ $this->http_version = (float) $this->http_version;
+ $this->position += strspn($this->data, "\x09\x20", $this->position);
+ $this->state = 'status';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
}
/**
- * Parse an HTTP-version string
+ * Parse the status code
*
* @access private
*/
- function http_version()
+ function status()
{
- if (preg_match('/^HTTP\/([0-9]+\.[0-9]+)/i', substr($this->data, $this->position, strcspn($this->data, "\r\n", $this->position)), $match))
+ if ($len = strspn($this->data, '0123456789', $this->position))
{
- $this->position += strlen($match[0]);
- $this->http_version = $match[1];
- return true;
+ $this->status_code = (int) substr($this->data, $this->position, $len);
+ $this->position += $len;
+ $this->state = 'reason';
}
else
{
- return false;
+ $this->state = false;
}
}
/**
- * Parse LWS, replacing consecutive characters with a single space
+ * Parse the reason phrase
*
* @access private
*/
- function linear_whitespace()
+ function reason()
{
- do
- {
- if (substr($this->data, $this->position, 2) == "\r\n")
- {
- $this->position += 2;
- }
- elseif (strspn($this->data, "\r\n", $this->position, 1))
- {
- $this->position++;
- }
- $this->position += strspn($this->data, "\x09\x20", $this->position);
- } while ($this->is_linear_whitespace());
- $this->value .= "\x20";
+ $len = strcspn($this->data, "\x0A", $this->position);
+ $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20");
+ $this->position += $len + 1;
+ $this->state = 'new_line';
}
/**
- * Parse an HTTP-version string within a response
+ * Deal with a new line, shifting data around as needed
*
* @access private
*/
- function http_version_response()
+ function new_line()
{
- if ($this->http_version() && $this->data[$this->position] == "\x20")
+ $this->value = trim($this->value, "\x0D\x20");
+ if ($this->name !== '' && $this->value !== '')
+ {
+ $this->name = strtolower($this->name);
+ if (isset($this->headers[$this->name]))
+ {
+ $this->headers[$this->name] .= ', ' . $this->value;
+ }
+ else
+ {
+ $this->headers[$this->name] = $this->value;
+ }
+ }
+ $this->name = '';
+ $this->value = '';
+ if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A")
+ {
+ $this->position += 2;
+ $this->state = 'body';
+ }
+ elseif ($this->data[$this->position] === "\x0A")
{
- $this->state = 'status_code';
$this->position++;
+ $this->state = 'body';
}
else
{
- $this->state = false;
+ $this->state = 'name';
}
}
/**
- * Parse a status code
+ * Parse a header name
*
* @access private
*/
- function status_code()
+ function name()
{
- if (strspn($this->data, '1234567890', $this->position, 3) == 3)
+ $len = strcspn($this->data, "\x0A:", $this->position);
+ if (isset($this->data[$this->position + $len]))
{
- $this->status_code = substr($this->data, $this->position, 3);
- $this->state = 'reason_phrase';
- $this->position += 3;
+ if ($this->data[$this->position + $len] === "\x0A")
+ {
+ $this->position += $len;
+ $this->state = 'new_line';
+ }
+ else
+ {
+ $this->name = substr($this->data, $this->position, $len);
+ $this->position += $len + 1;
+ $this->state = 'value';
+ }
}
else
{
@@ -6989,80 +8154,56 @@ class SimplePie_HTTP_Parser
}
/**
- * Skip over the reason phrase (it has no normative value, and you can send absolutely anything here)
+ * Parse LWS, replacing consecutive LWS characters with a single space
*
* @access private
*/
- function reason_phrase()
+ function linear_whitespace()
{
- $len = strcspn($this->data, "\r\n", $this->position);
- $this->reason = substr($this->data, $this->position, $len);
- $this->position += $len;
- if ($this->has_data())
+ do
{
- if (substr($this->data, $this->position, 2) == "\r\n")
+ if (substr($this->data, $this->position, 2) === "\x0D\x0A")
{
$this->position += 2;
}
- elseif (strspn($this->data, "\r\n", $this->position, 1))
+ elseif ($this->data[$this->position] === "\x0A")
{
$this->position++;
}
- $this->state = 'name';
- }
- }
-
- /**
- * Parse a header name
- *
- * @access private
- */
- function name()
- {
- $len = strcspn($this->data, ':', $this->position);
- $this->name = substr($this->data, $this->position, $len);
- $this->position += $len;
-
- if ($this->has_data() && $this->data[$this->position] == ':')
- {
- $this->state = 'value_next';
- $this->position++;
- }
- else
- {
- $this->state = false;
- }
+ $this->position += strspn($this->data, "\x09\x20", $this->position);
+ } while ($this->has_data() && $this->is_linear_whitespace());
+ $this->value .= "\x20";
}
/**
- * See what state to move the state machine to while within non-quoted header values
+ * See what state to move to while within non-quoted header values
*
* @access private
*/
- function value_next()
+ function value()
{
if ($this->is_linear_whitespace())
{
- $this->state = 'value_linear_whitespace';
- }
- elseif ($this->data[$this->position] == '"')
- {
- $this->state = 'value_quote_next';
- $this->position++;
- }
- elseif (substr($this->data, $this->position, 2) == "\r\n")
- {
- $this->state = 'end_crlf';
- $this->position += 2;
- }
- elseif (strspn($this->data, "\r\n", $this->position, 1))
- {
- $this->state = 'end_crlf';
- $this->position++;
+ $this->linear_whitespace();
}
else
{
- $this->state = 'value_no_quote';
+ switch ($this->data[$this->position])
+ {
+ case '"':
+ $this->position++;
+ $this->state = 'quote';
+ break;
+
+ case "\x0A":
+ $this->position++;
+ $this->state = 'new_line';
+ break;
+
+ default:
+ $this->state = 'value_char';
+ break;
+ }
}
}
@@ -7071,52 +8212,46 @@ class SimplePie_HTTP_Parser
*
* @access private
*/
- function value_no_quote()
+ function value_char()
{
- $len = strcspn($this->data, "\x09\x20\r\n\"", $this->position);
+ $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position);
$this->value .= substr($this->data, $this->position, $len);
- $this->state = 'value_next';
$this->position += $len;
+ $this->state = 'value';
}
/**
- * Parse LWS outside quotes
- *
- * @access private
- */
- function value_linear_whitespace()
- {
- $this->linear_whitespace();
- $this->state = 'value_next';
- }
-
- /**
- * See what state to move the state machine to while within quoted header values
+ * See what state to move to while within quoted header values
*
* @access private
*/
- function value_quote_next()
+ function quote()
{
if ($this->is_linear_whitespace())
{
- $this->state = 'value_linear_whitespace_quote';
+ $this->linear_whitespace();
}
else
{
switch ($this->data[$this->position])
{
case '"':
- $this->state = 'value_next';
$this->position++;
+ $this->state = 'value';
+ break;
+
+ case "\x0A":
+ $this->position++;
+ $this->state = 'new_line';
break;
case '\\':
- $this->state = 'value_quote_char';
$this->position++;
+ $this->state = 'quote_escaped';
break;
default:
- $this->state = 'value_quote';
+ $this->state = 'quote_char';
break;
}
}
@@ -7127,12 +8262,12 @@ class SimplePie_HTTP_Parser
*
* @access private
*/
- function value_quote()
+ function quote_char()
{
- $len = strcspn($this->data, "\x09\x20\r\n\"\\", $this->position);
+ $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position);
$this->value .= substr($this->data, $this->position, $len);
$this->position += $len;
- $this->state = 'value_quote_next';
+ $this->state = 'value';
}
/**
@@ -7140,90 +8275,407 @@ class SimplePie_HTTP_Parser
*
* @access private
*/
- function value_quote_char()
+ function quote_escaped()
{
$this->value .= $this->data[$this->position];
- $this->state = 'value_quote_next';
$this->position++;
+ $this->state = 'quote';
}
/**
- * Parse LWS within quotes
+ * Parse the body
*
* @access private
*/
- function value_linear_whitespace_quote()
+ function body()
{
- $this->linear_whitespace();
- $this->state = 'value_quote_next';
+ $this->body = substr($this->data, $this->position);
+ $this->state = 'emit';
}
+}
+
+/**
+ * gzdecode
+ *
+ * @package SimplePie
+ */
+class SimplePie_gzdecode
+{
+ /**
+ * Compressed data
+ *
+ * @access private
+ * @see gzdecode::$data
+ */
+ var $compressed_data;
/**
- * Parse a CRLF, and see whether we have a further header, or whether we are followed by the body
+ * Size of compressed data
*
* @access private
*/
- function end_crlf()
+ var $compressed_size;
+
+ /**
+ * Minimum size of a valid gzip string
+ *
+ * @access private
+ */
+ var $min_compressed_size = 18;
+
+ /**
+ * Current position of pointer
+ *
+ * @access private
+ */
+ var $position = 0;
+
+ /**
+ * Flags (FLG)
+ *
+ * @access private
+ */
+ var $flags;
+
+ /**
+ * Uncompressed data
+ *
+ * @access public
+ * @see gzdecode::$compressed_data
+ */
+ var $data;
+
+ /**
+ * Modified time
+ *
+ * @access public
+ */
+ var $MTIME;
+
+ /**
+ * Extra Flags
+ *
+ * @access public
+ */
+ var $XFL;
+
+ /**
+ * Operating System
+ *
+ * @access public
+ */
+ var $OS;
+
+ /**
+ * Subfield ID 1
+ *
+ * @access public
+ * @see gzdecode::$extra_field
+ * @see gzdecode::$SI2
+ */
+ var $SI1;
+
+ /**
+ * Subfield ID 2
+ *
+ * @access public
+ * @see gzdecode::$extra_field
+ * @see gzdecode::$SI1
+ */
+ var $SI2;
+
+ /**
+ * Extra field content
+ *
+ * @access public
+ * @see gzdecode::$SI1
+ * @see gzdecode::$SI2
+ */
+ var $extra_field;
+
+ /**
+ * Original filename
+ *
+ * @access public
+ */
+ var $filename;
+
+ /**
+ * Human readable comment
+ *
+ * @access public
+ */
+ var $comment;
+
+ /**
+ * Don't allow anything to be set
+ *
+ * @access public
+ */
+ function __set($name, $value)
+ {
+ trigger_error("Cannot write property $name", E_USER_ERROR);
+ }
+
+ /**
+ * Set the compressed string and related properties
+ *
+ * @access public
+ */
+ function SimplePie_gzdecode($data)
{
- $this->name = strtolower($this->name);
- $this->value = trim($this->value, "\x20");
- if (isset($this->headers[$this->name]))
+ $this->compressed_data = $data;
+ $this->compressed_size = strlen($data);
+ }
+
+ /**
+ * Decode the GZIP stream
+ *
+ * @access public
+ */
+ function parse()
+ {
+ if ($this->compressed_size >= $this->min_compressed_size)
{
- $this->headers[$this->name] .= ', ' . $this->value;
+ // Check ID1, ID2, and CM
+ if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08")
+ {
+ return false;
+ }
+
+ // Get the FLG (FLaGs)
+ $this->flags = ord($this->compressed_data[3]);
+
+ // FLG bits above (1 << 4) are reserved
+ if ($this->flags > 0x1F)
+ {
+ return false;
+ }
+
+ // Advance the pointer after the above
+ $this->position += 4;
+
+ // MTIME
+ $mtime = substr($this->compressed_data, $this->position, 4);
+ // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness
+ if (current(unpack('S', "\x00\x01")) === 1)
+ {
+ $mtime = strrev($mtime);
+ }
+ $this->MTIME = current(unpack('l', $mtime));
+ $this->position += 4;
+
+ // Get the XFL (eXtra FLags)
+ $this->XFL = ord($this->compressed_data[$this->position++]);
+
+ // Get the OS (Operating System)
+ $this->OS = ord($this->compressed_data[$this->position++]);
+
+ // Parse the FEXTRA
+ if ($this->flags & 4)
+ {
+ // Read subfield IDs
+ $this->SI1 = $this->compressed_data[$this->position++];
+ $this->SI2 = $this->compressed_data[$this->position++];
+
+ // SI2 set to zero is reserved for future use
+ if ($this->SI2 === "\x00")
+ {
+ return false;
+ }
+
+ // Get the length of the extra field
+ $len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
+ $position += 2;
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 4;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the extra field to the given data
+ $this->extra_field = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FNAME
+ if ($this->flags & 8)
+ {
+ // Get the length of the filename
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 1;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the original filename to the given string
+ $this->filename = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len + 1;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FCOMMENT
+ if ($this->flags & 16)
+ {
+ // Get the length of the comment
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 1;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the original comment to the given string
+ $this->comment = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len + 1;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FHCRC
+ if ($this->flags & 2)
+ {
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 2;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Read the CRC
+ $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
+
+ // Check the CRC matches
+ if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)
+ {
+ $this->position += 2;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Decompress the actual data
+ if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false)
+ {
+ return false;
+ }
+ else
+ {
+ $this->position = $this->compressed_size - 8;
+ }
+
+ // Check CRC of data
+ $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
+ $this->position += 4;
+ /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
+ {
+ return false;
+ }*/
+
+ // Check ISIZE of data
+ $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
+ $this->position += 4;
+ if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
+ {
+ return false;
+ }
+
+ // Wow, against all odds, we've actually got a valid gzip string
+ return true;
}
else
{
- $this->headers[$this->name] = $this->value;
+ return false;
}
+ }
+}
- if (substr($this->data, $this->position, 2) == "\r\n")
- {
- $this->body = substr($this->data, $this->position + 2);
- $this->state = 'emit';
- }
- elseif (strspn($this->data, "\r\n", $this->position, 1))
- {
- $this->body = substr($this->data, $this->position + 1);
- $this->state = 'emit';
- }
- else
+class SimplePie_Cache
+{
+ /**
+ * Don't call the constructor. Please.
+ *
+ * @access private
+ */
+ function SimplePie_Cache()
+ {
+ trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR);
+ }
+
+ /**
+ * Create a new SimplePie_Cache object
+ *
+ * @static
+ * @access public
+ */
+ function create($location, $filename, $extension)
+ {
+ $location_iri = new SimplePie_IRI($location);
+ switch ($location_iri->get_scheme())
{
- $this->name = '';
- $this->value = '';
- $this->state = 'name';
+ case 'mysql':
+ if (extension_loaded('mysql'))
+ {
+ return new SimplePie_Cache_MySQL($location_iri, $filename, $extension);
+ }
+ break;
+
+ default:
+ return new SimplePie_Cache_File($location, $filename, $extension);
}
}
}
-class SimplePie_Cache
+class SimplePie_Cache_File
{
var $location;
var $filename;
var $extension;
var $name;
- function SimplePie_Cache($location, $filename, $extension)
+ function SimplePie_Cache_File($location, $filename, $extension)
{
$this->location = $location;
- $this->filename = rawurlencode($filename);
- $this->extension = rawurlencode($extension);
- $this->name = "$location/$this->filename.$this->extension";
+ $this->filename = $filename;
+ $this->extension = $extension;
+ $this->name = "$this->location/$this->filename.$this->extension";
}
function save($data)
{
if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location))
{
+ if (is_a($data, 'SimplePie'))
+ {
+ $data = $data->data;
+ }
+
+ $data = serialize($data);
+
if (function_exists('file_put_contents'))
{
- return (bool) file_put_contents($this->name, serialize($data));
+ return (bool) file_put_contents($this->name, $data);
}
else
{
$fp = fopen($this->name, 'wb');
if ($fp)
{
- fwrite($fp, serialize($data));
+ fwrite($fp, $data);
fclose($fp);
return true;
}
@@ -7236,20 +8688,7 @@ class SimplePie_Cache
{
if (file_exists($this->name) && is_readable($this->name))
{
- if (function_exists('file_get_contents'))
- {
- return unserialize(file_get_contents($this->name));
- }
- elseif (($fp = fopen($this->name, 'rb')) !== false)
- {
- $data = '';
- while (!feof($fp))
- {
- $data .= fread($fp, 8192);
- }
- fclose($fp);
- return unserialize($data);
- }
+ return unserialize(file_get_contents($this->name));
}
return false;
}
@@ -7282,121 +8721,398 @@ class SimplePie_Cache
}
}
-class SimplePie_Misc
+class SimplePie_Cache_DB
{
- function time_hms($seconds)
+ function prepare_simplepie_object_for_cache($data)
{
- $time = '';
+ $items = $data->get_items();
+ $items_by_id = array();
- $hours = floor($seconds / 3600);
- $remainder = $seconds % 3600;
- if ($hours > 0)
+ if (!empty($items))
{
- $time .= $hours.':';
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id()] = $item;
+ }
+
+ if (count($items_by_id) !== count($items))
+ {
+ $items_by_id = array();
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id(true)] = $item;
+ }
+ }
+
+ if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];
+ }
+ else
+ {
+ $channel = null;
+ }
+
+ if ($channel !== null)
+ {
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']);
+ }
+ }
+ if (isset($data->data['items']))
+ {
+ unset($data->data['items']);
+ }
+ if (isset($data->data['ordered_items']))
+ {
+ unset($data->data['ordered_items']);
+ }
}
+ return array(serialize($data->data), $items_by_id);
+ }
+}
- $minutes = floor($remainder / 60);
- $seconds = $remainder % 60;
- if ($minutes < 10 && $hours > 0)
+class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
+{
+ var $mysql;
+ var $options;
+ var $id;
+
+ function SimplePie_Cache_MySQL($mysql_location, $name, $extension)
+ {
+ $host = $mysql_location->get_host();
+ if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')')
{
- $minutes = '0' . $minutes;
+ $server = ':' . substr($host, 5, -1);
}
- if ($seconds < 10)
+ else
{
- $seconds = '0' . $seconds;
+ $server = $host;
+ if ($mysql_location->get_port() !== null)
+ {
+ $server .= ':' . $mysql_location->get_port();
+ }
}
- $time .= $minutes.':';
- $time .= $seconds;
+ if (strpos($mysql_location->get_userinfo(), ':') !== false)
+ {
+ list($username, $password) = explode(':', $mysql_location->get_userinfo(), 2);
+ }
+ else
+ {
+ $username = $mysql_location->get_userinfo();
+ $password = null;
+ }
- return $time;
+ if ($this->mysql = mysql_connect($server, $username, $password))
+ {
+ $this->id = $name . $extension;
+ $this->options = SimplePie_Misc::parse_str($mysql_location->get_query());
+ if (!isset($this->options['prefix'][0]))
+ {
+ $this->options['prefix'][0] = '';
+ }
+
+ if (mysql_select_db(ltrim($mysql_location->get_path(), '/'))
+ && mysql_query('SET NAMES utf8')
+ && ($query = mysql_unbuffered_query('SHOW TABLES')))
+ {
+ $db = array();
+ while ($row = mysql_fetch_row($query))
+ {
+ $db[] = $row[0];
+ }
+
+ if (!in_array($this->options['prefix'][0] . 'cache_data', $db))
+ {
+ if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'))
+ {
+ $this->mysql = null;
+ }
+ }
+
+ if (!in_array($this->options['prefix'][0] . 'items', $db))
+ {
+ if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'))
+ {
+ $this->mysql = null;
+ }
+ }
+ }
+ else
+ {
+ $this->mysql = null;
+ }
+ }
}
- function absolutize_url($relative, $base)
+ function save($data)
{
- if ($relative !== '')
+ if ($this->mysql)
{
- $relative = SimplePie_Misc::parse_url($relative);
- if ($relative['scheme'] !== '')
- {
- $target = $relative;
- }
- elseif ($base !== '')
+ $feed_id = "'" . mysql_real_escape_string($this->id) . "'";
+
+ if (is_a($data, 'SimplePie'))
{
- $base = SimplePie_Misc::parse_url($base);
- $target = SimplePie_Misc::parse_url('');
- if ($relative['authority'] !== '')
+ if (SIMPLEPIE_PHP5)
{
- $target = $relative;
- $target['scheme'] = $base['scheme'];
+ // This keyword needs to defy coding standards for PHP4 compatibility
+ $data = clone($data);
}
- else
+
+ $prepared = $this->prepare_simplepie_object_for_cache($data);
+
+ if ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql))
{
- $target['scheme'] = $base['scheme'];
- $target['authority'] = $base['authority'];
- if ($relative['path'] !== '')
+ if (mysql_num_rows($query))
{
- if (strpos($relative['path'], '/') === 0)
- {
- $target['path'] = $relative['path'];
- }
- elseif (($target['path'] = dirname("$base[path].")) == '/')
+ $items = count($prepared[1]);
+ if ($items)
{
- $target['path'] .= $relative['path'];
+ $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = ' . $items . ', `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id;
}
else
{
- $target['path'] .= '/' . $relative['path'];
+ $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id;
}
- if ($relative['query'] !== '')
+
+ if (!mysql_query($sql, $this->mysql))
{
- $target['query'] = $relative['query'];
+ return false;
}
}
- else
+ elseif (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(' . $feed_id . ', ' . count($prepared[1]) . ', \'' . mysql_real_escape_string($prepared[0]) . '\', ' . time() . ')', $this->mysql))
{
- if ($base['path'] !== '')
- {
- $target['path'] = $base['path'];
- }
- else
- {
- $target['path'] = '/';
- }
- if ($relative['query'] !== '')
+ return false;
+ }
+
+ $ids = array_keys($prepared[1]);
+ if (!empty($ids))
+ {
+ foreach ($ids as $id)
{
- $target['query'] = $relative['query'];
+ $database_ids[] = mysql_real_escape_string($id);
}
- elseif ($base['query'] !== '')
+
+ if ($query = mysql_unbuffered_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'items` WHERE `id` = \'' . implode('\' OR `id` = \'', $database_ids) . '\' AND `feed_id` = ' . $feed_id, $this->mysql))
{
- $target['query'] = $base['query'];
+ $existing_ids = array();
+ while ($row = mysql_fetch_row($query))
+ {
+ $existing_ids[] = $row[0];
+ }
+
+ $new_ids = array_diff($ids, $existing_ids);
+
+ foreach ($new_ids as $new_id)
+ {
+ if (!($date = $prepared[1][$new_id]->get_date('U')))
+ {
+ $date = time();
+ }
+
+ if (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(' . $feed_id . ', \'' . mysql_real_escape_string($new_id) . '\', \'' . mysql_real_escape_string(serialize($prepared[1][$new_id]->data)) . '\', ' . $date . ')', $this->mysql))
+ {
+ return false;
+ }
+ }
+ return true;
}
}
+ else
+ {
+ return true;
+ }
+ }
+ }
+ elseif ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql))
+ {
+ if (mysql_num_rows($query))
+ {
+ if (mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = 0, `data` = \'' . mysql_real_escape_string(serialize($data)) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id, $this->mysql))
+ {
+ return true;
+ }
}
- if ($relative['fragment'] !== '')
+ elseif (mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(\'' . mysql_real_escape_string($this->id) . '\', 0, \'' . mysql_real_escape_string(serialize($data)) . '\', ' . time() . ')', $this->mysql))
{
- $target['fragment'] = $relative['fragment'];
+ return true;
}
}
+ }
+ return false;
+ }
+
+ function load()
+ {
+ if ($this->mysql && ($query = mysql_query('SELECT `items`, `data` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query)))
+ {
+ $data = unserialize($row[1]);
+
+ if (isset($this->options['items'][0]))
+ {
+ $items = (int) $this->options['items'][0];
+ }
else
{
- // No base URL, just return the relative URL
- $target = $relative;
+ $items = (int) $row[0];
+ }
+
+ if ($items !== 0)
+ {
+ if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
+ }
+ else
+ {
+ $feed = null;
+ }
+
+ if ($feed !== null)
+ {
+ $sql = 'SELECT `data` FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . '\' ORDER BY `posted` DESC';
+ if ($items > 0)
+ {
+ $sql .= ' LIMIT ' . $items;
+ }
+
+ if ($query = mysql_unbuffered_query($sql, $this->mysql))
+ {
+ while ($row = mysql_fetch_row($query))
+ {
+ $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row[0]);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
}
- $return = SimplePie_Misc::compress_parse_url($target['scheme'], $target['authority'], $target['path'], $target['query'], $target['fragment']);
+ return $data;
+ }
+ return false;
+ }
+
+ function mtime()
+ {
+ if ($this->mysql && ($query = mysql_query('SELECT `mtime` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query)))
+ {
+ return $row[0];
}
else
{
- $return = $base;
+ return false;
}
- $return = SimplePie_Misc::normalize_url($return);
- return $return;
+ }
+
+ function touch()
+ {
+ if ($this->mysql && ($query = mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `mtime` = ' . time() . ' WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && mysql_affected_rows($this->mysql))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function unlink()
+ {
+ if ($this->mysql && ($query = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($query2 = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
+
+class SimplePie_Misc
+{
+ function time_hms($seconds)
+ {
+ $time = '';
+
+ $hours = floor($seconds / 3600);
+ $remainder = $seconds % 3600;
+ if ($hours > 0)
+ {
+ $time .= $hours.':';
+ }
+
+ $minutes = floor($remainder / 60);
+ $seconds = $remainder % 60;
+ if ($minutes < 10 && $hours > 0)
+ {
+ $minutes = '0' . $minutes;
+ }
+ if ($seconds < 10)
+ {
+ $seconds = '0' . $seconds;
+ }
+
+ $time .= $minutes.':';
+ $time .= $seconds;
+
+ return $time;
+ }
+
+ function absolutize_url($relative, $base)
+ {
+ $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
+ return $iri->get_iri();
}
function remove_dot_segments($input)
{
$output = '';
- while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input == '.' || $input == '..')
+ while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
{
// A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
if (strpos($input, '../') === 0)
@@ -7412,7 +9128,7 @@ class SimplePie_Misc
{
$input = substr_replace($input, '/', 0, 3);
}
- elseif ($input == '/.')
+ elseif ($input === '/.')
{
$input = '/';
}
@@ -7422,13 +9138,13 @@ class SimplePie_Misc
$input = substr_replace($input, '/', 0, 4);
$output = substr_replace($output, '', strrpos($output, '/'));
}
- elseif ($input == '/..')
+ elseif ($input === '/..')
{
$input = '/';
$output = substr_replace($output, '', strrpos($output, '/'));
}
// D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
- elseif ($input == '.' || $input == '..')
+ elseif ($input === '.' || $input === '..')
{
$input = '';
}
@@ -7468,11 +9184,11 @@ class SimplePie_Misc
$return[$i]['content'] = $matches[$i][4][0];
}
$return[$i]['attribs'] = array();
- if (isset($matches[$i][2][0]) && preg_match_all('/((?:[^\s:]+:)?[^\s:]+)(?:\s*=\s*(?:"([^"]*)"|\'([^\']*)\'|([a-z0-9\-._:]*)))?\s/U', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
+ if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
{
for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
{
- if (count($attribs[$j]) == 2)
+ if (count($attribs[$j]) === 2)
{
$attribs[$j][2] = $attribs[$j][1];
}
@@ -7505,22 +9221,42 @@ class SimplePie_Misc
function error($message, $level, $file, $line)
{
- switch ($level)
+ if ((ini_get('error_reporting') & $level) > 0)
{
- case E_USER_ERROR:
- $note = 'PHP Error';
- break;
- case E_USER_WARNING:
- $note = 'PHP Warning';
- break;
- case E_USER_NOTICE:
- $note = 'PHP Notice';
- break;
- default:
- $note = 'Unknown Error';
- break;
+ switch ($level)
+ {
+ case E_USER_ERROR:
+ $note = 'PHP Error';
+ break;
+ case E_USER_WARNING:
+ $note = 'PHP Warning';
+ break;
+ case E_USER_NOTICE:
+ $note = 'PHP Notice';
+ break;
+ default:
+ $note = 'Unknown Error';
+ break;
+ }
+
+ $log_error = true;
+ if (!function_exists('error_log'))
+ {
+ $log_error = false;
+ }
+
+ $log_file = @ini_get('error_log');
+ if (!empty($log_file) && ('syslog' != $log_file) && !@is_writable($log_file))
+ {
+ $log_error = false;
+ }
+
+ if ($log_error)
+ {
+ @error_log("$note: $message in $file on line $line", 0);
+ }
}
- error_log("$note: $message in $file on line $line", 0);
+
return $message;
}
@@ -7543,16 +9279,23 @@ class SimplePie_Misc
* @param str $cache_class Name of the cache-handling class being used
* in SimplePie. Defaults to 'SimplePie_Cache', and should be left
* as-is unless you've overloaded the class.
- * @param str $cache_name_function Function that converts the filename
- * for saving. Defaults to 'md5'.
+ * @param str $cache_name_function Obsolete. Exists for backwards
+ * compatibility reasons only.
*/
function display_cached_file($identifier_url, $cache_location = './cache', $cache_extension = 'spc', $cache_class = 'SimplePie_Cache', $cache_name_function = 'md5')
{
- $cache = new $cache_class($cache_location, call_user_func($cache_name_function, $identifier_url), $cache_extension);
+ $cache = call_user_func(array($cache_class, 'create'), $cache_location, $identifier_url, $cache_extension);
if ($file = $cache->load())
{
- header('Content-type:' . $file['headers']['content-type']);
+ if (isset($file['headers']['content-type']))
+ {
+ header('Content-type:' . $file['headers']['content-type']);
+ }
+ else
+ {
+ header('Content-type: application/octet-stream');
+ }
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
echo $file['body'];
exit;
@@ -7565,7 +9308,7 @@ class SimplePie_Misc
{
$url = SimplePie_Misc::normalize_url($url);
$parsed = SimplePie_Misc::parse_url($url);
- if ($parsed['scheme'] !== '' && $parsed['scheme'] != 'http' && $parsed['scheme'] != 'https')
+ if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
{
return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);
}
@@ -7575,15 +9318,15 @@ class SimplePie_Misc
return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);
}
- if ($http == 2 && $parsed['scheme'] !== '')
+ if ($http === 2 && $parsed['scheme'] !== '')
{
return "feed:$url";
}
- elseif ($http == 3 && strtolower($parsed['scheme']) == 'http')
+ elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
{
return substr_replace($url, 'podcast', 0, 4);
}
- elseif ($http == 4 && strtolower($parsed['scheme']) == 'http')
+ elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
{
return substr_replace($url, 'itpc', 0, 4);
}
@@ -7595,68 +9338,37 @@ class SimplePie_Misc
function parse_url($url)
{
- static $cache = array();
- if (isset($cache[$url]))
- {
- return $cache[$url];
- }
- elseif (preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match))
- {
- for ($i = count($match); $i <= 9; $i++)
- {
- $match[$i] = '';
- }
- return $cache[$url] = array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
- }
- else
- {
- return $cache[$url] = array('scheme' => '', 'authority' => '', 'path' => '', 'query' => '', 'fragment' => '');
- }
+ $iri = new SimplePie_IRI($url);
+ return array(
+ 'scheme' => (string) $iri->get_scheme(),
+ 'authority' => (string) $iri->get_authority(),
+ 'path' => (string) $iri->get_path(),
+ 'query' => (string) $iri->get_query(),
+ 'fragment' => (string) $iri->get_fragment()
+ );
}
function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
{
- $return = '';
- if ($scheme !== '')
- {
- $return .= "$scheme:";
- }
- if ($authority !== '')
- {
- $return .= "//$authority";
- }
- if ($path !== '')
- {
- $return .= $path;
- }
- if ($query !== '')
- {
- $return .= "?$query";
- }
- if ($fragment !== '')
- {
- $return .= "#$fragment";
- }
- return $return;
+ $iri = new SimplePie_IRI('');
+ $iri->set_scheme($scheme);
+ $iri->set_authority($authority);
+ $iri->set_path($path);
+ $iri->set_query($query);
+ $iri->set_fragment($fragment);
+ return $iri->get_iri();
}
function normalize_url($url)
{
- $url = preg_replace_callback('/%([0-9A-Fa-f]{2})/', array('SimplePie_Misc', 'percent_encoding_normalization'), $url);
- $url = SimplePie_Misc::parse_url($url);
- $url['scheme'] = strtolower($url['scheme']);
- if ($url['authority'] !== '')
- {
- $url['authority'] = strtolower($url['authority']);
- $url['path'] = SimplePie_Misc::remove_dot_segments($url['path']);
- }
- return SimplePie_Misc::compress_parse_url($url['scheme'], $url['authority'], $url['path'], $url['query'], $url['fragment']);
+ $iri = new SimplePie_IRI($url);
+ return $iri->get_iri();
}
function percent_encoding_normalization($match)
{
$integer = hexdec($match[1]);
- if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer == 0x2D || $integer == 0x2E || $integer == 0x5F || $integer == 0x7E)
+ if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
{
return chr($integer);
}
@@ -7679,16 +9391,15 @@ class SimplePie_Misc
*/
function utf8_bad_replace($str)
{
- if (function_exists('iconv'))
+ if (function_exists('iconv') && ($return = @iconv('UTF-8', 'UTF-8//IGNORE', $str)))
{
- $out = iconv('UTF-8', 'UTF-8//IGNORE', $str);
- if($out !== false) return $out;
+ return $return;
}
- if (function_exists('mb_convert_encoding'))
+ elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($str, 'UTF-8', 'UTF-8')))
{
- return mb_convert_encoding($str, 'UTF-8', 'UTF-8');
+ return $return;
}
- elseif (preg_match_all('/([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})/', $str, $matches))
+ elseif (preg_match_all('/(?:[\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})+/', $str, $matches))
{
return implode("\xEF\xBF\xBD", $matches[0]);
}
@@ -7702,1372 +9413,1375 @@ class SimplePie_Misc
}
}
+ /**
+ * Converts a Windows-1252 encoded string to a UTF-8 encoded string
+ *
+ * @static
+ * @access public
+ * @param string $string Windows-1252 encoded string
+ * @return string UTF-8 encoded string
+ */
+ function windows_1252_to_utf8($string)
+ {
+ static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF");
+
+ return strtr($string, $convert_table);
+ }
+
function change_encoding($data, $input, $output)
{
$input = SimplePie_Misc::encoding($input);
$output = SimplePie_Misc::encoding($output);
- if (function_exists('iconv') && ($return = @iconv($input, "$output//IGNORE", $data)))
+ // We fail to fail on non US-ASCII bytes
+ if ($input === 'US-ASCII')
{
- return $return;
+ static $non_ascii_octects = '';
+ if (!$non_ascii_octects)
+ {
+ for ($i = 0x80; $i <= 0xFF; $i++)
+ {
+ $non_ascii_octects .= chr($i);
+ }
+ }
+ $data = substr($data, 0, strcspn($data, $non_ascii_octects));
}
- elseif (function_exists('iconv') && ($return = @iconv($input, $output, $data)))
+
+ // This is first, as behaviour of this is completely predictable
+ if ($input === 'Windows-1252' && $output === 'UTF-8')
{
- return $return;
+ return SimplePie_Misc::windows_1252_to_utf8($data);
}
- elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($data, $output, $input)))
+ // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
+ elseif (function_exists('mb_convert_encoding') && @mb_convert_encoding("\x80", 'UTF-16BE', $input) !== "\x00\x80" && ($return = @mb_convert_encoding($data, $output, $input)))
{
return $return;
}
- elseif ($input == 'ISO-8859-1' && $output == 'UTF-8')
+ // This is last, as behaviour of this varies with OS userland and PHP version
+ elseif (function_exists('iconv') && ($return = @iconv($input, $output, $data)))
{
- return utf8_encode($data);
+ return $return;
}
- elseif ($input == 'UTF-8' && $output == 'ISO-8859-1')
+ // If we can't do anything, just fail
+ else
{
- return utf8_decode($data);
+ return false;
}
- return $data;
}
- function encoding($encoding)
+ function encoding($charset)
{
- // Character sets are case-insensitive (though we'll return them in the form given in their registration)
- switch (strtoupper($encoding))
+ // Normalization from UTS #22
+ switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
{
- case 'ANSI_X3.4-1968':
- case 'ISO-IR-6':
- case 'ANSI_X3.4-1986':
- case 'ISO_646.IRV:1991':
- case 'ASCII':
- case 'ISO646-US':
- case 'US-ASCII':
- case 'US':
- case 'IBM367':
- case 'CP367':
- case 'CSASCII':
- return 'US-ASCII';
-
- case 'ISO_8859-1:1987':
- case 'ISO-IR-100':
- case 'ISO_8859-1':
- case 'ISO-8859-1':
- case 'LATIN1':
- case 'L1':
- case 'IBM819':
- case 'CP819':
- case 'CSISOLATIN1':
- return 'ISO-8859-1';
-
- case 'ISO_8859-2:1987':
- case 'ISO-IR-101':
- case 'ISO_8859-2':
- case 'ISO-8859-2':
- case 'LATIN2':
- case 'L2':
- case 'CSISOLATIN2':
- return 'ISO-8859-2';
-
- case 'ISO_8859-3:1988':
- case 'ISO-IR-109':
- case 'ISO_8859-3':
- case 'ISO-8859-3':
- case 'LATIN3':
- case 'L3':
- case 'CSISOLATIN3':
- return 'ISO-8859-3';
+ case 'adobestandardencoding':
+ case 'csadobestandardencoding':
+ return 'Adobe-Standard-Encoding';
- case 'ISO_8859-4:1988':
- case 'ISO-IR-110':
- case 'ISO_8859-4':
- case 'ISO-8859-4':
- case 'LATIN4':
- case 'L4':
- case 'CSISOLATIN4':
- return 'ISO-8859-4';
+ case 'adobesymbolencoding':
+ case 'cshppsmath':
+ return 'Adobe-Symbol-Encoding';
- case 'ISO_8859-5:1988':
- case 'ISO-IR-144':
- case 'ISO_8859-5':
- case 'ISO-8859-5':
- case 'CYRILLIC':
- case 'CSISOLATINCYRILLIC':
- return 'ISO-8859-5';
+ case 'ami1251':
+ case 'amiga1251':
+ return 'Amiga-1251';
- case 'ISO_8859-6:1987':
- case 'ISO-IR-127':
- case 'ISO_8859-6':
- case 'ISO-8859-6':
- case 'ECMA-114':
- case 'ASMO-708':
- case 'ARABIC':
- case 'CSISOLATINARABIC':
- return 'ISO-8859-6';
+ case 'ansix31101983':
+ case 'csat5001983':
+ case 'csiso99naplps':
+ case 'isoir99':
+ case 'naplps':
+ return 'ANSI_X3.110-1983';
- case 'ISO_8859-7:1987':
- case 'ISO-IR-126':
- case 'ISO_8859-7':
- case 'ISO-8859-7':
- case 'ELOT_928':
- case 'ECMA-118':
- case 'GREEK':
- case 'GREEK8':
- case 'CSISOLATINGREEK':
- return 'ISO-8859-7';
+ case 'arabic7':
+ case 'asmo449':
+ case 'csiso89asmo449':
+ case 'iso9036':
+ case 'isoir89':
+ return 'ASMO_449';
- case 'ISO_8859-8:1988':
- case 'ISO-IR-138':
- case 'ISO_8859-8':
- case 'ISO-8859-8':
- case 'HEBREW':
- case 'CSISOLATINHEBREW':
- return 'ISO-8859-8';
+ case 'big5':
+ case 'csbig5':
+ case 'xxbig5':
+ return 'Big5';
- case 'ISO_8859-9:1989':
- case 'ISO-IR-148':
- case 'ISO_8859-9':
- case 'ISO-8859-9':
- case 'LATIN5':
- case 'L5':
- case 'CSISOLATIN5':
- return 'ISO-8859-9';
-
- case 'ISO-8859-10':
- case 'ISO-IR-157':
- case 'L6':
- case 'ISO_8859-10:1992':
- case 'CSISOLATIN6':
- case 'LATIN6':
- return 'ISO-8859-10';
+ case 'big5hkscs':
+ return 'Big5-HKSCS';
- case 'ISO_6937-2-ADD':
- case 'ISO-IR-142':
- case 'CSISOTEXTCOMM':
- return 'ISO_6937-2-add';
+ case 'bocu1':
+ case 'csbocu1':
+ return 'BOCU-1';
- case 'JIS_X0201':
- case 'X0201':
- case 'CSHALFWIDTHKATAKANA':
- return 'JIS_X0201';
+ case 'brf':
+ case 'csbrf':
+ return 'BRF';
- case 'JIS_ENCODING':
- case 'CSJISENCODING':
- return 'JIS_Encoding';
+ case 'bs4730':
+ case 'csiso4unitedkingdom':
+ case 'gb':
+ case 'iso646gb':
+ case 'isoir4':
+ case 'uk':
+ return 'BS_4730';
- case 'SHIFT_JIS':
- case 'MS_KANJI':
- case 'CSSHIFTJIS':
- return 'Shift_JIS';
+ case 'bsviewdata':
+ case 'csiso47bsviewdata':
+ case 'isoir47':
+ return 'BS_viewdata';
- case 'EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE':
- case 'CSEUCPKDFMTJAPANESE':
- case 'EUC-JP':
- return 'EUC-JP';
+ case 'cesu8':
+ case 'cscesu8':
+ return 'CESU-8';
- case 'EXTENDED_UNIX_CODE_FIXED_WIDTH_FOR_JAPANESE':
- case 'CSEUCFIXWIDJAPANESE':
- return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
+ case 'ca':
+ case 'csa71':
+ case 'csaz243419851':
+ case 'csiso121canadian1':
+ case 'iso646ca':
+ case 'isoir121':
+ return 'CSA_Z243.4-1985-1';
- case 'BS_4730':
- case 'ISO-IR-4':
- case 'ISO646-GB':
- case 'GB':
- case 'UK':
- case 'CSISO4UNITEDKINGDOM':
- return 'BS_4730';
+ case 'csa72':
+ case 'csaz243419852':
+ case 'csiso122canadian2':
+ case 'iso646ca2':
+ case 'isoir122':
+ return 'CSA_Z243.4-1985-2';
- case 'SEN_850200_C':
- case 'ISO-IR-11':
- case 'ISO646-SE2':
- case 'SE2':
- case 'CSISO11SWEDISHFORNAMES':
- return 'SEN_850200_C';
+ case 'csaz24341985gr':
+ case 'csiso123csaz24341985gr':
+ case 'isoir123':
+ return 'CSA_Z243.4-1985-gr';
- case 'IT':
- case 'ISO-IR-15':
- case 'ISO646-IT':
- case 'CSISO15ITALIAN':
- return 'IT';
+ case 'csiso139csn369103':
+ case 'csn369103':
+ case 'isoir139':
+ return 'CSN_369103';
- case 'ES':
- case 'ISO-IR-17':
- case 'ISO646-ES':
- case 'CSISO17SPANISH':
- return 'ES';
+ case 'csdecmcs':
+ case 'dec':
+ case 'decmcs':
+ return 'DEC-MCS';
- case 'DIN_66003':
- case 'ISO-IR-21':
- case 'DE':
- case 'ISO646-DE':
- case 'CSISO21GERMAN':
+ case 'csiso21german':
+ case 'de':
+ case 'din66003':
+ case 'iso646de':
+ case 'isoir21':
return 'DIN_66003';
- case 'NS_4551-1':
- case 'ISO-IR-60':
- case 'ISO646-NO':
- case 'NO':
- case 'CSISO60DANISHNORWEGIAN':
- case 'CSISO60NORWEGIAN1':
- return 'NS_4551-1';
+ case 'csdkus':
+ case 'dkus':
+ return 'dk-us';
- case 'NF_Z_62-010':
- case 'ISO-IR-69':
- case 'ISO646-FR':
- case 'FR':
- case 'CSISO69FRENCH':
- return 'NF_Z_62-010';
+ case 'csiso646danish':
+ case 'dk':
+ case 'ds2089':
+ case 'iso646dk':
+ return 'DS_2089';
- case 'ISO-10646-UTF-1':
- case 'CSISO10646UTF1':
- return 'ISO-10646-UTF-1';
+ case 'csibmebcdicatde':
+ case 'ebcdicatde':
+ return 'EBCDIC-AT-DE';
- case 'ISO_646.BASIC:1983':
- case 'REF':
- case 'CSISO646BASIC1983':
- return 'ISO_646.basic:1983';
+ case 'csebcdicatdea':
+ case 'ebcdicatdea':
+ return 'EBCDIC-AT-DE-A';
- case 'INVARIANT':
- case 'CSINVARIANT':
- return 'INVARIANT';
+ case 'csebcdiccafr':
+ case 'ebcdiccafr':
+ return 'EBCDIC-CA-FR';
- case 'ISO_646.IRV:1983':
- case 'ISO-IR-2':
- case 'IRV':
- case 'CSISO2INTLREFVERSION':
- return 'ISO_646.irv:1983';
+ case 'csebcdicdkno':
+ case 'ebcdicdkno':
+ return 'EBCDIC-DK-NO';
- case 'NATS-SEFI':
- case 'ISO-IR-8-1':
- case 'CSNATSSEFI':
- return 'NATS-SEFI';
+ case 'csebcdicdknoa':
+ case 'ebcdicdknoa':
+ return 'EBCDIC-DK-NO-A';
- case 'NATS-SEFI-ADD':
- case 'ISO-IR-8-2':
- case 'CSNATSSEFIADD':
- return 'NATS-SEFI-ADD';
+ case 'csebcdices':
+ case 'ebcdices':
+ return 'EBCDIC-ES';
- case 'NATS-DANO':
- case 'ISO-IR-9-1':
- case 'CSNATSDANO':
- return 'NATS-DANO';
+ case 'csebcdicesa':
+ case 'ebcdicesa':
+ return 'EBCDIC-ES-A';
- case 'NATS-DANO-ADD':
- case 'ISO-IR-9-2':
- case 'CSNATSDANOADD':
- return 'NATS-DANO-ADD';
+ case 'csebcdicess':
+ case 'ebcdicess':
+ return 'EBCDIC-ES-S';
- case 'SEN_850200_B':
- case 'ISO-IR-10':
- case 'FI':
- case 'ISO646-FI':
- case 'ISO646-SE':
- case 'SE':
- case 'CSISO10SWEDISH':
- return 'SEN_850200_B';
+ case 'csebcdicfise':
+ case 'ebcdicfise':
+ return 'EBCDIC-FI-SE';
- case 'KS_C_5601-1987':
- case 'ISO-IR-149':
- case 'KS_C_5601-1989':
- case 'KSC_5601':
- case 'KOREAN':
- case 'CSKSC56011987':
- return 'KS_C_5601-1987';
+ case 'csebcdicfisea':
+ case 'ebcdicfisea':
+ return 'EBCDIC-FI-SE-A';
- case 'ISO-2022-KR':
- case 'CSISO2022KR':
- return 'ISO-2022-KR';
+ case 'csebcdicfr':
+ case 'ebcdicfr':
+ return 'EBCDIC-FR';
- case 'EUC-KR':
- case 'CSEUCKR':
- return 'EUC-KR';
+ case 'csebcdicit':
+ case 'ebcdicit':
+ return 'EBCDIC-IT';
- case 'ISO-2022-JP':
- case 'CSISO2022JP':
- return 'ISO-2022-JP';
+ case 'csebcdicpt':
+ case 'ebcdicpt':
+ return 'EBCDIC-PT';
- case 'ISO-2022-JP-2':
- case 'CSISO2022JP2':
- return 'ISO-2022-JP-2';
+ case 'csebcdicuk':
+ case 'ebcdicuk':
+ return 'EBCDIC-UK';
- case 'JIS_C6220-1969-JP':
- case 'JIS_C6220-1969':
- case 'ISO-IR-13':
- case 'KATAKANA':
- case 'X0201-7':
- case 'CSISO13JISC6220JP':
- return 'JIS_C6220-1969-jp';
+ case 'csebcdicus':
+ case 'ebcdicus':
+ return 'EBCDIC-US';
- case 'JIS_C6220-1969-RO':
- case 'ISO-IR-14':
- case 'JP':
- case 'ISO646-JP':
- case 'CSISO14JISC6220RO':
- return 'JIS_C6220-1969-ro';
+ case 'csiso111ecmacyrillic':
+ case 'ecmacyrillic':
+ case 'isoir111':
+ case 'koi8e':
+ return 'ECMA-cyrillic';
- case 'PT':
- case 'ISO-IR-16':
- case 'ISO646-PT':
- case 'CSISO16PORTUGUESE':
- return 'PT';
+ case 'csiso17spanish':
+ case 'es':
+ case 'iso646es':
+ case 'isoir17':
+ return 'ES';
- case 'GREEK7-OLD':
- case 'ISO-IR-18':
- case 'CSISO18GREEK7OLD':
- return 'greek7-old';
+ case 'csiso85spanish2':
+ case 'es2':
+ case 'iso646es2':
+ case 'isoir85':
+ return 'ES2';
- case 'LATIN-GREEK':
- case 'ISO-IR-19':
- case 'CSISO19LATINGREEK':
- return 'latin-greek';
+ case 'cseucfixwidjapanese':
+ case 'extendedunixcodefixedwidthforjapanese':
+ return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
- case 'NF_Z_62-010_(1973)':
- case 'ISO-IR-25':
- case 'ISO646-FR1':
- case 'CSISO25FRENCH':
- return 'NF_Z_62-010_(1973)';
+ case 'cseucpkdfmtjapanese':
+ case 'eucjp':
+ case 'extendedunixcodepackedformatforjapanese':
+ return 'Extended_UNIX_Code_Packed_Format_for_Japanese';
- case 'LATIN-GREEK-1':
- case 'ISO-IR-27':
- case 'CSISO27LATINGREEK1':
- return 'Latin-greek-1';
+ case 'gb18030':
+ return 'GB18030';
- case 'ISO_5427':
- case 'ISO-IR-37':
- case 'CSISO5427CYRILLIC':
- return 'ISO_5427';
+ case 'chinese':
+ case 'cp936':
+ case 'csgb2312':
+ case 'csiso58gb231280':
+ case 'gb2312':
+ case 'gb231280':
+ case 'gbk':
+ case 'isoir58':
+ case 'ms936':
+ case 'windows936':
+ return 'GBK';
- case 'JIS_C6226-1978':
- case 'ISO-IR-42':
- case 'CSISO42JISC62261978':
- return 'JIS_C6226-1978';
+ case 'cn':
+ case 'csiso57gb1988':
+ case 'gb198880':
+ case 'iso646cn':
+ case 'isoir57':
+ return 'GB_1988-80';
- case 'BS_VIEWDATA':
- case 'ISO-IR-47':
- case 'CSISO47BSVIEWDATA':
- return 'BS_viewdata';
+ case 'csiso153gost1976874':
+ case 'gost1976874':
+ case 'isoir153':
+ case 'stsev35888':
+ return 'GOST_19768-74';
- case 'INIS':
- case 'ISO-IR-49':
- case 'CSISO49INIS':
- return 'INIS';
+ case 'csiso150':
+ case 'csiso150greekccitt':
+ case 'greekccitt':
+ case 'isoir150':
+ return 'greek-ccitt';
- case 'INIS-8':
- case 'ISO-IR-50':
- case 'CSISO50INIS8':
- return 'INIS-8';
+ case 'csiso88greek7':
+ case 'greek7':
+ case 'isoir88':
+ return 'greek7';
- case 'INIS-CYRILLIC':
- case 'ISO-IR-51':
- case 'CSISO51INISCYRILLIC':
- return 'INIS-cyrillic';
+ case 'csiso18greek7old':
+ case 'greek7old':
+ case 'isoir18':
+ return 'greek7-old';
- case 'ISO_5427:1981':
- case 'ISO-IR-54':
- case 'ISO5427CYRILLIC1981':
- return 'ISO_5427:1981';
+ case 'cshpdesktop':
+ case 'hpdesktop':
+ return 'HP-DeskTop';
- case 'ISO_5428:1980':
- case 'ISO-IR-55':
- case 'CSISO5428GREEK':
- return 'ISO_5428:1980';
+ case 'cshplegal':
+ case 'hplegal':
+ return 'HP-Legal';
- case 'GB_1988-80':
- case 'ISO-IR-57':
- case 'CN':
- case 'ISO646-CN':
- case 'CSISO57GB1988':
- return 'GB_1988-80';
+ case 'cshpmath8':
+ case 'hpmath8':
+ return 'HP-Math8';
- case 'GB_2312-80':
- case 'ISO-IR-58':
- case 'CHINESE':
- case 'CSISO58GB231280':
- return 'GB_2312-80';
-
- case 'NS_4551-2':
- case 'ISO646-NO2':
- case 'ISO-IR-61':
- case 'NO2':
- case 'CSISO61NORWEGIAN2':
- return 'NS_4551-2';
+ case 'cshppifont':
+ case 'hppifont':
+ return 'HP-Pi-font';
- case 'VIDEOTEX-SUPPL':
- case 'ISO-IR-70':
- case 'CSISO70VIDEOTEXSUPP1':
- return 'videotex-suppl';
+ case 'cshproman8':
+ case 'hproman8':
+ case 'r8':
+ case 'roman8':
+ return 'hp-roman8';
- case 'PT2':
- case 'ISO-IR-84':
- case 'ISO646-PT2':
- case 'CSISO84PORTUGUESE2':
- return 'PT2';
+ case 'hzgb2312':
+ return 'HZ-GB-2312';
- case 'ES2':
- case 'ISO-IR-85':
- case 'ISO646-ES2':
- case 'CSISO85SPANISH2':
- return 'ES2';
+ case 'csibmsymbols':
+ case 'ibmsymbols':
+ return 'IBM-Symbols';
- case 'MSZ_7795.3':
- case 'ISO-IR-86':
- case 'ISO646-HU':
- case 'HU':
- case 'CSISO86HUNGARIAN':
- return 'MSZ_7795.3';
+ case 'csibmthai':
+ case 'ibmthai':
+ return 'IBM-Thai';
- case 'JIS_C6226-1983':
- case 'ISO-IR-87':
- case 'X0208':
- case 'JIS_X0208-1983':
- case 'CSISO87JISX0208':
- return 'JIS_C6226-1983';
+ case 'ccsid858':
+ case 'cp858':
+ case 'ibm858':
+ case 'pcmultilingual850euro':
+ return 'IBM00858';
- case 'GREEK7':
- case 'ISO-IR-88':
- case 'CSISO88GREEK7':
- return 'greek7';
+ case 'ccsid924':
+ case 'cp924':
+ case 'ebcdiclatin9euro':
+ case 'ibm924':
+ return 'IBM00924';
- case 'ASMO_449':
- case 'ISO_9036':
- case 'ARABIC7':
- case 'ISO-IR-89':
- case 'CSISO89ASMO449':
- return 'ASMO_449';
+ case 'ccsid1140':
+ case 'cp1140':
+ case 'ebcdicus37euro':
+ case 'ibm1140':
+ return 'IBM01140';
- case 'ISO-IR-90':
- case 'CSISO90':
- return 'iso-ir-90';
+ case 'ccsid1141':
+ case 'cp1141':
+ case 'ebcdicde273euro':
+ case 'ibm1141':
+ return 'IBM01141';
- case 'JIS_C6229-1984-A':
- case 'ISO-IR-91':
- case 'JP-OCR-A':
- case 'CSISO91JISC62291984A':
- return 'JIS_C6229-1984-a';
+ case 'ccsid1142':
+ case 'cp1142':
+ case 'ebcdicdk277euro':
+ case 'ebcdicno277euro':
+ case 'ibm1142':
+ return 'IBM01142';
- case 'JIS_C6229-1984-B':
- case 'ISO-IR-92':
- case 'ISO646-JP-OCR-B':
- case 'JP-OCR-B':
- case 'CSISO92JISC62991984B':
- return 'JIS_C6229-1984-b';
+ case 'ccsid1143':
+ case 'cp1143':
+ case 'ebcdicfi278euro':
+ case 'ebcdicse278euro':
+ case 'ibm1143':
+ return 'IBM01143';
- case 'JIS_C6229-1984-B-ADD':
- case 'ISO-IR-93':
- case 'JP-OCR-B-ADD':
- case 'CSISO93JIS62291984BADD':
- return 'JIS_C6229-1984-b-add';
+ case 'ccsid1144':
+ case 'cp1144':
+ case 'ebcdicit280euro':
+ case 'ibm1144':
+ return 'IBM01144';
- case 'JIS_C6229-1984-HAND':
- case 'ISO-IR-94':
- case 'JP-OCR-HAND':
- case 'CSISO94JIS62291984HAND':
- return 'JIS_C6229-1984-hand';
+ case 'ccsid1145':
+ case 'cp1145':
+ case 'ebcdices284euro':
+ case 'ibm1145':
+ return 'IBM01145';
- case 'JIS_C6229-1984-HAND-ADD':
- case 'ISO-IR-95':
- case 'JP-OCR-HAND-ADD':
- case 'CSISO95JIS62291984HANDADD':
- return 'JIS_C6229-1984-hand-add';
+ case 'ccsid1146':
+ case 'cp1146':
+ case 'ebcdicgb285euro':
+ case 'ibm1146':
+ return 'IBM01146';
- case 'JIS_C6229-1984-KANA':
- case 'ISO-IR-96':
- case 'CSISO96JISC62291984KANA':
- return 'JIS_C6229-1984-kana';
+ case 'ccsid1147':
+ case 'cp1147':
+ case 'ebcdicfr297euro':
+ case 'ibm1147':
+ return 'IBM01147';
- case 'ISO_2033-1983':
- case 'ISO-IR-98':
- case 'E13B':
- case 'CSISO2033':
- return 'ISO_2033-1983';
+ case 'ccsid1148':
+ case 'cp1148':
+ case 'ebcdicinternational500euro':
+ case 'ibm1148':
+ return 'IBM01148';
- case 'ANSI_X3.110-1983':
- case 'ISO-IR-99':
- case 'CSA_T500-1983':
- case 'NAPLPS':
- case 'CSISO99NAPLPS':
- return 'ANSI_X3.110-1983';
+ case 'ccsid1149':
+ case 'cp1149':
+ case 'ebcdicis871euro':
+ case 'ibm1149':
+ return 'IBM01149';
- case 'T.61-7BIT':
- case 'ISO-IR-102':
- case 'CSISO102T617BIT':
- return 'T.61-7bit';
+ case 'cp37':
+ case 'csibm37':
+ case 'ebcdiccpca':
+ case 'ebcdiccpnl':
+ case 'ebcdiccpus':
+ case 'ebcdiccpwt':
+ case 'ibm37':
+ return 'IBM037';
- case 'T.61-8BIT':
- case 'T.61':
- case 'ISO-IR-103':
- case 'CSISO103T618BIT':
- return 'T.61-8bit';
+ case 'cp38':
+ case 'csibm38':
+ case 'ebcdicint':
+ case 'ibm38':
+ return 'IBM038';
- case 'ECMA-CYRILLIC':
- case 'ISO-IR-111':
- case 'KOI8-E':
- case 'CSISO111ECMACYRILLIC':
- return 'ECMA-cyrillic';
+ case 'cp273':
+ case 'csibm273':
+ case 'ibm273':
+ return 'IBM273';
- case 'CSA_Z243.4-1985-1':
- case 'ISO-IR-121':
- case 'ISO646-CA':
- case 'CSA7-1':
- case 'CA':
- case 'CSISO121CANADIAN1':
- return 'CSA_Z243.4-1985-1';
+ case 'cp274':
+ case 'csibm274':
+ case 'ebcdicbe':
+ case 'ibm274':
+ return 'IBM274';
- case 'CSA_Z243.4-1985-2':
- case 'ISO-IR-122':
- case 'ISO646-CA2':
- case 'CSA7-2':
- case 'CSISO122CANADIAN2':
- return 'CSA_Z243.4-1985-2';
+ case 'cp275':
+ case 'csibm275':
+ case 'ebcdicbr':
+ case 'ibm275':
+ return 'IBM275';
- case 'CSA_Z243.4-1985-GR':
- case 'ISO-IR-123':
- case 'CSISO123CSAZ24341985GR':
- return 'CSA_Z243.4-1985-gr';
+ case 'csibm277':
+ case 'ebcdiccpdk':
+ case 'ebcdiccpno':
+ case 'ibm277':
+ return 'IBM277';
- case 'ISO_8859-6-E':
- case 'CSISO88596E':
- case 'ISO-8859-6-E':
- return 'ISO-8859-6-E';
+ case 'cp278':
+ case 'csibm278':
+ case 'ebcdiccpfi':
+ case 'ebcdiccpse':
+ case 'ibm278':
+ return 'IBM278';
- case 'ISO_8859-6-I':
- case 'CSISO88596I':
- case 'ISO-8859-6-I':
- return 'ISO-8859-6-I';
+ case 'cp280':
+ case 'csibm280':
+ case 'ebcdiccpit':
+ case 'ibm280':
+ return 'IBM280';
- case 'T.101-G2':
- case 'ISO-IR-128':
- case 'CSISO128T101G2':
- return 'T.101-G2';
+ case 'cp281':
+ case 'csibm281':
+ case 'ebcdicjpe':
+ case 'ibm281':
+ return 'IBM281';
- case 'ISO_8859-8-E':
- case 'CSISO88598E':
- case 'ISO-8859-8-E':
- return 'ISO-8859-8-E';
+ case 'cp284':
+ case 'csibm284':
+ case 'ebcdiccpes':
+ case 'ibm284':
+ return 'IBM284';
- case 'ISO_8859-8-I':
- case 'CSISO88598I':
- case 'ISO-8859-8-I':
- return 'ISO-8859-8-I';
+ case 'cp285':
+ case 'csibm285':
+ case 'ebcdiccpgb':
+ case 'ibm285':
+ return 'IBM285';
- case 'CSN_369103':
- case 'ISO-IR-139':
- case 'CSISO139CSN369103':
- return 'CSN_369103';
+ case 'cp290':
+ case 'csibm290':
+ case 'ebcdicjpkana':
+ case 'ibm290':
+ return 'IBM290';
- case 'JUS_I.B1.002':
- case 'ISO-IR-141':
- case 'ISO646-YU':
- case 'JS':
- case 'YU':
- case 'CSISO141JUSIB1002':
- return 'JUS_I.B1.002';
+ case 'cp297':
+ case 'csibm297':
+ case 'ebcdiccpfr':
+ case 'ibm297':
+ return 'IBM297';
- case 'IEC_P27-1':
- case 'ISO-IR-143':
- case 'CSISO143IECP271':
- return 'IEC_P27-1';
+ case 'cp420':
+ case 'csibm420':
+ case 'ebcdiccpar1':
+ case 'ibm420':
+ return 'IBM420';
- case 'JUS_I.B1.003-SERB':
- case 'ISO-IR-146':
- case 'SERBIAN':
- case 'CSISO146SERBIAN':
- return 'JUS_I.B1.003-serb';
+ case 'cp423':
+ case 'csibm423':
+ case 'ebcdiccpgr':
+ case 'ibm423':
+ return 'IBM423';
- case 'JUS_I.B1.003-MAC':
- case 'MACEDONIAN':
- case 'ISO-IR-147':
- case 'CSISO147MACEDONIAN':
- return 'JUS_I.B1.003-mac';
+ case 'cp424':
+ case 'csibm424':
+ case 'ebcdiccphe':
+ case 'ibm424':
+ return 'IBM424';
- case 'GREEK-CCITT':
- case 'ISO-IR-150':
- case 'CSISO150':
- case 'CSISO150GREEKCCITT':
- return 'greek-ccitt';
+ case '437':
+ case 'cp437':
+ case 'cspc8codepage437':
+ case 'ibm437':
+ return 'IBM437';
- case 'NC_NC00-10:81':
- case 'CUBA':
- case 'ISO-IR-151':
- case 'ISO646-CU':
- case 'CSISO151CUBA':
- return 'NC_NC00-10:81';
+ case 'cp500':
+ case 'csibm500':
+ case 'ebcdiccpbe':
+ case 'ebcdiccpch':
+ case 'ibm500':
+ return 'IBM500';
- case 'ISO_6937-2-25':
- case 'ISO-IR-152':
- case 'CSISO6937ADD':
- return 'ISO_6937-2-25';
+ case 'cp775':
+ case 'cspc775baltic':
+ case 'ibm775':
+ return 'IBM775';
- case 'GOST_19768-74':
- case 'ST_SEV_358-88':
- case 'ISO-IR-153':
- case 'CSISO153GOST1976874':
- return 'GOST_19768-74';
+ case '850':
+ case 'cp850':
+ case 'cspc850multilingual':
+ case 'ibm850':
+ return 'IBM850';
- case 'ISO_8859-SUPP':
- case 'ISO-IR-154':
- case 'LATIN1-2-5':
- case 'CSISO8859SUPP':
- return 'ISO_8859-supp';
+ case '851':
+ case 'cp851':
+ case 'csibm851':
+ case 'ibm851':
+ return 'IBM851';
- case 'ISO_10367-BOX':
- case 'ISO-IR-155':
- case 'CSISO10367BOX':
- return 'ISO_10367-box';
+ case '852':
+ case 'cp852':
+ case 'cspcp852':
+ case 'ibm852':
+ return 'IBM852';
- case 'LATIN-LAP':
- case 'LAP':
- case 'ISO-IR-158':
- case 'CSISO158LAP':
- return 'latin-lap';
+ case '855':
+ case 'cp855':
+ case 'csibm855':
+ case 'ibm855':
+ return 'IBM855';
- case 'JIS_X0212-1990':
- case 'X0212':
- case 'ISO-IR-159':
- case 'CSISO159JISX02121990':
- return 'JIS_X0212-1990';
+ case '857':
+ case 'cp857':
+ case 'csibm857':
+ case 'ibm857':
+ return 'IBM857';
- case 'DS_2089':
- case 'DS2089':
- case 'ISO646-DK':
- case 'DK':
- case 'CSISO646DANISH':
- return 'DS_2089';
+ case '860':
+ case 'cp860':
+ case 'csibm860':
+ case 'ibm860':
+ return 'IBM860';
- case 'US-DK':
- case 'CSUSDK':
- return 'us-dk';
+ case '861':
+ case 'cp861':
+ case 'cpis':
+ case 'csibm861':
+ case 'ibm861':
+ return 'IBM861';
- case 'DK-US':
- case 'CSDKUS':
- return 'dk-us';
+ case '862':
+ case 'cp862':
+ case 'cspc862latinhebrew':
+ case 'ibm862':
+ return 'IBM862';
- case 'KSC5636':
- case 'ISO646-KR':
- case 'CSKSC5636':
- return 'KSC5636';
+ case '863':
+ case 'cp863':
+ case 'csibm863':
+ case 'ibm863':
+ return 'IBM863';
- case 'UNICODE-1-1-UTF-7':
- case 'CSUNICODE11UTF7':
- return 'UNICODE-1-1-UTF-7';
+ case 'cp864':
+ case 'csibm864':
+ case 'ibm864':
+ return 'IBM864';
- case 'ISO-2022-CN':
- return 'ISO-2022-CN';
+ case '865':
+ case 'cp865':
+ case 'csibm865':
+ case 'ibm865':
+ return 'IBM865';
- case 'ISO-2022-CN-EXT':
- return 'ISO-2022-CN-EXT';
+ case '866':
+ case 'cp866':
+ case 'csibm866':
+ case 'ibm866':
+ return 'IBM866';
- case 'UTF-8':
- return 'UTF-8';
+ case 'cp868':
+ case 'cpar':
+ case 'csibm868':
+ case 'ibm868':
+ return 'IBM868';
- case 'ISO-8859-13':
- return 'ISO-8859-13';
+ case '869':
+ case 'cp869':
+ case 'cpgr':
+ case 'csibm869':
+ case 'ibm869':
+ return 'IBM869';
- case 'ISO-8859-14':
- case 'ISO-IR-199':
- case 'ISO_8859-14:1998':
- case 'ISO_8859-14':
- case 'LATIN8':
- case 'ISO-CELTIC':
- case 'L8':
- return 'ISO-8859-14';
+ case 'cp870':
+ case 'csibm870':
+ case 'ebcdiccproece':
+ case 'ebcdiccpyu':
+ case 'ibm870':
+ return 'IBM870';
- case 'ISO-8859-15':
- case 'ISO_8859-15':
- case 'LATIN-9':
- return 'ISO-8859-15';
+ case 'cp871':
+ case 'csibm871':
+ case 'ebcdiccpis':
+ case 'ibm871':
+ return 'IBM871';
- case 'ISO-8859-16':
- case 'ISO-IR-226':
- case 'ISO_8859-16:2001':
- case 'ISO_8859-16':
- case 'LATIN10':
- case 'L10':
- return 'ISO-8859-16';
+ case 'cp880':
+ case 'csibm880':
+ case 'ebcdiccyrillic':
+ case 'ibm880':
+ return 'IBM880';
- case 'GBK':
- case 'CP936':
- case 'MS936':
- case 'WINDOWS-936':
- return 'GBK';
+ case 'cp891':
+ case 'csibm891':
+ case 'ibm891':
+ return 'IBM891';
- case 'GB18030':
- return 'GB18030';
+ case 'cp903':
+ case 'csibm903':
+ case 'ibm903':
+ return 'IBM903';
- case 'OSD_EBCDIC_DF04_15':
- return 'OSD_EBCDIC_DF04_15';
+ case '904':
+ case 'cp904':
+ case 'csibbm904':
+ case 'ibm904':
+ return 'IBM904';
- case 'OSD_EBCDIC_DF03_IRV':
- return 'OSD_EBCDIC_DF03_IRV';
+ case 'cp905':
+ case 'csibm905':
+ case 'ebcdiccptr':
+ case 'ibm905':
+ return 'IBM905';
- case 'OSD_EBCDIC_DF04_1':
- return 'OSD_EBCDIC_DF04_1';
+ case 'cp918':
+ case 'csibm918':
+ case 'ebcdiccpar2':
+ case 'ibm918':
+ return 'IBM918';
- case 'ISO-11548-1':
- case 'ISO_11548-1':
- case 'ISO_TR_11548-1':
- case 'CSISO115481':
- return 'ISO-11548-1';
+ case 'cp1026':
+ case 'csibm1026':
+ case 'ibm1026':
+ return 'IBM1026';
- case 'KZ-1048':
- case 'STRK1048-2002':
- case 'RK1048':
- case 'CSKZ1048':
- return 'KZ-1048';
+ case 'ibm1047':
+ return 'IBM1047';
- case 'ISO-10646-UCS-2':
- case 'CSUNICODE':
- return 'ISO-10646-UCS-2';
+ case 'csiso143iecp271':
+ case 'iecp271':
+ case 'isoir143':
+ return 'IEC_P27-1';
- case 'ISO-10646-UCS-4':
- case 'CSUCS4':
- return 'ISO-10646-UCS-4';
+ case 'csiso49inis':
+ case 'inis':
+ case 'isoir49':
+ return 'INIS';
- case 'ISO-10646-UCS-BASIC':
- case 'CSUNICODEASCII':
- return 'ISO-10646-UCS-Basic';
+ case 'csiso50inis8':
+ case 'inis8':
+ case 'isoir50':
+ return 'INIS-8';
- case 'ISO-10646-UNICODE-LATIN1':
- case 'CSUNICODELATIN1':
- case 'ISO-10646':
- return 'ISO-10646-Unicode-Latin1';
+ case 'csiso51iniscyrillic':
+ case 'iniscyrillic':
+ case 'isoir51':
+ return 'INIS-cyrillic';
- case 'ISO-10646-J-1':
- return 'ISO-10646-J-1';
+ case 'csinvariant':
+ case 'invariant':
+ return 'INVARIANT';
- case 'ISO-UNICODE-IBM-1261':
- case 'CSUNICODEIBM1261':
- return 'ISO-Unicode-IBM-1261';
+ case 'iso2022cn':
+ return 'ISO-2022-CN';
- case 'ISO-UNICODE-IBM-1268':
- case 'CSUNICODEIBM1268':
- return 'ISO-Unicode-IBM-1268';
+ case 'iso2022cnext':
+ return 'ISO-2022-CN-EXT';
- case 'ISO-UNICODE-IBM-1276':
- case 'CSUNICODEIBM1276':
- return 'ISO-Unicode-IBM-1276';
+ case 'csiso2022jp':
+ case 'iso2022jp':
+ return 'ISO-2022-JP';
- case 'ISO-UNICODE-IBM-1264':
- case 'CSUNICODEIBM1264':
- return 'ISO-Unicode-IBM-1264';
+ case 'csiso2022jp2':
+ case 'iso2022jp2':
+ return 'ISO-2022-JP-2';
- case 'ISO-UNICODE-IBM-1265':
- case 'CSUNICODEIBM1265':
- return 'ISO-Unicode-IBM-1265';
+ case 'csiso2022kr':
+ case 'iso2022kr':
+ return 'ISO-2022-KR';
- case 'UNICODE-1-1':
- case 'CSUNICODE11':
- return 'UNICODE-1-1';
+ case 'cswindows30latin1':
+ case 'iso88591windows30latin1':
+ return 'ISO-8859-1-Windows-3.0-Latin-1';
- case 'SCSU':
- return 'SCSU';
+ case 'cswindows31latin1':
+ case 'iso88591windows31latin1':
+ return 'ISO-8859-1-Windows-3.1-Latin-1';
- case 'UTF-7':
- return 'UTF-7';
+ case 'csisolatin2':
+ case 'iso88592':
+ case 'iso885921987':
+ case 'isoir101':
+ case 'l2':
+ case 'latin2':
+ return 'ISO-8859-2';
- case 'UTF-16BE':
- return 'UTF-16BE';
+ case 'cswindows31latin2':
+ case 'iso88592windowslatin2':
+ return 'ISO-8859-2-Windows-Latin-2';
- case 'UTF-16LE':
- return 'UTF-16LE';
+ case 'csisolatin3':
+ case 'iso88593':
+ case 'iso885931988':
+ case 'isoir109':
+ case 'l3':
+ case 'latin3':
+ return 'ISO-8859-3';
- case 'UTF-16':
- return 'UTF-16';
+ case 'csisolatin4':
+ case 'iso88594':
+ case 'iso885941988':
+ case 'isoir110':
+ case 'l4':
+ case 'latin4':
+ return 'ISO-8859-4';
- case 'CESU-8':
- case 'CSCESU-8':
- return 'CESU-8';
+ case 'csisolatincyrillic':
+ case 'cyrillic':
+ case 'iso88595':
+ case 'iso885951988':
+ case 'isoir144':
+ return 'ISO-8859-5';
- case 'UTF-32':
- return 'UTF-32';
+ case 'arabic':
+ case 'asmo708':
+ case 'csisolatinarabic':
+ case 'ecma114':
+ case 'iso88596':
+ case 'iso885961987':
+ case 'isoir127':
+ return 'ISO-8859-6';
- case 'UTF-32BE':
- return 'UTF-32BE';
+ case 'csiso88596e':
+ case 'iso88596e':
+ return 'ISO-8859-6-E';
- case 'UTF-32LE':
- return 'UTF-32LE';
+ case 'csiso88596i':
+ case 'iso88596i':
+ return 'ISO-8859-6-I';
- case 'BOCU-1':
- case 'CSBOCU-1':
- return 'BOCU-1';
+ case 'csisolatingreek':
+ case 'ecma118':
+ case 'elot928':
+ case 'greek':
+ case 'greek8':
+ case 'iso88597':
+ case 'iso885971987':
+ case 'isoir126':
+ return 'ISO-8859-7';
- case 'ISO-8859-1-WINDOWS-3.0-LATIN-1':
- case 'CSWINDOWS30LATIN1':
- return 'ISO-8859-1-Windows-3.0-Latin-1';
+ case 'csisolatinhebrew':
+ case 'hebrew':
+ case 'iso88598':
+ case 'iso885981988':
+ case 'isoir138':
+ return 'ISO-8859-8';
- case 'ISO-8859-1-WINDOWS-3.1-LATIN-1':
- case 'CSWINDOWS31LATIN1':
- return 'ISO-8859-1-Windows-3.1-Latin-1';
+ case 'csiso88598e':
+ case 'iso88598e':
+ return 'ISO-8859-8-E';
- case 'ISO-8859-2-WINDOWS-LATIN-2':
- case 'CSWINDOWS31LATIN2':
- return 'ISO-8859-2-Windows-Latin-2';
+ case 'csiso88598i':
+ case 'iso88598i':
+ return 'ISO-8859-8-I';
- case 'ISO-8859-9-WINDOWS-LATIN-5':
- case 'CSWINDOWS31LATIN5':
+ case 'cswindows31latin5':
+ case 'iso88599windowslatin5':
return 'ISO-8859-9-Windows-Latin-5';
- case 'HP-ROMAN8':
- case 'ROMAN8':
- case 'R8':
- case 'CSHPROMAN8':
- return 'hp-roman8';
-
- case 'ADOBE-STANDARD-ENCODING':
- case 'CSADOBESTANDARDENCODING':
- return 'Adobe-Standard-Encoding';
+ case 'csisolatin6':
+ case 'iso885910':
+ case 'iso8859101992':
+ case 'isoir157':
+ case 'l6':
+ case 'latin6':
+ return 'ISO-8859-10';
- case 'VENTURA-US':
- case 'CSVENTURAUS':
- return 'Ventura-US';
+ case 'iso885913':
+ return 'ISO-8859-13';
- case 'VENTURA-INTERNATIONAL':
- case 'CSVENTURAINTERNATIONAL':
- return 'Ventura-International';
+ case 'iso885914':
+ case 'iso8859141998':
+ case 'isoceltic':
+ case 'isoir199':
+ case 'l8':
+ case 'latin8':
+ return 'ISO-8859-14';
- case 'DEC-MCS':
- case 'DEC':
- case 'CSDECMCS':
- return 'DEC-MCS';
+ case 'iso885915':
+ case 'latin9':
+ return 'ISO-8859-15';
- case 'IBM850':
- case 'CP850':
- case '850':
- case 'CSPC850MULTILINGUAL':
- return 'IBM850';
+ case 'iso885916':
+ case 'iso8859162001':
+ case 'isoir226':
+ case 'l10':
+ case 'latin10':
+ return 'ISO-8859-16';
- case 'PC8-DANISH-NORWEGIAN':
- case 'CSPC8DANISHNORWEGIAN':
- return 'PC8-Danish-Norwegian';
+ case 'iso10646j1':
+ return 'ISO-10646-J-1';
- case 'IBM862':
- case 'CP862':
- case '862':
- case 'CSPC862LATINHEBREW':
- return 'IBM862';
+ case 'csunicode':
+ case 'iso10646ucs2':
+ return 'ISO-10646-UCS-2';
- case 'PC8-TURKISH':
- case 'CSPC8TURKISH':
- return 'PC8-Turkish';
+ case 'csucs4':
+ case 'iso10646ucs4':
+ return 'ISO-10646-UCS-4';
- case 'IBM-SYMBOLS':
- case 'CSIBMSYMBOLS':
- return 'IBM-Symbols';
+ case 'csunicodeascii':
+ case 'iso10646ucsbasic':
+ return 'ISO-10646-UCS-Basic';
- case 'IBM-THAI':
- case 'CSIBMTHAI':
- return 'IBM-Thai';
+ case 'csunicodelatin1':
+ case 'iso10646':
+ case 'iso10646unicodelatin1':
+ return 'ISO-10646-Unicode-Latin1';
- case 'HP-LEGAL':
- case 'CSHPLEGAL':
- return 'HP-Legal';
+ case 'csiso10646utf1':
+ case 'iso10646utf1':
+ return 'ISO-10646-UTF-1';
- case 'HP-PI-FONT':
- case 'CSHPPIFONT':
- return 'HP-Pi-font';
+ case 'csiso115481':
+ case 'iso115481':
+ case 'isotr115481':
+ return 'ISO-11548-1';
- case 'HP-MATH8':
- case 'CSHPMATH8':
- return 'HP-Math8';
+ case 'csiso90':
+ case 'isoir90':
+ return 'iso-ir-90';
- case 'ADOBE-SYMBOL-ENCODING':
- case 'CSHPPSMATH':
- return 'Adobe-Symbol-Encoding';
+ case 'csunicodeibm1261':
+ case 'isounicodeibm1261':
+ return 'ISO-Unicode-IBM-1261';
- case 'HP-DESKTOP':
- case 'CSHPDESKTOP':
- return 'HP-DeskTop';
+ case 'csunicodeibm1264':
+ case 'isounicodeibm1264':
+ return 'ISO-Unicode-IBM-1264';
- case 'VENTURA-MATH':
- case 'CSVENTURAMATH':
- return 'Ventura-Math';
+ case 'csunicodeibm1265':
+ case 'isounicodeibm1265':
+ return 'ISO-Unicode-IBM-1265';
- case 'MICROSOFT-PUBLISHING':
- case 'CSMICROSOFTPUBLISHING':
- return 'Microsoft-Publishing';
+ case 'csunicodeibm1268':
+ case 'isounicodeibm1268':
+ return 'ISO-Unicode-IBM-1268';
- case 'WINDOWS-31J':
- case 'CSWINDOWS31J':
- return 'Windows-31J';
+ case 'csunicodeibm1276':
+ case 'isounicodeibm1276':
+ return 'ISO-Unicode-IBM-1276';
- case 'GB2312':
- case 'CSGB2312':
- return 'GB2312';
+ case 'csiso646basic1983':
+ case 'iso646basic1983':
+ case 'ref':
+ return 'ISO_646.basic:1983';
- case 'BIG5':
- case 'CSBIG5':
- return 'Big5';
+ case 'csiso2intlrefversion':
+ case 'irv':
+ case 'iso646irv1983':
+ case 'isoir2':
+ return 'ISO_646.irv:1983';
- case 'MACINTOSH':
- case 'MAC':
- case 'CSMACINTOSH':
- return 'macintosh';
+ case 'csiso2033':
+ case 'e13b':
+ case 'iso20331983':
+ case 'isoir98':
+ return 'ISO_2033-1983';
- case 'IBM037':
- case 'CP037':
- case 'EBCDIC-CP-US':
- case 'EBCDIC-CP-CA':
- case 'EBCDIC-CP-WT':
- case 'EBCDIC-CP-NL':
- case 'CSIBM037':
- return 'IBM037';
+ case 'csiso5427cyrillic':
+ case 'iso5427':
+ case 'isoir37':
+ return 'ISO_5427';
- case 'IBM038':
- case 'EBCDIC-INT':
- case 'CP038':
- case 'CSIBM038':
- return 'IBM038';
+ case 'iso5427cyrillic1981':
+ case 'iso54271981':
+ case 'isoir54':
+ return 'ISO_5427:1981';
- case 'IBM273':
- case 'CP273':
- case 'CSIBM273':
- return 'IBM273';
+ case 'csiso5428greek':
+ case 'iso54281980':
+ case 'isoir55':
+ return 'ISO_5428:1980';
- case 'IBM274':
- case 'EBCDIC-BE':
- case 'CP274':
- case 'CSIBM274':
- return 'IBM274';
+ case 'csiso6937add':
+ case 'iso6937225':
+ case 'isoir152':
+ return 'ISO_6937-2-25';
- case 'IBM275':
- case 'EBCDIC-BR':
- case 'CP275':
- case 'CSIBM275':
- return 'IBM275';
+ case 'csisotextcomm':
+ case 'iso69372add':
+ case 'isoir142':
+ return 'ISO_6937-2-add';
- case 'IBM277':
- case 'EBCDIC-CP-DK':
- case 'EBCDIC-CP-NO':
- case 'CSIBM277':
- return 'IBM277';
+ case 'csiso8859supp':
+ case 'iso8859supp':
+ case 'isoir154':
+ case 'latin125':
+ return 'ISO_8859-supp';
- case 'IBM278':
- case 'CP278':
- case 'EBCDIC-CP-FI':
- case 'EBCDIC-CP-SE':
- case 'CSIBM278':
- return 'IBM278';
+ case 'csiso10367box':
+ case 'iso10367box':
+ case 'isoir155':
+ return 'ISO_10367-box';
- case 'IBM280':
- case 'CP280':
- case 'EBCDIC-CP-IT':
- case 'CSIBM280':
- return 'IBM280';
+ case 'csiso15italian':
+ case 'iso646it':
+ case 'isoir15':
+ case 'it':
+ return 'IT';
- case 'IBM281':
- case 'EBCDIC-JP-E':
- case 'CP281':
- case 'CSIBM281':
- return 'IBM281';
+ case 'csiso13jisc6220jp':
+ case 'isoir13':
+ case 'jisc62201969':
+ case 'jisc62201969jp':
+ case 'katakana':
+ case 'x2017':
+ return 'JIS_C6220-1969-jp';
- case 'IBM284':
- case 'CP284':
- case 'EBCDIC-CP-ES':
- case 'CSIBM284':
- return 'IBM284';
+ case 'csiso14jisc6220ro':
+ case 'iso646jp':
+ case 'isoir14':
+ case 'jisc62201969ro':
+ case 'jp':
+ return 'JIS_C6220-1969-ro';
- case 'IBM285':
- case 'CP285':
- case 'EBCDIC-CP-GB':
- case 'CSIBM285':
- return 'IBM285';
+ case 'csiso42jisc62261978':
+ case 'isoir42':
+ case 'jisc62261978':
+ return 'JIS_C6226-1978';
- case 'IBM290':
- case 'CP290':
- case 'EBCDIC-JP-KANA':
- case 'CSIBM290':
- return 'IBM290';
+ case 'csiso87jisx208':
+ case 'isoir87':
+ case 'jisc62261983':
+ case 'jisx2081983':
+ case 'x208':
+ return 'JIS_C6226-1983';
- case 'IBM297':
- case 'CP297':
- case 'EBCDIC-CP-FR':
- case 'CSIBM297':
- return 'IBM297';
+ case 'csiso91jisc62291984a':
+ case 'isoir91':
+ case 'jisc62291984a':
+ case 'jpocra':
+ return 'JIS_C6229-1984-a';
- case 'IBM420':
- case 'CP420':
- case 'EBCDIC-CP-AR1':
- case 'CSIBM420':
- return 'IBM420';
+ case 'csiso92jisc62991984b':
+ case 'iso646jpocrb':
+ case 'isoir92':
+ case 'jisc62291984b':
+ case 'jpocrb':
+ return 'JIS_C6229-1984-b';
- case 'IBM423':
- case 'CP423':
- case 'EBCDIC-CP-GR':
- case 'CSIBM423':
- return 'IBM423';
+ case 'csiso93jis62291984badd':
+ case 'isoir93':
+ case 'jisc62291984badd':
+ case 'jpocrbadd':
+ return 'JIS_C6229-1984-b-add';
- case 'IBM424':
- case 'CP424':
- case 'EBCDIC-CP-HE':
- case 'CSIBM424':
- return 'IBM424';
+ case 'csiso94jis62291984hand':
+ case 'isoir94':
+ case 'jisc62291984hand':
+ case 'jpocrhand':
+ return 'JIS_C6229-1984-hand';
- case 'IBM437':
- case 'CP437':
- case '437':
- case 'CSPC8CODEPAGE437':
- return 'IBM437';
+ case 'csiso95jis62291984handadd':
+ case 'isoir95':
+ case 'jisc62291984handadd':
+ case 'jpocrhandadd':
+ return 'JIS_C6229-1984-hand-add';
- case 'IBM500':
- case 'CP500':
- case 'EBCDIC-CP-BE':
- case 'EBCDIC-CP-CH':
- case 'CSIBM500':
- return 'IBM500';
+ case 'csiso96jisc62291984kana':
+ case 'isoir96':
+ case 'jisc62291984kana':
+ return 'JIS_C6229-1984-kana';
- case 'IBM851':
- case 'CP851':
- case '851':
- case 'CSIBM851':
- return 'IBM851';
+ case 'csjisencoding':
+ case 'jisencoding':
+ return 'JIS_Encoding';
- case 'IBM852':
- case 'CP852':
- case '852':
- case 'CSPCP852':
- return 'IBM852';
+ case 'cshalfwidthkatakana':
+ case 'jisx201':
+ case 'x201':
+ return 'JIS_X0201';
- case 'IBM855':
- case 'CP855':
- case '855':
- case 'CSIBM855':
- return 'IBM855';
+ case 'csiso159jisx2121990':
+ case 'isoir159':
+ case 'jisx2121990':
+ case 'x212':
+ return 'JIS_X0212-1990';
- case 'IBM857':
- case 'CP857':
- case '857':
- case 'CSIBM857':
- return 'IBM857';
+ case 'csiso141jusib1002':
+ case 'iso646yu':
+ case 'isoir141':
+ case 'js':
+ case 'jusib1002':
+ case 'yu':
+ return 'JUS_I.B1.002';
- case 'IBM860':
- case 'CP860':
- case '860':
- case 'CSIBM860':
- return 'IBM860';
+ case 'csiso147macedonian':
+ case 'isoir147':
+ case 'jusib1003mac':
+ case 'macedonian':
+ return 'JUS_I.B1.003-mac';
- case 'IBM861':
- case 'CP861':
- case '861':
- case 'CP-IS':
- case 'CSIBM861':
- return 'IBM861';
+ case 'csiso146serbian':
+ case 'isoir146':
+ case 'jusib1003serb':
+ case 'serbian':
+ return 'JUS_I.B1.003-serb';
- case 'IBM863':
- case 'CP863':
- case '863':
- case 'CSIBM863':
- return 'IBM863';
+ case 'koi7switched':
+ return 'KOI7-switched';
- case 'IBM864':
- case 'CP864':
- case 'CSIBM864':
- return 'IBM864';
+ case 'cskoi8r':
+ case 'koi8r':
+ return 'KOI8-R';
- case 'IBM865':
- case 'CP865':
- case '865':
- case 'CSIBM865':
- return 'IBM865';
+ case 'koi8u':
+ return 'KOI8-U';
- case 'IBM868':
- case 'CP868':
- case 'CP-AR':
- case 'CSIBM868':
- return 'IBM868';
+ case 'csksc5636':
+ case 'iso646kr':
+ case 'ksc5636':
+ return 'KSC5636';
- case 'IBM869':
- case 'CP869':
- case '869':
- case 'CP-GR':
- case 'CSIBM869':
- return 'IBM869';
+ case 'cskz1048':
+ case 'kz1048':
+ case 'rk1048':
+ case 'strk10482002':
+ return 'KZ-1048';
- case 'IBM870':
- case 'CP870':
- case 'EBCDIC-CP-ROECE':
- case 'EBCDIC-CP-YU':
- case 'CSIBM870':
- return 'IBM870';
+ case 'csiso19latingreek':
+ case 'isoir19':
+ case 'latingreek':
+ return 'latin-greek';
- case 'IBM871':
- case 'CP871':
- case 'EBCDIC-CP-IS':
- case 'CSIBM871':
- return 'IBM871';
+ case 'csiso27latingreek1':
+ case 'isoir27':
+ case 'latingreek1':
+ return 'Latin-greek-1';
- case 'IBM880':
- case 'CP880':
- case 'EBCDIC-CYRILLIC':
- case 'CSIBM880':
- return 'IBM880';
+ case 'csiso158lap':
+ case 'isoir158':
+ case 'lap':
+ case 'latinlap':
+ return 'latin-lap';
- case 'IBM891':
- case 'CP891':
- case 'CSIBM891':
- return 'IBM891';
+ case 'csmacintosh':
+ case 'mac':
+ case 'macintosh':
+ return 'macintosh';
- case 'IBM903':
- case 'CP903':
- case 'CSIBM903':
- return 'IBM903';
+ case 'csmicrosoftpublishing':
+ case 'microsoftpublishing':
+ return 'Microsoft-Publishing';
- case 'IBM904':
- case 'CP904':
- case '904':
- case 'CSIBBM904':
- return 'IBM904';
+ case 'csmnem':
+ case 'mnem':
+ return 'MNEM';
- case 'IBM905':
- case 'CP905':
- case 'EBCDIC-CP-TR':
- case 'CSIBM905':
- return 'IBM905';
+ case 'csmnemonic':
+ case 'mnemonic':
+ return 'MNEMONIC';
- case 'IBM918':
- case 'CP918':
- case 'EBCDIC-CP-AR2':
- case 'CSIBM918':
- return 'IBM918';
+ case 'csiso86hungarian':
+ case 'hu':
+ case 'iso646hu':
+ case 'isoir86':
+ case 'msz77953':
+ return 'MSZ_7795.3';
- case 'IBM1026':
- case 'CP1026':
- case 'CSIBM1026':
- return 'IBM1026';
+ case 'csnatsdano':
+ case 'isoir91':
+ case 'natsdano':
+ return 'NATS-DANO';
- case 'EBCDIC-AT-DE':
- case 'CSIBMEBCDICATDE':
- return 'EBCDIC-AT-DE';
+ case 'csnatsdanoadd':
+ case 'isoir92':
+ case 'natsdanoadd':
+ return 'NATS-DANO-ADD';
- case 'EBCDIC-AT-DE-A':
- case 'CSEBCDICATDEA':
- return 'EBCDIC-AT-DE-A';
+ case 'csnatssefi':
+ case 'isoir81':
+ case 'natssefi':
+ return 'NATS-SEFI';
- case 'EBCDIC-CA-FR':
- case 'CSEBCDICCAFR':
- return 'EBCDIC-CA-FR';
+ case 'csnatssefiadd':
+ case 'isoir82':
+ case 'natssefiadd':
+ return 'NATS-SEFI-ADD';
- case 'EBCDIC-DK-NO':
- case 'CSEBCDICDKNO':
- return 'EBCDIC-DK-NO';
+ case 'csiso151cuba':
+ case 'cuba':
+ case 'iso646cu':
+ case 'isoir151':
+ case 'ncnc1081':
+ return 'NC_NC00-10:81';
- case 'EBCDIC-DK-NO-A':
- case 'CSEBCDICDKNOA':
- return 'EBCDIC-DK-NO-A';
+ case 'csiso69french':
+ case 'fr':
+ case 'iso646fr':
+ case 'isoir69':
+ case 'nfz62010':
+ return 'NF_Z_62-010';
- case 'EBCDIC-FI-SE':
- case 'CSEBCDICFISE':
- return 'EBCDIC-FI-SE';
+ case 'csiso25french':
+ case 'iso646fr1':
+ case 'isoir25':
+ case 'nfz620101973':
+ return 'NF_Z_62-010_(1973)';
- case 'EBCDIC-FI-SE-A':
- case 'CSEBCDICFISEA':
- return 'EBCDIC-FI-SE-A';
+ case 'csiso60danishnorwegian':
+ case 'csiso60norwegian1':
+ case 'iso646no':
+ case 'isoir60':
+ case 'no':
+ case 'ns45511':
+ return 'NS_4551-1';
- case 'EBCDIC-FR':
- case 'CSEBCDICFR':
- return 'EBCDIC-FR';
+ case 'csiso61norwegian2':
+ case 'iso646no2':
+ case 'isoir61':
+ case 'no2':
+ case 'ns45512':
+ return 'NS_4551-2';
- case 'EBCDIC-IT':
- case 'CSEBCDICIT':
- return 'EBCDIC-IT';
+ case 'osdebcdicdf3irv':
+ return 'OSD_EBCDIC_DF03_IRV';
- case 'EBCDIC-PT':
- case 'CSEBCDICPT':
- return 'EBCDIC-PT';
+ case 'osdebcdicdf41':
+ return 'OSD_EBCDIC_DF04_1';
- case 'EBCDIC-ES':
- case 'CSEBCDICES':
- return 'EBCDIC-ES';
+ case 'osdebcdicdf415':
+ return 'OSD_EBCDIC_DF04_15';
- case 'EBCDIC-ES-A':
- case 'CSEBCDICESA':
- return 'EBCDIC-ES-A';
+ case 'cspc8danishnorwegian':
+ case 'pc8danishnorwegian':
+ return 'PC8-Danish-Norwegian';
- case 'EBCDIC-ES-S':
- case 'CSEBCDICESS':
- return 'EBCDIC-ES-S';
+ case 'cspc8turkish':
+ case 'pc8turkish':
+ return 'PC8-Turkish';
- case 'EBCDIC-UK':
- case 'CSEBCDICUK':
- return 'EBCDIC-UK';
+ case 'csiso16portuguese':
+ case 'iso646pt':
+ case 'isoir16':
+ case 'pt':
+ return 'PT';
- case 'EBCDIC-US':
- case 'CSEBCDICUS':
- return 'EBCDIC-US';
+ case 'csiso84portuguese2':
+ case 'iso646pt2':
+ case 'isoir84':
+ case 'pt2':
+ return 'PT2';
- case 'UNKNOWN-8BIT':
- case 'CSUNKNOWN8BIT':
- return 'UNKNOWN-8BIT';
+ case 'cp154':
+ case 'csptcp154':
+ case 'cyrillicasian':
+ case 'pt154':
+ case 'ptcp154':
+ return 'PTCP154';
- case 'MNEMONIC':
- case 'CSMNEMONIC':
- return 'MNEMONIC';
+ case 'scsu':
+ return 'SCSU';
- case 'MNEM':
- case 'CSMNEM':
- return 'MNEM';
+ case 'csiso10swedish':
+ case 'fi':
+ case 'iso646fi':
+ case 'iso646se':
+ case 'isoir10':
+ case 'se':
+ case 'sen850200b':
+ return 'SEN_850200_B';
- case 'VISCII':
- case 'CSVISCII':
- return 'VISCII';
+ case 'csiso11swedishfornames':
+ case 'iso646se2':
+ case 'isoir11':
+ case 'se2':
+ case 'sen850200c':
+ return 'SEN_850200_C';
- case 'VIQR':
- case 'CSVIQR':
- return 'VIQR';
+ case 'csshiftjis':
+ case 'mskanji':
+ case 'shiftjis':
+ return 'Shift_JIS';
- case 'KOI8-R':
- case 'CSKOI8R':
- return 'KOI8-R';
+ case 'csiso102t617bit':
+ case 'isoir102':
+ case 't617bit':
+ return 'T.61-7bit';
- case 'HZ-GB-2312':
- return 'HZ-GB-2312';
+ case 'csiso103t618bit':
+ case 'isoir103':
+ case 't61':
+ case 't618bit':
+ return 'T.61-8bit';
- case 'IBM866':
- case 'CP866':
- case '866':
- case 'CSIBM866':
- return 'IBM866';
+ case 'csiso128t101g2':
+ case 'isoir128':
+ case 't101g2':
+ return 'T.101-G2';
- case 'IBM775':
- case 'CP775':
- case 'CSPC775BALTIC':
- return 'IBM775';
+ case 'cstscii':
+ case 'tscii':
+ return 'TSCII';
- case 'KOI8-U':
- return 'KOI8-U';
+ case 'csunicode11':
+ case 'unicode11':
+ return 'UNICODE-1-1';
- case 'IBM00858':
- case 'CCSID00858':
- case 'CP00858':
- case 'PC-MULTILINGUAL-850+EURO':
- return 'IBM00858';
+ case 'csunicode11utf7':
+ case 'unicode11utf7':
+ return 'UNICODE-1-1-UTF-7';
- case 'IBM00924':
- case 'CCSID00924':
- case 'CP00924':
- case 'EBCDIC-LATIN9--EURO':
- return 'IBM00924';
+ case 'csunknown8bit':
+ case 'unknown8bit':
+ return 'UNKNOWN-8BIT';
- case 'IBM01140':
- case 'CCSID01140':
- case 'CP01140':
- case 'EBCDIC-US-37+EURO':
- return 'IBM01140';
+ case 'ansix341968':
+ case 'ansix341986':
+ case 'ascii':
+ case 'cp367':
+ case 'csascii':
+ case 'ibm367':
+ case 'iso646irv1991':
+ case 'iso646us':
+ case 'isoir6':
+ case 'us':
+ case 'usascii':
+ return 'US-ASCII';
- case 'IBM01141':
- case 'CCSID01141':
- case 'CP01141':
- case 'EBCDIC-DE-273+EURO':
- return 'IBM01141';
+ case 'csusdk':
+ case 'usdk':
+ return 'us-dk';
- case 'IBM01142':
- case 'CCSID01142':
- case 'CP01142':
- case 'EBCDIC-DK-277+EURO':
- case 'EBCDIC-NO-277+EURO':
- return 'IBM01142';
+ case 'utf7':
+ return 'UTF-7';
- case 'IBM01143':
- case 'CCSID01143':
- case 'CP01143':
- case 'EBCDIC-FI-278+EURO':
- case 'EBCDIC-SE-278+EURO':
- return 'IBM01143';
+ case 'utf8':
+ return 'UTF-8';
- case 'IBM01144':
- case 'CCSID01144':
- case 'CP01144':
- case 'EBCDIC-IT-280+EURO':
- return 'IBM01144';
+ case 'utf16':
+ return 'UTF-16';
- case 'IBM01145':
- case 'CCSID01145':
- case 'CP01145':
- case 'EBCDIC-ES-284+EURO':
- return 'IBM01145';
+ case 'utf16be':
+ return 'UTF-16BE';
- case 'IBM01146':
- case 'CCSID01146':
- case 'CP01146':
- case 'EBCDIC-GB-285+EURO':
- return 'IBM01146';
+ case 'utf16le':
+ return 'UTF-16LE';
- case 'IBM01147':
- case 'CCSID01147':
- case 'CP01147':
- case 'EBCDIC-FR-297+EURO':
- return 'IBM01147';
+ case 'utf32':
+ return 'UTF-32';
- case 'IBM01148':
- case 'CCSID01148':
- case 'CP01148':
- case 'EBCDIC-INTERNATIONAL-500+EURO':
- return 'IBM01148';
+ case 'utf32be':
+ return 'UTF-32BE';
- case 'IBM01149':
- case 'CCSID01149':
- case 'CP01149':
- case 'EBCDIC-IS-871+EURO':
- return 'IBM01149';
+ case 'utf32le':
+ return 'UTF-32LE';
- case 'BIG5-HKSCS':
- return 'Big5-HKSCS';
+ case 'csventurainternational':
+ case 'venturainternational':
+ return 'Ventura-International';
- case 'IBM1047':
- case 'IBM-1047':
- return 'IBM1047';
+ case 'csventuramath':
+ case 'venturamath':
+ return 'Ventura-Math';
- case 'PTCP154':
- case 'CSPTCP154':
- case 'PT154':
- case 'CP154':
- case 'CYRILLIC-ASIAN':
- return 'PTCP154';
+ case 'csventuraus':
+ case 'venturaus':
+ return 'Ventura-US';
- case 'AMIGA-1251':
- case 'AMI1251':
- case 'AMIGA1251':
- case 'AMI-1251':
- return 'Amiga-1251';
+ case 'csiso70videotexsupp1':
+ case 'isoir70':
+ case 'videotexsuppl':
+ return 'videotex-suppl';
- case 'KOI7-SWITCHED':
- return 'KOI7-switched';
+ case 'csviqr':
+ case 'viqr':
+ return 'VIQR';
- case 'BRF':
- case 'CSBRF':
- return 'BRF';
+ case 'csviscii':
+ case 'viscii':
+ return 'VISCII';
- case 'TSCII':
- case 'CSTSCII':
- return 'TSCII';
+ case 'cswindows31j':
+ case 'windows31j':
+ return 'Windows-31J';
- case 'WINDOWS-1250':
+ case 'iso885911':
+ case 'tis620':
+ return 'windows-874';
+
+ case 'cseuckr':
+ case 'csksc56011987':
+ case 'euckr':
+ case 'isoir149':
+ case 'korean':
+ case 'ksc5601':
+ case 'ksc56011987':
+ case 'ksc56011989':
+ case 'windows949':
+ return 'windows-949';
+
+ case 'windows1250':
return 'windows-1250';
- case 'WINDOWS-1251':
+ case 'windows1251':
return 'windows-1251';
- case 'WINDOWS-1252':
+ case 'cp819':
+ case 'csisolatin1':
+ case 'ibm819':
+ case 'iso88591':
+ case 'iso885911987':
+ case 'isoir100':
+ case 'l1':
+ case 'latin1':
+ case 'windows1252':
return 'windows-1252';
- case 'WINDOWS-1253':
+ case 'windows1253':
return 'windows-1253';
- case 'WINDOWS-1254':
+ case 'csisolatin5':
+ case 'iso88599':
+ case 'iso885991989':
+ case 'isoir148':
+ case 'l5':
+ case 'latin5':
+ case 'windows1254':
return 'windows-1254';
- case 'WINDOWS-1255':
+ case 'windows1255':
return 'windows-1255';
- case 'WINDOWS-1256':
+ case 'windows1256':
return 'windows-1256';
- case 'WINDOWS-1257':
+ case 'windows1257':
return 'windows-1257';
- case 'WINDOWS-1258':
+ case 'windows1258':
return 'windows-1258';
default:
- return (string) $encoding;
+ return $charset;
}
}
@@ -9077,11 +10791,11 @@ class SimplePie_Misc
{
$curl = $curl['version'];
}
- elseif (substr($curl, 0, 5) == 'curl/')
+ elseif (substr($curl, 0, 5) === 'curl/')
{
$curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
}
- elseif (substr($curl, 0, 8) == 'libcurl/')
+ elseif (substr($curl, 0, 8) === 'libcurl/')
{
$curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
}
@@ -9094,7 +10808,7 @@ class SimplePie_Misc
function is_subclass_of($class1, $class2)
{
- if (func_num_args() != 2)
+ if (func_num_args() !== 2)
{
trigger_error('Wrong parameter count for SimplePie_Misc::is_subclass_of()', E_USER_WARNING);
}
@@ -9111,7 +10825,7 @@ class SimplePie_Misc
$class2 = strtolower($class2);
while ($class1 = strtolower(get_parent_class($class1)))
{
- if ($class1 == $class2)
+ if ($class1 === $class2)
{
return true;
}
@@ -9120,7 +10834,7 @@ class SimplePie_Misc
}
else
{
- trigger_error('Unknown class passed as parameter', E_USER_WARNING);
+ trigger_error('Unknown class passed as parameter', E_USER_WARNNG);
}
}
return false;
@@ -9151,303 +10865,10 @@ class SimplePie_Misc
return $output . $data;
}
- function parse_date($dt, $rfc822_tz = true)
+ function parse_date($dt)
{
- static $cache = array();
- if (!isset($cache[$dt][$rfc822_tz]))
- {
- $dt = SimplePie_Misc::uncomment_rfc822($dt);
- /*
- Capturing subpatterns:
- 1: RFC 822 date
- 2: RFC 822 day
- 3: RFC 822 month
- 4: RFC 822 year
- 5: ISO 8601 date
- 6: ISO 8601 century
- 7: ISO 8601 year
- 8: ISO 8601 month
- 9: ISO 8601 day
- 10: ISO 8601 ordinal day
- 11: ISO 8601 month
- 12: ISO 8601 day
- 13: ISO 8601 week
- 14: ISO 8601 day of week
- 15: Time
- 16: Hour
- 17: Hour Decimal
- 18: Minute
- 19: Minute Decimal
- 20: Second
- 21: Second Decimal
- 22: Timezone
- 23: Diff ±
- 24: Hour
- 25: Hour Decimal
- 26: Minute
- 27: Minute Decimal
- 28: Alphabetic Timezone
- */
- if (preg_match('/^(?:(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)[,\s]+)?(([0-9]{1,2})\s*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s*([0-9]{4}|[0-9]{2}))|(([0-9]{2})(?:([0-9]{2})(?:(?:-|\s)*(?:([0-9]{2})([0-9]{2})|([0-9]{3})|([0-9]{2})(?:(?:-|\s)*([0-9]{2}))?|W([0-9]{2})(?:(?:-|\s)*([0-9]))?))?)?))((?:T|\s)+([0-9]{2})(?:(?:,|\.)([0-9]*)|(?:\:|\s)*([0-9]{2})(?:(?:,|\.)([0-9]*)|(?:\:|\s)*([0-9]{2})(?:(?:,|\.)([0-9]*))?)?)?(?:\s)*((?:(\+|-)([0-9]{2})(?:(?:,|\.)([0-9]*)|(?:\:|\s)*(?:([0-9]{2})(?:(?:,|\.)([0-9]*))?))?)|(UTC|GMT|EST|CST|MST|PST|EDT|CDT|MDT|PDT|UT|[A-IK-Z]))?)?$/i', $dt, $match))
- {
- // Fill all matches
- for ($i = count($match); $i <= 28; $i++)
- {
- $match[$i] = '';
- }
-
- // Set blank vars
- $year = 1970;
- $month = 1;
- $day = 1;
- $hour = 0;
- $minute = 0;
- $second = 0;
- $timezone = false;
-
- // RFC 822
- if ($match[1] !== '')
- {
- if (strlen($match[4]) == 2)
- {
- $year = ($match[4] < 70) ? "20$match[4]" : "19$match[4]";
- }
- else
- {
- $year = $match[4];
- }
- switch (strtolower($match[3]))
- {
- case 'jan':
- $month = 1;
- break;
-
- case 'feb':
- $month = 2;
- break;
-
- case 'mar':
- $month = 3;
- break;
-
- case 'apr':
- $month = 4;
- break;
-
- case 'may':
- $month = 5;
- break;
-
- case 'jun':
- $month = 6;
- break;
-
- case 'jul':
- $month = 7;
- break;
-
- case 'aug':
- $month = 8;
- break;
-
- case 'sep':
- $month = 9;
- break;
-
- case 'oct':
- $month = 10;
- break;
-
- case 'nov':
- $month = 11;
- break;
-
- case 'dec':
- $month = 12;
- break;
- }
- $day = $match[2];
- }
- // ISO 8601
- else
- {
- // Year
- if ($match[7] !== '')
- {
- $year = "$match[6]$match[7]";
-
- // Two Digit Month/Day
- if ($match[11] !== '')
- {
- $month = $match[11];
- if ($match[12] !== '')
- {
- $day = $match[12];
- }
- }
-
- // Four Digit Month/Day
- elseif ($match[8] !== '')
- {
- $month = $match[8];
- $day = $match[9];
- }
-
- // Ordinal Day
- elseif ($match[10] !== '')
- {
- $day = $match[10];
- }
-
- // Week Date
- elseif ($match[13] !== '')
- {
- // Week Day
- if ($match[14] !== '')
- {
- $day = $match[14];
- }
-
- $first_day_of_year = date('w', mktime(0, 0, 0, 1, 1, $year));
- if ($first_day_of_year == 0)
- {
- $first_day_of_year = 7;
- }
-
- $day = 7 * ($match[13] - 1) + $day - ($first_day_of_year - 1);
- }
- }
- else
- {
- $year = "$match[6]00";
- }
- }
- // Time
- if ($match[15] !== '')
- {
- $time = 0;
- $time += ($match[16] + ('.' . $match[17])) * 3600;
- $time += ($match[18] + ('.' . $match[19])) * 60;
- $time += $match[20] + ('.' . $match[21]);
- $hour = floor($time / 3600);
- $time -= $hour * 3600;
- $minute = floor($time / 60);
- $time -= $minute * 60;
- $second = round($time);
-
- // Timezone
- if ($match[22] !== '')
- {
- // Alphabetic Timezone
- if ($match[28] !== '')
- {
- // Military
- if (strlen($match[28]) == 1)
- {
- if ($match[28] == 'Z' || $match[28] == 'z' || !$rfc822_tz)
- {
- $timezone = 0;
- }
- else
- {
- $timezone = ord(strtoupper($match[28]));
-
- if ($timezone > 74)
- {
- $timezone--;
- }
-
- if ($timezone <= 76)
- {
- $timezone = -($timezone - 64);
- }
- else
- {
- $timezone -= 76;
- }
-
- $timezone *= 3600;
- }
- }
- // Code
- else
- {
- switch (strtoupper($match[28]))
- {
- case 'UT':
- case 'UTC':
- case 'GMT':
- $timezone = 0;
- break;
-
- case 'EST':
- $timezone = -18000;
- break;
-
- case 'CST':
- $timezone = -21600;
- break;
-
- case 'MST':
- $timezone = -25200;
- break;
-
- case 'PST':
- $timezone = -28800;
- break;
-
- case 'EDT':
- $timezone = -14400;
- break;
-
- case 'CDT':
- $timezone = -18000;
- break;
-
- case 'MDT':
- $timezone = -21600;
- break;
-
- case 'PDT':
- $timezone = -25200;
- break;
- }
- }
- }
- // Timezone difference from UTC
- else
- {
- $timezone = 0;
- $timezone += ($match[24] + ('.' . $match[25])) * 3600;
- $timezone += ($match[26] + ('.' . $match[27])) * 60;
- $timezone = (int) round($timezone);
-
- if ($match[23] == '-')
- {
- $timezone = -$timezone;
- }
- }
- }
- }
- if ($timezone === false)
- {
- $cache[$dt][$rfc822_tz] = mktime($hour, $minute, $second, $month, $day, $year);
- }
- else
- {
- $cache[$dt][$rfc822_tz] = gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone;
- }
- }
- elseif (($time = strtotime($dt)) > 0)
- {
- $cache[$dt][$rfc822_tz] = $time;
- }
- else
- {
- $cache[$dt][$rfc822_tz] = false;
- }
- }
- return $cache[$dt][$rfc822_tz];
+ $parser = SimplePie_Parse_Date::get();
+ return $parser->parse($dt);
}
/**
@@ -9467,27 +10888,62 @@ class SimplePie_Misc
/**
* Remove RFC822 comments
*
- * @author Tomas V.V.Cox <cox@idecnet.com>
- * @author Pierre-Alain Joye <pajoye@php.net>
- * @author Amir Mohammad Saied <amir@php.net>
- * @copyright 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox,Amir Mohammad Saied
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: Validate.php,v 1.104 2006/11/17 16:32:06 amir Exp $
- * @link http://pear.php.net/package/Validate
* @access public
* @param string $data Data to strip comments from
* @return string Comment stripped string
*/
- function uncomment_rfc822($data)
+ function uncomment_rfc822($string)
{
- if ((version_compare(PHP_VERSION, '4.4.6', '>=') && version_compare(PHP_VERSION, '5', '<')) || version_compare(PHP_VERSION, '5.2.2', '>='))
- {
- return $data;
- }
- else
+ $string = (string) $string;
+ $position = 0;
+ $length = strlen($string);
+ $depth = 0;
+
+ $output = '';
+
+ while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
{
- return preg_replace('/((?:(?:\\\\"|[^("])*(?:"(?:[^"\\\\\r]|\\\\.)*"\s*)?)*)((?<!\\\\)\((?:(?2)|.)*?(?<!\\\\)\))/', '$1', $data);
+ $output .= substr($string, $position, $pos - $position);
+ $position = $pos + 1;
+ if ($string[$pos - 1] !== '\\')
+ {
+ $depth++;
+ while ($depth && $position < $length)
+ {
+ $position += strcspn($string, '()', $position);
+ if ($string[$position - 1] === '\\')
+ {
+ $position++;
+ continue;
+ }
+ elseif (isset($string[$position]))
+ {
+ switch ($string[$position])
+ {
+ case '(':
+ $depth++;
+ break;
+
+ case ')':
+ $depth--;
+ break;
+ }
+ $position++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ $output .= '(';
+ }
}
+ $output .= substr($string, $position);
+
+ return $output;
}
function parse_mime($mime)
@@ -9516,7 +10972,7 @@ class SimplePie_Misc
function atom_03_construct_type($attribs)
{
- if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) == 'base64'))
+ if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
{
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
}
@@ -9588,7 +11044,7 @@ class SimplePie_Misc
case 'xhtml':
return SIMPLEPIE_CONSTRUCT_XHTML;
}
- if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) == 'text/')
+ if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
{
return SIMPLEPIE_CONSTRUCT_NONE;
}
@@ -9679,69 +11135,35 @@ class SimplePie_Misc
*/
function codepoint_to_utf8($codepoint)
{
- static $cache = array();
$codepoint = (int) $codepoint;
- if (isset($cache[$codepoint]))
- {
- return $cache[$codepoint];
- }
- elseif ($codepoint < 0)
+ if ($codepoint < 0)
{
- return $cache[$codepoint] = false;
+ return false;
}
else if ($codepoint <= 0x7f)
{
- return $cache[$codepoint] = chr($codepoint);
+ return chr($codepoint);
}
else if ($codepoint <= 0x7ff)
{
- return $cache[$codepoint] = chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
}
else if ($codepoint <= 0xffff)
{
- return $cache[$codepoint] = chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
}
else if ($codepoint <= 0x10ffff)
{
- return $cache[$codepoint] = chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
}
else
{
// U+FFFD REPLACEMENT CHARACTER
- return $cache[$codepoint] = "\xEF\xBF\xBD";
+ return "\xEF\xBF\xBD";
}
}
/**
- * Re-implementation of PHP 4.2.0's is_a()
- *
- * @static
- * @access public
- * @param object $object The tested object
- * @param string $class_name The class name
- * @return bool Returns true if the object is of this class or has this class as one of its parents, false otherwise
- */
- function is_a($object, $class_name)
- {
- if (function_exists('is_a'))
- {
- return is_a($object, $class_name);
- }
- elseif (!is_object($object))
- {
- return false;
- }
- elseif (get_class($object) == strtolower($class_name))
- {
- return true;
- }
- else
- {
- return is_subclass_of($object, $class_name);
- }
- }
-
- /**
* Re-implementation of PHP 5's stripos()
*
* Returns the numeric position of the first occurrence of needle in the
@@ -9758,31 +11180,207 @@ class SimplePie_Misc
* relative to the beginning of haystack.
* @return bool If needle is not found, stripos() will return boolean false.
*/
- function stripos($haystack, $needle, $offset = 0)
- {
- if (function_exists('stripos'))
- {
- return stripos($haystack, $needle, $offset);
- }
- else
- {
- if (is_string($needle))
- {
- $needle = strtolower($needle);
- }
- elseif (is_int($needle) || is_bool($needle) || is_double($needle))
- {
- $needle = strtolower(chr($needle));
- }
- else
- {
- trigger_error('needle is not a string or an integer', E_USER_WARNING);
- return false;
- }
-
- return strpos(strtolower($haystack), $needle, $offset);
- }
- }
+ function stripos($haystack, $needle, $offset = 0)
+ {
+ if (function_exists('stripos'))
+ {
+ return stripos($haystack, $needle, $offset);
+ }
+ else
+ {
+ if (is_string($needle))
+ {
+ $needle = strtolower($needle);
+ }
+ elseif (is_int($needle) || is_bool($needle) || is_double($needle))
+ {
+ $needle = strtolower(chr($needle));
+ }
+ else
+ {
+ trigger_error('needle is not a string or an integer', E_USER_WARNING);
+ return false;
+ }
+
+ return strpos(strtolower($haystack), $needle, $offset);
+ }
+ }
+
+ /**
+ * Similar to parse_str()
+ *
+ * Returns an associative array of name/value pairs, where the value is an
+ * array of values that have used the same name
+ *
+ * @static
+ * @access string
+ * @param string $str The input string.
+ * @return array
+ */
+ function parse_str($str)
+ {
+ $return = array();
+ $str = explode('&', $str);
+
+ foreach ($str as $section)
+ {
+ if (strpos($section, '=') !== false)
+ {
+ list($name, $value) = explode('=', $section, 2);
+ $return[urldecode($name)][] = urldecode($value);
+ }
+ else
+ {
+ $return[urldecode($section)][] = null;
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Detect XML encoding, as per XML 1.0 Appendix F.1
+ *
+ * @todo Add support for EBCDIC
+ * @param string $data XML data
+ * @return array Possible encodings
+ */
+ function xml_encoding($data)
+ {
+ // UTF-32 Big Endian BOM
+ if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
+ {
+ $encoding[] = 'UTF-32BE';
+ }
+ // UTF-32 Little Endian BOM
+ elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00")
+ {
+ $encoding[] = 'UTF-32LE';
+ }
+ // UTF-16 Big Endian BOM
+ elseif (substr($data, 0, 2) === "\xFE\xFF")
+ {
+ $encoding[] = 'UTF-16BE';
+ }
+ // UTF-16 Little Endian BOM
+ elseif (substr($data, 0, 2) === "\xFF\xFE")
+ {
+ $encoding[] = 'UTF-16LE';
+ }
+ // UTF-8 BOM
+ elseif (substr($data, 0, 3) === "\xEF\xBB\xBF")
+ {
+ $encoding[] = 'UTF-8';
+ }
+ // UTF-32 Big Endian Without BOM
+ elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
+ {
+ if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
+ {
+ $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-32BE';
+ }
+ // UTF-32 Little Endian Without BOM
+ elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
+ {
+ if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
+ {
+ $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-32LE';
+ }
+ // UTF-16 Big Endian Without BOM
+ elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
+ {
+ if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
+ {
+ $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-16BE';
+ }
+ // UTF-16 Little Endian Without BOM
+ elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
+ {
+ if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
+ {
+ $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-16LE';
+ }
+ // US-ASCII (or superset)
+ elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C")
+ {
+ if ($pos = strpos($data, "\x3F\x3E"))
+ {
+ $parser = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-8';
+ }
+ // Fallback to UTF-8
+ else
+ {
+ $encoding[] = 'UTF-8';
+ }
+ return $encoding;
+ }
+
+ function output_javascript()
+ {
+ if (function_exists('ob_gzhandler'))
+ {
+ ob_start('ob_gzhandler');
+ }
+ header('Content-type: text/javascript; charset: UTF-8');
+ header('Cache-Control: must-revalidate');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
+ ?>
+function embed_odeo(link) {
+ document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>');
+}
+
+function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
+ if (placeholder != '') {
+ document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
+ }
+ else {
+ document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
+ }
+}
+
+function embed_flash(bgcolor, width, height, link, loop, type) {
+ document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
+}
+
+function embed_flv(width, height, link, placeholder, loop, player) {
+ document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>');
+}
+
+function embed_wmedia(width, height, link) {
+ document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
+}
+ <?php
+ }
}
/**
@@ -9861,7 +11459,6 @@ class SimplePie_Decode_HTML_Entities
}
else
{
- $this->consumed = false;
return false;
}
}
@@ -9884,7 +11481,6 @@ class SimplePie_Decode_HTML_Entities
}
else
{
- $this->consumed = false;
return false;
}
}
@@ -9958,7 +11554,7 @@ class SimplePie_Decode_HTML_Entities
$replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);
}
- if ($this->consume() != ';')
+ if (!in_array($this->consume(), array(';', false), true))
{
$this->unconsume();
}
@@ -9972,7 +11568,7 @@ class SimplePie_Decode_HTML_Entities
default:
static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C");
- for ($i = 0, $match = null; $i < 9 && $this->consume(); $i++)
+ for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++)
{
$consumed = substr($this->consumed, 1);
if (isset($entities[$consumed]))
@@ -9991,6 +11587,2489 @@ class SimplePie_Decode_HTML_Entities
}
}
+/**
+ * IRI parser/serialiser
+ *
+ * @package SimplePie
+ */
+class SimplePie_IRI
+{
+ /**
+ * Scheme
+ *
+ * @access private
+ * @var string
+ */
+ var $scheme;
+
+ /**
+ * User Information
+ *
+ * @access private
+ * @var string
+ */
+ var $userinfo;
+
+ /**
+ * Host
+ *
+ * @access private
+ * @var string
+ */
+ var $host;
+
+ /**
+ * Port
+ *
+ * @access private
+ * @var string
+ */
+ var $port;
+
+ /**
+ * Path
+ *
+ * @access private
+ * @var string
+ */
+ var $path;
+
+ /**
+ * Query
+ *
+ * @access private
+ * @var string
+ */
+ var $query;
+
+ /**
+ * Fragment
+ *
+ * @access private
+ * @var string
+ */
+ var $fragment;
+
+ /**
+ * Whether the object represents a valid IRI
+ *
+ * @access private
+ * @var array
+ */
+ var $valid = array();
+
+ /**
+ * Return the entire IRI when you try and read the object as a string
+ *
+ * @access public
+ * @return string
+ */
+ function __toString()
+ {
+ return $this->get_iri();
+ }
+
+ /**
+ * Create a new IRI object, from a specified string
+ *
+ * @access public
+ * @param string $iri
+ * @return SimplePie_IRI
+ */
+ function SimplePie_IRI($iri)
+ {
+ $iri = (string) $iri;
+ if ($iri !== '')
+ {
+ $parsed = $this->parse_iri($iri);
+ $this->set_scheme($parsed['scheme']);
+ $this->set_authority($parsed['authority']);
+ $this->set_path($parsed['path']);
+ $this->set_query($parsed['query']);
+ $this->set_fragment($parsed['fragment']);
+ }
+ }
+
+ /**
+ * Create a new IRI object by resolving a relative IRI
+ *
+ * @static
+ * @access public
+ * @param SimplePie_IRI $base Base IRI
+ * @param string $relative Relative IRI
+ * @return SimplePie_IRI
+ */
+ function absolutize($base, $relative)
+ {
+ $relative = (string) $relative;
+ if ($relative !== '')
+ {
+ $relative = new SimplePie_IRI($relative);
+ if ($relative->get_scheme() !== null)
+ {
+ $target = $relative;
+ }
+ elseif ($base->get_iri() !== null)
+ {
+ if ($relative->get_authority() !== null)
+ {
+ $target = $relative;
+ $target->set_scheme($base->get_scheme());
+ }
+ else
+ {
+ $target = new SimplePie_IRI('');
+ $target->set_scheme($base->get_scheme());
+ $target->set_userinfo($base->get_userinfo());
+ $target->set_host($base->get_host());
+ $target->set_port($base->get_port());
+ if ($relative->get_path() !== null)
+ {
+ if (strpos($relative->get_path(), '/') === 0)
+ {
+ $target->set_path($relative->get_path());
+ }
+ elseif (($base->get_userinfo() !== null || $base->get_host() !== null || $base->get_port() !== null) && $base->get_path() === null)
+ {
+ $target->set_path('/' . $relative->get_path());
+ }
+ elseif (($last_segment = strrpos($base->get_path(), '/')) !== false)
+ {
+ $target->set_path(substr($base->get_path(), 0, $last_segment + 1) . $relative->get_path());
+ }
+ else
+ {
+ $target->set_path($relative->get_path());
+ }
+ $target->set_query($relative->get_query());
+ }
+ else
+ {
+ $target->set_path($base->get_path());
+ if ($relative->get_query() !== null)
+ {
+ $target->set_query($relative->get_query());
+ }
+ elseif ($base->get_query() !== null)
+ {
+ $target->set_query($base->get_query());
+ }
+ }
+ }
+ $target->set_fragment($relative->get_fragment());
+ }
+ else
+ {
+ // No base URL, just return the relative URL
+ $target = $relative;
+ }
+ }
+ else
+ {
+ $target = $base;
+ }
+ return $target;
+ }
+
+ /**
+ * Parse an IRI into scheme/authority/path/query/fragment segments
+ *
+ * @access private
+ * @param string $iri
+ * @return array
+ */
+ function parse_iri($iri)
+ {
+ preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $iri, $match);
+ for ($i = count($match); $i <= 9; $i++)
+ {
+ $match[$i] = '';
+ }
+ return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
+ }
+
+ /**
+ * Remove dot segments from a path
+ *
+ * @access private
+ * @param string $input
+ * @return string
+ */
+ function remove_dot_segments($input)
+ {
+ $output = '';
+ while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
+ {
+ // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
+ if (strpos($input, '../') === 0)
+ {
+ $input = substr($input, 3);
+ }
+ elseif (strpos($input, './') === 0)
+ {
+ $input = substr($input, 2);
+ }
+ // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise,
+ elseif (strpos($input, '/./') === 0)
+ {
+ $input = substr_replace($input, '/', 0, 3);
+ }
+ elseif ($input === '/.')
+ {
+ $input = '/';
+ }
+ // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise,
+ elseif (strpos($input, '/../') === 0)
+ {
+ $input = substr_replace($input, '/', 0, 4);
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ elseif ($input === '/..')
+ {
+ $input = '/';
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
+ elseif ($input === '.' || $input === '..')
+ {
+ $input = '';
+ }
+ // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer
+ elseif (($pos = strpos($input, '/', 1)) !== false)
+ {
+ $output .= substr($input, 0, $pos);
+ $input = substr_replace($input, '', 0, $pos);
+ }
+ else
+ {
+ $output .= $input;
+ $input = '';
+ }
+ }
+ return $output . $input;
+ }
+
+ /**
+ * Replace invalid character with percent encoding
+ *
+ * @access private
+ * @param string $string Input string
+ * @param string $valid_chars Valid characters
+ * @param int $case Normalise case
+ * @return string
+ */
+ function replace_invalid_with_pct_encoding($string, $valid_chars, $case = SIMPLEPIE_SAME_CASE)
+ {
+ // Normalise case
+ if ($case & SIMPLEPIE_LOWERCASE)
+ {
+ $string = strtolower($string);
+ }
+ elseif ($case & SIMPLEPIE_UPPERCASE)
+ {
+ $string = strtoupper($string);
+ }
+
+ // Store position and string length (to avoid constantly recalculating this)
+ $position = 0;
+ $strlen = strlen($string);
+
+ // Loop as long as we have invalid characters, advancing the position to the next invalid character
+ while (($position += strspn($string, $valid_chars, $position)) < $strlen)
+ {
+ // If we have a % character
+ if ($string[$position] === '%')
+ {
+ // If we have a pct-encoded section
+ if ($position + 2 < $strlen && strspn($string, '0123456789ABCDEFabcdef', $position + 1, 2) === 2)
+ {
+ // Get the the represented character
+ $chr = chr(hexdec(substr($string, $position + 1, 2)));
+
+ // If the character is valid, replace the pct-encoded with the actual character while normalising case
+ if (strpos($valid_chars, $chr) !== false)
+ {
+ if ($case & SIMPLEPIE_LOWERCASE)
+ {
+ $chr = strtolower($chr);
+ }
+ elseif ($case & SIMPLEPIE_UPPERCASE)
+ {
+ $chr = strtoupper($chr);
+ }
+ $string = substr_replace($string, $chr, $position, 3);
+ $strlen -= 2;
+ $position++;
+ }
+
+ // Otherwise just normalise the pct-encoded to uppercase
+ else
+ {
+ $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2);
+ $position += 3;
+ }
+ }
+ // If we don't have a pct-encoded section, just replace the % with its own esccaped form
+ else
+ {
+ $string = substr_replace($string, '%25', $position, 1);
+ $strlen += 2;
+ $position += 3;
+ }
+ }
+ // If we have an invalid character, change into its pct-encoded form
+ else
+ {
+ $replacement = sprintf("%%%02X", ord($string[$position]));
+ $string = str_replace($string[$position], $replacement, $string);
+ $strlen = strlen($string);
+ }
+ }
+ return $string;
+ }
+
+ /**
+ * Check if the object represents a valid IRI
+ *
+ * @access public
+ * @return bool
+ */
+ function is_valid()
+ {
+ return array_sum($this->valid) === count($this->valid);
+ }
+
+ /**
+ * Set the scheme. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $scheme
+ * @return bool
+ */
+ function set_scheme($scheme)
+ {
+ if ($scheme === null || $scheme === '')
+ {
+ $this->scheme = null;
+ }
+ else
+ {
+ $len = strlen($scheme);
+ switch (true)
+ {
+ case $len > 1:
+ if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-.', 1))
+ {
+ $this->scheme = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+
+ case $len > 0:
+ if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 0, 1))
+ {
+ $this->scheme = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+ $this->scheme = strtolower($scheme);
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the authority. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $authority
+ * @return bool
+ */
+ function set_authority($authority)
+ {
+ if (($userinfo_end = strrpos($authority, '@')) !== false)
+ {
+ $userinfo = substr($authority, 0, $userinfo_end);
+ $authority = substr($authority, $userinfo_end + 1);
+ }
+ else
+ {
+ $userinfo = null;
+ }
+
+ if (($port_start = strpos($authority, ':')) !== false)
+ {
+ $port = substr($authority, $port_start + 1);
+ $authority = substr($authority, 0, $port_start);
+ }
+ else
+ {
+ $port = null;
+ }
+
+ return $this->set_userinfo($userinfo) && $this->set_host($authority) && $this->set_port($port);
+ }
+
+ /**
+ * Set the userinfo.
+ *
+ * @access public
+ * @param string $userinfo
+ * @return bool
+ */
+ function set_userinfo($userinfo)
+ {
+ if ($userinfo === null || $userinfo === '')
+ {
+ $this->userinfo = null;
+ }
+ else
+ {
+ $this->userinfo = $this->replace_invalid_with_pct_encoding($userinfo, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the host. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $host
+ * @return bool
+ */
+ function set_host($host)
+ {
+ if ($host === null || $host === '')
+ {
+ $this->host = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif ($host[0] === '[' && substr($host, -1) === ']')
+ {
+ if (Net_IPv6::checkIPv6(substr($host, 1, -1)))
+ {
+ $this->host = $host;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ else
+ {
+ $this->host = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+ else
+ {
+ $this->host = $this->replace_invalid_with_pct_encoding($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=', SIMPLEPIE_LOWERCASE);
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ }
+
+ /**
+ * Set the port. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $port
+ * @return bool
+ */
+ function set_port($port)
+ {
+ if ($port === null || $port === '')
+ {
+ $this->port = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif (strspn($port, '0123456789') === strlen($port))
+ {
+ $this->port = (int) $port;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ else
+ {
+ $this->port = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+
+ /**
+ * Set the path.
+ *
+ * @access public
+ * @param string $path
+ * @return bool
+ */
+ function set_path($path)
+ {
+ if ($path === null || $path === '')
+ {
+ $this->path = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif (substr($path, 0, 2) === '//' && $this->userinfo === null && $this->host === null && $this->port === null)
+ {
+ $this->path = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ else
+ {
+ $this->path = $this->replace_invalid_with_pct_encoding($path, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=@/');
+ if ($this->scheme !== null)
+ {
+ $this->path = $this->remove_dot_segments($this->path);
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ }
+
+ /**
+ * Set the query.
+ *
+ * @access public
+ * @param string $query
+ * @return bool
+ */
+ function set_query($query)
+ {
+ if ($query === null || $query === '')
+ {
+ $this->query = null;
+ }
+ else
+ {
+ $this->query = $this->replace_invalid_with_pct_encoding($query, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$\'()*+,;:@/?&=');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the fragment.
+ *
+ * @access public
+ * @param string $fragment
+ * @return bool
+ */
+ function set_fragment($fragment)
+ {
+ if ($fragment === null || $fragment === '')
+ {
+ $this->fragment = null;
+ }
+ else
+ {
+ $this->fragment = $this->replace_invalid_with_pct_encoding($fragment, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Get the complete IRI
+ *
+ * @access public
+ * @return string
+ */
+ function get_iri()
+ {
+ $iri = '';
+ if ($this->scheme !== null)
+ {
+ $iri .= $this->scheme . ':';
+ }
+ if (($authority = $this->get_authority()) !== null)
+ {
+ $iri .= '//' . $authority;
+ }
+ if ($this->path !== null)
+ {
+ $iri .= $this->path;
+ }
+ if ($this->query !== null)
+ {
+ $iri .= '?' . $this->query;
+ }
+ if ($this->fragment !== null)
+ {
+ $iri .= '#' . $this->fragment;
+ }
+
+ if ($iri !== '')
+ {
+ return $iri;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Get the scheme
+ *
+ * @access public
+ * @return string
+ */
+ function get_scheme()
+ {
+ return $this->scheme;
+ }
+
+ /**
+ * Get the complete authority
+ *
+ * @access public
+ * @return string
+ */
+ function get_authority()
+ {
+ $authority = '';
+ if ($this->userinfo !== null)
+ {
+ $authority .= $this->userinfo . '@';
+ }
+ if ($this->host !== null)
+ {
+ $authority .= $this->host;
+ }
+ if ($this->port !== null)
+ {
+ $authority .= ':' . $this->port;
+ }
+
+ if ($authority !== '')
+ {
+ return $authority;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Get the user information
+ *
+ * @access public
+ * @return string
+ */
+ function get_userinfo()
+ {
+ return $this->userinfo;
+ }
+
+ /**
+ * Get the host
+ *
+ * @access public
+ * @return string
+ */
+ function get_host()
+ {
+ return $this->host;
+ }
+
+ /**
+ * Get the port
+ *
+ * @access public
+ * @return string
+ */
+ function get_port()
+ {
+ return $this->port;
+ }
+
+ /**
+ * Get the path
+ *
+ * @access public
+ * @return string
+ */
+ function get_path()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Get the query
+ *
+ * @access public
+ * @return string
+ */
+ function get_query()
+ {
+ return $this->query;
+ }
+
+ /**
+ * Get the fragment
+ *
+ * @access public
+ * @return string
+ */
+ function get_fragment()
+ {
+ return $this->fragment;
+ }
+}
+
+/**
+ * Class to validate and to work with IPv6 addresses.
+ *
+ * @package SimplePie
+ * @copyright 2003-2005 The PHP Group
+ * @license http://www.opensource.org/licenses/bsd-license.php
+ * @link http://pear.php.net/package/Net_IPv6
+ * @author Alexander Merz <alexander.merz@web.de>
+ * @author elfrink at introweb dot nl
+ * @author Josh Peck <jmp at joshpeck dot org>
+ * @author Geoffrey Sneddon <geoffers@gmail.com>
+ */
+class SimplePie_Net_IPv6
+{
+ /**
+ * Removes a possible existing netmask specification of an IP address.
+ *
+ * @param string $ip the (compressed) IP as Hex representation
+ * @return string the IP the without netmask
+ * @since 1.1.0
+ * @access public
+ * @static
+ */
+ function removeNetmaskSpec($ip)
+ {
+ if (strpos($ip, '/') !== false)
+ {
+ list($addr, $nm) = explode('/', $ip);
+ }
+ else
+ {
+ $addr = $ip;
+ }
+ return $addr;
+ }
+
+ /**
+ * Uncompresses an IPv6 address
+ *
+ * RFC 2373 allows you to compress zeros in an address to '::'. This
+ * function expects an valid IPv6 address and expands the '::' to
+ * the required zeros.
+ *
+ * Example: FF01::101 -> FF01:0:0:0:0:0:0:101
+ * ::1 -> 0:0:0:0:0:0:0:1
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address (hex format)
+ * @return string the uncompressed IPv6-address (hex format)
+ */
+ function Uncompress($ip)
+ {
+ $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
+ $c1 = -1;
+ $c2 = -1;
+ if (strpos($ip, '::') !== false)
+ {
+ list($ip1, $ip2) = explode('::', $ip);
+ if ($ip1 === '')
+ {
+ $c1 = -1;
+ }
+ else
+ {
+ $pos = 0;
+ if (($pos = substr_count($ip1, ':')) > 0)
+ {
+ $c1 = $pos;
+ }
+ else
+ {
+ $c1 = 0;
+ }
+ }
+ if ($ip2 === '')
+ {
+ $c2 = -1;
+ }
+ else
+ {
+ $pos = 0;
+ if (($pos = substr_count($ip2, ':')) > 0)
+ {
+ $c2 = $pos;
+ }
+ else
+ {
+ $c2 = 0;
+ }
+ }
+ if (strstr($ip2, '.'))
+ {
+ $c2++;
+ }
+ // ::
+ if ($c1 === -1 && $c2 === -1)
+ {
+ $uip = '0:0:0:0:0:0:0:0';
+ }
+ // ::xxx
+ else if ($c1 === -1)
+ {
+ $fill = str_repeat('0:', 7 - $c2);
+ $uip = str_replace('::', $fill, $uip);
+ }
+ // xxx::
+ else if ($c2 === -1)
+ {
+ $fill = str_repeat(':0', 7 - $c1);
+ $uip = str_replace('::', $fill, $uip);
+ }
+ // xxx::xxx
+ else
+ {
+ $fill = str_repeat(':0:', 6 - $c2 - $c1);
+ $uip = str_replace('::', $fill, $uip);
+ $uip = str_replace('::', ':', $uip);
+ }
+ }
+ return $uip;
+ }
+
+ /**
+ * Splits an IPv6 address into the IPv6 and a possible IPv4 part
+ *
+ * RFC 2373 allows you to note the last two parts of an IPv6 address as
+ * an IPv4 compatible address
+ *
+ * Example: 0:0:0:0:0:0:13.1.68.3
+ * 0:0:0:0:0:FFFF:129.144.52.38
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address (hex format)
+ * @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format)
+ */
+ function SplitV64($ip)
+ {
+ $ip = SimplePie_Net_IPv6::Uncompress($ip);
+ if (strstr($ip, '.'))
+ {
+ $pos = strrpos($ip, ':');
+ $ip[$pos] = '_';
+ $ipPart = explode('_', $ip);
+ return $ipPart;
+ }
+ else
+ {
+ return array($ip, '');
+ }
+ }
+
+ /**
+ * Checks an IPv6 address
+ *
+ * Checks if the given IP is IPv6-compatible
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address
+ * @return bool true if $ip is an IPv6 address
+ */
+ function checkIPv6($ip)
+ {
+ $ipPart = SimplePie_Net_IPv6::SplitV64($ip);
+ $count = 0;
+ if (!empty($ipPart[0]))
+ {
+ $ipv6 = explode(':', $ipPart[0]);
+ for ($i = 0; $i < count($ipv6); $i++)
+ {
+ $dec = hexdec($ipv6[$i]);
+ $hex = strtoupper(preg_replace('/^[0]{1,3}(.*[0-9a-fA-F])$/', '\\1', $ipv6[$i]));
+ if ($ipv6[$i] >= 0 && $dec <= 65535 && $hex === strtoupper(dechex($dec)))
+ {
+ $count++;
+ }
+ }
+ if ($count === 8)
+ {
+ return true;
+ }
+ elseif ($count === 6 && !empty($ipPart[1]))
+ {
+ $ipv4 = explode('.', $ipPart[1]);
+ $count = 0;
+ foreach ($ipv4 as $ipv4_part)
+ {
+ if ($ipv4_part >= 0 && $ipv4_part <= 255 && preg_match('/^\d{1,3}$/', $ipv4_part))
+ {
+ $count++;
+ }
+ }
+ if ($count === 4)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
+
+/**
+ * Date Parser
+ *
+ * @package SimplePie
+ */
+class SimplePie_Parse_Date
+{
+ /**
+ * Input data
+ *
+ * @access protected
+ * @var string
+ */
+ var $date;
+
+ /**
+ * List of days, calendar day name => ordinal day number in the week
+ *
+ * @access protected
+ * @var array
+ */
+ var $day = array(
+ // English
+ 'mon' => 1,
+ 'monday' => 1,
+ 'tue' => 2,
+ 'tuesday' => 2,
+ 'wed' => 3,
+ 'wednesday' => 3,
+ 'thu' => 4,
+ 'thursday' => 4,
+ 'fri' => 5,
+ 'friday' => 5,
+ 'sat' => 6,
+ 'saturday' => 6,
+ 'sun' => 7,
+ 'sunday' => 7,
+ // Dutch
+ 'maandag' => 1,
+ 'dinsdag' => 2,
+ 'woensdag' => 3,
+ 'donderdag' => 4,
+ 'vrijdag' => 5,
+ 'zaterdag' => 6,
+ 'zondag' => 7,
+ // French
+ 'lundi' => 1,
+ 'mardi' => 2,
+ 'mercredi' => 3,
+ 'jeudi' => 4,
+ 'vendredi' => 5,
+ 'samedi' => 6,
+ 'dimanche' => 7,
+ // German
+ 'montag' => 1,
+ 'dienstag' => 2,
+ 'mittwoch' => 3,
+ 'donnerstag' => 4,
+ 'freitag' => 5,
+ 'samstag' => 6,
+ 'sonnabend' => 6,
+ 'sonntag' => 7,
+ // Italian
+ 'lunedì' => 1,
+ 'martedì' => 2,
+ 'mercoledì' => 3,
+ 'giovedì' => 4,
+ 'venerdì' => 5,
+ 'sabato' => 6,
+ 'domenica' => 7,
+ // Spanish
+ 'lunes' => 1,
+ 'martes' => 2,
+ 'miércoles' => 3,
+ 'jueves' => 4,
+ 'viernes' => 5,
+ 'sábado' => 6,
+ 'domingo' => 7,
+ // Finnish
+ 'maanantai' => 1,
+ 'tiistai' => 2,
+ 'keskiviikko' => 3,
+ 'torstai' => 4,
+ 'perjantai' => 5,
+ 'lauantai' => 6,
+ 'sunnuntai' => 7,
+ // Hungarian
+ 'hétfő' => 1,
+ 'kedd' => 2,
+ 'szerda' => 3,
+ 'csütörtok' => 4,
+ 'péntek' => 5,
+ 'szombat' => 6,
+ 'vasárnap' => 7,
+ // Greek
+ 'Δευ' => 1,
+ 'Τρι' => 2,
+ 'Τετ' => 3,
+ 'Πεμ' => 4,
+ 'Παρ' => 5,
+ 'Σαβ' => 6,
+ 'Κυρ' => 7,
+ );
+
+ /**
+ * List of months, calendar month name => calendar month number
+ *
+ * @access protected
+ * @var array
+ */
+ var $month = array(
+ // English
+ 'jan' => 1,
+ 'january' => 1,
+ 'feb' => 2,
+ 'february' => 2,
+ 'mar' => 3,
+ 'march' => 3,
+ 'apr' => 4,
+ 'april' => 4,
+ 'may' => 5,
+ // No long form of May
+ 'jun' => 6,
+ 'june' => 6,
+ 'jul' => 7,
+ 'july' => 7,
+ 'aug' => 8,
+ 'august' => 8,
+ 'sep' => 9,
+ 'september' => 8,
+ 'oct' => 10,
+ 'october' => 10,
+ 'nov' => 11,
+ 'november' => 11,
+ 'dec' => 12,
+ 'december' => 12,
+ // Dutch
+ 'januari' => 1,
+ 'februari' => 2,
+ 'maart' => 3,
+ 'april' => 4,
+ 'mei' => 5,
+ 'juni' => 6,
+ 'juli' => 7,
+ 'augustus' => 8,
+ 'september' => 9,
+ 'oktober' => 10,
+ 'november' => 11,
+ 'december' => 12,
+ // French
+ 'janvier' => 1,
+ 'février' => 2,
+ 'mars' => 3,
+ 'avril' => 4,
+ 'mai' => 5,
+ 'juin' => 6,
+ 'juillet' => 7,
+ 'août' => 8,
+ 'septembre' => 9,
+ 'octobre' => 10,
+ 'novembre' => 11,
+ 'décembre' => 12,
+ // German
+ 'januar' => 1,
+ 'februar' => 2,
+ 'märz' => 3,
+ 'april' => 4,
+ 'mai' => 5,
+ 'juni' => 6,
+ 'juli' => 7,
+ 'august' => 8,
+ 'september' => 9,
+ 'oktober' => 10,
+ 'november' => 11,
+ 'dezember' => 12,
+ // Italian
+ 'gennaio' => 1,
+ 'febbraio' => 2,
+ 'marzo' => 3,
+ 'aprile' => 4,
+ 'maggio' => 5,
+ 'giugno' => 6,
+ 'luglio' => 7,
+ 'agosto' => 8,
+ 'settembre' => 9,
+ 'ottobre' => 10,
+ 'novembre' => 11,
+ 'dicembre' => 12,
+ // Spanish
+ 'enero' => 1,
+ 'febrero' => 2,
+ 'marzo' => 3,
+ 'abril' => 4,
+ 'mayo' => 5,
+ 'junio' => 6,
+ 'julio' => 7,
+ 'agosto' => 8,
+ 'septiembre' => 9,
+ 'setiembre' => 9,
+ 'octubre' => 10,
+ 'noviembre' => 11,
+ 'diciembre' => 12,
+ // Finnish
+ 'tammikuu' => 1,
+ 'helmikuu' => 2,
+ 'maaliskuu' => 3,
+ 'huhtikuu' => 4,
+ 'toukokuu' => 5,
+ 'kesäkuu' => 6,
+ 'heinäkuu' => 7,
+ 'elokuu' => 8,
+ 'suuskuu' => 9,
+ 'lokakuu' => 10,
+ 'marras' => 11,
+ 'joulukuu' => 12,
+ // Hungarian
+ 'január' => 1,
+ 'február' => 2,
+ 'március' => 3,
+ 'április' => 4,
+ 'május' => 5,
+ 'június' => 6,
+ 'július' => 7,
+ 'augusztus' => 8,
+ 'szeptember' => 9,
+ 'október' => 10,
+ 'november' => 11,
+ 'december' => 12,
+ // Greek
+ 'Ιαν' => 1,
+ 'Φεβ' => 2,
+ 'Μάώ' => 3,
+ 'Μαώ' => 3,
+ 'Απρ' => 4,
+ 'Μάι' => 5,
+ 'Μαϊ' => 5,
+ 'Μαι' => 5,
+ 'Ιούν' => 6,
+ 'Ιον' => 6,
+ 'Ιούλ' => 7,
+ 'Ιολ' => 7,
+ 'Αύγ' => 8,
+ 'Αυγ' => 8,
+ 'Σεπ' => 9,
+ 'Οκτ' => 10,
+ 'Νοέ' => 11,
+ 'Δεκ' => 12,
+ );
+
+ /**
+ * List of timezones, abbreviation => offset from UTC
+ *
+ * @access protected
+ * @var array
+ */
+ var $timezone = array(
+ 'ACDT' => 37800,
+ 'ACIT' => 28800,
+ 'ACST' => 34200,
+ 'ACT' => -18000,
+ 'ACWDT' => 35100,
+ 'ACWST' => 31500,
+ 'AEDT' => 39600,
+ 'AEST' => 36000,
+ 'AFT' => 16200,
+ 'AKDT' => -28800,
+ 'AKST' => -32400,
+ 'AMDT' => 18000,
+ 'AMT' => -14400,
+ 'ANAST' => 46800,
+ 'ANAT' => 43200,
+ 'ART' => -10800,
+ 'AZOST' => -3600,
+ 'AZST' => 18000,
+ 'AZT' => 14400,
+ 'BIOT' => 21600,
+ 'BIT' => -43200,
+ 'BOT' => -14400,
+ 'BRST' => -7200,
+ 'BRT' => -10800,
+ 'BST' => 3600,
+ 'BTT' => 21600,
+ 'CAST' => 18000,
+ 'CAT' => 7200,
+ 'CCT' => 23400,
+ 'CDT' => -18000,
+ 'CEDT' => 7200,
+ 'CET' => 3600,
+ 'CGST' => -7200,
+ 'CGT' => -10800,
+ 'CHADT' => 49500,
+ 'CHAST' => 45900,
+ 'CIST' => -28800,
+ 'CKT' => -36000,
+ 'CLDT' => -10800,
+ 'CLST' => -14400,
+ 'COT' => -18000,
+ 'CST' => -21600,
+ 'CVT' => -3600,
+ 'CXT' => 25200,
+ 'DAVT' => 25200,
+ 'DTAT' => 36000,
+ 'EADT' => -18000,
+ 'EAST' => -21600,
+ 'EAT' => 10800,
+ 'ECT' => -18000,
+ 'EDT' => -14400,
+ 'EEST' => 10800,
+ 'EET' => 7200,
+ 'EGT' => -3600,
+ 'EKST' => 21600,
+ 'EST' => -18000,
+ 'FJT' => 43200,
+ 'FKDT' => -10800,
+ 'FKST' => -14400,
+ 'FNT' => -7200,
+ 'GALT' => -21600,
+ 'GEDT' => 14400,
+ 'GEST' => 10800,
+ 'GFT' => -10800,
+ 'GILT' => 43200,
+ 'GIT' => -32400,
+ 'GST' => 14400,
+ 'GST' => -7200,
+ 'GYT' => -14400,
+ 'HAA' => -10800,
+ 'HAC' => -18000,
+ 'HADT' => -32400,
+ 'HAE' => -14400,
+ 'HAP' => -25200,
+ 'HAR' => -21600,
+ 'HAST' => -36000,
+ 'HAT' => -9000,
+ 'HAY' => -28800,
+ 'HKST' => 28800,
+ 'HMT' => 18000,
+ 'HNA' => -14400,
+ 'HNC' => -21600,
+ 'HNE' => -18000,
+ 'HNP' => -28800,
+ 'HNR' => -25200,
+ 'HNT' => -12600,
+ 'HNY' => -32400,
+ 'IRDT' => 16200,
+ 'IRKST' => 32400,
+ 'IRKT' => 28800,
+ 'IRST' => 12600,
+ 'JFDT' => -10800,
+ 'JFST' => -14400,
+ 'JST' => 32400,
+ 'KGST' => 21600,
+ 'KGT' => 18000,
+ 'KOST' => 39600,
+ 'KOVST' => 28800,
+ 'KOVT' => 25200,
+ 'KRAST' => 28800,
+ 'KRAT' => 25200,
+ 'KST' => 32400,
+ 'LHDT' => 39600,
+ 'LHST' => 37800,
+ 'LINT' => 50400,
+ 'LKT' => 21600,
+ 'MAGST' => 43200,
+ 'MAGT' => 39600,
+ 'MAWT' => 21600,
+ 'MDT' => -21600,
+ 'MESZ' => 7200,
+ 'MEZ' => 3600,
+ 'MHT' => 43200,
+ 'MIT' => -34200,
+ 'MNST' => 32400,
+ 'MSDT' => 14400,
+ 'MSST' => 10800,
+ 'MST' => -25200,
+ 'MUT' => 14400,
+ 'MVT' => 18000,
+ 'MYT' => 28800,
+ 'NCT' => 39600,
+ 'NDT' => -9000,
+ 'NFT' => 41400,
+ 'NMIT' => 36000,
+ 'NOVST' => 25200,
+ 'NOVT' => 21600,
+ 'NPT' => 20700,
+ 'NRT' => 43200,
+ 'NST' => -12600,
+ 'NUT' => -39600,
+ 'NZDT' => 46800,
+ 'NZST' => 43200,
+ 'OMSST' => 25200,
+ 'OMST' => 21600,
+ 'PDT' => -25200,
+ 'PET' => -18000,
+ 'PETST' => 46800,
+ 'PETT' => 43200,
+ 'PGT' => 36000,
+ 'PHOT' => 46800,
+ 'PHT' => 28800,
+ 'PKT' => 18000,
+ 'PMDT' => -7200,
+ 'PMST' => -10800,
+ 'PONT' => 39600,
+ 'PST' => -28800,
+ 'PWT' => 32400,
+ 'PYST' => -10800,
+ 'PYT' => -14400,
+ 'RET' => 14400,
+ 'ROTT' => -10800,
+ 'SAMST' => 18000,
+ 'SAMT' => 14400,
+ 'SAST' => 7200,
+ 'SBT' => 39600,
+ 'SCDT' => 46800,
+ 'SCST' => 43200,
+ 'SCT' => 14400,
+ 'SEST' => 3600,
+ 'SGT' => 28800,
+ 'SIT' => 28800,
+ 'SRT' => -10800,
+ 'SST' => -39600,
+ 'SYST' => 10800,
+ 'SYT' => 7200,
+ 'TFT' => 18000,
+ 'THAT' => -36000,
+ 'TJT' => 18000,
+ 'TKT' => -36000,
+ 'TMT' => 18000,
+ 'TOT' => 46800,
+ 'TPT' => 32400,
+ 'TRUT' => 36000,
+ 'TVT' => 43200,
+ 'TWT' => 28800,
+ 'UYST' => -7200,
+ 'UYT' => -10800,
+ 'UZT' => 18000,
+ 'VET' => -14400,
+ 'VLAST' => 39600,
+ 'VLAT' => 36000,
+ 'VOST' => 21600,
+ 'VUT' => 39600,
+ 'WAST' => 7200,
+ 'WAT' => 3600,
+ 'WDT' => 32400,
+ 'WEST' => 3600,
+ 'WFT' => 43200,
+ 'WIB' => 25200,
+ 'WIT' => 32400,
+ 'WITA' => 28800,
+ 'WKST' => 18000,
+ 'WST' => 28800,
+ 'YAKST' => 36000,
+ 'YAKT' => 32400,
+ 'YAPT' => 36000,
+ 'YEKST' => 21600,
+ 'YEKT' => 18000,
+ );
+
+ /**
+ * Cached PCRE for SimplePie_Parse_Date::$day
+ *
+ * @access protected
+ * @var string
+ */
+ var $day_pcre;
+
+ /**
+ * Cached PCRE for SimplePie_Parse_Date::$month
+ *
+ * @access protected
+ * @var string
+ */
+ var $month_pcre;
+
+ /**
+ * Array of user-added callback methods
+ *
+ * @access private
+ * @var array
+ */
+ var $built_in = array();
+
+ /**
+ * Array of user-added callback methods
+ *
+ * @access private
+ * @var array
+ */
+ var $user = array();
+
+ /**
+ * Create new SimplePie_Parse_Date object, and set self::day_pcre,
+ * self::month_pcre, and self::built_in
+ *
+ * @access private
+ */
+ function SimplePie_Parse_Date()
+ {
+ $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
+ $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';
+
+ static $cache;
+ if (!isset($cache[get_class($this)]))
+ {
+ $all_methods = get_class_methods($this);
+
+ foreach ($all_methods as $method)
+ {
+ if (strtolower(substr($method, 0, 5)) === 'date_')
+ {
+ $cache[get_class($this)][] = $method;
+ }
+ }
+ }
+
+ foreach ($cache[get_class($this)] as $method)
+ {
+ $this->built_in[] = $method;
+ }
+ }
+
+ /**
+ * Get the object
+ *
+ * @access public
+ */
+ function get()
+ {
+ static $object;
+ if (!$object)
+ {
+ $object = new SimplePie_Parse_Date;
+ }
+ return $object;
+ }
+
+ /**
+ * Parse a date
+ *
+ * @final
+ * @access public
+ * @param string $date Date to parse
+ * @return int Timestamp corresponding to date string, or false on failure
+ */
+ function parse($date)
+ {
+ foreach ($this->user as $method)
+ {
+ if (($returned = call_user_func($method, $date)) !== false)
+ {
+ return $returned;
+ }
+ }
+
+ foreach ($this->built_in as $method)
+ {
+ if (($returned = call_user_func(array(&$this, $method), $date)) !== false)
+ {
+ return $returned;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Add a callback method to parse a date
+ *
+ * @final
+ * @access public
+ * @param callback $callback
+ */
+ function add_callback($callback)
+ {
+ if (is_callable($callback))
+ {
+ $this->user[] = $callback;
+ }
+ else
+ {
+ trigger_error('User-supplied function must be a valid callback', E_USER_WARNING);
+ }
+ }
+
+ /**
+ * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as
+ * well as allowing any of upper or lower case "T", horizontal tabs, or
+ * spaces to be used as the time seperator (including more than one))
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ function date_w3cdtf($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $year = '([0-9]{4})';
+ $month = $day = $hour = $minute = $second = '([0-9]{2})';
+ $decimal = '([0-9]*)';
+ $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))';
+ $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Year
+ 2: Month
+ 3: Day
+ 4: Hour
+ 5: Minute
+ 6: Second
+ 7: Decimal fraction of a second
+ 8: Zulu
+ 9: Timezone ±
+ 10: Timezone hours
+ 11: Timezone minutes
+ */
+
+ // Fill in empty matches
+ for ($i = count($match); $i <= 3; $i++)
+ {
+ $match[$i] = '1';
+ }
+
+ for ($i = count($match); $i <= 7; $i++)
+ {
+ $match[$i] = '0';
+ }
+
+ // Numeric timezone
+ if (isset($match[9]) && $match[9] !== '')
+ {
+ $timezone = $match[10] * 3600;
+ $timezone += $match[11] * 60;
+ if ($match[9] === '-')
+ {
+ $timezone = 0 - $timezone;
+ }
+ }
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Convert the number of seconds to an integer, taking decimals into account
+ $second = round($match[6] + $match[7] / pow(10, strlen($match[7])));
+
+ return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Remove RFC822 comments
+ *
+ * @access protected
+ * @param string $data Data to strip comments from
+ * @return string Comment stripped string
+ */
+ function remove_rfc2822_comments($string)
+ {
+ $string = (string) $string;
+ $position = 0;
+ $length = strlen($string);
+ $depth = 0;
+
+ $output = '';
+
+ while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
+ {
+ $output .= substr($string, $position, $pos - $position);
+ $position = $pos + 1;
+ if ($string[$pos - 1] !== '\\')
+ {
+ $depth++;
+ while ($depth && $position < $length)
+ {
+ $position += strcspn($string, '()', $position);
+ if ($string[$position - 1] === '\\')
+ {
+ $position++;
+ continue;
+ }
+ elseif (isset($string[$position]))
+ {
+ switch ($string[$position])
+ {
+ case '(':
+ $depth++;
+ break;
+
+ case ')':
+ $depth--;
+ break;
+ }
+ $position++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ $output .= '(';
+ }
+ }
+ $output .= substr($string, $position);
+
+ return $output;
+ }
+
+ /**
+ * Parse RFC2822's date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ function date_rfc2822($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $wsp = '[\x09\x20]';
+ $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)';
+ $optional_fws = $fws . '?';
+ $day_name = $this->day_pcre;
+ $month = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $hour = $minute = $second = '([0-9]{2})';
+ $year = '([0-9]{2,4})';
+ $num_zone = '([+\-])([0-9]{2})([0-9]{2})';
+ $character_zone = '([A-Z]{1,5})';
+ $zone = '(?:' . $num_zone . '|' . $character_zone . ')';
+ $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i';
+ }
+ if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Day
+ 3: Month
+ 4: Year
+ 5: Hour
+ 6: Minute
+ 7: Second
+ 8: Timezone ±
+ 9: Timezone hours
+ 10: Timezone minutes
+ 11: Alphabetic timezone
+ */
+
+ // Find the month number
+ $month = $this->month[strtolower($match[3])];
+
+ // Numeric timezone
+ if ($match[8] !== '')
+ {
+ $timezone = $match[9] * 3600;
+ $timezone += $match[10] * 60;
+ if ($match[8] === '-')
+ {
+ $timezone = 0 - $timezone;
+ }
+ }
+ // Character timezone
+ elseif (isset($this->timezone[strtoupper($match[11])]))
+ {
+ $timezone = $this->timezone[strtoupper($match[11])];
+ }
+ // Assume everything else to be -0000
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Deal with 2/3 digit years
+ if ($match[4] < 50)
+ {
+ $match[4] += 2000;
+ }
+ elseif ($match[4] < 1000)
+ {
+ $match[4] += 1900;
+ }
+
+ // Second is optional, if it is empty set it to zero
+ if ($match[7] !== '')
+ {
+ $second = $match[7];
+ }
+ else
+ {
+ $second = 0;
+ }
+
+ return gmmktime($match[5], $match[6], $second, $month, $match[2], $match[4]) - $timezone;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Parse RFC850's date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ function date_rfc850($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $space = '[\x09\x20]+';
+ $day_name = $this->day_pcre;
+ $month = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $year = $hour = $minute = $second = '([0-9]{2})';
+ $zone = '([A-Z]{1,5})';
+ $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Day
+ 3: Month
+ 4: Year
+ 5: Hour
+ 6: Minute
+ 7: Second
+ 8: Timezone
+ */
+
+ // Month
+ $month = $this->month[strtolower($match[3])];
+
+ // Character timezone
+ if (isset($this->timezone[strtoupper($match[8])]))
+ {
+ $timezone = $this->timezone[strtoupper($match[8])];
+ }
+ // Assume everything else to be -0000
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Deal with 2 digit year
+ if ($match[4] < 50)
+ {
+ $match[4] += 2000;
+ }
+ else
+ {
+ $match[4] += 1900;
+ }
+
+ return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Parse C99's asctime()'s date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ function date_asctime($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $space = '[\x09\x20]+';
+ $wday_name = $this->day_pcre;
+ $mon_name = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $hour = $sec = $min = '([0-9]{2})';
+ $year = '([0-9]{4})';
+ $terminator = '\x0A?\x00?';
+ $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Month
+ 3: Day
+ 4: Hour
+ 5: Minute
+ 6: Second
+ 7: Year
+ */
+
+ $month = $this->month[strtolower($match[2])];
+ return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Parse dates using strtotime()
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ function date_strtotime($date)
+ {
+ $strtotime = strtotime($date);
+ if ($strtotime === -1 || $strtotime === false)
+ {
+ return false;
+ }
+ else
+ {
+ return $strtotime;
+ }
+ }
+}
+
+/**
+ * Content-type sniffing
+ *
+ * @package SimplePie
+ */
+class SimplePie_Content_Type_Sniffer
+{
+ /**
+ * File object
+ *
+ * @var SimplePie_File
+ * @access private
+ */
+ var $file;
+
+ /**
+ * Create an instance of the class with the input file
+ *
+ * @access public
+ * @param SimplePie_Content_Type_Sniffer $file Input file
+ */
+ function SimplePie_Content_Type_Sniffer($file)
+ {
+ $this->file = $file;
+ }
+
+ /**
+ * Get the Content-Type of the specified file
+ *
+ * @access public
+ * @return string Actual Content-Type
+ */
+ function get_type()
+ {
+ if (isset($this->file->headers['content-type']))
+ {
+ if (!isset($this->file->headers['content-encoding'])
+ && ($this->file->headers['content-type'] === 'text/plain'
+ || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
+ || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'))
+ {
+ return $this->text_or_binary();
+ }
+
+ if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
+ {
+ $official = substr($this->file->headers['content-type'], 0, $pos);
+ }
+ else
+ {
+ $official = $this->file->headers['content-type'];
+ }
+ $official = strtolower($official);
+
+ if ($official === 'unknown/unknown'
+ || $official === 'application/unknown')
+ {
+ return $this->unknown();
+ }
+ elseif (substr($official, -4) === '+xml'
+ || $official === 'text/xml'
+ || $official === 'application/xml')
+ {
+ return $official;
+ }
+ elseif (substr($official, 0, 6) === 'image/')
+ {
+ if ($return = $this->image())
+ {
+ return $return;
+ }
+ else
+ {
+ return $official;
+ }
+ }
+ elseif ($official === 'text/html')
+ {
+ return $this->feed_or_html();
+ }
+ else
+ {
+ return $official;
+ }
+ }
+ else
+ {
+ return $this->unknown();
+ }
+ }
+
+ /**
+ * Sniff text or binary
+ *
+ * @access private
+ * @return string Actual Content-Type
+ */
+ function text_or_binary()
+ {
+ if (substr($this->file->body, 0, 2) === "\xFE\xFF"
+ || substr($this->file->body, 0, 2) === "\xFF\xFE"
+ || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF"
+ || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF")
+ {
+ return 'text/plain';
+ }
+ elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
+ {
+ return 'application/octect-stream';
+ }
+ else
+ {
+ return 'text/plain';
+ }
+ }
+
+ /**
+ * Sniff unknown
+ *
+ * @access private
+ * @return string Actual Content-Type
+ */
+ function unknown()
+ {
+ $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20");
+ if (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html'
+ || strtolower(substr($this->file->body, $ws, 5)) === '<html'
+ || strtolower(substr($this->file->body, $ws, 7)) === '<script')
+ {
+ return 'text/html';
+ }
+ elseif (substr($this->file->body, 0, 5) === '%PDF-')
+ {
+ return 'application/pdf';
+ }
+ elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-')
+ {
+ return 'application/postscript';
+ }
+ elseif (substr($this->file->body, 0, 6) === 'GIF87a'
+ || substr($this->file->body, 0, 6) === 'GIF89a')
+ {
+ return 'image/gif';
+ }
+ elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
+ {
+ return 'image/png';
+ }
+ elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF")
+ {
+ return 'image/jpeg';
+ }
+ elseif (substr($this->file->body, 0, 2) === "\x42\x4D")
+ {
+ return 'image/bmp';
+ }
+ else
+ {
+ return $this->text_or_binary();
+ }
+ }
+
+ /**
+ * Sniff images
+ *
+ * @access private
+ * @return string Actual Content-Type
+ */
+ function image()
+ {
+ if (substr($this->file->body, 0, 6) === 'GIF87a'
+ || substr($this->file->body, 0, 6) === 'GIF89a')
+ {
+ return 'image/gif';
+ }
+ elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
+ {
+ return 'image/png';
+ }
+ elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF")
+ {
+ return 'image/jpeg';
+ }
+ elseif (substr($this->file->body, 0, 2) === "\x42\x4D")
+ {
+ return 'image/bmp';
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Sniff HTML
+ *
+ * @access private
+ * @return string Actual Content-Type
+ */
+ function feed_or_html()
+ {
+ $len = strlen($this->file->body);
+ $pos = strspn($this->file->body, "\x09\x0A\x0D\x20");
+
+ while ($pos < $len)
+ {
+ switch ($this->file->body[$pos])
+ {
+ case "\x09":
+ case "\x0A":
+ case "\x0D":
+ case "\x20":
+ $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos);
+ continue 2;
+
+ case '<':
+ $pos++;
+ break;
+
+ default:
+ return 'text/html';
+ }
+
+ if (substr($this->file->body, $pos, 3) === '!--')
+ {
+ $pos += 3;
+ if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false)
+ {
+ $pos += 3;
+ }
+ else
+ {
+ return 'text/html';
+ }
+ }
+ elseif (substr($this->file->body, $pos, 1) === '!')
+ {
+ if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false)
+ {
+ $pos++;
+ }
+ else
+ {
+ return 'text/html';
+ }
+ }
+ elseif (substr($this->file->body, $pos, 1) === '?')
+ {
+ if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false)
+ {
+ $pos += 2;
+ }
+ else
+ {
+ return 'text/html';
+ }
+ }
+ elseif (substr($this->file->body, $pos, 3) === 'rss'
+ || substr($this->file->body, $pos, 7) === 'rdf:RDF')
+ {
+ return 'application/rss+xml';
+ }
+ elseif (substr($this->file->body, $pos, 4) === 'feed')
+ {
+ return 'application/atom+xml';
+ }
+ else
+ {
+ return 'text/html';
+ }
+ }
+
+ return 'text/html';
+ }
+}
+
+/**
+ * Parses the XML Declaration
+ *
+ * @package SimplePie
+ */
+class SimplePie_XML_Declaration_Parser
+{
+ /**
+ * XML Version
+ *
+ * @access public
+ * @var string
+ */
+ var $version = '1.0';
+
+ /**
+ * Encoding
+ *
+ * @access public
+ * @var string
+ */
+ var $encoding = 'UTF-8';
+
+ /**
+ * Standalone
+ *
+ * @access public
+ * @var bool
+ */
+ var $standalone = false;
+
+ /**
+ * Current state of the state machine
+ *
+ * @access private
+ * @var string
+ */
+ var $state = 'before_version_name';
+
+ /**
+ * Input data
+ *
+ * @access private
+ * @var string
+ */
+ var $data = '';
+
+ /**
+ * Input data length (to avoid calling strlen() everytime this is needed)
+ *
+ * @access private
+ * @var int
+ */
+ var $data_length = 0;
+
+ /**
+ * Current position of the pointer
+ *
+ * @var int
+ * @access private
+ */
+ var $position = 0;
+
+ /**
+ * Create an instance of the class with the input data
+ *
+ * @access public
+ * @param string $data Input data
+ */
+ function SimplePie_XML_Declaration_Parser($data)
+ {
+ $this->data = $data;
+ $this->data_length = strlen($this->data);
+ }
+
+ /**
+ * Parse the input data
+ *
+ * @access public
+ * @return bool true on success, false on failure
+ */
+ function parse()
+ {
+ while ($this->state && $this->state !== 'emit' && $this->has_data())
+ {
+ $state = $this->state;
+ $this->$state();
+ }
+ $this->data = '';
+ if ($this->state === 'emit')
+ {
+ return true;
+ }
+ else
+ {
+ $this->version = '';
+ $this->encoding = '';
+ $this->standalone = '';
+ return false;
+ }
+ }
+
+ /**
+ * Check whether there is data beyond the pointer
+ *
+ * @access private
+ * @return bool true if there is further data, false if not
+ */
+ function has_data()
+ {
+ return (bool) ($this->position < $this->data_length);
+ }
+
+ /**
+ * Advance past any whitespace
+ *
+ * @return int Number of whitespace characters passed
+ */
+ function skip_whitespace()
+ {
+ $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position);
+ $this->position += $whitespace;
+ return $whitespace;
+ }
+
+ /**
+ * Read value
+ */
+ function get_value()
+ {
+ $quote = substr($this->data, $this->position, 1);
+ if ($quote === '"' || $quote === "'")
+ {
+ $this->position++;
+ $len = strcspn($this->data, $quote, $this->position);
+ if ($this->has_data())
+ {
+ $value = substr($this->data, $this->position, $len);
+ $this->position += $len + 1;
+ return $value;
+ }
+ }
+ return false;
+ }
+
+ function before_version_name()
+ {
+ if ($this->skip_whitespace())
+ {
+ $this->state = 'version_name';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function version_name()
+ {
+ if (substr($this->data, $this->position, 7) === 'version')
+ {
+ $this->position += 7;
+ $this->skip_whitespace();
+ $this->state = 'version_equals';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function version_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'version_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function version_value()
+ {
+ if ($this->version = $this->get_value())
+ {
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = 'encoding_name';
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function encoding_name()
+ {
+ if (substr($this->data, $this->position, 8) === 'encoding')
+ {
+ $this->position += 8;
+ $this->skip_whitespace();
+ $this->state = 'encoding_equals';
+ }
+ else
+ {
+ $this->state = 'standalone_name';
+ }
+ }
+
+ function encoding_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'encoding_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function encoding_value()
+ {
+ if ($this->encoding = $this->get_value())
+ {
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = 'standalone_name';
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function standalone_name()
+ {
+ if (substr($this->data, $this->position, 10) === 'standalone')
+ {
+ $this->position += 10;
+ $this->skip_whitespace();
+ $this->state = 'standalone_equals';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function standalone_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'standalone_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ function standalone_value()
+ {
+ if ($standalone = $this->get_value())
+ {
+ switch ($standalone)
+ {
+ case 'yes':
+ $this->standalone = true;
+ break;
+
+ case 'no':
+ $this->standalone = false;
+ break;
+
+ default:
+ $this->state = false;
+ return;
+ }
+
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = false;
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+}
+
class SimplePie_Locator
{
var $useragent;
@@ -10005,23 +14084,34 @@ class SimplePie_Locator
var $base_location = 0;
var $checked_feeds = 0;
var $max_checked_feeds = 10;
+ var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer';
- function SimplePie_Locator(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10)
+ function SimplePie_Locator(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer')
{
$this->file =& $file;
$this->file_class = $file_class;
$this->useragent = $useragent;
$this->timeout = $timeout;
$this->max_checked_feeds = $max_checked_feeds;
+ $this->content_type_sniffer_class = $content_type_sniffer_class;
}
- function find($type = SIMPLEPIE_LOCATOR_ALL)
+ function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
{
if ($this->is_feed($this->file))
{
return $this->file;
}
+ if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
+ {
+ $sniffer = new $this->content_type_sniffer_class($this->file);
+ if ($sniffer->get_type() !== 'text/html')
+ {
+ return null;
+ }
+ }
+
if ($type & ~SIMPLEPIE_LOCATOR_NONE)
{
$this->get_base();
@@ -10029,7 +14119,7 @@ class SimplePie_Locator
if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())
{
- return $working;
+ return $working[0];
}
if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
@@ -10059,24 +14149,32 @@ class SimplePie_Locator
function is_feed(&$file)
{
- $body = SimplePie_Misc::strip_comments($file->body);
- if (preg_match('/<([^\s:]+:)?(rss|RDF|feed)' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/i', $body))
+ if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
{
- return true;
+ $sniffer = new $this->content_type_sniffer_class($file);
+ $sniffed = $sniffer->get_type();
+ if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml')))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
- return false;
- }
-
- function get_base()
- {
- if (isset($this->file->headers['content-location']))
+ elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)
{
- $this->http_base = SimplePie_Misc::absolutize_url(trim($this->file->headers['content-location']), $this->file->url);
+ return true;
}
else
{
- $this->http_base = $this->file->url;
+ return false;
}
+ }
+
+ function get_base()
+ {
+ $this->http_base = $this->file->url;
$this->base = $this->http_base;
$elements = SimplePie_Misc::get_element('base', $this->file->body);
foreach ($elements as $element)
@@ -10094,9 +14192,10 @@ class SimplePie_Locator
{
$links = array_merge(SimplePie_Misc::get_element('link', $this->file->body), SimplePie_Misc::get_element('a', $this->file->body), SimplePie_Misc::get_element('area', $this->file->body));
$done = array();
+ $feeds = array();
foreach ($links as $link)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
@@ -10113,19 +14212,26 @@ class SimplePie_Locator
$href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->http_base);
}
- if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))))
+ if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
{
$this->checked_feeds++;
$feed = new $this->file_class($href, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
- return $feed;
+ $feeds[$href] = $feed;
}
}
$done[] = $href;
}
}
- return null;
+
+ if (!empty($feeds))
+ {
+ return array_values($feeds);
+ }
+ else {
+ return null;
+ }
}
function get_links()
@@ -10150,7 +14256,7 @@ class SimplePie_Locator
$current = SimplePie_Misc::parse_url($this->file->url);
- if ($parsed['authority'] === '' || $parsed['authority'] == $current['authority'])
+ if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])
{
$this->local[] = $href;
}
@@ -10174,7 +14280,7 @@ class SimplePie_Locator
{
foreach ($array as $key => $value)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
@@ -10182,7 +14288,7 @@ class SimplePie_Locator
{
$this->checked_feeds++;
$feed = new $this->file_class($value, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
return $feed;
}
@@ -10199,7 +14305,7 @@ class SimplePie_Locator
{
foreach ($array as $key => $value)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
@@ -10207,7 +14313,7 @@ class SimplePie_Locator
{
$this->checked_feeds++;
$feed = new $this->file_class($value, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
return $feed;
}
@@ -10223,14 +14329,12 @@ class SimplePie_Locator
class SimplePie_Parser
{
- var $xml;
var $error_code;
var $error_string;
var $current_line;
var $current_column;
var $current_byte;
var $separator = ' ';
- var $feed = false;
var $namespace = array('');
var $element = array('');
var $xml_base = array('');
@@ -10241,10 +14345,10 @@ class SimplePie_Parser
var $current_xhtml_construct = -1;
var $encoding;
- function pre_process(&$data, $encoding)
+ function parse(&$data, $encoding)
{
// Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
- if (strtoupper($encoding) == 'US-ASCII')
+ if (strtoupper($encoding) === 'US-ASCII')
{
$this->encoding = 'UTF-8';
}
@@ -10255,68 +14359,150 @@ class SimplePie_Parser
// Strip BOM:
// UTF-32 Big Endian BOM
- if (strpos($data, "\x0\x0\xFE\xFF") === 0)
+ if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
{
$data = substr($data, 4);
}
// UTF-32 Little Endian BOM
- elseif (strpos($data, "\xFF\xFE\x0\x0") === 0)
+ elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00")
{
$data = substr($data, 4);
}
// UTF-16 Big Endian BOM
- elseif (strpos($data, "\xFE\xFF") === 0)
+ elseif (substr($data, 0, 2) === "\xFE\xFF")
{
$data = substr($data, 2);
}
// UTF-16 Little Endian BOM
- elseif (strpos($data, "\xFF\xFE") === 0)
+ elseif (substr($data, 0, 2) === "\xFF\xFE")
{
$data = substr($data, 2);
}
// UTF-8 BOM
- elseif (strpos($data, "\xEF\xBB\xBF") === 0)
+ elseif (substr($data, 0, 3) === "\xEF\xBB\xBF")
{
$data = substr($data, 3);
}
- // Make sure the XML prolog is sane and has the correct encoding
- $data = preg_replace("/^<\?xml[\x20\x9\xD\xA]+version([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"1.0\"|'1.0'|\"1.1\"|'1.1')([\x20\x9\xD\xA]+encoding([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"[A-Za-z][A-Za-z0-9._\-]*\"|'[A-Za-z][A-Za-z0-9._\-]*'))?([\x20\x9\xD\xA]+standalone([\x20\x9\xD\xA]+)?=([\x20\x9\xD\xA]+)?(\"(yes|no)\"|'(yes|no)'))?([\x20\x9\xD\xA]+)?\?>/", '', $data);
- $data = "<?xml version='1.0' encoding='$encoding'?>\n" . $data;
- }
+ if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false)
+ {
+ $declaration = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
+ if ($declaration->parse())
+ {
+ $data = substr($data, $pos + 2);
+ $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . $data;
+ }
+ else
+ {
+ $this->error_string = 'SimplePie bug! Please report this!';
+ return false;
+ }
+ }
- function parse(&$data)
- {
$return = true;
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
+ {
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '<foo>&amp;</foo>', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
+ }
+
// Create the parser
- $this->xml = xml_parser_create_ns($this->encoding, $this->separator);
- xml_parser_set_option($this->xml, XML_OPTION_SKIP_WHITE, 1);
- xml_parser_set_option($this->xml, XML_OPTION_CASE_FOLDING, 0);
- xml_set_object($this->xml, $this);
- xml_set_character_data_handler($this->xml, 'cdata');
- xml_set_element_handler($this->xml, 'tag_open', 'tag_close');
-
- // workound for a bug in PHP/libxml2 as described on http://bugs.simplepie.org/issues/show/101
- $data = str_replace('&lt;', '&#60;', $data);
- $data = str_replace('&gt;', '&#62;', $data);
- $data = str_replace('&amp;', '&#38;', $data);
- $data = str_replace('&apos;', '&#39;', $data);
- $data = str_replace('&quot;', '&#34;', $data);
-
- // Parse!
- if (!xml_parse($this->xml, $data, true))
- {
- $this->data = null;
- $this->error_code = xml_get_error_code($this->xml);
- $this->error_string = xml_error_string($this->error_code);
- $return = false;
- }
- $this->current_line = xml_get_current_line_number($this->xml);
- $this->current_column = xml_get_current_column_number($this->xml);
- $this->current_byte = xml_get_current_byte_index($this->xml);
- xml_parser_free($this->xml);
- return $return;
+ if ($xml_is_sane)
+ {
+ $xml = xml_parser_create_ns($this->encoding, $this->separator);
+ xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
+ xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
+ xml_set_object($xml, $this);
+ xml_set_character_data_handler($xml, 'cdata');
+ xml_set_element_handler($xml, 'tag_open', 'tag_close');
+
+ // Parse!
+ if (!xml_parse($xml, $data, true))
+ {
+ $this->error_code = xml_get_error_code($xml);
+ $this->error_string = xml_error_string($this->error_code);
+ $return = false;
+ }
+ $this->current_line = xml_get_current_line_number($xml);
+ $this->current_column = xml_get_current_column_number($xml);
+ $this->current_byte = xml_get_current_byte_index($xml);
+ xml_parser_free($xml);
+ return $return;
+ }
+ else
+ {
+ libxml_clear_errors();
+ $xml = new XMLReader();
+ $xml->xml($data);
+ while (@$xml->read())
+ {
+ switch ($xml->nodeType)
+ {
+
+ case constant('XMLReader::END_ELEMENT'):
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $this->tag_close(null, $tagName);
+ break;
+ case constant('XMLReader::ELEMENT'):
+ $empty = $xml->isEmptyElement;
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $attributes = array();
+ while ($xml->moveToNextAttribute())
+ {
+ if ($xml->namespaceURI !== '')
+ {
+ $attrName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $attrName = $xml->localName;
+ }
+ $attributes[$attrName] = $xml->value;
+ }
+ $this->tag_open(null, $tagName, $attributes);
+ if ($empty)
+ {
+ $this->tag_close(null, $tagName);
+ }
+ break;
+ case constant('XMLReader::TEXT'):
+
+ case constant('XMLReader::CDATA'):
+ $this->cdata(null, $xml->value);
+ break;
+ }
+ }
+ if ($error = libxml_get_last_error())
+ {
+ $this->error_code = $error->code;
+ $this->error_string = $error->message;
+ $this->current_line = $error->line;
+ $this->current_column = $error->column;
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
}
function get_error_code()
@@ -10351,27 +14537,6 @@ class SimplePie_Parser
function tag_open($parser, $tag, $attributes)
{
- if ($this->feed === 0)
- {
- return;
- }
- elseif ($this->feed == false)
- {
- if (in_array($tag, array(
- SIMPLEPIE_NAMESPACE_ATOM_10 . $this->separator . 'feed',
- SIMPLEPIE_NAMESPACE_ATOM_03 . $this->separator . 'feed',
- 'rss',
- SIMPLEPIE_NAMESPACE_RDF . $this->separator . 'RDF'
- )))
- {
- $this->feed = 1;
- }
- }
- else
- {
- $this->feed++;
- }
-
list($this->namespace[], $this->element[]) = $this->split_ns($tag);
$attribs = array();
@@ -10404,7 +14569,7 @@ class SimplePie_Parser
if ($this->current_xhtml_construct >= 0)
{
$this->current_xhtml_construct++;
- if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML)
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML)
{
$this->data['data'] .= '<' . end($this->element);
if (isset($attribs['']))
@@ -10422,8 +14587,8 @@ class SimplePie_Parser
$this->datas[] =& $this->data;
$this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];
$this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang));
- if ((end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] == 'xml')
- || (end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] == 'xhtml'))
+ if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml'))
{
$this->current_xhtml_construct = 0;
}
@@ -10436,7 +14601,7 @@ class SimplePie_Parser
{
$this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding);
}
- elseif ($this->feed > 1)
+ else
{
$this->data['data'] .= $cdata;
}
@@ -10444,22 +14609,17 @@ class SimplePie_Parser
function tag_close($parser, $tag)
{
- if (!$this->feed)
- {
- return;
- }
-
if ($this->current_xhtml_construct >= 0)
{
$this->current_xhtml_construct--;
- if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
{
$this->data['data'] .= '</' . end($this->element) . '>';
}
}
- if ($this->current_xhtml_construct == -1)
+ if ($this->current_xhtml_construct === -1)
{
- $this->data =& $this->datas[$this->feed];
+ $this->data =& $this->datas[count($this->datas) - 1];
array_pop($this->datas);
}
@@ -10468,7 +14628,6 @@ class SimplePie_Parser
array_pop($this->xml_base);
array_pop($this->xml_base_explicit);
array_pop($this->xml_lang);
- $this->feed--;
}
function split_ns($string)
@@ -10483,7 +14642,19 @@ class SimplePie_Parser
{
$separator_length = strlen($this->separator);
}
- $cache[$string] = array(substr($string, 0, $pos), substr($string, $pos + $separator_length));
+ $namespace = substr($string, 0, $pos);
+ $local_name = substr($string, $pos + $separator_length);
+ if (strtolower($namespace) === SIMPLEPIE_NAMESPACE_ITUNES)
+ {
+ $namespace = SIMPLEPIE_NAMESPACE_ITUNES;
+ }
+
+ // Normalize the Media RSS namespaces
+ if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG)
+ {
+ $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS;
+ }
+ $cache[$string] = array($namespace, $local_name);
}
else
{
@@ -10495,7 +14666,7 @@ class SimplePie_Parser
}
/**
- * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shortern a string while preserving HTML tags
+ * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags
*/
class SimplePie_Sanitize
{
@@ -10667,7 +14838,7 @@ class SimplePie_Sanitize
{
if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
{
- if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/(\w+)' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
+ if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
{
$type |= SIMPLEPIE_CONSTRUCT_HTML;
}
@@ -10722,9 +14893,7 @@ class SimplePie_Sanitize
{
foreach ($this->strip_attributes as $attrib)
{
- $data = preg_replace('/ '. trim($attrib) .'=("|&quot;)(\w|\s|=|-|:|;|\/|\.|\?|&|,|#|!|\(|\)|\'|&apos;|<|>|\+|{|})*("|&quot;)/i', '', $data);
- $data = preg_replace('/ '. trim($attrib) .'=(\'|&apos;)(\w|\s|=|-|:|;|\/|\.|\?|&|,|#|!|\(|\)|"|&quot;|<|>|\+|{|})*(\'|&apos;)/i', '', $data);
- $data = preg_replace('/ '. trim($attrib) .'=(\w|\s|=|-|:|;|\/|\.|\?|&|,|#|!|\(|\)|\+|{|})*/i', '', $data);
+ $data = preg_replace('/(<[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*)' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . trim($attrib) . '(?:\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>/', '\1\2\3>', $data);
}
}
@@ -10743,27 +14912,30 @@ class SimplePie_Sanitize
{
if (isset($img['attribs']['src']['data']))
{
- $image_url = $img['attribs']['src']['data'];
- $cache = new $this->cache_class($this->cache_location, call_user_func($this->cache_name_function, $image_url), 'spi');
+ $image_url = call_user_func($this->cache_name_function, $img['attribs']['src']['data']);
+ $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, $image_url, 'spi');
if ($cache->load())
{
- $img['attribs']['src']['data'] = $this->image_handler . rawurlencode($img['attribs']['src']['data']);
+ $img['attribs']['src']['data'] = $this->image_handler . $image_url;
$data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data);
}
else
{
- $file = new $this->file_class($image_url, $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
+ $file = new $this->file_class($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
$headers = $file->headers;
- if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)))
+ if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
{
- if (!$cache->save(array('headers' => $file->headers, 'body' => $file->body)))
+ if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
+ {
+ $img['attribs']['src']['data'] = $this->image_handler . $image_url;
+ $data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data);
+ }
+ else
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
+ trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
}
- $img['attribs']['src']['data'] = $this->image_handler . rawurlencode($img['attribs']['src']['data']);
- $data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data);
}
}
}
@@ -10784,7 +14956,7 @@ class SimplePie_Sanitize
$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
}
- if ($this->output_encoding != 'UTF-8')
+ if ($this->output_encoding !== 'UTF-8')
{
$data = SimplePie_Misc::change_encoding($data, 'UTF-8', $this->output_encoding);
}
@@ -10806,7 +14978,9 @@ class SimplePie_Sanitize
if (isset($element['attribs'][$attribute]['data']))
{
$element['attribs'][$attribute]['data'] = SimplePie_Misc::absolutize_url($element['attribs'][$attribute]['data'], $this->base);
- $data = str_replace($element['full'], SimplePie_Misc::element_implode($element), $data);
+ $new_element = SimplePie_Misc::element_implode($element);
+ $data = str_replace($element['full'], $new_element, $data);
+ $element['full'] = $new_element;
}
}
}
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php
index 7a7acdbdb..12418c48d 100644
--- a/inc/TarLib.class.php
+++ b/inc/TarLib.class.php
@@ -7,7 +7,7 @@
*
* Modified for Dokuwiki
*
- * @license GPL
+ * @license LGPL-2.1
* @link http://docs.maxg.info
* @author Bouchon <tarlib@bouchon.org> (Maxg)
* @author Christopher Smith <chris@jalakai.co.uk>
diff --git a/inc/actions.php b/inc/actions.php
index 9db7d5f24..016af4aea 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -20,6 +20,7 @@ function act_dispatch(){
global $ID;
global $QUERY;
global $lang;
+ global $conf;
$preact = $ACT;
@@ -50,6 +51,12 @@ function act_dispatch(){
}
}
+ //display some infos
+ if($ACT == 'check'){
+ check();
+ $ACT = 'show';
+ }
+
//check permissions
$ACT = act_permcheck($ACT);
@@ -120,12 +127,6 @@ function act_dispatch(){
if(substr($ACT,0,7) == 'export_')
$ACT = act_export($ACT);
- //display some infos
- if($ACT == 'check'){
- check();
- $ACT = 'show';
- }
-
//handle admin tasks
if($ACT == 'admin'){
// retrieve admin plugin name from $_REQUEST['page']
@@ -143,6 +144,10 @@ function act_dispatch(){
$ACT = act_permcheck($ACT);
} // end event ACTION_ACT_PREPROCESS default action
$evt->advise_after();
+ // Make sure plugs can handle 'denied'
+ if($conf['send404'] && $ACT == 'denied') {
+ header('HTTP/1.0 403 Forbidden');
+ }
unset($evt);
// when action 'show', the intial not 'show' and POST, do a redirect
@@ -287,10 +292,10 @@ function act_draftsave($act){
global $conf;
if($conf['usedraft'] && $_POST['wikitext']){
$draft = array('id' => $ID,
- 'prefix' => $_POST['prefix'],
+ 'prefix' => substr($_POST['prefix'], 0, -1),
'text' => $_POST['wikitext'],
'suffix' => $_POST['suffix'],
- 'date' => $_POST['date'],
+ 'date' => (int) $_POST['date'],
'client' => $INFO['client'],
);
$cname = getCacheName($draft['client'].$ID,'.draft');
@@ -621,6 +626,7 @@ function act_sitemap($act) {
if (is_readable($sitemap)) {
// Send headers
header('Content-Type: '.$mime);
+ header('Content-Disposition: attachment; filename='.basename($sitemap));
http_conditionalRequest(filemtime($sitemap));
@@ -738,4 +744,4 @@ function subscription_handle_post(&$params) {
$params = compact('target', 'style', 'data', 'action');
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/adLDAP.php b/inc/adLDAP.php
index 94cd8a50d..4c8ee5db3 100644
--- a/inc/adLDAP.php
+++ b/inc/adLDAP.php
@@ -1,7 +1,7 @@
<?php
/**
* PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY
- * Version 3.3.1
+ * Version 3.3.2
*
* PHP Version 5 with SSL and LDAP support
*
@@ -9,7 +9,7 @@
* email: scott@wiggumworld.com, adldap@richardhyland.com
* http://adldap.sourceforge.net/
*
- * Copyright (c) 2006-2009 Scott Barnett, Richard Hyland
+ * Copyright (c) 2006-2010 Scott Barnett, Richard Hyland
*
* We'd appreciate any improvements or additions to be submitted back
* to benefit the entire community :)
@@ -27,10 +27,10 @@
* @category ToolsAndUtilities
* @package adLDAP
* @author Scott Barnett, Richard Hyland
- * @copyright (c) 2006-2009 Scott Barnett, Richard Hyland
+ * @copyright (c) 2006-2010 Scott Barnett, Richard Hyland
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
- * @revision $Revision: 67 $
- * @version 3.3.1
+ * @revision $Revision: 91 $
+ * @version 3.3.2
* @link http://adldap.sourceforge.net/
*/
@@ -409,25 +409,26 @@ class adLDAP {
* @param bool optional $prevent_rebind
* @return bool
*/
- public function authenticate($username,$password,$prevent_rebind=false){
+ public function authenticate($username, $password, $prevent_rebind = false) {
// Prevent null binding
- if ($username===NULL || $password===NULL){ return (false); }
- if (empty($username) || empty($password)){ return (false); }
+ if ($username === NULL || $password === NULL) { return false; }
+ if (empty($username) || empty($password)) { return false; }
// Bind as the user
- $this->_bind = @ldap_bind($this->_conn,$username.$this->_account_suffix,$password);
- if (!$this->_bind){ return (false); }
+ $ret = true;
+ $this->_bind = @ldap_bind($this->_conn, $username . $this->_account_suffix, $password);
+ if (!$this->_bind){ $ret = false; }
// Cnce we've checked their details, kick back into admin mode if we have it
- if ($this->_ad_username!=NULL && !$prevent_rebind){
- $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password);
+ if ($this->_ad_username !== NULL && !$prevent_rebind) {
+ $this->_bind = @ldap_bind($this->_conn, $this->_ad_username . $this->_account_suffix , $this->_ad_password);
if (!$this->_bind){
// This should never happen in theory
throw new adLDAPException('Rebind to Active Directory failed. AD said: ' . $this->get_last_error());
}
}
- return (true);
+ return $ret;
}
//*****************************************************************************************************************
@@ -758,7 +759,7 @@ class adLDAP {
$ret_groups=array();
$groups=$this->group_info($group,array("memberof"));
- if (is_array($groups[0]["memberof"])) {
+ if (isset($groups[0]["memberof"]) && is_array($groups[0]["memberof"])) {
$groups=$groups[0]["memberof"];
if ($groups){
@@ -861,7 +862,7 @@ class adLDAP {
* @param array $attributes The attributes to set to the user account
* @return bool
*/
- public function user_create($attributes){
+ public function user_create($attributes){
// Check for compulsory fields
if (!array_key_exists("username",$attributes)){ return ("Missing compulsory field [username]"); }
if (!array_key_exists("firstname",$attributes)){ return ("Missing compulsory field [firstname]"); }
@@ -963,25 +964,36 @@ class adLDAP {
$username = $this->strguid2hex($username);
$filter="objectguid=".$username;
}
+ else if (strstr($username, "@")) {
+ $filter="userPrincipalName=".$username;
+ }
else {
- $filter="samaccountname=".$username;
+ $filter="samaccountname=".$username;
}
+ $filter = "(&(objectCategory=person)({$filter}))";
if ($fields===NULL){ $fields=array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid","objectsid"); }
+ if (!in_array("objectsid",$fields)){
+ $fields[] = "objectsid";
+ }
$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
$entries = ldap_get_entries($this->_conn, $sr);
- if ($entries[0]['count'] >= 1) {
- // AD does not return the primary group in the ldap query, we may need to fudge it
- if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
- //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
- $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
- } else {
- $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+ if (isset($entries[0])) {
+ if ($entries[0]['count'] >= 1) {
+ if (in_array("memberof", $fields)) {
+ // AD does not return the primary group in the ldap query, we may need to fudge it
+ if ($this->_real_primarygroup && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
+ //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
+ $entries[0]["memberof"][]=$this->get_primary_group($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
+ } else {
+ $entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
+ }
+ $entries[0]["memberof"]["count"]++;
+ }
}
+ return $entries;
}
-
- $entries[0]["memberof"]["count"]++;
- return ($entries);
+ return false;
}
/**
@@ -1232,6 +1244,33 @@ class adLDAP {
}
}
+ /**
+ * Move a user account to a different OU
+ *
+ * @param string $username The username to move (please be careful here!)
+ * @param array $container The container or containers to move the user to (please be careful here!).
+ * accepts containers in 1. parent 2. child order
+ * @return array
+ */
+ public function user_move($username, $container) {
+ if (!$this->_bind){ return (false); }
+ if ($username === null){ return ("Missing compulsory field [username]"); }
+ if ($container === null){ return ("Missing compulsory field [container]"); }
+ if (!is_array($container)){ return ("Container must be an array"); }
+
+ $userinfo = $this->user_info($username, array("*"));
+ $dn = $userinfo[0]['distinguishedname'][0];
+ $newrdn = "cn=" . $username;
+ $container = array_reverse($container);
+ $newcontainer = "ou=" . implode(",ou=",$container);
+ $newbasedn = strtolower($newcontainer) . "," . $this->_base_dn;
+ $result=@ldap_rename($this->_conn,$dn,$newrdn,$newbasedn,true);
+ if ($result !== true) {
+ return (false);
+ }
+ return (true);
+ }
+
//*****************************************************************************************************************
// CONTACT FUNCTIONS
// * Still work to do in this area, and new functions to write
@@ -1568,6 +1607,32 @@ class adLDAP {
}
//************************************************************************************************************
+ // ORGANIZATIONAL UNIT FUNCTIONS
+
+ /**
+ * Create an organizational unit
+ *
+ * @param array $attributes Default attributes of the ou
+ * @return bool
+ */
+ public function ou_create($attributes){
+ if (!is_array($attributes)){ return ("Attributes must be an array"); }
+ if (!array_key_exists("ou_name",$attributes)){ return ("Missing compulsory field [ou_name]"); }
+ if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); }
+ if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
+ $attributes["container"]=array_reverse($attributes["container"]);
+
+ $add=array();
+ $add["objectClass"] = "organizationalUnit";
+
+ $container="OU=".implode(",OU=",$attributes["container"]);
+ $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add);
+ if ($result!=true){ return (false); }
+
+ return (true);
+ }
+
+ //************************************************************************************************************
// EXCHANGE FUNCTIONS
/**
@@ -1998,6 +2063,7 @@ class adLDAP {
if ($attributes["exchange_usedefaults"]){ $mod["mDBUseDefaults"][0]=$attributes["exchange_usedefaults"]; }
if ($attributes["exchange_policyexclude"]){ $mod["msExchPoliciesExcluded"][0]=$attributes["exchange_policyexclude"]; }
if ($attributes["exchange_policyinclude"]){ $mod["msExchPoliciesIncluded"][0]=$attributes["exchange_policyinclude"]; }
+ if ($attributes["exchange_addressbook"]){ $mod["showInAddressBook"][0]=$attributes["exchange_addressbook"]; }
// This schema is designed for contacts
if ($attributes["exchange_hidefromlists"]){ $mod["msExchHideFromAddressLists"][0]=$attributes["exchange_hidefromlists"]; }
diff --git a/inc/auth.php b/inc/auth.php
index a2844a732..38d1c925d 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -70,6 +70,12 @@ function auth_setup(){
$_REQUEST['http_credentials'] = false;
if (!$conf['rememberme']) $_REQUEST['r'] = false;
+ // handle renamed HTTP_AUTHORIZATION variable (can happen when a fix like
+ // the one presented at
+ // http://www.besthostratings.com/articles/http-auth-php-cgi.html is used
+ // for enabling HTTP authentication with CGI/SuExec)
+ if(isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']))
+ $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
// streamline HTTP auth credentials (IIS/rewrite -> mod_php)
if(isset($_SERVER['HTTP_AUTHORIZATION'])){
list($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']) =
@@ -194,10 +200,11 @@ function auth_login($user,$pass,$sticky=false,$silent=false){
}else{
// read cookie information
list($user,$sticky,$pass) = auth_getCookie();
- // get session info
- $session = $_SESSION[DOKU_COOKIE]['auth'];
if($user && $pass){
// we got a cookie - see if we can trust it
+
+ // get session info
+ $session = $_SESSION[DOKU_COOKIE]['auth'];
if(isset($session) &&
$auth->useSessionCache($user) &&
($session['time'] >= time()-$conf['auth_security_timeout']) &&
@@ -371,63 +378,15 @@ function auth_ismanager($user=null,$groups=null,$adminonly=false){
$user = $_SERVER['REMOTE_USER'];
}
}
- $user = trim($auth->cleanUser($user));
- if($user === '') return false;
- if(is_null($groups)) $groups = (array) $USERINFO['grps'];
- $groups = array_map(array($auth,'cleanGroup'),$groups);
- $user = auth_nameencode($user);
-
- // check username against superuser and manager
- $superusers = explode(',', $conf['superuser']);
- $superusers = array_unique($superusers);
- $superusers = array_map('trim', $superusers);
- $superusers = array_filter($superusers);
- // prepare an array containing only true values for array_map call
- $alltrue = array_fill(0, count($superusers), true);
- $superusers = array_map('auth_nameencode', $superusers, $alltrue);
-
- // case insensitive?
- if(!$auth->isCaseSensitive()){
- $superusers = array_map('utf8_strtolower',$superusers);
- $user = utf8_strtolower($user);
+ if(is_null($groups)){
+ $groups = (array) $USERINFO['grps'];
}
- // check user match
- if(in_array($user, $superusers)) return true;
-
+ // check superuser match
+ if(auth_isMember($conf['superuser'],$user, $groups)) return true;
+ if($adminonly) return false;
// check managers
- if(!$adminonly){
- $managers = explode(',', $conf['manager']);
- $managers = array_unique($managers);
- $managers = array_map('trim', $managers);
- $managers = array_filter($managers);
- // prepare an array containing only true values for array_map call
- $alltrue = array_fill(0, count($managers), true);
- $managers = array_map('auth_nameencode', $managers, $alltrue);
- if(!$auth->isCaseSensitive()) $managers = array_map('utf8_strtolower',$managers);
- if(in_array($user, $managers)) return true;
- }
-
- // check user's groups against superuser and manager
- if (!empty($groups)) {
-
- //prepend groups with @ and nameencode
- $cnt = count($groups);
- for($i=0; $i<$cnt; $i++){
- $groups[$i] = '@'.auth_nameencode($groups[$i]);
- if(!$auth->isCaseSensitive()){
- $groups[$i] = utf8_strtolower($groups[$i]);
- }
- }
-
- // check groups against superuser and manager
- foreach($superusers as $supu)
- if(in_array($supu, $groups)) return true;
- if(!$adminonly){
- foreach($managers as $mana)
- if(in_array($mana, $groups)) return true;
- }
- }
+ if(auth_isMember($conf['manager'],$user, $groups)) return true;
return false;
}
@@ -446,6 +405,52 @@ function auth_isadmin($user=null,$groups=null){
return auth_ismanager($user,$groups,true);
}
+
+/**
+ * Match a user and his groups against a comma separated list of
+ * users and groups to determine membership status
+ *
+ * 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
+ * @returns bool true for membership acknowledged
+ */
+function auth_isMember($memberlist,$user,array $groups){
+ global $auth;
+ if (!$auth) return false;
+
+ // clean user and groups
+ if(!$auth->isCaseSensitive()){
+ $user = utf8_strtolower($user);
+ $groups = array_map('utf8_strtolower',$groups);
+ }
+ $user = $auth->cleanUser($user);
+ $groups = array_map(array($auth,'cleanGroup'),$groups);
+
+ // extract the memberlist
+ $members = explode(',',$memberlist);
+ $members = array_map('trim',$members);
+ $members = array_unique($members);
+ $members = array_filter($members);
+
+ // compare cleaned values
+ foreach($members as $member){
+ if(!$auth->isCaseSensitive()) $member = utf8_strtolower($member);
+ if($member[0] == '@'){
+ $member = $auth->cleanGroup(substr($member,1));
+ if(in_array($member, $groups)) return true;
+ }else{
+ $member = $auth->cleanUser($member);
+ if($member == $user) return true;
+ }
+ }
+
+ // still here? not a member!
+ return false;
+}
+
/**
* Convinience function for auth_aclcheck()
*
@@ -536,13 +541,13 @@ function auth_aclcheck($id,$user,$groups){
//still here? do the namespace checks
if($ns){
- $path = $ns.':\*';
+ $path = $ns.':*';
}else{
- $path = '\*'; //root document
+ $path = '*'; //root document
}
do{
- $matches = preg_grep('/^'.$path.'\s+('.$regexp.')\s+/'.$ci,$AUTH_ACL);
+ $matches = preg_grep('/^'.preg_quote($path,'/').'\s+('.$regexp.')\s+/'.$ci,$AUTH_ACL);
if(count($matches)){
foreach($matches as $match){
$match = preg_replace('/#.*$/','',$match); //ignore comments
@@ -559,9 +564,9 @@ function auth_aclcheck($id,$user,$groups){
//get next higher namespace
$ns = getNS($ns);
- if($path != '\*'){
- $path = $ns.':\*';
- if($path == ':\*') $path = '\*';
+ if($path != '*'){
+ $path = $ns.':*';
+ if($path == ':*') $path = '*';
}else{
//we did this already
//looks like there is something wrong with the ACL
@@ -938,6 +943,8 @@ function act_resendpwd(){
* mysql - MySQL password (old method)
* my411 - MySQL 4.1.1 password
* kmd5 - Salted MD5 hashing as used by UNB
+ * pmd5 - Salted multi iteration MD5 as used by Wordpress
+ * hmd5 - Same as pmd5 but PhpBB3 flavour
*
* @author Andreas Gohr <andi@splitbrain.org>
* @return string The crypted password
@@ -1017,6 +1024,45 @@ function auth_cryptPassword($clear,$method='',$salt=null){
$hash1 = strtolower(md5($key . md5($clear)));
$hash2 = substr($hash1, 0, 16) . $key . substr($hash1, 16);
return $hash2;
+ case 'hmd5':
+ $key = 'H';
+ // hmd5 is exactly the same as pmd5, but uses an H as identifier
+ // PhpBB3 uses it that way, so we just fall through here
+ case 'pmd5':
+ if(!$key) $key = 'P';
+ $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+ $iterc = $salt[0]; // pos 0 of salt is iteration count
+ $iter = strpos($itoa64,$iterc);
+ $iter = 1 << $iter;
+ $salt = substr($salt,1,8);
+
+ // iterate
+ $hash = md5($salt . $clear, true);
+ do {
+ $hash = md5($hash . $clear, true);
+ } while (--$iter);
+
+ // encode
+ $output = '';
+ $count = 16;
+ $i = 0;
+ do {
+ $value = ord($hash[$i++]);
+ $output .= $itoa64[$value & 0x3f];
+ if ($i < $count)
+ $value |= ord($hash[$i]) << 8;
+ $output .= $itoa64[($value >> 6) & 0x3f];
+ if ($i++ >= $count)
+ break;
+ if ($i < $count)
+ $value |= ord($hash[$i]) << 16;
+ $output .= $itoa64[($value >> 12) & 0x3f];
+ if ($i++ >= $count)
+ break;
+ $output .= $itoa64[($value >> 18) & 0x3f];
+ } while ($i < $count);
+
+ return '$'.$key.'$'.$iterc.$salt.$output;
default:
msg("Unsupported crypt method $method",-1);
}
@@ -1044,6 +1090,12 @@ function auth_verifyPassword($clear,$crypt){
}elseif(preg_match('/^\$apr1\$([^\$]{0,8})\$/',$crypt,$m)){
$method = 'apr1';
$salt = $m[1];
+ }elseif(preg_match('/^\$P\$(.{31})$/',$crypt,$m)){
+ $method = 'pmd5';
+ $salt = $m[1];
+ }elseif(preg_match('/^\$H\$(.{31})$/',$crypt,$m)){
+ $method = 'hmd5';
+ $salt = $m[1];
}elseif(substr($crypt,0,6) == '{SSHA}'){
$method = 'ssha';
$salt = substr(base64_decode(substr($crypt, 6)),20);
@@ -1117,4 +1169,4 @@ function auth_getCookie(){
return array($user,$sticky,$pass);
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/auth/ad.class.php b/inc/auth/ad.class.php
index 90fe0266b..5478d64b9 100644
--- a/inc/auth/ad.class.php
+++ b/inc/auth/ad.class.php
@@ -126,7 +126,7 @@ class auth_ad extends auth_basic {
* at least these fields:
*
* name string full name of the user
- * mail string email addres of the user
+ * mail string email address of the user
* grps array list of groups the user is in
*
* This LDAP specific function returns the following
@@ -296,4 +296,4 @@ class auth_ad extends auth_basic {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/auth/basic.class.php b/inc/auth/basic.class.php
index fa38970ae..c7e7031bf 100644
--- a/inc/auth/basic.class.php
+++ b/inc/auth/basic.class.php
@@ -400,4 +400,4 @@ class auth_basic {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/auth/ldap.class.php b/inc/auth/ldap.class.php
index 7f1eec187..420043238 100644
--- a/inc/auth/ldap.class.php
+++ b/inc/auth/ldap.class.php
@@ -457,4 +457,4 @@ class auth_ldap extends auth_basic {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/auth/mysql.class.php b/inc/auth/mysql.class.php
index ca607ced5..dbdfe5fda 100644
--- a/inc/auth/mysql.class.php
+++ b/inc/auth/mysql.class.php
@@ -936,4 +936,4 @@ class auth_mysql extends auth_basic {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/auth/pgsql.class.php b/inc/auth/pgsql.class.php
index 8e68e865e..cf8bf7600 100644
--- a/inc/auth/pgsql.class.php
+++ b/inc/auth/pgsql.class.php
@@ -407,4 +407,4 @@ class auth_pgsql extends auth_mysql {
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/auth/plain.class.php b/inc/auth/plain.class.php
index ec9e52beb..3941190e9 100644
--- a/inc/auth/plain.class.php
+++ b/inc/auth/plain.class.php
@@ -325,4 +325,4 @@ class auth_plain extends auth_basic {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/cache.php b/inc/cache.php
index 571b314cd..ff78e37ae 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -197,18 +197,6 @@ class cache_parser extends cache {
}
class cache_renderer extends cache_parser {
-
- function useCache($depends=array()) {
- $use = parent::useCache($depends);
-
- // meta data needs to be kept in step with the cache
- if (!$use && isset($this->page)) {
- p_set_metadata($this->page,array(),true);
- }
-
- return $use;
- }
-
function _useCache() {
global $conf;
@@ -251,19 +239,12 @@ class cache_renderer extends cache_parser {
if (isset($this->page)) {
$metafile = metaFN($this->page,'.meta');
- if (@file_exists($metafile)) {
- $files[] = $metafile; // ... the page's own metadata
- $files[] = DOKU_INC.'inc/parser/metadata.php'; // ... the metadata renderer
-
- $valid = p_get_metadata($this->page, 'date valid');
- if (!empty($valid['age'])) {
- $this->depends['age'] = isset($this->depends['age']) ?
- min($this->depends['age'],$valid['age']) : $valid['age'];
- }
-
- } else {
- $this->depends['purge'] = true; // ... purging cache will generate metadata
- return;
+ $files[] = $metafile; // ... the page's own metadata
+
+ $valid = p_get_metadata($this->page, 'date valid'); // for xhtml this will render the metadata if needed
+ if (!empty($valid['age'])) {
+ $this->depends['age'] = isset($this->depends['age']) ?
+ min($this->depends['age'],$valid['age']) : $valid['age'];
}
}
diff --git a/inc/changelog.php b/inc/changelog.php
index cc7612bfd..15cd46d77 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -84,7 +84,10 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
$meta = array();
if (!$INFO['exists'] && empty($oldmeta['persistent']['date']['created'])){ // newly created
$meta['date']['created'] = $created;
- if ($user) $meta['creator'] = $INFO['userinfo']['name'];
+ if ($user){
+ $meta['creator'] = $INFO['userinfo']['name'];
+ $meta['user'] = $user;
+ }
} elseif (!$INFO['exists'] && !empty($oldmeta['persistent']['date']['created'])) { // re-created / restored
$meta['date']['created'] = $oldmeta['persistent']['date']['created'];
$meta['date']['modified'] = $created; // use the files ctime here
diff --git a/inc/common.php b/inc/common.php
index 18f782788..b4866bccf 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -242,13 +242,16 @@ function buildURLparams($params, $sep='&amp;'){
*/
function buildAttributes($params,$skipempty=false){
$url = '';
+ $white = false;
foreach($params as $key => $val){
if($key{0} == '_') continue;
if($val === '' && $skipempty) continue;
+ if($white) $url .= ' ';
$url .= $key.'="';
$url .= htmlspecialchars ($val);
- $url .= '" ';
+ $url .= '"';
+ $white = true;
}
return $url;
}
@@ -1128,12 +1131,15 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){
$diff = rawWiki($id);
}
$text = str_replace('@DIFF@',$diff,$text);
- if(utf8_strlen($conf['title']) < 20) {
- $subject = '['.$conf['title'].'] '.$subject;
+ if(empty($conf['mailprefix'])) {
+ if(utf8_strlen($conf['title']) < 20) {
+ $subject = '['.$conf['title'].'] '.$subject;
+ }else{
+ $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject;
+ }
}else{
- $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject;
+ $subject = '['.$conf['mailprefix'].'] '.$subject;
}
-
mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc);
}
@@ -1538,4 +1544,4 @@ function valid_input_set($param, $valid_values, $array, $exc = '') {
}
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/confutils.php b/inc/confutils.php
index 4306dab8f..26ed4f087 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -324,4 +324,4 @@ function conf_decodeString($str) {
return $str;
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php
index 8141d867c..435add6ac 100644
--- a/inc/feedcreator.class.php
+++ b/inc/feedcreator.class.php
@@ -1577,4 +1577,4 @@ class DokuWikiFeedCreator extends UniversalFeedCreator{
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/form.php b/inc/form.php
index 70190d2b4..30e16b626 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -252,7 +252,7 @@ class Doku_Form {
global $lang;
$form = '';
$this->params['accept-charset'] = $lang['encoding'];
- $form .= '<form ' . html_attbuild($this->params) . '><div class="no">' . DOKU_LF;
+ $form .= '<form ' . buildAttributes($this->params,true) . '><div class="no">' . DOKU_LF;
if (!empty($this->_hidden)) {
foreach ($this->_hidden as $name=>$value)
$form .= form_hidden(array('name'=>$name, 'value'=>$value));
@@ -597,7 +597,7 @@ function form_makeListboxField($name, $values, $selected='', $label=null, $id=''
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function form_tag($attrs) {
- return '<'.$attrs['_tag'].' '.buildAttributes($attrs).'/>';
+ return '<'.$attrs['_tag'].' '.buildAttributes($attrs,true).'/>';
}
/**
@@ -696,7 +696,7 @@ function form_wikitext($attrs) {
*/
function form_button($attrs) {
$p = (!empty($attrs['_action'])) ? 'name="do['.$attrs['_action'].']" ' : '';
- return '<input '.$p.buildAttributes($attrs,true).'/>';
+ return '<input '.$p.buildAttributes($attrs,true).' />';
}
/**
@@ -714,7 +714,7 @@ function form_field($attrs) {
if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
$s .= '><span>'.$attrs['_text'].'</span>';
- $s .= ' <input '.buildAttributes($attrs,true).'/></label>';
+ $s .= ' <input '.buildAttributes($attrs,true).' /></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
return $s;
@@ -734,7 +734,7 @@ function form_fieldright($attrs) {
$s = '<label';
if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
- $s .= '><input '.buildAttributes($attrs,true).'/>';
+ $s .= '><input '.buildAttributes($attrs,true).' />';
$s .= ' <span>'.$attrs['_text'].'</span></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
@@ -758,7 +758,7 @@ function form_textfield($attrs) {
if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
$s .= '><span>'.$attrs['_text'].'</span> ';
- $s .= '<input type="text" '.buildAttributes($attrs,true).'/></label>';
+ $s .= '<input type="text" '.buildAttributes($attrs,true).' /></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
return $s;
@@ -781,7 +781,7 @@ function form_passwordfield($attrs) {
if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
$s .= '><span>'.$attrs['_text'].'</span> ';
- $s .= '<input type="password" '.buildAttributes($attrs,true).'/></label>';
+ $s .= '<input type="password" '.buildAttributes($attrs,true).' /></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
return $s;
@@ -807,7 +807,7 @@ function form_filefield($attrs) {
$s .= '<input type="file" '.buildAttributes($attrs,true);
if (!empty($attrs['_maxlength'])) $s .= ' maxlength="'.$attrs['_maxlength'].'"';
if (!empty($attrs['_accept'])) $s .= ' accept="'.$attrs['_accept'].'"';
- $s .= '/></label>';
+ $s .= ' /></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
return $s;
@@ -837,7 +837,7 @@ function form_checkboxfield($attrs) {
. ' value="' . hsc($attrs['value'][1]) . '" />';
$attrs['value'] = $attrs['value'][0];
}
- $s .= '<input type="checkbox" '.buildAttributes($attrs,true).'/>';
+ $s .= '<input type="checkbox" '.buildAttributes($attrs,true).' />';
$s .= ' <span>'.$attrs['_text'].'</span></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
@@ -860,7 +860,7 @@ function form_radiofield($attrs) {
$s = '<label';
if ($attrs['_class']) $s .= ' class="'.$attrs['_class'].'"';
if (!empty($attrs['id'])) $s .= ' for="'.$attrs['id'].'"';
- $s .= '><input type="radio" '.buildAttributes($attrs,true).'/>';
+ $s .= '><input type="radio" '.buildAttributes($attrs,true).' />';
$s .= ' <span>'.$attrs['_text'].'</span></label>';
if (preg_match('/(^| )block($| )/', $attrs['_class']))
$s .= '<br />';
diff --git a/inc/fulltext.php b/inc/fulltext.php
index 35ee4ba34..805da2e37 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -376,6 +376,11 @@ function ft_snippet($id,$highlight){
* Wraps a search term in regex boundary checks.
*/
function ft_snippet_re_preprocess($term) {
+ // do not process asian terms where word boundaries are not explicit
+ if(preg_match('/'.IDX_ASIAN.'/u',$term)){
+ return $term;
+ }
+
if(substr($term,0,2) == '\\*'){
$term = substr($term,2);
}else{
@@ -710,7 +715,7 @@ function ft_termParser($Indexer, $term, $consider_asian = true, $phrase_mode = f
// successive asian characters need to be searched as a phrase
$words = preg_split('/('.IDX_ASIAN.'+)/u', $term, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
foreach ($words as $word) {
- if (preg_match('/'.IDX_ASIAN.'/u', $word)) $phrase_mode = true;
+ $phrase_mode = $phrase_mode ? true : preg_match('/'.IDX_ASIAN.'/u', $word);
$parsed .= ft_termParser($Indexer, $word, false, $phrase_mode);
}
} else {
@@ -732,4 +737,4 @@ function ft_termParser($Indexer, $term, $consider_asian = true, $phrase_mode = f
return $parsed;
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/html.php b/inc/html.php
index 7f502afa5..bd87ee7a1 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -26,6 +26,7 @@ function html_wikilink($id,$name=null,$search=''){
/**
* Helps building long attribute lists
*
+ * @deprecated Use buildAttributes instead
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_attbuild($attributes){
@@ -887,6 +888,9 @@ function html_diff($text='',$intro=true){
$rev2 = (int) $_REQUEST['rev2'];
}
+ $r_minor = '';
+ $l_minor = '';
+
if($text){ // compare text to the most current revision
$l_rev = '';
$l_text = rawWiki($ID,'');
@@ -1033,7 +1037,10 @@ function html_conflict($text,$summary){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_msgarea(){
- global $MSG;
+ global $MSG, $MSG_shown;
+ // store if the global $MSG has already been shown and thus HTML output has been started
+ $MSG_shown = true;
+
if(!isset($MSG)) return;
$shown = array();
@@ -1045,6 +1052,8 @@ function html_msgarea(){
print '</div>';
$shown[$hash] = 1;
}
+
+ unset($GLOBALS['MSG']);
}
/**
@@ -1213,9 +1222,9 @@ function html_edit(){
if($wr && $conf['license']){
$form->addElement(form_makeOpenTag('div', array('class'=>'license')));
$out = $lang['licenseok'];
- $out .= '<a href="'.$license[$conf['license']]['url'].'" rel="license" class="urlextern"';
+ $out .= ' <a href="'.$license[$conf['license']]['url'].'" rel="license" class="urlextern"';
if(isset($conf['target']['extern'])) $out .= ' target="'.$conf['target']['extern'].'"';
- $out .= '> '.$license[$conf['license']]['name'].'</a>';
+ $out .= '>'.$license[$conf['license']]['name'].'</a>';
$form->addElement($out);
$form->addElement(form_makeCloseTag('div'));
}
diff --git a/inc/infoutils.php b/inc/infoutils.php
index d3c6f2918..5f406aa3e 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -258,7 +258,7 @@ function check(){
* @see html_msgarea
*/
function msg($message,$lvl=0,$line='',$file=''){
- global $MSG;
+ global $MSG, $MSG_shown;
$errors[-1] = 'error';
$errors[0] = 'info';
$errors[1] = 'success';
@@ -268,7 +268,7 @@ function msg($message,$lvl=0,$line='',$file=''){
if(!isset($MSG)) $MSG = array();
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);
- if(headers_sent()){
+ if(isset($MSG_shown) || headers_sent()){
if(function_exists('html_msgarea')){
html_msgarea();
}else{
diff --git a/inc/init.php b/inc/init.php
index 1dc31a31f..f4c867935 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -421,14 +421,27 @@ function getBaseURL($abs=null){
if($conf['baseurl']) return rtrim($conf['baseurl'],'/').$dir;
//split hostheader into host and port
- $addr = explode(':',$_SERVER['HTTP_HOST']);
- $host = $addr[0];
- $port = '';
- if (isset($addr[1])) {
- $port = $addr[1];
- } elseif (isset($_SERVER['SERVER_PORT'])) {
+ if(isset($_SERVER['HTTP_HOST'])){
+ $parsed_host = parse_url('http://'.$_SERVER['HTTP_HOST']);
+ $host = $parsed_host['host'];
+ $port = $parsed_host['port'];
+ }elseif(isset($_SERVER['SERVER_NAME'])){
+ $parsed_host = parse_url('http://'.$_SERVER['SERVER_NAME']);
+ $host = $parsed_host['host'];
+ $port = $parsed_host['port'];
+ }else{
+ $host = php_uname('n');
+ $port = '';
+ }
+
+ if(!$port && isset($_SERVER['SERVER_PORT'])) {
$port = $_SERVER['SERVER_PORT'];
}
+
+ if(is_null($port)){
+ $port = '';
+ }
+
if(!is_ssl()){
$proto = 'http://';
if ($port == '80') {
diff --git a/inc/io.php b/inc/io.php
index a0be00da3..034ac650e 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -486,7 +486,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20
preg_match('/attachment;\s*filename\s*=\s*"([^"]*)"/i', $content_disposition, $match)) {
$name = basename($match[1]);
- }
+ }
}
diff --git a/inc/lang/ar/lang.php b/inc/lang/ar/lang.php
index 30095347e..0a2341b97 100644
--- a/inc/lang/ar/lang.php
+++ b/inc/lang/ar/lang.php
@@ -28,7 +28,7 @@ $lang['btn_revs'] = 'نسخ قديمة';
$lang['btn_recent'] = 'أحدث التغييرات';
$lang['btn_upload'] = 'ارفع';
$lang['btn_cancel'] = 'ألغ';
-$lang['btn_index'] = 'فهرس';
+$lang['btn_index'] = 'خريطة موقع';
$lang['btn_secedit'] = 'حرر';
$lang['btn_login'] = 'لج';
$lang['btn_logout'] = 'اخرج';
@@ -54,21 +54,21 @@ $lang['newpass'] = 'كلمة سر جديدة';
$lang['oldpass'] = 'أكد كلمة السر الحالية';
$lang['passchk'] = 'مرة أخرى';
$lang['remember'] = 'تذكرني';
-$lang['fullname'] = 'الاسم الكامل';
+$lang['fullname'] = 'الاسم الحقيقي';
$lang['email'] = 'البريد الإلكتروني';
$lang['register'] = 'سجّل';
$lang['profile'] = 'الملف الشخصي';
$lang['badlogin'] = 'عذرا، اسم المشترك أو كلمة السر غير صحيحة';
$lang['minoredit'] = 'تعديلات طفيفة';
-$lang['draftdate'] = 'حفظ المسودات تلقائيا مشغل';
-$lang['nosecedit'] = 'غُيرت الصفحة في هذه الأثناء، معلومات الفقرة اصبحت قديمة. حُمُلت كل الصفحة بدلا.';
-$lang['regmissing'] = 'عذرا، يجب ملء جميع الحقول';
+$lang['draftdate'] = 'حفظ المسودات آليا مفعّل';
+$lang['nosecedit'] = 'غُيرت الصفحة في هذه الأثناء، معلومات الجزء اصبحت قديمة. حُمُلت كل الصفحة بدلا.';
+$lang['regmissing'] = 'عذرا، عليك ملء جميع الحقول.';
$lang['reguexists'] = 'عذرا، يوجد مشترك بنفس الاسم.';
$lang['regsuccess'] = 'أنشئ المستخدم و ارسلت كلمة السر بالبريد.';
$lang['regsuccess2'] = 'أنشئ المستخدم.';
-$lang['regmailfail'] = 'حدث خطأ فى إرسال رسالة كلمة اسرر. يرجى مراسلة المدير';
-$lang['regbadmail'] = 'يبدو البريد الإلكتروني المعطى غير صحيح، إن كنت تظن أن هذا خطأ، راسل المدير';
-$lang['regbadpass'] = 'كلمتى المرور غير متطابقتين، حاول مرة أخرى.';
+$lang['regmailfail'] = 'حدث خطأ فى إرسال رسالة كلمة السر. يرجى مراسلة المدير!';
+$lang['regbadmail'] = 'يبدو البريد الإلكتروني المعطى غيرَ صحيح، إن كنت تظن أن هذا خطأ، راسل المدير';
+$lang['regbadpass'] = 'كلمتا المرور غير متطابقتين، حاول مرة أخرى.';
$lang['regpwmail'] = 'كلمة مرورك إلى دوكو ويكي';
$lang['reghere'] = 'ليس لديك حساب بعد؟ احصل على واحد';
$lang['profna'] = 'هذه الويكي لا تدعم تعديل الملف الشخصي';
@@ -81,35 +81,35 @@ $lang['resendpwd'] = 'إرسال كلمة مرور';
$lang['resendpwdmissing'] = 'عذراّ، يجب أن تملأ كل الحقول.';
$lang['resendpwdnouser'] = 'عذراً، لم نجد المستخدم هذا في قاعدة بياناتنا.';
$lang['resendpwdbadauth'] = 'عذراً، رمز التفعيل هذا غير صحيح. نأكد من استخدامك كامل وصلة التأكيد.';
-$lang['resendpwdconfirm'] = 'أرسل رابط التأكيد بواسطة البريد.';
-$lang['resendpwdsuccess'] = 'كلمة السرالجديدة إرسلت عبر البريد.';
-$lang['license'] = 'مالم يشر لخلاف ذلك، فإن المحتوى على هذه الويكي مرخص وفق الرخصة التالية:';
+$lang['resendpwdconfirm'] = 'اُرسل رابط التأكيد بواسطة البريد.';
+$lang['resendpwdsuccess'] = 'كلمة السرالجديدة اُرسلت عبر البريد.';
+$lang['license'] = 'مالم يشر لخلاف ذلك، فإن المحتوى في هذه الويكي مرخص وفق الرخصة التالية:';
$lang['licenseok'] = 'لاحظ: بتحرير هذه الصفحة أنت توافق على ترخيص محتواها تحت الرخصة التالية:';
-$lang['searchmedia'] = 'ابحث في اسماء الملفات:';
+$lang['searchmedia'] = 'ابحث في أسماء الملفات:';
$lang['searchmedia_in'] = 'ابحث في %s';
$lang['txt_upload'] = 'اختر ملفاً للرفع';
$lang['txt_filename'] = 'رفع كـ (اختياري)';
$lang['txt_overwrt'] = 'اكتب على ملف موجود';
-$lang['lockedby'] = 'حالياً مقفل بواسطة';
+$lang['lockedby'] = 'مقفلة حاليا لـ';
$lang['lockexpire'] = 'ينتهي القفل في';
$lang['willexpire'] = 'سينتهي قفل تحرير هذه الصفحه خلال دقيقة.\nلتجنب التعارض استخدم زر المعاينة لتصفير مؤقت القفل.';
-$lang['js']['notsavedyet'] = 'التعديلات غير المحفوظة ستفقد. اكمل فعلا؟';
+$lang['js']['notsavedyet'] = 'التعديلات غير المحفوظة ستفقد.';
$lang['js']['searchmedia'] = 'ابحث عن ملفات';
$lang['js']['keepopen'] = 'أبقي النافذة مفتوحة أثناء الاختيار';
$lang['js']['hidedetails'] = 'أخف التفاصيل';
-$lang['js']['mediatitle'] = 'اعدادات الرابط';
+$lang['js']['mediatitle'] = 'إعدادات الرابط';
$lang['js']['mediadisplay'] = 'نوع الرابط';
$lang['js']['mediaalign'] = 'المحاذاة';
$lang['js']['mediasize'] = 'حجم الصورة';
$lang['js']['mediatarget'] = 'هدف الرابط';
-$lang['js']['mediaclose'] = 'اغلق';
+$lang['js']['mediaclose'] = 'أغلق';
$lang['js']['mediainsert'] = 'أدرج';
-$lang['js']['mediadisplayimg'] = 'اظهر الصورة.';
+$lang['js']['mediadisplayimg'] = 'أظهر الصورة.';
$lang['js']['mediadisplaylnk'] = 'اظهر الرابط فقط.';
$lang['js']['mediasmall'] = 'نسخة مصغرة';
$lang['js']['mediamedium'] = 'نسخة متوسطة';
$lang['js']['medialarge'] = 'نسخة كبيرة';
-$lang['js']['mediaoriginal'] = 'نسخة أصلية';
+$lang['js']['mediaoriginal'] = 'النسخة الأصلية';
$lang['js']['medialnk'] = 'الرابط لصفحة التفاصيل';
$lang['js']['mediadirect'] = 'رابط مباشر للأصل';
$lang['js']['medianolnk'] = 'لا رابط';
@@ -118,70 +118,73 @@ $lang['js']['medialeft'] = 'حاذي الصورة إلى اليسار.';
$lang['js']['mediaright'] = 'حاذي الصورة إلى اليمين.';
$lang['js']['mediacenter'] = 'حاذي الصورة إلى الوسط.';
$lang['js']['medianoalign'] = 'لا تستعمل المحاذاة.';
-$lang['js']['nosmblinks'] = 'الروابط لمجلدات ويندوز المشاركة تعمل فقط مع متصفح مايكروسفت Internet Explorer. ما زال بإمكانك قص و لصق الرابط.';
+$lang['js']['nosmblinks'] = 'الروابط لمجلدات مشاركة وندز تعمل فقط مع متصفح مايكروسفت Internet Explorer.
+ما زال بإمكانك قص و لصق الرابط.';
$lang['js']['linkwiz'] = 'مرشد الروابط';
$lang['js']['linkto'] = 'الرابط إلى :';
$lang['js']['del_confirm'] = 'هل حقاً تريد حذف البنود المختارة؟';
$lang['js']['mu_btn'] = 'رفع عدة ملفات في وقت واحد';
$lang['rssfailed'] = 'خطأ ما حدث أثناء جلب ملف التغذية:';
$lang['nothingfound'] = 'لا يوجد شيء';
-$lang['mediaselect'] = 'ملفات الوسائط المتعددة';
-$lang['fileupload'] = 'تحميل ملف وسائط متعددة';
-$lang['uploadsucc'] = 'تم التحميل بنجاح';
-$lang['uploadfail'] = 'فشل التحميل، قد يكون الخطأ فى التراخيص؟';
-$lang['uploadwrong'] = 'التحميل ممنوع، نوع الملف مرفوض!';
-$lang['uploadexist'] = 'الملف موجود أصلاً. لم يحدث شيء';
-$lang['uploadbadcontent'] = 'المحتوى المحمّل لم يتطابق مع نوع الملف %s';
-$lang['uploadspam'] = 'التحميل محجوب بواسطة القائمة السوداء لبرنامج تقفي التطفل';
-$lang['uploadxss'] = 'التحميل محجوب لمنع المحتويات الخبيثة';
-$lang['uploadsize'] = 'الملف الذي تم رفعه كبير جدا . ( الحد الأقصى %s )';
-$lang['deletesucc'] = 'تم حذف الملف "%s"';
-$lang['deletefail'] = 'لا يمكن حذف "%s"، تأكد من تراخيصك';
-$lang['mediainuse'] = 'لم يحذف الملف "%s"، مازال موجوداً';
+$lang['mediaselect'] = 'ملفات الوسائط';
+$lang['fileupload'] = 'تحميل ملف وسائط';
+$lang['uploadsucc'] = 'تم الرفع بنجاح';
+$lang['uploadfail'] = 'فشل الرفع، ربما خطأ تراخيص؟';
+$lang['uploadwrong'] = 'الرفع ممنوع، نوع الملف مرفوض!';
+$lang['uploadexist'] = 'الملف موجود أصلاً. لم يُعمل شيئ.';
+$lang['uploadbadcontent'] = 'المحتوى المرفوع لم يطابق لاحقة ملفات %s.';
+$lang['uploadspam'] = 'الرفع محجوب بواسطة القائمة السوداء لبرنامج تقفي التطفل.';
+$lang['uploadxss'] = 'رُفض الرفع للإشتباه بمحتوى ضار.';
+$lang['uploadsize'] = 'الملف المرفوع كان كبيرا جدا . ( الحد %s )';
+$lang['deletesucc'] = 'حُذف الملف "%s".';
+$lang['deletefail'] = 'تعذر حذف "%s" - تأكد من الصلاحيات.';
+$lang['mediainuse'] = 'لم يحذف الملف "%s" - مازال مستخدما.';
$lang['namespaces'] = 'فضاء التسمية';
$lang['mediafiles'] = 'ملفات موجودة في';
+$lang['accessdenied'] = 'لا يسمح لك برؤية هذه الصفحة.';
$lang['mediausage'] = 'استخدم هذه الصياغة للدلالة على هذا الملف:';
-$lang['mediaview'] = 'عرض الملف الأصلي';
+$lang['mediaview'] = 'اعرض الملف الأصلي';
$lang['mediaroot'] = 'الجذر';
-$lang['mediaupload'] = 'تحميل ملف إلى فضاء التسمية هنا. لإنشاء فضاءات تسمية فرعية، أضفها إلى بداية خانة تحميل باسم وافصل بينها باستخدام الفواصل';
-$lang['mediaextchange'] = 'تم تغيير نوع الملف من .%s إلى .%s!';
+$lang['mediaupload'] = 'تحميل ملف إلى فضاء التسمية هنا. لإنشاء فضاءات تسمية فرعية، أضفها إلى بداية خانة تحميل باسم وافصل بينها باستخدام الفاصلتان الرأسيتان.';
+$lang['mediaextchange'] = 'غُيرت لاحقة الملف من .%s إلى .%s!';
$lang['reference'] = 'مراجع لـ';
$lang['ref_inuse'] = 'لا يمكن حذف الملف، لأنه مستخدم من قبل الصفحات التالية:';
-$lang['ref_hidden'] = 'بعض المراجع لصفاحات لا تملك ترخيص برؤيتها';
-$lang['hits'] = 'زوار';
-$lang['quickhits'] = 'صفحات بهذا الاسم';
+$lang['ref_hidden'] = 'بعض المراجع على صفحات لا تملك صلاحيات قراءتها';
+$lang['hits'] = 'مرة';
+$lang['quickhits'] = 'صفحات مطابقة';
$lang['toc'] = 'جدول المحتويات';
$lang['current'] = 'حالي';
$lang['yours'] = 'نسختك';
-$lang['diff'] = 'مقارنة بالنسخة الحالية';
-$lang['diff2'] = 'مقارنة بين النسخ المختارة';
+$lang['diff'] = 'أظهر الاختلافات مع النسخة الحالية';
+$lang['diff2'] = 'أظهر الاختلافات بين النسخ المحددة';
+$lang['difflink'] = 'رابط إلى هذه المقارنة';
$lang['line'] = 'سطر';
$lang['breadcrumb'] = 'أثر';
$lang['youarehere'] = 'أنت هنا';
$lang['lastmod'] = 'آخر تعديل';
$lang['by'] = 'بواسطة';
-$lang['deleted'] = 'تم حذف';
-$lang['created'] = 'تم إنشاء';
-$lang['restored'] = 'عودة لنسخة قديمة';
+$lang['deleted'] = 'حذفت';
+$lang['created'] = 'اُنشئت';
+$lang['restored'] = 'استعيدت نسخة قديمة';
$lang['external_edit'] = 'تحرير خارجي';
$lang['summary'] = 'ملخص التحرير';
$lang['noflash'] = 'تحتاج إلى<a href="http://www.adobe.com/products/flashplayer/">ملحق فلاش أدوبي</a> لعرض هذا المحتوى.';
$lang['download'] = 'نزل Snippet';
$lang['mail_newpage'] = 'إضافة صفحة:';
$lang['mail_changed'] = 'تعديل صفحة:';
-$lang['mail_subscribe_list'] = 'صفحات غيرت في النظاق:';
-$lang['mail_new_user'] = 'مشترك جديد';
-$lang['mail_upload'] = 'تحميل ملف:';
+$lang['mail_subscribe_list'] = 'صفحات غيرت في النطاق:';
+$lang['mail_new_user'] = 'مشترك جديد:';
+$lang['mail_upload'] = 'رفع ملف:';
$lang['qb_bold'] = 'نص عريض';
$lang['qb_italic'] = 'نص مائل';
$lang['qb_underl'] = 'نص مسطر';
$lang['qb_code'] = 'نص برمجي';
$lang['qb_strike'] = 'نص مشطوب';
-$lang['qb_h1'] = 'عنوان مستوى أول';
-$lang['qb_h2'] = 'عنوان مستوى ثاني';
-$lang['qb_h3'] = 'عنوان مستوى ثالث';
-$lang['qb_h4'] = 'عنوان مستوى رابع';
-$lang['qb_h5'] = 'عنوان مستوى خامس';
+$lang['qb_h1'] = 'عنوان مستوى ١';
+$lang['qb_h2'] = 'عنوان مستوى ٢';
+$lang['qb_h3'] = 'عنوان مستوى ٣';
+$lang['qb_h4'] = 'عنوان مستوى ٤';
+$lang['qb_h5'] = 'عنوان مستوى ٥';
$lang['qb_h'] = 'الترويسة';
$lang['qb_hs'] = 'حدد الترويسة';
$lang['qb_hplus'] = 'ترويسة أعلى';
@@ -192,29 +195,29 @@ $lang['qb_extlink'] = 'رابط خارجي';
$lang['qb_hr'] = 'سطر أفقي';
$lang['qb_ol'] = 'بند فى قائمة مرتبة';
$lang['qb_ul'] = 'بند فى قائمة غير مرتبة';
-$lang['qb_media'] = 'إضافة صور و ملفات أخرى';
-$lang['qb_sig'] = 'أضف توقيعك';
-$lang['qb_smileys'] = 'الابتسامات';
+$lang['qb_media'] = 'أضف صورا و ملفات أخرى';
+$lang['qb_sig'] = 'أدرج التوقيع';
+$lang['qb_smileys'] = 'الإبتسامات';
$lang['qb_chars'] = 'محارف خاصة';
$lang['upperns'] = 'انتقل للنطاق الأب';
-$lang['admin_register'] = 'إضافة مشترك جديد';
+$lang['admin_register'] = 'أضف مستخدما جديدا';
$lang['metaedit'] = 'تحرير البيانات الشمولية ';
-$lang['metasaveerr'] = 'فشلت عملية كتابة البيانات الشمولية';
-$lang['metasaveok'] = 'تم حفظ البيانت الشمولية';
-$lang['img_backto'] = 'العودة إلى';
+$lang['metasaveerr'] = 'فشلت كتابة البيانات الشمولية';
+$lang['metasaveok'] = 'حُفظت البيانات الشمولية';
+$lang['img_backto'] = 'عودة إلى';
$lang['img_title'] = 'العنوان';
-$lang['img_caption'] = 'تنويه الصورة';
+$lang['img_caption'] = 'وصف';
$lang['img_date'] = 'التاريخ';
$lang['img_fname'] = 'اسم الملف';
$lang['img_fsize'] = 'الحجم';
$lang['img_artist'] = 'المصور';
$lang['img_copyr'] = 'حقوق النسخ';
-$lang['img_format'] = 'صيغ رسومية';
-$lang['img_camera'] = 'آلة التصوير';
+$lang['img_format'] = 'الهيئة';
+$lang['img_camera'] = 'الكمرا';
$lang['img_keywords'] = 'كلمات مفتاحية';
$lang['subscr_subscribe_success'] = 'اضيف %s لقائمة اشتراك %s';
$lang['subscr_subscribe_error'] = 'خطأ في إضافة %s لقائمة اشتراك %s';
-$lang['subscr_subscribe_noaddress'] = 'ليس هناك عنوان مرتبط بدخولك، لا يمكن اضافتك لقائمة الاشتراك';
+$lang['subscr_subscribe_noaddress'] = 'ليس هناك عنوان مرتبط بولوجك، لا يمكن اضافتك لقائمة الاشتراك';
$lang['subscr_unsubscribe_success'] = 'أزيل %s من قائمة اشتراك %s';
$lang['subscr_unsubscribe_error'] = 'خطأ في إزالة %s من قائمة اشتراك %s';
$lang['subscr_already_subscribed'] = '%s مشترك مسبقا في %s';
@@ -224,7 +227,7 @@ $lang['subscr_m_new_header'] = 'أضف اشتراكا';
$lang['subscr_m_current_header'] = 'الاشتراكات الحالية';
$lang['subscr_m_unsubscribe'] = 'ألغ الاشتراك';
$lang['subscr_m_subscribe'] = 'اشترك';
-$lang['subscr_m_receive'] = 'استقبل';
+$lang['subscr_m_receive'] = 'استقبال';
$lang['subscr_style_every'] = 'بريدا على كل تغيير';
$lang['subscr_style_digest'] = 'بريد ملخص عن تغييرات كل صفحة';
$lang['subscr_style_list'] = 'قائمة بالصفحات المتغيرة منذ آخر بريد';
diff --git a/inc/lang/cs/lang.php b/inc/lang/cs/lang.php
index 33c6db01a..749a41a5b 100644
--- a/inc/lang/cs/lang.php
+++ b/inc/lang/cs/lang.php
@@ -242,7 +242,7 @@ $lang['i_wikiname'] = 'Název wiki';
$lang['i_enableacl'] = 'Zapnout ACL (doporučeno)';
$lang['i_superuser'] = 'Správce';
$lang['i_problems'] = 'Instalátor narazil na níže popsané problémy. Nelze pokračovat v instalaci, dokud je neopravíte.';
-$lang['i_modified'] = 'Instalátor bude z bezpečnostních důvodů pracovat pouze s čistou a ještě neupravenou instalací DokuWiki. Buď znovu rozbalte souboru z instalačního balíčku nebo se zkuste poradit s <a href="http://dokuwiki.org/install">instrukcemi pro instalci DokuWiki</a>.';
+$lang['i_modified'] = 'Instalátor bude z bezpečnostních důvodů pracovat pouze s čistou a ještě neupravenou instalací DokuWiki. Buď znovu rozbalte souboru z instalačního balíčku nebo se zkuste poradit s <a href="http://dokuwiki.org/install">instrukcemi pro instalaci DokuWiki</a>.';
$lang['i_funcna'] = 'PHP funkce <code>%s</code> není dostupná. Váš webhosting ji možná z nějakého důvodu vypnul.';
$lang['i_phpver'] = 'Verze vaší instalace PHP <code>%s</code> je nižší než požadovaná <code>%s</code>. Budete muset aktualizovat svou instalaci PHP.';
$lang['i_permfail'] = 'DokuWiki nemůže zapisovat do <code>%s</code>. Budete muset opravit práva k tomuto adresáři.';
@@ -268,7 +268,7 @@ $lang['mu_toobig'] = 'příliš velké';
$lang['mu_ready'] = 'připraveno k načtení';
$lang['mu_done'] = 'hotovo';
$lang['mu_fail'] = 'selhalo';
-$lang['mu_authfail'] = 'vypršla session';
+$lang['mu_authfail'] = 'vypršela session';
$lang['mu_progress'] = '@PCT@% načten';
$lang['mu_filetypes'] = 'Povolené typy souborů';
$lang['mu_info'] = 'soubory načteny.';
diff --git a/inc/lang/cs/subscr_form.txt b/inc/lang/cs/subscr_form.txt
index b786ac137..d051b646f 100644
--- a/inc/lang/cs/subscr_form.txt
+++ b/inc/lang/cs/subscr_form.txt
@@ -1,3 +1,3 @@
====== Správa odběratelů změn ======
-Tato stránka Vám umožnuje spravovat uživatele přihlášené k odběru změn aktuální stránky nebo jmenného prostoru. \ No newline at end of file
+Tato stránka Vám umožňuje spravovat uživatele přihlášené k odběru změn aktuální stránky nebo jmenného prostoru. \ No newline at end of file
diff --git a/inc/lang/de-informal/lang.php b/inc/lang/de-informal/lang.php
index 948a1ee51..b7c446656 100644
--- a/inc/lang/de-informal/lang.php
+++ b/inc/lang/de-informal/lang.php
@@ -17,6 +17,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -49,7 +50,7 @@ $lang['btn_delete'] = 'Löschen';
$lang['btn_back'] = 'Zurück';
$lang['btn_backlink'] = 'Links hierher';
$lang['btn_backtomedia'] = 'Zurück zur Dateiauswahl';
-$lang['btn_subscribe'] = 'Änderungen abonnieren';
+$lang['btn_subscribe'] = 'Aboverwaltung';
$lang['btn_profile'] = 'Benutzerprofil';
$lang['btn_reset'] = 'Zurücksetzen';
$lang['btn_resendpwd'] = 'Sende neues Passwort';
@@ -107,27 +108,27 @@ $lang['js']['notsavedyet'] = 'Nicht gespeicherte Änderungen gehen verloren!
$lang['js']['searchmedia'] = 'Suche nach Dateien';
$lang['js']['keepopen'] = 'Fenster nach Auswahl nicht schließen';
$lang['js']['hidedetails'] = 'Details ausblenden';
-$lang['js']['mediatitle'] = 'Link-Eigenschaften';
-$lang['js']['mediadisplay'] = 'Linktyp';
-$lang['js']['mediaalign'] = 'Ausrichtung';
-$lang['js']['mediasize'] = 'Bildgröße';
-$lang['js']['mediatarget'] = 'Linkziel';
-$lang['js']['mediaclose'] = 'Schließen';
-$lang['js']['mediainsert'] = 'Einfügen';
-$lang['js']['mediadisplayimg'] = 'Bild anzeigen.';
-$lang['js']['mediadisplaylnk'] = 'Nur den Link anzeigen.';
-$lang['js']['mediasmall'] = 'Kleine Version';
-$lang['js']['mediamedium'] = 'Mittelgroße Version';
-$lang['js']['medialarge'] = 'Große Version';
-$lang['js']['mediaoriginal'] = 'Original Version';
-$lang['js']['medialnk'] = 'Link zu der Detailseite';
-$lang['js']['mediadirect'] = 'Direkter Link zum Original';
-$lang['js']['medianolnk'] = 'Kein link';
-$lang['js']['medianolink'] = 'Keine Verlinkung des Bildes';
-$lang['js']['medialeft'] = 'Bild nach links ausrichten.';
-$lang['js']['mediaright'] = 'Bild nach rechts ausrichten.';
-$lang['js']['mediacenter'] = 'Bild in der Mitte ausrichten';
-$lang['js']['medianoalign'] = 'Keine Ausrichtung des Bildes.';
+$lang['js']['mediatitle'] = 'Link-Eigenschaften';
+$lang['js']['mediadisplay'] = 'Linktyp';
+$lang['js']['mediaalign'] = 'Ausrichtung';
+$lang['js']['mediasize'] = 'Bildgröße';
+$lang['js']['mediatarget'] = 'Linkziel';
+$lang['js']['mediaclose'] = 'Schließen';
+$lang['js']['mediainsert'] = 'Einfügen';
+$lang['js']['mediadisplayimg'] = 'Bild anzeigen.';
+$lang['js']['mediadisplaylnk'] = 'Nur den Link anzeigen.';
+$lang['js']['mediasmall'] = 'Kleine Version';
+$lang['js']['mediamedium'] = 'Mittelgroße Version';
+$lang['js']['medialarge'] = 'Große Version';
+$lang['js']['mediaoriginal'] = 'Original Version';
+$lang['js']['medialnk'] = 'Link zu der Detailseite';
+$lang['js']['mediadirect'] = 'Direkter Link zum Original';
+$lang['js']['medianolnk'] = 'Kein link';
+$lang['js']['medianolink'] = 'Keine Verlinkung des Bildes';
+$lang['js']['medialeft'] = 'Bild nach links ausrichten.';
+$lang['js']['mediaright'] = 'Bild nach rechts ausrichten.';
+$lang['js']['mediacenter'] = 'Bild in der Mitte ausrichten';
+$lang['js']['medianoalign'] = 'Keine Ausrichtung des Bildes.';
$lang['js']['nosmblinks'] = 'Das Verlinken von Windows-Freigaben funktioniert nur im Microsoft Internet-Explorer.\nDer Link kann jedoch durch Kopieren und Einfügen verwendet werden.';
$lang['js']['linkwiz'] = 'Link-Assistent';
$lang['js']['linkto'] = 'Link zu:';
@@ -148,7 +149,6 @@ $lang['uploadsize'] = 'Die hochgeladene Datei war zu groß. (max. %s)
$lang['deletesucc'] = 'Die Datei "%s" wurde gelöscht.';
$lang['deletefail'] = '"%s" konnte nicht gelöscht werden. Keine Berechtigung?.';
$lang['mediainuse'] = 'Die Datei "%s" wurde nicht gelöscht. Sie wird noch verwendet.';
-$lang['mediainuse'] = 'Die Datei "%s" wurde nicht gelöscht. Sie wird noch verwendet.';
$lang['namespaces'] = 'Namensräume';
$lang['mediafiles'] = 'Vorhandene Dateien in';
$lang['accessdenied'] = 'Du hast keinen Zugriff auf diese Seite';
@@ -225,22 +225,22 @@ $lang['img_copyr'] = 'Copyright';
$lang['img_format'] = 'Format';
$lang['img_camera'] = 'Kamera';
$lang['img_keywords'] = 'Schlagwörter';
-$lang['subscr_subscribe_success'] = 'Die Seite %s wurde zur Abonnementenliste von %s hinzugefügt';
-$lang['subscr_subscribe_error'] = 'Fehler beim Hinzufügen von %s zur Abonnementenliste von %s';
+$lang['subscr_subscribe_success'] = 'Die Seite %s wurde zur Abonnementenliste von %s hinzugefügt';
+$lang['subscr_subscribe_error'] = 'Fehler beim Hinzufügen von %s zur Abonnementenliste von %s';
$lang['subscr_subscribe_noaddress'] = 'In deinem Account ist keine E-Mail-Adresse hinterlegt. Dadurch kann die Seite nicht abonniert werden';
$lang['subscr_unsubscribe_success'] = 'Die Seite %s wurde von der Abonnementenliste von %s entfernt';
-$lang['subscr_unsubscribe_error'] = 'Fehler beim Entfernen von %s von der Abonnementenliste von %s';
-$lang['subscr_already_subscribed'] = '%s ist bereits auf der Abonnementenliste von %s';
-$lang['subscr_not_subscribed'] = '%s ist nicht auf der Abonnementenliste von %s';
-$lang['subscr_m_not_subscribed'] = 'Du hast kein Abonnement von dieser Seite oder dem Namensraum.';
-$lang['subscr_m_new_header'] = 'Abonnementen hinzufügen';
-$lang['subscr_m_current_header'] = 'Aktive Abonnements';
-$lang['subscr_m_unsubscribe'] = 'Abbestellen';
-$lang['subscr_m_subscribe'] = 'Abonnieren';
-$lang['subscr_m_receive'] = 'Erhalten';
-$lang['subscr_style_every'] = 'E-Mail bei jeder Änderung';
-$lang['subscr_style_digest'] = 'E-Mail mit zusammengefasster Übersicht der Seitenänderungen (alle %.2f Tage)';
-$lang['subscr_style_list'] = 'Auflistung aller geänderten Seiten seit der letzten E-Mail (alle %.2f Tage)';
+$lang['subscr_unsubscribe_error'] = 'Fehler beim Entfernen von %s von der Abonnementenliste von %s';
+$lang['subscr_already_subscribed'] = '%s ist bereits auf der Abonnementenliste von %s';
+$lang['subscr_not_subscribed'] = '%s ist nicht auf der Abonnementenliste von %s';
+$lang['subscr_m_not_subscribed'] = 'Du hast kein Abonnement von dieser Seite oder dem Namensraum.';
+$lang['subscr_m_new_header'] = 'Abonnementen hinzufügen';
+$lang['subscr_m_current_header'] = 'Aktive Abonnements';
+$lang['subscr_m_unsubscribe'] = 'Abbestellen';
+$lang['subscr_m_subscribe'] = 'Abonnieren';
+$lang['subscr_m_receive'] = 'Erhalten';
+$lang['subscr_style_every'] = 'E-Mail bei jeder Änderung';
+$lang['subscr_style_digest'] = 'E-Mail mit zusammengefasster Übersicht der Seitenänderungen (alle %.2f Tage)';
+$lang['subscr_style_list'] = 'Auflistung aller geänderten Seiten seit der letzten E-Mail (alle %.2f Tage)';
$lang['authmodfailed'] = 'Benutzerüberprüfung nicht möglich. Bitte wende dich an den Admin.';
$lang['authtempfail'] = 'Benutzerüberprüfung momentan nicht möglich. Falls das Problem andauert, wende dich an den Admin.';
$lang['i_chooselang'] = 'Wähle deine Sprache';
diff --git a/inc/lang/de-informal/subscr_digest.txt b/inc/lang/de-informal/subscr_digest.txt
index 9e943626c..f8cab210f 100644
--- a/inc/lang/de-informal/subscr_digest.txt
+++ b/inc/lang/de-informal/subscr_digest.txt
@@ -1,7 +1,7 @@
Hallo!
Die Seite @PAGE@ im @TITLE@ Wiki wurde bearbeitet.
-Das sind die nderungen:
+Üersicht der Änderungen:
--------------------------------------------------------
@DIFF@
@@ -10,10 +10,10 @@ Das sind die nderungen:
Alte Revision: @OLDPAGE@
Neue Revision: @NEWPAGE@
-Um das Abonnement fr diese Seite aufzulsen, melde dich im Wiki an
+Um das Abonnement für diese Seite aufzulösen, melde dich im Wiki an
@DOKUWIKIURL@, besuchen dann
@SUBSCRIBE@
-und klicke auf den Link 'nderungen abbestellen'.
+und klicke auf den Link 'Aboverwaltung'.
--
Diese Mail kommt vom DokuWiki auf
diff --git a/inc/lang/de-informal/subscr_single.txt b/inc/lang/de-informal/subscr_single.txt
index 3a295be76..3c557bc17 100644
--- a/inc/lang/de-informal/subscr_single.txt
+++ b/inc/lang/de-informal/subscr_single.txt
@@ -1,22 +1,22 @@
Hallo!
Die Seite @PAGE@ im @TITLE@ Wiki wurde bearbeitet.
-Das sind die Änderungen:
+Übersicht der Änderungen:
--------------------------------------------------------
@DIFF@
--------------------------------------------------------
-Datum : @DATE@
-Benutzer : @USER@
-Übersicht: @SUMMARY@
+Datum: @DATE@
+Benutzer: @USER@
+Zusammenfassung: @SUMMARY@
Alte Revision: @OLDPAGE@
Neue Revision: @NEWPAGE@
Um das Abonnement für diese Seite aufzulösen, melde dich im Wiki an
-@DOKUWIKIURL@, besuchen dann
+@DOKUWIKIURL@, besuche dann
@NEWPAGE@
-und klicke auf den Link 'Änderungen abbestellen'.
+und klicke auf den Link 'Aboverwaltung'.
--
Diese Mail kommt vom DokuWiki auf
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index dfd9a8eab..a353b98ed 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -17,6 +17,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -49,12 +51,12 @@ $lang['btn_delete'] = 'Löschen';
$lang['btn_back'] = 'Zurück';
$lang['btn_backlink'] = 'Links hierher';
$lang['btn_backtomedia'] = 'Zurück zur Dateiauswahl';
-$lang['btn_subscribe'] = 'Änderungen abonnieren';
+$lang['btn_subscribe'] = 'Aboverwaltung';
$lang['btn_profile'] = 'Benutzerprofil';
$lang['btn_reset'] = 'Zurücksetzen';
$lang['btn_resendpwd'] = 'Sende neues Passwort';
$lang['btn_draft'] = 'Entwurf bearbeiten';
-$lang['btn_recover'] = 'Entwurf wieder herstellen';
+$lang['btn_recover'] = 'Entwurf wiederherstellen';
$lang['btn_draftdel'] = 'Entwurf löschen';
$lang['btn_revert'] = 'Wiederherstellen';
$lang['loggedinas'] = 'Angemeldet als';
diff --git a/inc/lang/de/subscr_digest.txt b/inc/lang/de/subscr_digest.txt
index c8bf770ee..7cc79bba2 100644
--- a/inc/lang/de/subscr_digest.txt
+++ b/inc/lang/de/subscr_digest.txt
@@ -1,7 +1,7 @@
Hallo!
Die Seite @PAGE@ im @TITLE@ Wiki wurde bearbeitet.
-Das sind die Änderungen:
+Übersicht der Änderungen:
--------------------------------------------------------
@DIFF@
@@ -13,7 +13,7 @@ Neue Revision: @NEWPAGE@
Um das Abonnement für diese Seite aufzulösen, melden Sie sich im Wiki an
@DOKUWIKIURL@, besuchen dann
@SUBSCRIBE@
-und klicken auf den Link 'Änderungen abbestellen'.
+und klicken auf den Link 'Aboverwaltung'.
--
Diese Mail kommt vom DokuWiki auf
diff --git a/inc/lang/de/subscr_single.txt b/inc/lang/de/subscr_single.txt
index fb149e927..f3e1cd393 100644
--- a/inc/lang/de/subscr_single.txt
+++ b/inc/lang/de/subscr_single.txt
@@ -1,22 +1,22 @@
Hallo!
Die Seite @PAGE@ im @TITLE@ Wiki wurde bearbeitet.
-Das sind die Änderungen:
+Übersicht der Änderungen:
--------------------------------------------------------
@DIFF@
--------------------------------------------------------
-Datum : @DATE@
-Benutzer : @USER@
-Übersicht: @SUMMARY@
+Datum: @DATE@
+Benutzer: @USER@
+Zusammenfassung: @SUMMARY@
Alte Revision: @OLDPAGE@
Neue Revision: @NEWPAGE@
-Um das Abonnement für diese Seite aufzulösen, melde Sie sich im Wiki an
+Um das Abonnement für diese Seite aufzulösen, melden Sie sich im Wiki an
@DOKUWIKIURL@, besuchen dann
@NEWPAGE@
-und klicken auf die Taste 'Änderungen abbestellen'.
+und klicken auf die Taste 'Aboverwaltung'.
--
Diese Mail kommt vom DokuWiki auf
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 5c890246c..9ccbe14e0 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -316,4 +316,4 @@ $lang['seconds'] = '%d seconds ago';
$lang['wordblock'] = 'Your change was not saved because it contains blocked text (spam).';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/et/lang.php b/inc/lang/et/lang.php
index ef540bb3d..ee765b5b5 100644
--- a/inc/lang/et/lang.php
+++ b/inc/lang/et/lang.php
@@ -211,4 +211,4 @@ $lang['js']['del_confirm']= 'Kas kustutame selle kirje?';
#$lang['unsubscribe_success'] = '';
#$lang['unsubscribe_error'] = '';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/he/conflict.txt b/inc/lang/he/conflict.txt
index d27a78559..c1cccdfcf 100644
--- a/inc/lang/he/conflict.txt
+++ b/inc/lang/he/conflict.txt
@@ -1,6 +1,6 @@
-====== גירסה עדכנית יותר של הקובץ קיימת ======
+====== קיימת גרסה עדכנית יותר של הקובץ ======
-גירסה עדכנית יותר של המסמך קיימת. דבר זה קורה כאשר משתמש אחר שינה את המסמך בזמן שערכת אותו.
+ישנה גרסה עדכנית יותר של המסמך. מצב כזה קורה כאשר משתמש אחר שינה את המסמך בזמן שערכת אותו.
-מומלץ לעיין בהבדלים תחת הודעה ולאחר מכן להחליט איזו גירסה כדאי לשמור. לחיצה על הכפתור "שמור" תשמור את הגרסה שערכת. לחיצה על הכפתור "בטל" תשמור את הגרסה הקיימת.
+מומלץ לעיין בהבדלים המופיעים להלן ולאחר מכן להחליט איזו גרסה כדאי לשמור. לחיצה על הכפתור "שמירה" תשמור את הגרסה שערכת. לחיצה על הכפתור "ביטול" תשמור את הגרסה הקיימת.
diff --git a/inc/lang/he/denied.txt b/inc/lang/he/denied.txt
index 34c8417b4..a366fc198 100644
--- a/inc/lang/he/denied.txt
+++ b/inc/lang/he/denied.txt
@@ -1,3 +1,3 @@
====== הרשאה נדחתה ======
-אנו מצטערים אך אין לך הרשאות מתאימות כדי להמשיך. אולי שכחת להכנס למערכת? \ No newline at end of file
+אנו מצטערים אך אין לך הרשאות מתאימות כדי להמשיך. אולי שכחת להיכנס למערכת? \ No newline at end of file
diff --git a/inc/lang/he/draft.txt b/inc/lang/he/draft.txt
index 22fc88d9f..b999cc187 100644
--- a/inc/lang/he/draft.txt
+++ b/inc/lang/he/draft.txt
@@ -1,5 +1,5 @@
-====== נמצא קובץ טיוטא ======
+====== נמצא קובץ טיוטה ======
-העריכה האחרונה שבוצעה לדף זה לא הסתימה כהלכה. DokuWiki שמר באופן אוטומטי טיוטה של העבודה ובאפשרותך להשתמש בה כדי להמשיך את העריכה. ניתן לראות מטה את המידע שנשמר מהפעם הקודמת.
+העריכה האחרונה שבוצעה לדף זה לא הושלמה כראוי. DokuWiki שמר באופן אוטומטי טיוטה של העבודה ובאפשרותך להשתמש בה כדי להמשיך את העריכה. ניתן לראות להלן את הנתונים שנשמרו מהפעם הקודמת.
באפשרותך לבחור ב//שחזור הטיוטה// של אותה עריכה //מחיקת הטיוטה// או //ביטול// העריכה כליל. \ No newline at end of file
diff --git a/inc/lang/he/edit.txt b/inc/lang/he/edit.txt
index 4d8151e9d..74b3cefeb 100644
--- a/inc/lang/he/edit.txt
+++ b/inc/lang/he/edit.txt
@@ -1 +1 @@
-עריכת הדף ולחיצה על הכפתור "שמור" תעדכן את תוכנו. מומלץ לעיין בדף ה[[wiki:syntax|תחביר]] כדי להכיר את כללי תחביר הויקי. נא לערוך את הדף רק אם הדבר נעשה כדי **לשפר** אותו. אם העריכה היא לצורך התנסות מומלץ לבקר ב[[playground:playground|ארגז החול]].
+עריכת הדף ולחיצה על הלחצן "שמירה" תעדכן את תוכנו. מומלץ לעיין בדף ה[[wiki:syntax|תחביר]] כדי להכיר את כללי תחביר הוויקי. נא לערוך את הדף רק אם הדבר נעשה כדי **לשפר** אותו. אם העריכה היא לצורך התנסות מומלץ לבקר ב[[playground:playground|ארגז החול]].
diff --git a/inc/lang/he/editrev.txt b/inc/lang/he/editrev.txt
index a6c755cba..e33001fa3 100644
--- a/inc/lang/he/editrev.txt
+++ b/inc/lang/he/editrev.txt
@@ -1,2 +1,2 @@
-**הדף שנפתח הוא גרסה ישנה של המסמך!** לחיצה על הכפתור "שמור" תשחזר את המסמך לגרסה המוצגת כעת.
+**הדף שנפתח הוא גרסה ישנה של המסמך!** לחיצה על הלחצן "שמירה" תשחזר את המסמך לגרסה המוצגת כעת.
---- \ No newline at end of file
diff --git a/inc/lang/he/index.txt b/inc/lang/he/index.txt
index 12b7a960e..4b0623f84 100644
--- a/inc/lang/he/index.txt
+++ b/inc/lang/he/index.txt
@@ -1,4 +1,4 @@
-====== אינדקס ======
+====== מפת אתר ======
-זהו קובץ אינדקס הנמצא מעל לכל הדפים המאורגנים ב[[ויקי:דוקיוויקי]].
+זהו קובץ מפת אתר הנמצא מעל לכל הדפים המאורגנים ב[[ויקי:דוקיוויקי]].
diff --git a/inc/lang/he/install.html b/inc/lang/he/install.html
index 7831623c9..3832fb5fb 100644
--- a/inc/lang/he/install.html
+++ b/inc/lang/he/install.html
@@ -1,13 +1,13 @@
-<p>דף זה מסייע להתקנה וההגדרה הראשוניות של
-<a href="http://dokuwiki.org">Dokuwiki</a>. מידע נוסף על מתקין זה זמין בדף
+<p>דף זה מסייע בהליכי ההתקנה וההגדרה הראשוניים של
+<a href="http://dokuwiki.org">Dokuwiki</a>. מידע נוסף על תכנית התקנה זו זמין בדף
<a href="http://dokuwiki.org/installer">התיעוד שלו</a>.</p>
-<p>DokuWiki עושה שימוש בקבצים רגילים לשמירת דפי ויקי ומידע נוסף הקשור לדפים אלו (לדוגמה תמונות, רשימות חיפוש, גרסאות קודמות וכו').
-לתפקוד תקין DokuWiki <strong>חייב</strong> גישה לכתיבה לתיקיות המכילות קבצים אלו. מתקין זה אינו יכול לקבוע הרשאות לתיקיות.
-פעולה זו צריכה בד"כ להתבצע ישירות משורת הפקודה או במקרה שנעשה שימוש בשרת מארח דרך FTP או מנשק הניהול של המארח (cPanell לדוגמה).</p>
+<p>DokuWiki עושה שימוש בקבצים רגילים לשמירת דפי ויקי ומידע נוסף הקשור לדפים אלו (לדוגמה: תמונות, רשימות חיפוש, גרסאות קודמות וכו׳).
+לצורך תפקוד תקין DokuWiki <strong>חייב</strong> גישה לכתיבה לתיקיות המכילות קבצים אלו. תכנית התקנה זו אינה יכולה להגדיר הרשאות לתיקיות.
+פעולה זו צריכה בד״כ להתבצע ישירות משורת הפקודה או במקרה שנעשה שימוש בשרת מארח דרך FTP או מנשק הניהול של המארח (cPanell לדוגמה).</p>
-<p>מתקין זה יגדיר את תצורת ה-<acronym title="access control list">ACL</acronym> ב-DokuWiki שלך
+<p>מתקין זה יגדיר את תצורת ה־<acronym title="access control list">ACL</acronym> ב-DokuWiki שלך
, זה בתורו מאפשר גישת מנהל לתפריט הניהול של DokuWiki כדי להתקין הרחבות, לנהל משתמשים, לנהל גישות לדפי ויקי ושינויים בהגדרות התצורה.
-אין הוא הכרחי לתפקוד DokuWiki אך הוא יהפוך את Dokuwiki קל יותר לניהול.</p>
+אין הוא הכרחי לתפקוד DokuWiki אך הוא יהפוך את Dokuwiki לפשוט יותר לניהול.</p>
-<p>על משתמשים מנוסים או כאלו עם דרישות מיוחדות להתקנה להשתמש בקישורים אלו לפרטים בנוגע ל<a href="http://dokuwiki.org/install">הוראות התקנה</a> ו<a href="http://dokuwiki.org/config">הגדרות תצורה</a>.</p>
+<p>על משתמשים מנוסים או כאלו עם דרישות מיוחדות להתקנה להשתמש בקישורים אלו לפרטים בנוגע ל<a href="http://dokuwiki.org/install">הוראות התקנה</a> ול<a href="http://dokuwiki.org/config">הגדרות תצורה</a>.</p>
diff --git a/inc/lang/he/lang.php b/inc/lang/he/lang.php
index a411764d2..47310d4d1 100644
--- a/inc/lang/he/lang.php
+++ b/inc/lang/he/lang.php
@@ -10,6 +10,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'rtl';
@@ -18,132 +19,153 @@ $lang['doublequoteclosing'] = '”';
$lang['singlequoteopening'] = '‘';
$lang['singlequoteclosing'] = '’';
$lang['apostrophe'] = '\'';
-$lang['btn_edit'] = 'עריכה';
-$lang['btn_source'] = 'הצג את מקור הדף';
-$lang['btn_show'] = 'הצג דף';
+$lang['btn_edit'] = 'עריכת דף זה';
+$lang['btn_source'] = 'הצגת מקור הדף';
+$lang['btn_show'] = 'הצגת דף';
$lang['btn_create'] = 'יצירת דף';
-$lang['btn_search'] = 'חפש';
-$lang['btn_save'] = 'שמור';
+$lang['btn_search'] = 'חיפוש';
+$lang['btn_save'] = 'שמירה';
$lang['btn_preview'] = 'תצוגה מקדימה';
-$lang['btn_top'] = 'חזור למעלה';
-$lang['btn_newer'] = '<< יותר חדש';
-$lang['btn_older'] = 'פחות חדש >>';
+$lang['btn_top'] = 'חזרה למעלה';
+$lang['btn_newer'] = '<< חדש יותר';
+$lang['btn_older'] = 'פחות חדש >>';
$lang['btn_revs'] = 'גרסאות קודמות';
$lang['btn_recent'] = 'שינויים אחרונים';
-$lang['btn_upload'] = 'העלה';
-$lang['btn_cancel'] = 'בטל';
-$lang['btn_index'] = 'אינדקס';
+$lang['btn_upload'] = 'העלאה';
+$lang['btn_cancel'] = 'ביטול';
+$lang['btn_index'] = 'מפת האתר';
$lang['btn_secedit'] = 'עריכה';
$lang['btn_login'] = 'כניסה';
$lang['btn_logout'] = 'יציאה';
-$lang['btn_admin'] = 'מנהל';
-$lang['btn_update'] = 'עדכן';
-$lang['btn_delete'] = 'מחק';
-$lang['btn_back'] = 'חזור';
+$lang['btn_admin'] = 'ניהול';
+$lang['btn_update'] = 'עדכון';
+$lang['btn_delete'] = 'מחיקה';
+$lang['btn_back'] = 'חזרה';
$lang['btn_backlink'] = 'קישורים לכאן';
-$lang['btn_backtomedia'] = 'לחזור לבחירת קובץ מדיה';
-$lang['btn_subscribe'] = 'עקוב אחרי שינוים';
-$lang['btn_unsubscribe'] = 'הפסק לעקוב';
-$lang['btn_subscribens'] = 'הרשמה לשינויים במרחב השם';
-$lang['btn_unsubscribens'] = 'הסרת הרשמה לשינויים במחב השם';
-$lang['btn_profile'] = 'עדכן פרופיל';
+$lang['btn_backtomedia'] = 'חזרה לבחירת קובץ מדיה';
+$lang['btn_subscribe'] = 'מעקב אחרי שינוים';
+$lang['btn_profile'] = 'עדכון הפרופיל';
$lang['btn_reset'] = 'איפוס';
-$lang['btn_resendpwd'] = 'שלח סיסמה חדשה';
+$lang['btn_resendpwd'] = 'שליחת ססמה חדשה';
$lang['btn_draft'] = 'עריכת טיוטה';
$lang['btn_recover'] = 'שחזור טיוטה';
$lang['btn_draftdel'] = 'מחיקת טיוטה';
-$lang['btn_revert'] = 'שחזר';
-$lang['loggedinas'] = 'רשום כ-';
+$lang['btn_revert'] = 'שחזור';
+$lang['loggedinas'] = 'נכנסת בשם';
$lang['user'] = 'שם משתמש';
-$lang['pass'] = 'סיסמה';
-$lang['newpass'] = 'סיסמה חדשה';
-$lang['oldpass'] = 'אשר את הסיסמה הנוכחית';
-$lang['passchk'] = 'שוב';
-$lang['remember'] = 'זכור אותי';
+$lang['pass'] = 'ססמה';
+$lang['newpass'] = 'ססמה חדשה';
+$lang['oldpass'] = 'אישור הססמה הנוכחית';
+$lang['passchk'] = 'פעם נוספת';
+$lang['remember'] = 'שמירת הפרטים שלי';
$lang['fullname'] = 'שם מלא';
-$lang['email'] = 'דוא"ל';
+$lang['email'] = 'דוא״ל';
$lang['register'] = 'הרשמה';
-$lang['profile'] = 'פרופיל';
-$lang['badlogin'] = 'סליחה, שם המשתמש או הסיסמה שגויים';
-$lang['minoredit'] = 'שינוים מינוריים';
-$lang['draftdate'] = 'טיוטה נשמרה ב-';
+$lang['profile'] = 'פרופיל המשתמש';
+$lang['badlogin'] = 'שם המשתמש או הססמה שגויים, עמך הסליחה';
+$lang['minoredit'] = 'שינוים מזעריים';
+$lang['draftdate'] = 'הטיוטה נשמרה אוטומטית ב־';
$lang['nosecedit'] = 'הדף השתנה בינתיים, הקטע שערכת אינו מעודכן - העמוד כולו נטען במקום זאת.';
-$lang['regmissing'] = 'סליחה, עליך למלא את כל השדות';
-$lang['reguexists'] = 'סליחה, משתמש בשם זה כבר נרשם';
-$lang['regsuccess'] = 'הרשמה הצליחה, המשתמש נרשם והודעה נשלחה בדואר';
-$lang['regsuccess2'] = 'הרשמה הצליחה, המשתמש נרשם.';
-$lang['regmailfail'] = 'שליחת הודעת הדואר כשלה, נא ליצור קשר עם מנהל האתר';
-$lang['regbadmail'] = 'כתובת דואר כנראה לא תקפה, אם לא כך היא יש ליצור קשר עם מנהל האתר';
-$lang['regbadpass'] = 'שתי הסיסמות הן לא זהות, נא לנסות שוב';
-$lang['regpwmail'] = 'סיסמת הדוקוויקי שלך';
-$lang['reghere'] = 'עדיין ללא שם-משתמש? ההרשמה כאן';
+$lang['regmissing'] = 'עליך למלא את כל השדות, עמך הסליחה.';
+$lang['reguexists'] = 'משתמש בשם זה כבר נרשם, עמך הסליחה.';
+$lang['regsuccess'] = 'ההרשמה הצליחה, המשתמש נרשם והודעה נשלחה בדוא״ל.';
+$lang['regsuccess2'] = 'ההרשמה הצליחה, המשתמש נוצר.';
+$lang['regmailfail'] = 'שליחת הודעת הדוא״ל כשלה, נא ליצור קשר עם מנהל האתר!';
+$lang['regbadmail'] = 'יתכן כי כתובת הדוא״ל אינה תקפה, אם לא כך הדבר ליצור קשר עם מנהל האתר';
+$lang['regbadpass'] = 'שתי הססמאות אינן זהות זו לזו, נא לנסות שוב.';
+$lang['regpwmail'] = 'ססמת הדוקוויקי שלך';
+$lang['reghere'] = 'עדיין אין לך חשבון? ההרשמה כאן';
$lang['profna'] = 'בוויקי הזה לא ניתן לשנות פרופיל';
-$lang['profnochange'] = 'אין שינוים, פרופיל לא עודכן';
-$lang['profnoempty'] = 'שם וכתובת דוא"ל לא יכולים להיות ריקים';
-$lang['profchanged'] = 'פרופיל עודכן בהצלחה';
-$lang['pwdforget'] = 'שכחת סיסמה? קבל חדשה';
-$lang['resendna'] = 'הוויקי הזה לא תומך בחידוש סיסמה';
-$lang['resendpwd'] = 'שלח סיסמה חדשה עבור';
-$lang['resendpwdmissing'] = 'סליחה, עליך למלא את כל השדות';
-$lang['resendpwdnouser'] = 'סליחה, משתמש בשם זה לא נמצא';
-$lang['resendpwdbadauth'] = 'סליחה, קוד אימות זה אינו תקף. יש לודא כי נעשה שימוש במלוא קישור האימות.';
-$lang['resendpwdconfirm'] = 'קישור אימות נשלח בדוא"ל.';
-$lang['resendpwdsuccess'] = 'סיסמה חדשה נשלחה בדואר';
-$lang['license'] = 'למעט מקרים בהם צוין אחרת, התוכן בוויקי זה זמין לפי הרשיון הבא:';
-$lang['licenseok'] = 'שים לב: עריכת דף זה מהווה הסכמה מצידך להצגת התוכן שהוספת לפי הרשיון הבא:';
-$lang['searchmedia'] = 'חפש שם קובץ:';
-$lang['txt_upload'] = 'בחר קובץ להעלות';
-$lang['txt_filename'] = 'הכנס שם לוויקי (בחירה)';
-$lang['txt_overwrt'] = 'לכתוב במקום קובץ קיים';
+$lang['profnochange'] = 'אין שינויים, הפרופיל לא עודכן';
+$lang['profnoempty'] = 'השם וכתובת הדוא״ל לא יכולים להיות ריקים';
+$lang['profchanged'] = 'הפרופיל עודכן בהצלחה';
+$lang['pwdforget'] = 'שכחת את הססמה שלך? ניתן לקבל חדשה';
+$lang['resendna'] = 'הוויקי הזה אינו תומך בחידוש ססמה';
+$lang['resendpwd'] = 'שליחת ססמה חדשה עבור';
+$lang['resendpwdmissing'] = 'עליך למלא את כל השדות, עמך הסליחה.';
+$lang['resendpwdnouser'] = 'משתמש בשם זה לא נמצא במסד הנתונים, עמך הסליחה.';
+$lang['resendpwdbadauth'] = 'קוד אימות זה אינו תקף. יש לוודא כי נעשה שימוש בקישור האימות המלא, עמך הסליחה.';
+$lang['resendpwdconfirm'] = 'נשלח קישור לאימות נשלח בדוא״ל.';
+$lang['resendpwdsuccess'] = 'נשלחה ססמה חדשה בדוא״ל';
+$lang['license'] = 'למעט מקרים בהם צוין אחרת, התוכן בוויקי זה זמין לפי הרישיון הבא:';
+$lang['licenseok'] = 'נא לשים לב: עריכת דף זה מהווה הסכמה מצדך להצגת התוכן שהוספת בהתאם הרישיון הבא:';
+$lang['searchmedia'] = 'חיפוש שם קובץ:';
+$lang['searchmedia_in'] = 'חיפוש תחת %s';
+$lang['txt_upload'] = 'בחירת קובץ להעלות';
+$lang['txt_filename'] = 'העלאה בשם (נתון לבחירה)';
+$lang['txt_overwrt'] = 'שכתוב על קובץ קיים';
$lang['lockedby'] = 'נעול על ידי';
-$lang['lockexpire'] = 'נעילה פגה';
-$lang['willexpire'] = 'נעילה תחלוף עוד זמן קצר. \nלמניעת התנגשויות יש להשתמש בכפתור הרענון מטה כדי לאתחל את הנעילה שנית';
-$lang['js']['notsavedyet'] = "קיימים שינויים שטרם נשמרו ואשר יאבדו \n האם להמשיך?";
-$lang['rssfailed'] = 'כשל ב-RSS';
-$lang['nothingfound'] = 'לא נמצאו תוצאות';
-$lang['mediaselect'] = 'בחירת קובץ מדיה';
-$lang['fileupload'] = 'העלאת קובץ מדיה';
-$lang['uploadsucc'] = 'העלאת הקובץ בוצעה בהצלחה';
-$lang['uploadfail'] = 'קרתה שגיאה בעת העלאת הקובץ. תיתכן ובעייה זו נוצרה עקב הרשאות שגיות.';
-$lang['uploadwrong'] = 'העלאה לא אושרה. קבצים בסיומת זו אסורים';
-$lang['uploadexist'] = 'הקובץ כבר קיים. פעולה בוטלה';
+$lang['lockexpire'] = 'הנעילה פגה';
+$lang['willexpire'] = 'הנעילה תחלוף עוד זמן קצר. \nלמניעת התנגשויות יש להשתמש בכפתור הרענון מטה כדי לאפס את מד משך הנעילה.';
+$lang['js']['notsavedyet'] = 'שינויים שלא נשמרו ילכו לאיבוד.';
+$lang['js']['searchmedia'] = 'חיפוש אחר קבצים';
+$lang['js']['keepopen'] = 'השארת חלון פתוח על הבחירה';
+$lang['js']['hidedetails'] = 'הסתרת פרטים';
+$lang['js']['mediatitle'] = 'הגדרות הקישור';
+$lang['js']['mediadisplay'] = 'סוג הקישור';
+$lang['js']['mediaalign'] = 'יישור';
+$lang['js']['mediasize'] = 'גודל התמונה';
+$lang['js']['mediatarget'] = 'יעד הקישור';
+$lang['js']['mediaclose'] = 'סגירה';
+$lang['js']['mediainsert'] = 'הוספה';
+$lang['js']['mediadisplayimg'] = 'הצגת התמונה.';
+$lang['js']['mediadisplaylnk'] = 'הצגת הקישור בלבד.';
+$lang['js']['mediasmall'] = 'גרסה קטנה';
+$lang['js']['mediamedium'] = 'גרסה בינונית';
+$lang['js']['medialarge'] = 'גרסה גדולה';
+$lang['js']['mediaoriginal'] = 'הגרסה המקורית';
+$lang['js']['medialnk'] = 'קישור לעמוד הפרטים';
+$lang['js']['mediadirect'] = 'הקישור הישיר למקור';
+$lang['js']['medianolnk'] = 'אין קישור';
+$lang['js']['medianolink'] = 'אין לקשר לתמונה';
+$lang['js']['medialeft'] = 'יישור התמונה לשמאל.';
+$lang['js']['mediaright'] = 'יישור התמונה לימין.';
+$lang['js']['mediacenter'] = 'מרכוז התמונה.';
+$lang['js']['medianoalign'] = 'לא להשתמש ביישור.';
+$lang['js']['nosmblinks'] = 'קישור לכונני שיתוף של Windows עובד רק באמצעות Microsoft Internet Explorer.
+עדיין ניתן להעתיק ולהדביק את הקישור.';
+$lang['js']['linkwiz'] = 'אשף הקישורים';
+$lang['js']['linkto'] = 'קישור אל:';
+$lang['js']['del_confirm'] = 'באמת למחוק?';
+$lang['js']['mu_btn'] = 'העלאת מספר קבצים יחד';
+$lang['rssfailed'] = 'אירע כשל בעת קבלת הזנה זו:';
+$lang['nothingfound'] = 'לא נמצאו תוצאות.';
+$lang['mediaselect'] = 'קובצי מדיה';
+$lang['fileupload'] = 'העלאת קובצי מדיה';
+$lang['uploadsucc'] = 'ההעלאה הושלמה בהצלחה';
+$lang['uploadfail'] = 'אירעה שגיאה בעת העלאת הקובץ. היתכן שתקלה זו נוצרה עקב הרשאות שגיות?';
+$lang['uploadwrong'] = 'ההעלאה לא אושרה. קבצים בסיומת זו אסורים!';
+$lang['uploadexist'] = 'הקובץ כבר קיים. הפעולה בוטלה.';
$lang['uploadbadcontent'] = 'התוכן שהועלה לא תאם את הסיומת %s של הקובץ.';
-$lang['uploadspam'] = 'ההעלאה נחסמה על ידי הרשימה השחורה של הספאם.';
+$lang['uploadspam'] = 'ההעלאה נחסמה על ידי רשימת חסימת הספאם.';
$lang['uploadxss'] = 'ההעלאה נחסמה בשל חשד לתוכן זדוני.';
-$lang['uploadsize'] = 'הקובץ שהועלה היה גדול מדי. (מקסימום %s)';
-$lang['deletesucc'] = 'קובץ %s נמחק';
-$lang['deletefail'] = 'לא יכולתי למחוק "%s" -- בדקו הרשאות';
-$lang['mediainuse'] = 'קובץ "%s" לא נמחק - הוא עדיין בשימוש';
+$lang['uploadsize'] = 'הקובץ שהועלה היה גדול מדי. (%s לכל היותר)';
+$lang['deletesucc'] = 'הקובץ %s נמחק.';
+$lang['deletefail'] = 'לא ניתן למחוק את "%s" -- נא לבדוק את ההרשאות.';
+$lang['mediainuse'] = 'הקובץ "%s" לא נמחק - הוא עדיין בשימוש.';
$lang['namespaces'] = 'שמות מתחם';
-$lang['mediafiles'] = 'קבצים זמינים ב-';
-$lang['js']['searchmedia'] = 'חיפוש קבצים';
-$lang['js']['keepopen'] = 'השאר חלון פתוח בבחירה';
-$lang['js']['hidedetails'] = 'הסתר פרטים';
-$lang['js']['nosmblinks'] = ':( קישור למערכת קבצים של חלונות פועל רק בדפדפן אינטרנט אקספלורר.
- זה בסדר, אין צורך לעבור. אפשר להעתיק ולהדביק את הקישור';
-$lang['js']['linkwiz'] = 'אשף הקישורים';
-$lang['js']['linkto'] = 'קשר אל:';
-$lang['js']['del_confirm'] = 'באמת למחוק?';
-$lang['js']['mu_btn'] = 'העלאת קבצים מרובים';
-$lang['mediausage'] = 'השתמש בתחביר הבא להתיחסות אל קובץ זה:';
-$lang['mediaview'] = 'הצג את הקובץ המקורי';
+$lang['mediafiles'] = 'קבצים זמינים תחת';
+$lang['accessdenied'] = 'אין לך הרשאה לצפות בדף זה.';
+$lang['mediausage'] = 'יש להשתמש בתחביר הבא כדי להפנות לקובץ זה:';
+$lang['mediaview'] = 'הצגת הקובץ המקורי';
$lang['mediaroot'] = 'root';
-$lang['mediaupload'] = 'כאן ניתן להעלות קובץ למרחב השמות הנוכחי. ליצירת תתי-מרחבי שמות צרפם ב-"העלה" לתחילת שם הקובץ מופרדים בפסיקים';
-$lang['mediaextchange'] = 'סיומת הקובץ השתנתה מ-.%s ל-.%s!';
-$lang['reference'] = 'קישורים ל';
+$lang['mediaupload'] = 'כאן ניתן להעלות קובץ למרחב השם הנוכחי. ליצירת תת־מרחבי שם יש לצרף אותם לתחילת שם הקובץ, מופרדים בפסיקים, בשם הקובץ תחת "העלאה בתור".';
+$lang['mediaextchange'] = 'סיומת הקובץ השתנתה מ־‎.%s ל־‎.%s!';
+$lang['reference'] = 'הפניות אל';
$lang['ref_inuse'] = 'לא ניתן למחוק קובץ זה, כיוון שהדפים הבאים עדיין משתמשים בו:';
-$lang['ref_hidden'] = 'יש קישורים לדפים ללא הרשאת קריאה';
-$lang['hits'] = 'פגיעות';
-$lang['quickhits'] = 'דפים שנמצאו';
+$lang['ref_hidden'] = 'חלק מההפניות נמצאות בדפים שאין לך הרשאות לקרוא אותם';
+$lang['hits'] = 'ביקורים';
+$lang['quickhits'] = 'שמות דפים שנמצאו';
$lang['toc'] = 'תוכן עניינים';
-$lang['current'] = 'גירסה נוכחית';
+$lang['current'] = 'הגרסה הנוכחית';
$lang['yours'] = 'הגרסה שלך';
-$lang['diff'] = 'הצג שינוים מגרסה זו ועד הנוכחית';
+$lang['diff'] = 'הצגת שינוים מגרסה זו ועד הנוכחית';
$lang['diff2'] = 'הצגת הבדלים בין הגרסאות שנבחרו';
+$lang['difflink'] = 'קישור לתצוגה השוואה זו';
$lang['line'] = 'שורה';
$lang['breadcrumb'] = 'ביקורים אחרונים';
-$lang['youarehere'] = 'אתה נמצא כאן';
-$lang['lastmod'] = 'שונה לאחרונה ב';
+$lang['youarehere'] = 'זהו מיקומך';
+$lang['lastmod'] = 'מועד השינוי האחרון';
$lang['by'] = 'על ידי';
$lang['deleted'] = 'נמחק';
$lang['created'] = 'נוצר';
@@ -151,9 +173,10 @@ $lang['restored'] = 'שוחזר';
$lang['external_edit'] = 'עריכה חיצונית';
$lang['summary'] = 'תקציר העריכה';
$lang['noflash'] = '<a href="http://www.adobe.com/products/flashplayer/">תוסף פלאש לדפדפן</a> נדרש כדי להציג תוכן זה.';
-$lang['download'] = 'הורד מקטע';
+$lang['download'] = 'הורדת מקטע';
$lang['mail_newpage'] = 'דף נוסף:';
$lang['mail_changed'] = 'דף שונה:';
+$lang['mail_subscribe_list'] = 'דפים שהשתנו במרחב השם:';
$lang['mail_new_user'] = 'משתמש חדש:';
$lang['mail_upload'] = 'קובץ הועלה:';
$lang['qb_bold'] = 'טקסט מודגש';
@@ -167,7 +190,7 @@ $lang['qb_h3'] = 'כותרת רמה 3';
$lang['qb_h4'] = 'כותרת רמה 4';
$lang['qb_h5'] = 'כותרת רמה 5';
$lang['qb_h'] = 'כותרת';
-$lang['qb_hs'] = 'בחירת כותרת';
+$lang['qb_hs'] = 'כותרת נבחרת';
$lang['qb_hplus'] = 'כותרת ברמה גבוהה יותר';
$lang['qb_hminus'] = 'כותרת ברמה נמוכה יותר';
$lang['qb_hequal'] = 'כותרת באותה רמה';
@@ -175,73 +198,85 @@ $lang['qb_link'] = 'קישור פנימי';
$lang['qb_extlink'] = 'קישור חיצוני';
$lang['qb_hr'] = 'קו אופקי';
$lang['qb_ol'] = 'איבר ברשימה ממוספרת';
-$lang['qb_ul'] = 'אבר ברשימה לא ממוספרת';
-$lang['qb_media'] = 'תמונות או קובץ אחר';
-$lang['qb_sig'] = 'הזנת חתימה';
-$lang['qb_smileys'] = 'פרצופונים';
-$lang['qb_chars'] = 'סימנים מיוחדים';
-$lang['upperns'] = 'עבור למרחב השם שברמה שמעל הנוכחית';
-$lang['admin_register'] = 'להוסיף משתמש חדש';
-$lang['metaedit'] = 'ערוך נתונים';
-$lang['metasaveerr'] = 'כשל בשמירת נתונים';
-$lang['metasaveok'] = 'נתונים נשמרו';
-$lang['img_backto'] = 'הזור ל';
-$lang['img_title'] = 'כותרת';
-$lang['img_caption'] = 'תיאור';
+$lang['qb_ul'] = 'איבר ברשימה לא ממוספרת';
+$lang['qb_media'] = 'תמונות וקבצים אחרים';
+$lang['qb_sig'] = 'הוספת חתימה';
+$lang['qb_smileys'] = 'חייכנים';
+$lang['qb_chars'] = 'תווים מיוחדים';
+$lang['upperns'] = 'מעבר למרחב השם שברמה שמעל הנוכחית';
+$lang['admin_register'] = 'הוספת משתמש חדש';
+$lang['metaedit'] = 'עריכת נתוני העל';
+$lang['metasaveerr'] = 'אירע כשל בשמירת נתוני העל';
+$lang['metasaveok'] = 'נתוני העל נשמרו';
+$lang['img_backto'] = 'חזרה אל';
+$lang['img_title'] = 'שם';
+$lang['img_caption'] = 'כותרת';
$lang['img_date'] = 'תאריך';
$lang['img_fname'] = 'שם הקובץ';
$lang['img_fsize'] = 'גודל';
$lang['img_artist'] = 'צלם';
-$lang['img_copyr'] = 'זכויות';
-$lang['img_format'] = 'פורמט';
+$lang['img_copyr'] = 'זכויות יוצרים';
+$lang['img_format'] = 'מבנה';
$lang['img_camera'] = 'מצלמה';
$lang['img_keywords'] = 'מילות מפתח';
-$lang['subscribe_success'] = '%s נוסף לרשימת המכותבים עבור %s';
-$lang['subscribe_error'] = 'שגיאה בהוספת %s לרשימת המכותבים עבור %s';
-$lang['subscribe_noaddress'] = 'אין כתובת המשויכת לרישום שלך ולכן אין באפשרותך להצטרף לרשימת המכותבים';
-$lang['unsubscribe_success'] = '%s הוסר מרשימת המכותבים עבור %s';
-$lang['unsubscribe_error'] = 'שגיאה בהסרת %s מרשימת המכותבים עבור %s';
-$lang['authmodfailed'] = 'תצורת אימות משתמשים גרועה. נא לדווח למנהל הויקי.';
-$lang['authtempfail'] = 'אימות משתמשים אינו זמין כרגע. אם מצב זה נמשך נא להודיע למנהל הויקי.';
+$lang['subscr_subscribe_success'] = '%s נוסף לרשימת המינויים לדף %s';
+$lang['subscr_subscribe_error'] = 'אירעה שגיאה בהוספת %s לרשימת המינויים לדף %s';
+$lang['subscr_subscribe_noaddress'] = 'אין כתובת המשויכת עם הכניסה שלך, נא ניתן להוסיף אותך לרשימת המינויים';
+$lang['subscr_unsubscribe_success'] = 'המשתמש %s הוסר מרשימת המינויים לדף %s';
+$lang['subscr_unsubscribe_error'] = 'אירעה שגיאה בהסרת %s מרשימת המינויים לדף %s';
+$lang['subscr_already_subscribed'] = 'המשתמש %s כבר מנוי לדף %s';
+$lang['subscr_not_subscribed'] = 'המשתמש %s איננו רשום לדף %s';
+$lang['subscr_m_not_subscribed'] = 'המשתמש שלך אינו רשום, נכון לעכשיו, לדף הנוכחי או למרחב השם.';
+$lang['subscr_m_new_header'] = 'הוספת מינוי';
+$lang['subscr_m_current_header'] = 'המינויים הנוכחיים';
+$lang['subscr_m_unsubscribe'] = 'ביטול המינוי';
+$lang['subscr_m_subscribe'] = 'מינוי';
+$lang['subscr_m_receive'] = 'קבלת';
+$lang['subscr_style_every'] = 'דוא״ל עם כל שינוי';
+$lang['subscr_style_digest'] = 'הודעת דוא״ל המציגה את כל השינויים בכל עמוד (בכל %.2f ימים)';
+$lang['subscr_style_list'] = 'רשימת השינויים בדפים מאז הודעת הדוא״ל האחרונה (בכל %.2f ימים)';
+$lang['authmodfailed'] = 'תצורת אימות המשתמשים אינה תקינה. נא ליידע את מנהל הוויקי.';
+$lang['authtempfail'] = 'אימות משתמשים אינו זמין כרגע. אם מצב זה נמשך נא ליידע את מנהל הוויקי.';
$lang['i_chooselang'] = 'נא לבחור שפה';
-$lang['i_installer'] = 'DokuWiki Installer';
-$lang['i_wikiname'] = 'שם הויקי';
-$lang['i_enableacl'] = 'אפשר ACL (מומלץ)';
-$lang['i_superuser'] = 'משתמש-על';
-$lang['i_problems'] = 'המתקין זיהה מספר בעיות המצוינות מטה. אין באפשרותך להמשיך לפני תיקונן.';
-$lang['i_modified'] = 'משיקולי אבטחה תסריט זה יעבוד אך ורק עם התקנת DokuWiki חדשה שלא עברה כל שינוי.
- עליך לחלץ שנית את הקבצים מהחבילה שהורדה או להעזר בדף
+$lang['i_installer'] = 'תכנית ההתקנה של DokuWiki';
+$lang['i_wikiname'] = 'שם הוויקי';
+$lang['i_enableacl'] = 'הפעלת ACL (מומלץ)';
+$lang['i_superuser'] = 'משתמש־על';
+$lang['i_problems'] = 'תכנית ההתקנה זיהתה מספר בעיות המפורטות להלן. אין באפשרותך להמשיך לפני תיקונן.';
+$lang['i_modified'] = 'משיקולי אבטחה סקריפט זה יעבוד אך ורק עם התקנת DokuWiki חדשה שלא עברה כל שינוי.
+ עליך לחלץ שנית את הקבצים מהחבילה שהורדה או להיעזר בדף
<a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
-$lang['i_funcna'] = 'פונקצית ה-PHP <code>%s</code> אינה זמינה. יתכן כי מארח האתר חסם אותה מסיבה כלשהי?';
-$lang['i_phpver'] = 'גרסת ה-PHP שלך <code>%s</code> נמוכה מהדרוש. עליך לשדרג את התקנת ה-PHP';
-$lang['i_permfail'] = '<code>%s</code> אינה ברת כתיבה על ידי DokuWiki. עליך לשנות הרשאות ספריה זו!';
+$lang['i_funcna'] = 'פונקציית ה-PHP&rlm; <code>%s</code> אינה זמינה. יתכן כי מארח האתר חסם אותה מסיבה כלשהי?';
+$lang['i_phpver'] = 'גרסת ה־PHP שלך <code>%s</code> נמוכה מהדרוש. עליך לשדרג את התקנת ה־PHP שלך.';
+$lang['i_permfail'] = '<code>%s</code> אינה ניתנת לכתיבה על ידי DokuWiki. עליך לשנות הרשאות תיקייה זו!';
$lang['i_confexists'] = '<code>%s</code> כבר קיים';
-$lang['i_writeerr'] = 'אין אפשרות ליצור את <code>%s</code>. נא לבדוק את הרשאות הקובץ/ספריה וליצור את הקובץ ידנית.';
-$lang['i_badhash'] = 'קובץ Dokuwiki.php לא מזוהה או שעבר שינויים (hash=<code>%s</code>)';
-$lang['i_badval'] = '<code>%s</code> - ערך לא חוקי או ריק';
-$lang['i_success'] = 'ההגדרה הסתימה בהצלחה. באפשרותך למחוק עתה את הקובץ install.php ולהמשיך אל <a href="doku.php">DokuWiki החדש שלך</a>.';
-$lang['i_failure'] = 'מספר שגיאות ארעו בעת כתיבת קבצי התצורה. ייתכן כי יהיה צורך לתקנם ידנית לפני שניתן יהיה להשתמש ב<a href="doku.php">DokuWiki החדש שלך</a>.';
-$lang['i_policy'] = 'מדיניות ACL תחילית';
+$lang['i_writeerr'] = 'אין אפשרות ליצור את <code>%s</code>. נא לבדוק את הרשאות הקובץ/תיקייה וליצור את הקובץ ידנית.';
+$lang['i_badhash'] = 'הקובץ Dokuwiki.php אינו מזוהה או שעבר שינויים (hash=<code>%s</code>)';
+$lang['i_badval'] = '<code>%s</code> - הערך אינו חוקי או ריק';
+$lang['i_success'] = 'תהליך ההגדרה הסתיים בהצלחה. כעת ניתן למחוק את הקובץ install.php ולהמשיך אל ה־<a href="doku.php">DokuWiki החדש שלך</a>.';
+$lang['i_failure'] = 'מספר שגיאות אירעו בעת כתיבת קובצי התצורה. יתכן כי יהיה צורך לתקנם ידנית לפני שניתן יהיה להשתמש ב־<a href="doku.php">DokuWiki החדש שלך</a>.';
+$lang['i_policy'] = 'מדיניות ACL התחלתית';
$lang['i_pol0'] = 'ויקי פתוח (קריאה, כתיבה והעלאה לכולם)';
$lang['i_pol1'] = ' ויקי ציבורי (קריאה לכולם, כתיבה והעלאה למשתמשים רשומים)';
$lang['i_pol2'] = 'ויקי סגור (קריאה, כתיבה והעלאה למשתמשים רשומים בלבד)';
-$lang['i_retry'] = 'נסיון נוסף';
-$lang['mu_intro'] = 'כאן תוכל להעלות קבצים מרובים. לחץ על כפתור החיפוש להוסיף אותם למחסנית. לחץ על העלאה לסיום.';
-$lang['mu_gridname'] = 'שם קובץ';
+$lang['i_retry'] = 'ניסיון נוסף';
+$lang['i_license'] = 'נא לבחור את הרישיון שיחול על התוכן שבוויקי שלך:';
+$lang['mu_intro'] = 'דרך כאן ניתן להעלות מספר קבצים בבת אחת. יש ללחוץ על לחצן החיפוש להוסיף אותם למחסנית. ניתן ללחוץ על העלאה לסיום.';
+$lang['mu_gridname'] = 'שם הקובץ';
$lang['mu_gridsize'] = 'גודל';
-$lang['mu_gridstat'] = 'סטאטןס';
+$lang['mu_gridstat'] = 'מצב';
$lang['mu_namespace'] = 'מרחב שם';
$lang['mu_browse'] = 'חיפוש';
$lang['mu_toobig'] = 'גדול מדי';
-$lang['mu_ready'] = 'מוכן להעלאה';
-$lang['mu_done'] = 'סיים';
+$lang['mu_ready'] = 'בהמתנה להעלאה';
+$lang['mu_done'] = 'הסתיים';
$lang['mu_fail'] = 'נכשל';
-$lang['mu_authfail'] = 'תקוף נעילת עריכה פג';
+$lang['mu_authfail'] = 'תוקף ההפעלה פג';
$lang['mu_progress'] = '@PCT@% הועלה';
$lang['mu_filetypes'] = 'סוגי קבצים מורשים';
$lang['mu_info'] = 'הקבצים הועלו';
$lang['mu_lasterr'] = 'שגיאה אחרונה:';
-$lang['recent_global'] = 'אתה צופה כעת בשינויים בתוך מרחב השם <b>%s</b>. אתה יכול גם <a href="%s">לצפות בשינויים האחרונים של כל הוויקי </a>.';
+$lang['recent_global'] = 'נכון לעכשיו מתנהל על ידיך מעקב אחר מרחב השם <b>%s</b>. כמו כן, באפשרותך <a href="%s">לצפות בשינויים האחרונים בוויקי כולו</a>.';
$lang['years'] = 'לפני %d שנים';
$lang['months'] = 'לפני %d חודשים';
$lang['weeks'] = 'לפני %d שבועות';
@@ -249,3 +284,4 @@ $lang['days'] = 'לפני %d ימים';
$lang['hours'] = 'לפני %d שעות';
$lang['minutes'] = 'לפני %d דקות';
$lang['seconds'] = 'לפני %d שניות';
+$lang['wordblock'] = 'השינויים שלך לא נשמרו כיוון שהם מכילים טקסט חסום (ספאם).';
diff --git a/inc/lang/he/mailtext.txt b/inc/lang/he/mailtext.txt
index d7990b2b3..222ee1b6d 100644
--- a/inc/lang/he/mailtext.txt
+++ b/inc/lang/he/mailtext.txt
@@ -1,17 +1,17 @@
-דף בDokuWiki נוסף או שונה. הנה הפרטים:
+דף בDokuWiki נוסף או שונה. להלן הפרטים:
-Date : @DATE@
-Browser : @BROWSER@
-IP-Address : @IPADDRESS@
-Hostname : @HOSTNAME@
-Old Revision: @OLDPAGE@
-New Revision: @NEWPAGE@
-Edit Summary: @SUMMARY@
-User : @USER@
+תאריך : @DATE@
+דפדפן : @BROWSER@
+כתובת ה־IP&rlm; : @IPADDRESS@
+שם המארח : @HOSTNAME@
+המהדורה הישנה: @OLDPAGE@
+המהדורה החדשה: @NEWPAGE@
+תקציר העריכה: @SUMMARY@
+משתמש : @USER@
@DIFF@
--
-דף זה נוצר ע"י DokuWiki ב-
+דף זה נוצר ע״י ה־DokuWiki הזמין בכתובת
@DOKUWIKIURL@
diff --git a/inc/lang/he/password.txt b/inc/lang/he/password.txt
index 29742ebda..745c5cb5c 100644
--- a/inc/lang/he/password.txt
+++ b/inc/lang/he/password.txt
@@ -1,10 +1,10 @@
שלום @FULLNAME@!
-הנה נתוני המשתמש שלך עבור @TITLE@ ב- @DOKUWIKIURL@
+הנה נתוני המשתמש שלך עבור @TITLE@ ב־@DOKUWIKIURL@
-כניסה : @LOGIN@
-סיסמה : @PASSWORD@
+שם כניסה : @LOGIN@
+ססמה : @PASSWORD@
--
-מכתב זה נוצר על ידי דוקוויקי ב-
+מכתב זה נוצר על ידי ה־DokuWiki הזמין בכתובת
@DOKUWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/he/pwconfirm.txt b/inc/lang/he/pwconfirm.txt
index 255195c7f..7dc46c340 100644
--- a/inc/lang/he/pwconfirm.txt
+++ b/inc/lang/he/pwconfirm.txt
@@ -1,13 +1,13 @@
שלום @FULLNAME@!
-מישהו ביקש סיסמה חדשה עבור הכניסה שלך ל-@TITLE@ ב-@DOKUWIKIURL@
+מישהו ביקש ססמה חדשה עבור שם הכניסה שלך לוויקי @TITLE@ בכתובת @DOKUWIKIURL@
-אם לא ביקשת סיסמה חדשה פשוט התעלם מדוא"ל זה.
+אם לא ביקשת ססמה חדשה באפשרותך פשוט להתעלם מהודעת דוא״ל זו.
-כדי לאשר שהבקשה באמת נשלחה על ידך נא השתמש בקישור הבא.
+כדי לאשר שהבקשה באמת נשלחה על ידך עליך השתמש בקישור הבא.
@CONFIRM@
--
-דואר זה נוצר על ידי DokuWiki ב-
+הודעת דוא״ל זו נוצרה על ידי ה־DokuWiki הזמין בכתובת
@DOKUWIKIURL@
diff --git a/inc/lang/he/read.txt b/inc/lang/he/read.txt
index 8e4c177ee..18efc5e03 100644
--- a/inc/lang/he/read.txt
+++ b/inc/lang/he/read.txt
@@ -1,2 +1,2 @@
-דף זה הוא דף לקריאה בלבד. ניתן לצפות בקוד המקור שלו, אבל לא ניתן לערוך אותו. ניתן לפנות אל מנהל הויקי אם לדעתך נפלה טעות.
+דף זה הוא דף לקריאה בלבד. ניתן לצפות בקוד המקור שלו, אך לא ניתן לערוך אותו. ניתן לפנות למנהל הוויקי אם לדעתך נפלה טעות.
diff --git a/inc/lang/he/register.txt b/inc/lang/he/register.txt
index 7225b02fd..c4dfad752 100644
--- a/inc/lang/he/register.txt
+++ b/inc/lang/he/register.txt
@@ -1,3 +1,3 @@
====== הרשמה כמשתמש חדש ======
-יש למלא את כל המידע מטה כדי ליצור חשבון חדש בויקי זה. יש לודא כי מוזנת **כתובת דוא"ל תקפה**- סיסמתך החדשה תשלח לכתובת זו\\ על שם המשתמש להיות [[hdoku>ויקי:שם דף|שם דף]] תקף.
+יש למלא את כל המידע להלן כדי ליצור חשבון חדש בוויקי זה. עליך לוודא כי הזנת **כתובת דוא״ל תקפה**- ססמתך החדשה תשלח לכתובת זו. על שם המשתמש להיות [[hdoku>ויקי:שם דף|שם דף]] תקף.
diff --git a/inc/lang/he/registermail.txt b/inc/lang/he/registermail.txt
index bb64a8158..3edca3fa0 100644
--- a/inc/lang/he/registermail.txt
+++ b/inc/lang/he/registermail.txt
@@ -1,14 +1,14 @@
-משתמש חדש נרשם. הנה הפרטים:
+משתמש חדש נרשם. להלן הפרטים:
שם משתמש : @NEWUSER@
שם מלא : @NEWNAME@
-דוא"ל : @NEWEMAIL@
+דוא״ל : @NEWEMAIL@
תאריך : @DATE@
דפדפן : @BROWSER@
-כתובת רשת : @IPADDRESS@
-שם המחשב : @HOSTNAME@
+כתובת IP&rlm; : @IPADDRESS@
+שם המארח : @HOSTNAME@
--
-דוא"ל זה נוצר על ידי DokuWiki ב-
+הודעת דוא״ל זו נוצרה על ידי ה־DokuWiki הזמין בכתובת
@DOKUWIKIURL@
diff --git a/inc/lang/he/resendpwd.txt b/inc/lang/he/resendpwd.txt
index 47e7749c2..8ca27207b 100644
--- a/inc/lang/he/resendpwd.txt
+++ b/inc/lang/he/resendpwd.txt
@@ -1,4 +1,4 @@
-====== שליחת סיסמה חדשה ======
+====== שליחת ססמה חדשה ======
-יש להזין את שם המשתמש בטופס מטה ולבקש סיסמה חדשה לחשבון שלך בויקי זה. קישור לאימות ישלח לכתובת הדו"ל איתה נרשמת.
+יש להזין את שם המשתמש בטופס מטה ולבקש ססמה חדשה לחשבון שלך בוויקי זה. הקישור לאימות יישלח לכתובת הדוא״ל באמצעותה נרשמת.
diff --git a/inc/lang/he/subscr_digest.txt b/inc/lang/he/subscr_digest.txt
new file mode 100644
index 000000000..af5220229
--- /dev/null
+++ b/inc/lang/he/subscr_digest.txt
@@ -0,0 +1,20 @@
+שלום!
+
+הדף @PAGE@ שבאתר הוויקי @TITLE@ השתנה.
+להלן השינויים:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+המהדורה הישנה: @OLDPAGE@
+המהדורה החדשה: @NEWPAGE@
+
+כדי לבטל את ההתרעות לשינויי העמוד, יש להיכנס לאתר הוויקי בכתובת
+@DOKUWIKIURL@ ואז לבקר באגף
+@SUBSCRIBE@
+ולבטל את המינוי לשינויים בדף ו/או במרחב השם.
+
+--
+הודעת דוא״ל זו נוצרה על ידי ה־DokuWiki שבכתובת
+@DOKUWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/he/subscr_single.txt b/inc/lang/he/subscr_single.txt
new file mode 100644
index 000000000..123b186c8
--- /dev/null
+++ b/inc/lang/he/subscr_single.txt
@@ -0,0 +1,22 @@
+שלום!
+
+הדף @PAGE@ באתר הוויקי @TITLE@ השתנה.
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+תאריך : @DATE@
+משתמש : @USER@
+תקציר העריכה: @SUMMARY@
+המהדורה הישנה: @OLDPAGE@
+המהדורה החדשה: @NEWPAGE@
+
+לביטול התרעות בנוגע לעמוד, יש להיכנס לאתר הוויקי בכתובת
+@DOKUWIKIURL@ ואז לבקר בדף
+@NEWPAGE@
+ולבטל את המינוי לקבלת שינויים בדף ו/או במרחב השם.
+
+--
+הודעת דוא״ל זו נוצרה על ידי ה־DokuWiki הזמין בכתובת
+@DOKUWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/km/lang.php b/inc/lang/km/lang.php
index 19847674d..3519a484e 100644
--- a/inc/lang/km/lang.php
+++ b/inc/lang/km/lang.php
@@ -227,4 +227,4 @@ $lang['i_pol2'] = 'វីគីបិទជិត';
$lang['i_retry'] = 'ម្តងទៀត';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/ko/adminplugins.txt b/inc/lang/ko/adminplugins.txt
new file mode 100644
index 000000000..5312cf357
--- /dev/null
+++ b/inc/lang/ko/adminplugins.txt
@@ -0,0 +1 @@
+===== 부가적인 플러그인 ===== \ No newline at end of file
diff --git a/inc/lang/ko/edit.txt b/inc/lang/ko/edit.txt
index d73f935fe..9b59524f7 100644
--- a/inc/lang/ko/edit.txt
+++ b/inc/lang/ko/edit.txt
@@ -1,2 +1,2 @@
-페이지를 편집하고 **저장**을 누르십시오. 위키 구문은 [[wiki:syntax]] 혹은 [[syntax|(한글) 구문]]을 참고하십시오. 이 페이지를 **더 낫게 만들 자신이 있을** 때에만 편집하십시오. 실험을 하고 싶을 때에는, 먼저 [[playground:playground|연습장]] 에 가서 연습해 보십시오.
+페이지를 편집하고 **저장**을 누르십시오. 위키 구문은 [[wiki:syntax]] 혹은 [[wiki:ko_syntax|(한글) 구문]]을 참고하십시오. 이 페이지를 **더 낫게 만들 자신이 있을** 때에만 편집하십시오. 실험을 하고 싶을 때에는, 먼저 [[playground:playground|연습장]] 에 가서 연습해 보십시오.
diff --git a/inc/lang/ko/lang.php b/inc/lang/ko/lang.php
index 83014c151..3765dd011 100644
--- a/inc/lang/ko/lang.php
+++ b/inc/lang/ko/lang.php
@@ -8,6 +8,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -41,15 +42,13 @@ $lang['btn_back'] = '뒤로';
$lang['btn_backlink'] = '이전 링크';
$lang['btn_backtomedia'] = '미디어 파일 선택으로 돌아가기';
$lang['btn_subscribe'] = '구독 신청';
-$lang['btn_unsubscribe'] = '구독 신청 해지';
-$lang['btn_subscribens'] = '네임스페이스 구독 신청';
-$lang['btn_unsubscribens'] = '네임스페이스 구독 신청 해지';
$lang['btn_profile'] = '개인정보 변경';
$lang['btn_reset'] = '초기화';
$lang['btn_resendpwd'] = '새 패스워드 보내기';
$lang['btn_draft'] = '문서초안 편집';
$lang['btn_recover'] = '문서초안 복구';
$lang['btn_draftdel'] = '문서초안 삭제';
+$lang['btn_revert'] = '복원';
$lang['loggedinas'] = '다음 사용자로 로그인';
$lang['user'] = '사용자';
$lang['pass'] = '패스워드';
@@ -88,13 +87,45 @@ $lang['resendpwdconfirm'] = '확인 링크를 이메일로 보냈습니다.
$lang['resendpwdsuccess'] = '새로운 패스워드는 이메일로 보내드립니다.';
$lang['license'] = '이 위키의 내용은 다음의 라이센스에 따릅니다 :';
$lang['licenseok'] = '주의 : 이 페이지를 수정한다는 다음의 라이센스에 동의함을 의미합니다 :';
+$lang['searchmedia'] = '파일이름 찾기:';
+$lang['searchmedia_in'] = ' %에서 검색';
$lang['txt_upload'] = '업로드 파일을 선택합니다.';
$lang['txt_filename'] = '업로드 파일 이름을 입력합니다.(선택 사항)';
$lang['txt_overwrt'] = '새로운 파일로 이전 파일을 교체합니다.';
$lang['lockedby'] = '현재 잠금 사용자';
$lang['lockexpire'] = '잠금 해제 시간';
$lang['willexpire'] = '잠시 후 편집 잠금이 해제됩니다.\n편집 충돌을 피하려면 미리보기를 눌러 잠금 시간을 다시 설정하기 바랍니다.';
-$lang['js']['notsavedyet'] = "저장하지 않은 변경은 지워집니다.\n계속하시겠습니까?";
+$lang['js']['notsavedyet'] = '저장하지 않은 변경은 지워집니다.
+계속하시겠습니까?';
+$lang['js']['searchmedia'] = '파일 찾기';
+$lang['js']['keepopen'] = '선택할 때 윈도우를 열어놓으시기 바랍니다.';
+$lang['js']['hidedetails'] = '자세한 정보 감추기';
+$lang['js']['mediatitle'] = '링크 설정';
+$lang['js']['mediadisplay'] = '링크 형태';
+$lang['js']['mediaalign'] = '배치';
+$lang['js']['mediasize'] = '그림 크기';
+$lang['js']['mediatarget'] = '링크 목표';
+$lang['js']['mediaclose'] = '닫기';
+$lang['js']['mediainsert'] = '삽입';
+$lang['js']['mediadisplayimg'] = '그림보기';
+$lang['js']['mediasmall'] = '작게';
+$lang['js']['mediamedium'] = '중간';
+$lang['js']['medialarge'] = '크게';
+$lang['js']['mediaoriginal'] = '원본';
+$lang['js']['medialnk'] = '세부정보페이지로 링크';
+$lang['js']['mediadirect'] = '원본으로 직접 링크';
+$lang['js']['medianolnk'] = '링크 없슴';
+$lang['js']['medianolink'] = '그림을 링크하지 않음';
+$lang['js']['medialeft'] = '왼쪽 배치';
+$lang['js']['mediaright'] = '오른쪽 배치';
+$lang['js']['mediacenter'] = '중앙 배치';
+$lang['js']['medianoalign'] = '배치 없슴';
+$lang['js']['nosmblinks'] = '윈도우 공유 파일과의 연결은 MS 인터넷 익스플로러에서만 동작합니다.
+그러나 링크를 복사하거나 붙여넣기를 할 수 있습니다.';
+$lang['js']['linkwiz'] = '링크 마법사';
+$lang['js']['linkto'] = '다음으로 연결:';
+$lang['js']['del_confirm'] = '정말로 선택된 항목(들)을 삭제하시겠습니까?';
+$lang['js']['mu_btn'] = '여러 파일들을 한번에 업로드합니다.';
$lang['rssfailed'] = 'feed 가져오기 실패: ';
$lang['nothingfound'] = '아무 것도 없습니다.';
$lang['mediaselect'] = '미디어 파일 선택';
@@ -112,11 +143,7 @@ $lang['deletefail'] = '"%s" 파일을 삭제할 수 없습니다. -
$lang['mediainuse'] = '"%s" 파일을 삭제할 수 없습니다. - 아직 사용 중입니다.';
$lang['namespaces'] = '네임스페이스';
$lang['mediafiles'] = '사용 가능한 파일 목록';
-$lang['js']['keepopen'] = '선택할 때 윈도우를 열어놓으시기 바랍니다.';
-$lang['js']['hidedetails'] = '자세한 정보 감추기';
-$lang['js']['nosmblinks'] = '윈도우 공유 파일과의 연결은 MS 인터넷 익스플로러에서만 동작합니다.
-그러나 링크를 복사하거나 붙여넣기를 할 수 있습니다.';
-$lang['js']['mu_btn'] = '여러 파일들을 한번에 업로드합니다.';
+$lang['accessdenied'] = '이 페이지를 볼 권한이 없습니다.';
$lang['mediausage'] = '이 파일을 참조하려면 다음 문법을 사용하기 바랍니다:';
$lang['mediaview'] = '원본 파일 보기';
$lang['mediaroot'] = '루트(root)';
@@ -143,8 +170,10 @@ $lang['restored'] = '옛 버전 복구';
$lang['external_edit'] = '외부 편집기';
$lang['summary'] = '편집 요약';
$lang['noflash'] = '이 컨텐츠를 표시하기 위해서 <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a>이 필요합니다.';
+$lang['download'] = '조각 다운로드';
$lang['mail_newpage'] = '페이지 추가:';
$lang['mail_changed'] = '페이지 변경:';
+$lang['mail_subscribe_list'] = '네임스페이스에서 변경된 페이지:';
$lang['mail_new_user'] = '새로운 사용자:';
$lang['mail_upload'] = '파일 첨부:';
$lang['qb_bold'] = '굵은 글';
@@ -157,6 +186,11 @@ $lang['qb_h2'] = '2단계 헤드라인';
$lang['qb_h3'] = '3단계 헤드라인';
$lang['qb_h4'] = '4단계 헤드라인';
$lang['qb_h5'] = '5단계 헤드라인';
+$lang['qb_h'] = '표제';
+$lang['qb_hs'] = '표제 선택';
+$lang['qb_hplus'] = '상위 표제';
+$lang['qb_hminus'] = '하위 표제';
+$lang['qb_hequal'] = '동급 표제';
$lang['qb_link'] = '내부 링크';
$lang['qb_extlink'] = '외부 링크';
$lang['qb_hr'] = '수평선';
@@ -166,7 +200,7 @@ $lang['qb_media'] = '이미지와 기타 파일 추가';
$lang['qb_sig'] = '서명 추가';
$lang['qb_smileys'] = '이모티콘';
$lang['qb_chars'] = '특수문자';
-$lang['js']['del_confirm'] = '정말로 선택된 항목(들)을 삭제하시겠습니까?';
+$lang['upperns'] = '상위 네임스페이스로 이동';
$lang['admin_register'] = '새로운 사용자 추가';
$lang['metaedit'] = '메타 데이타를 편집합니다.';
$lang['metasaveerr'] = '메타 데이타 쓰기가 실패했습니다.';
@@ -182,11 +216,16 @@ $lang['img_copyr'] = '저작권';
$lang['img_format'] = '포맷';
$lang['img_camera'] = '카메라';
$lang['img_keywords'] = '키워드';
-$lang['subscribe_success'] = '%s를 추가했습니다. (%s의 구독 목록)';
-$lang['subscribe_error'] = '%s를 추가하는데 실패했습니다.(%s의 구독 목록)';
-$lang['subscribe_noaddress'] = '로그인 정보에 이메일 주소가 없습니다, 구독 목록에 추가할 수 없습니다.';
-$lang['unsubscribe_success'] = '%s를 제외시켰습니다. (%s의 구독 목록)';
-$lang['unsubscribe_error'] = '%s를 제외시키는데 실패했습니다.(%s의 구독 목록)';
+$lang['subscr_subscribe_noaddress'] = '등록된 주소가 없기 때문에 구독목록에 등록되지 않았습니다.';
+$lang['subscr_m_not_subscribed'] = '현재의 페이지나 네임스페이스에 구독등록이 되어있지 않습니다.';
+$lang['subscr_m_new_header'] = '구독 추가';
+$lang['subscr_m_current_header'] = '현재 구독중인 것들';
+$lang['subscr_m_unsubscribe'] = '구독 취소';
+$lang['subscr_m_subscribe'] = '구독';
+$lang['subscr_m_receive'] = '받기';
+$lang['subscr_style_every'] = '모든 변화를 이메일로 받기';
+$lang['subscr_style_digest'] = '각 페이지의 변화를 요약 (매 %.2f 일 마다)';
+$lang['subscr_style_list'] = '마지막 이메일 이후 변화된 페이지의 목록 (매 %.2f 일 마다)';
$lang['authmodfailed'] = '잘못된 사용자 인증 설정입니다. 관리자에게 문의하기 바랍니다.';
$lang['authtempfail'] = '사용자 인증이 일시적으로 불가능합니다. 만일 계속해서 문제가 발생하면 관리자에게 문의하기 바랍니다.';
$lang['i_chooselang'] = '사용하는 언어를 선택합니다.';
@@ -213,6 +252,7 @@ $lang['i_pol0'] = '개방형 위키 (누구나 읽기/쓰기/업
$lang['i_pol1'] = '공개형 위키 (누구나 읽을 수 있지만, 등록된 사용자만 쓰기/업로드가 가능합니다.)';
$lang['i_pol2'] = '폐쇄형 위키 (등록된 사용자만 읽기/쓰기/업로드가 가능합니다.)';
$lang['i_retry'] = '다시 시도';
+$lang['i_license'] = '내용의 배포를 위한 라이센스를 선택하세요.';
$lang['mu_intro'] = '여러 파일을 한번에 업로드할 수 있습니다. 파일 목록에 추가하려면 "찾기" 버튼을 클릭합니다. 파일 목록 추가 작업이 끝나면 "업로드" 버튼을 클릭하기 바랍니다. ';
$lang['mu_gridname'] = '파일명';
$lang['mu_gridsize'] = '크기';
@@ -226,4 +266,14 @@ $lang['mu_fail'] = '업로드가 실패했습니다.';
$lang['mu_authfail'] = '세션 기간이 종료되었습니다.';
$lang['mu_progress'] = '@PCT@% 업로드되었습니다.';
$lang['mu_filetypes'] = '허용된 파일타입';
+$lang['mu_info'] = '업로드 되었습니다.';
+$lang['mu_lasterr'] = '마지막 에러:';
$lang['recent_global'] = '<b>%s</b> 네임스페이스를 구독중입니다. <a href="%s">전체위키 변경사항 </a>도 보실수 있습니다.';
+$lang['years'] = '%d 년 전';
+$lang['months'] = '%d 개월 전';
+$lang['weeks'] = '%d 주 전';
+$lang['days'] = '%d 일 전';
+$lang['hours'] = '%d 시간 전';
+$lang['minutes'] = '%d 분 전';
+$lang['seconds'] = '%d 초 전';
+$lang['wordblock'] = '스팸 문구를 포함하고 있어서 저장되지 않았습니다.';
diff --git a/inc/lang/ko/register.txt b/inc/lang/ko/register.txt
index 999073a1d..24105efeb 100644
--- a/inc/lang/ko/register.txt
+++ b/inc/lang/ko/register.txt
@@ -1,4 +1,4 @@
====== 새 사용자 등록 ======
-이 위키에 새 계정을 만들려면 아래의 모든 내용을 입력하십시오. **제대로 된 이메일 주소**를 사용하십시오. 그러나, 아래 내용을 입력했다고 해서 계정을 만들 수 있으리라고는 믿지 마십시오. 이곳은 내가 개인적으로 사용하는 곳이며, 계정을 만들어 주고 안주고는 내 마음입니다. 차라리, 내게 이메일을 보내서 신청하는 편이 더 나을 것입니다. 패스워드는 이 이메일로 보내집니다. 사용자명은 올바른 [[doku>pagename|pagename]] 이어야 합니다.
+이 위키에 새 계정을 만들려면 아래의 모든 내용을 입력하세요. **제대로 된 이메일 주소**를 사용하세요. 암호를 입력하는 곳이 없다면 암호는 이 이메일로 보내집니다. 사용자명은 올바른 [[doku>pagename|pagename]] 이어야 합니다.
diff --git a/inc/lang/ko/subscr_digest.txt b/inc/lang/ko/subscr_digest.txt
new file mode 100644
index 000000000..2e9c87848
--- /dev/null
+++ b/inc/lang/ko/subscr_digest.txt
@@ -0,0 +1,18 @@
+안녕하세요!
+
+@TITLE@ 라는 제목의 페이지 @PAGE@ 가 변경되었습니다.
+
+변경사항은 다음과 같습니다:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+옛날 것: @OLDPAGE@
+새 것: @NEWPAGE@
+
+이 페이지 변경알림의 설정을 바구려면, @DOKUWIKIURL@에 로그인한 뒤
+@SUBSCRIBE@ 를 방문하여 페이지나 이름공간의 구독을 취소하세요.
+
+--
+@DOKUWIKIURL@의 DokuWiki가 자동으로 만들어낸 메일입니다. \ No newline at end of file
diff --git a/inc/lang/ko/subscr_form.txt b/inc/lang/ko/subscr_form.txt
new file mode 100644
index 000000000..31470f372
--- /dev/null
+++ b/inc/lang/ko/subscr_form.txt
@@ -0,0 +1,3 @@
+====== 구독 관리 ======
+
+이 페이지는 현재의 페이지와 네임스페이스의 구독을 관리할 수있도록 해줍니다. \ No newline at end of file
diff --git a/inc/lang/ko/subscr_list.txt b/inc/lang/ko/subscr_list.txt
new file mode 100644
index 000000000..2661a6a15
--- /dev/null
+++ b/inc/lang/ko/subscr_list.txt
@@ -0,0 +1,15 @@
+안녕하세요!
+
+@TITLE@ 라는 제목의 페이지 @PAGE@ 가 변경되었습니다.
+
+변경사항은 다음과 같습니다:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+이 페이지 변경알림의 설정을 바구려면, @DOKUWIKIURL@에 로그인한 뒤
+@SUBSCRIBE@ 를 방문하여 페이지나 이름공간의 구독을 취소하세요.
+
+--
+@DOKUWIKIURL@의 DokuWiki가 자동으로 만들어낸 메일입니다. \ No newline at end of file
diff --git a/inc/lang/ko/subscr_single.txt b/inc/lang/ko/subscr_single.txt
new file mode 100644
index 000000000..1aa4d7efa
--- /dev/null
+++ b/inc/lang/ko/subscr_single.txt
@@ -0,0 +1,21 @@
+안녕하세요!
+
+@TITLE@ 라는 제목의 페이지 @PAGE@ 가 변경되었습니다.
+
+변경사항은 다음과 같습니다:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+날짜 : @DATE@
+사용자 : @USER@
+편집 요약 : @SUMMARY@
+구 버전 : @OLDPAGE@
+새 버전 : @NEWPAGE@
+
+이 페이지 변경알림의 설정을 바구려면, @DOKUWIKIURL@에 로그인한 뒤 t
+@NEWPAGE@ 를 방문하여 페이지나 이름공간의 구독을 취소하세요.
+
+--
+@DOKUWIKIURL@의 DokuWiki가 자동으로 만들어낸 메일입니다. \ No newline at end of file
diff --git a/inc/lang/ku/lang.php b/inc/lang/ku/lang.php
index cb8dd0865..0ff2ca4ca 100644
--- a/inc/lang/ku/lang.php
+++ b/inc/lang/ku/lang.php
@@ -160,4 +160,4 @@ $lang['subscribe_noaddress']= 'There is no address associated with your login, y
$lang['unsubscribe_success']= 'Removed %s from subscription list for %s';
$lang['unsubscribe_error'] = 'Error removing %s from subscription list for %s';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/la/conflict.txt b/inc/lang/la/conflict.txt
index 3d1f66ab6..aebc38b25 100644
--- a/inc/lang/la/conflict.txt
+++ b/inc/lang/la/conflict.txt
@@ -1,5 +1,5 @@
-====== Recentior uersio est ======
+====== Recentior forma est ======
-Recentior uersio est: nam dum hanc paginam recensibas, aliquis paginam mutauit.
+Recentior forma est: nam dum hanc paginam recensibas, aliquis paginam mutauit.
-Discrimina uides et uersionem seruandam eligis. Alia uersio delebitur. \ No newline at end of file
+Discrimina uides et formam seruandam eligis. Alia forma delebitur. \ No newline at end of file
diff --git a/inc/lang/la/editrev.txt b/inc/lang/la/editrev.txt
index bac047d31..6a4d082cc 100644
--- a/inc/lang/la/editrev.txt
+++ b/inc/lang/la/editrev.txt
@@ -1,2 +1,2 @@
-**Vetus uersio a te restituta est** Si hanc uersionem seruabis, nouam creabis.
+**Vetus forma a te restituta est** Si hanc formam seruabis, nouam creabis.
---- \ No newline at end of file
diff --git a/inc/lang/la/index.txt b/inc/lang/la/index.txt
index eb6f06f79..cd65dbb59 100644
--- a/inc/lang/la/index.txt
+++ b/inc/lang/la/index.txt
@@ -1,3 +1,3 @@
====== Forma Situs ======
-Haec forma situs ordinata a(b) [[doku>namespaces|namespaces]]. \ No newline at end of file
+Haec forma situs ordinata [[doku>namespaces|generatim]]. \ No newline at end of file
diff --git a/inc/lang/la/install.html b/inc/lang/la/install.html
new file mode 100644
index 000000000..c06f3ac2c
--- /dev/null
+++ b/inc/lang/la/install.html
@@ -0,0 +1,8 @@
+<p>Haec pagina te adiuuat in <a href="http://dokuwiki.org">Dokuuiki</a> conformando. Maiores res in
+<a href="http://dokuwiki.org/installer">hac pagina</a> sunt.</p>
+
+<p>DokuWiki documenta ut omnes paginas uicis et omnia (ut imagines, indices, ueteres formas) quae ad easdem pertinent colligat. Vt bene operet DokuWiki omnes facultates scrini habere <strong>debes</strong>. Hoc instrumentum facultates eligere non potest, his facultatibus locatori spati interretis quaeras uel FTP intrumento uel aliis rebus (ut cPanel) uteraris.</p>
+
+<p>Hoc intrumentum optiones primae DokuWiki <acronym title="index custodiae ,aditus">ICA</acronym>, quos rectori situs inire et indicem, ut addenda optiones uicis et alia administrare possit uidere licet. Hoc instrumentum non necessarium DokuWiki ut feliciter operet, sed melius administrare adiuuat.</p>
+
+<p>Periti uel qui certa quaesita habet paginas <a href="http://dokuwiki.org/install">rationis conformandum uicem</a> et <a href="http://dokuwiki.org/config">optionum conformationis</a> uidere possunt.</p> \ No newline at end of file
diff --git a/inc/lang/la/lang.php b/inc/lang/la/lang.php
index 49ae67c31..ec80ac4d1 100644
--- a/inc/lang/la/lang.php
+++ b/inc/lang/la/lang.php
@@ -8,6 +8,7 @@
* lines starting with @author
*
* @url http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/messages/MessagesLa.php?view=co
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -19,9 +20,9 @@ $lang['apostrophe'] = '´';
$lang['btn_edit'] = 'Recensere hanc paginam';
$lang['btn_source'] = 'Fontem uidere';
$lang['btn_show'] = 'Ostendere paginam';
-$lang['btn_create'] = 'Facere paginam';
+$lang['btn_create'] = 'Creare paginam';
$lang['btn_search'] = 'Quaerere';
-$lang['btn_save'] = 'Seruare paginam';
+$lang['btn_save'] = 'Seruare';
$lang['btn_preview'] = 'Praeuidere';
$lang['btn_top'] = 'I ad summa';
$lang['btn_newer'] = '<< recentiores';
@@ -39,7 +40,7 @@ $lang['btn_update'] = 'Nouare';
$lang['btn_delete'] = 'Delere';
$lang['btn_back'] = 'Redire';
$lang['btn_backlink'] = 'Nexus ad paginam';
-$lang['btn_backtomedia'] = 'Ad medias redire';
+$lang['btn_backtomedia'] = 'Ad media redire';
$lang['btn_subscribe'] = 'Custodire';
$lang['btn_profile'] = 'Tabellam nouare';
$lang['btn_reset'] = 'Abrogare';
@@ -55,14 +56,14 @@ $lang['newpass'] = 'Tessera noua';
$lang['oldpass'] = 'Tessera uetus:';
$lang['passchk'] = 'Tesseram tuam adfirmare';
$lang['remember'] = 'Tesseram meam sodalitatis memento';
-$lang['fullname'] = 'Nomen tuum uerum:';
+$lang['fullname'] = 'Nomen tuom uerum:';
$lang['email'] = 'Cursus interretialis:';
$lang['register'] = 'Te adscribere';
$lang['profile'] = 'Tabella Sodalis';
-$lang['badlogin'] = 'Error in ineundo est.';
-$lang['minoredit'] = 'Haec est recensio minor';
+$lang['badlogin'] = 'Error in ineundo est, rectum nomen uel tessera cedo.';
+$lang['minoredit'] = 'Recensio minor';
$lang['draftdate'] = 'Propositum seruatur die:';
-$lang['nosecedit'] = 'Pagina interea mutatur, pars rerum exiit.';
+$lang['nosecedit'] = 'Pagina interea mutatur, pars rerum exiit, in loco eius tota pagina reclamata est.';
$lang['regmissing'] = 'Omnes campi complendi sunt.';
$lang['reguexists'] = 'Nomen Sodalis ab aliquo iam elegitur.';
$lang['regsuccess'] = 'Adscriptio feliciter perficitur et tessera cursu interretiali mittitur';
@@ -92,17 +93,17 @@ $lang['txt_upload'] = 'Eligere documenta oneranda:';
$lang['txt_filename'] = 'Onerare (optio):';
$lang['txt_overwrt'] = 'Documento ueteri imponere:';
$lang['lockedby'] = 'Nunc hoc intercludit';
-$lang['lockexpire'] = 'Hoc aperiuit';
+$lang['lockexpire'] = 'Hoc apertum';
$lang['willexpire'] = 'Interclusio paginae recensendae uno minuto finita est.\nUt errores uites, \'praeuisio\' preme ut interclusionem ripristines.';
$lang['js']['notsavedyet'] = 'Res non seruatae amissurae sunt.';
$lang['js']['searchmedia'] = 'Quaere inter documenta';
$lang['js']['keepopen'] = 'Fenestram apertam tene';
$lang['js']['hidedetails'] = 'Singulas res abscondere';
-$lang['js']['mediatitle'] = 'Optiones connectendi';
-$lang['js']['mediadisplay'] = 'Exemplar connectendi';
+$lang['js']['mediatitle'] = 'Optiones nexorum';
+$lang['js']['mediadisplay'] = 'Genus nexi';
$lang['js']['mediaalign'] = 'Collocatio';
$lang['js']['mediasize'] = 'Amplitudo imaginis';
-$lang['js']['mediatarget'] = 'Signum connectere';
+$lang['js']['mediatarget'] = 'Cui nexum est';
$lang['js']['mediaclose'] = 'Claudere';
$lang['js']['mediainsert'] = 'Insere';
$lang['js']['mediadisplayimg'] = 'Imaginem ostendere';
@@ -122,7 +123,7 @@ $lang['js']['medianoalign'] = 'Collocationem remouere';
$lang['js']['nosmblinks'] = 'Windows nexa solum cum Microsoft Internet Explorer ostendi possunt.
Adhuc transcribere nexum potes.';
$lang['js']['linkwiz'] = 'Connectendi ductor';
-$lang['js']['linkto'] = 'Nexum:';
+$lang['js']['linkto'] = 'Nexum ad:';
$lang['js']['del_confirm'] = 'Delere electas res uin?';
$lang['js']['mu_btn'] = 'Plura documenta uno tempore onerare';
$lang['rssfailed'] = 'Error in restituendo ';
@@ -140,13 +141,13 @@ $lang['uploadsize'] = 'Documentum onerandum ponderosius est. (Maxime
$lang['deletesucc'] = 'Documentum "%s" deletum est.';
$lang['deletefail'] = '"%s" non deletur: uide facultates.';
$lang['mediainuse'] = 'documentum "%s" non deletur, nam aliquis hoc utitur.';
-$lang['namespaces'] = 'Spatium nominis';
+$lang['namespaces'] = 'Genus';
$lang['mediafiles'] = 'Documentum liberum in:';
$lang['accessdenied'] = 'Non uidere documentum potes.';
$lang['mediausage'] = 'Hac forma uteris ut documentum referas:';
$lang['mediaview'] = 'Vide documentum primigenium';
$lang['mediaroot'] = 'scrinium';
-$lang['mediaupload'] = 'Spatium nominis hic oneras. Si nouom spatium nominis creare uis, ante "Onerare ut" nomen documenti diuisum a duabus punctis ponas.';
+$lang['mediaupload'] = 'Hic genus oneras. Si nouom genus creare uis, ante "Onerare ut" nomen documenti diuisum a duabus punctis ponas.';
$lang['mediaextchange'] = 'Genus documenti mutatum a(b) ".%s" ad ".%s"!';
$lang['reference'] = 'Referre:';
$lang['ref_inuse'] = 'Documentum non deleri potest, nam in his paginis apertum est:';
@@ -170,10 +171,10 @@ $lang['restored'] = 'Recensio uetus restituta';
$lang['external_edit'] = 'Externe recensere';
$lang['summary'] = 'Indicem recensere';
$lang['noflash'] = '<a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> necessarium est.';
-$lang['download'] = 'Snippet cape';
+$lang['download'] = 'Snippet capere';
$lang['mail_newpage'] = 'Pagina addita:';
$lang['mail_changed'] = 'Pagina mutata:';
-$lang['mail_subscribe_list'] = 'Pagina in spatio nominis mutata:';
+$lang['mail_subscribe_list'] = 'Paginae in genere mutatae:';
$lang['mail_new_user'] = 'Nouos Sodalis:';
$lang['mail_upload'] = 'Documentum oneratum:';
$lang['qb_bold'] = 'Litterae pingues';
@@ -198,9 +199,9 @@ $lang['qb_ol'] = 'Index ordinatus rerum';
$lang['qb_ul'] = 'Index non ordinatus rerum';
$lang['qb_media'] = 'Imagines et documenta addere';
$lang['qb_sig'] = 'Subscriptio tua cum indicatione temporis';
-$lang['qb_smileys'] = 'Facies';
+$lang['qb_smileys'] = 'Pupuli';
$lang['qb_chars'] = 'Signa singularia';
-$lang['upperns'] = 'I ad anterius spatium nominis';
+$lang['upperns'] = 'I ad anterius genus';
$lang['admin_register'] = 'Nouom Sodalem creare';
$lang['metaedit'] = 'Res codicis mutare';
$lang['metasaveerr'] = 'Res codicis non scribitur.';
@@ -223,7 +224,7 @@ $lang['subscr_unsubscribe_success'] = 'A subscriptione %s deletur quod %s';
$lang['subscr_unsubscribe_error'] = 'Error delendi %s a subscriptione quod %s';
$lang['subscr_already_subscribed'] = '%s iam subscriptus\a est in %s';
$lang['subscr_not_subscribed'] = '%s non subscriptus\a est in %n';
-$lang['subscr_m_not_subscribed'] = 'Non hanc paginam uel spatium nominis subscribere potes.';
+$lang['subscr_m_not_subscribed'] = 'Non hanc paginam uel genus subscribere potes.';
$lang['subscr_m_new_header'] = 'Subscriptionem addere';
$lang['subscr_m_current_header'] = 'haec subscriptio:';
$lang['subscr_m_unsubscribe'] = 'Delere';
@@ -237,12 +238,12 @@ $lang['authtempfail'] = 'Confirmare non potes. Rectorem conuenis.';
$lang['i_chooselang'] = 'Linguam eligere';
$lang['i_installer'] = 'Docuuicis creator';
$lang['i_wikiname'] = 'Nomen Vicis';
-$lang['i_enableacl'] = 'AAA aptum facias (consulatum est)';
+$lang['i_enableacl'] = 'ICA aptum facias (consulatum est)';
$lang['i_superuser'] = 'Magister\stra';
$lang['i_problems'] = 'Creator hos errores habes. Continuare potes postquam omnia soluentur.';
-$lang['i_modified'] = 'Hoc scriptum solum cum noua uersione Dokuuicis est. Hoc rursum capere in pagina, in qua haec machina capta est, potes aut i ad <a href="http://dokuwiki.org/install">Dokuuicis installation instructions</a>';
+$lang['i_modified'] = 'Hoc scriptum solum cum noua forma Dokuuicis est. Hoc rursum capere in pagina, in qua haec machina capta est, potes aut i ad <a href="http://dokuwiki.org/install">Dokuuicis installation instructions</a>';
$lang['i_funcna'] = 'PHP functio <code>%s</code> inepta est.';
-$lang['i_phpver'] = 'Versio tua PHP <code>%s</code> minor quam illa necessaria <code>%s</code>.';
+$lang['i_phpver'] = 'Forma tua PHP <code>%s</code> minor quam illa necessaria <code>%s</code>.';
$lang['i_permfail'] = '<code>%s</code> non a uice scribitur. Facultates inspicere.';
$lang['i_confexists'] = '<code>%s</code> iam est.';
$lang['i_writeerr'] = '<code>%s</code> non creari potest. Manu illum creas.';
@@ -250,7 +251,7 @@ $lang['i_badhash'] = 'Ignotum uel mutatum dokuwiki.php (<code>%s</co
$lang['i_badval'] = '<code>%s</code> non legitimum uel uacuom';
$lang['i_success'] = 'Administratio feliciter perficitur. Delere install.php documentum potes. I ad <a href="doku.php">hanc paginam</a> ut continues.';
$lang['i_failure'] = 'Aliqui errores dum documenta administrantur sunt. Manu onerare omnes potes priusquam <a href="doku.php">tuo nouo uice</a> uteris.';
-$lang['i_policy'] = 'AAA ratio prima';
+$lang['i_policy'] = 'ICA ratio prima';
$lang['i_pol0'] = 'Vicem aperire (omnes legere, scribere, onerare possunt)';
$lang['i_pol1'] = 'Publicus uicis (omnes legere, Sodales scribere et onerare possunt)';
$lang['i_pol2'] = 'Clausus uicis (Soli Sodales legere scribere et onerare poccunt)';
@@ -260,7 +261,7 @@ $lang['mu_intro'] = 'Plura documenta uno tempore onerare potes.';
$lang['mu_gridname'] = 'Documenti nomen';
$lang['mu_gridsize'] = 'Pondus';
$lang['mu_gridstat'] = 'Status';
-$lang['mu_namespace'] = 'Spatium nominis';
+$lang['mu_namespace'] = 'Genus';
$lang['mu_browse'] = 'Euoluere';
$lang['mu_toobig'] = 'Ponderosius';
$lang['mu_ready'] = 'Aptus ad onerandum';
@@ -271,7 +272,7 @@ $lang['mu_progress'] = '@PCT@% oneratum';
$lang['mu_filetypes'] = 'Genera documenti apta facere';
$lang['mu_info'] = 'Documenta onerare';
$lang['mu_lasterr'] = 'Extremus error:';
-$lang['recent_global'] = 'Mutatione in hoc spatio nominis uides. Recentiores mutationes quoque uidere <a href="%s">potes</a>';
+$lang['recent_global'] = 'Mutatione in hoc genere uides. Recentiores mutationes quoque uidere <a href="%s">potes</a>';
$lang['years'] = 'ab annis %d';
$lang['months'] = 'a mensibus %d';
$lang['weeks'] = 'a septimanis %d';
diff --git a/inc/lang/la/norev.txt b/inc/lang/la/norev.txt
index 872eb8070..19b60fe15 100644
--- a/inc/lang/la/norev.txt
+++ b/inc/lang/la/norev.txt
@@ -1,3 +1,3 @@
-====== Versio non reperta ======
+====== Forma non reperta ======
-Haec uersio non reperta est. Aliam uersionem quaeris. \ No newline at end of file
+Haec forma non reperta est. Aliam formam quaeris. \ No newline at end of file
diff --git a/inc/lang/la/showrev.txt b/inc/lang/la/showrev.txt
index c5019d798..b95e68265 100644
--- a/inc/lang/la/showrev.txt
+++ b/inc/lang/la/showrev.txt
@@ -1,2 +1,2 @@
-**Haec uetus uersio documenti est!**
+**Haec uetus forma documenti est!**
---- \ No newline at end of file
diff --git a/inc/lang/la/subscr_digest.txt b/inc/lang/la/subscr_digest.txt
index a64a2c61b..629213359 100644
--- a/inc/lang/la/subscr_digest.txt
+++ b/inc/lang/la/subscr_digest.txt
@@ -13,7 +13,7 @@ Noua recensio: @NEWPAGE@
Ut paginae adnotationes deleas, in uicem ineas in
@DOKUWIKIURL@, deinde uideas
@NEWPAGE@
-et paginarum spatiorum nominis optiones mutasa.
+et paginarum generum optiones mutes.
--
Hic cursus a uicis generatus
diff --git a/inc/lang/la/subscr_form.txt b/inc/lang/la/subscr_form.txt
index 82b0a692e..23000b31e 100644
--- a/inc/lang/la/subscr_form.txt
+++ b/inc/lang/la/subscr_form.txt
@@ -1,3 +1,3 @@
====== Inscriptionis Administratio ======
-In hac pagina inscriptiones paginae et spatio nominis sunt. \ No newline at end of file
+In hac pagina inscriptiones huius paginae et generis sunt. \ No newline at end of file
diff --git a/inc/lang/la/subscr_list.txt b/inc/lang/la/subscr_list.txt
index 87ce97215..e6ff8d89d 100644
--- a/inc/lang/la/subscr_list.txt
+++ b/inc/lang/la/subscr_list.txt
@@ -10,7 +10,7 @@ Hae mutationes sunt:
Ut adnotationes deleas, preme hic
@DOKUWIKIURL@ then visit
@SUBSCRIBE@
-et paginarum spatiorum nominis mutationes tollis.
+et paginarum et\aut generum mutationes tollis.
--
Hic cursus generatus a(b)
diff --git a/inc/lang/la/subscr_single.txt b/inc/lang/la/subscr_single.txt
index e21af04bb..7839791ea 100644
--- a/inc/lang/la/subscr_single.txt
+++ b/inc/lang/la/subscr_single.txt
@@ -16,7 +16,7 @@ Noua recensio: @NEWPAGE@
Ut paginae adnotationes deleas, in uicem ineas in
@DOKUWIKIURL@, deinde uideas
@NEWPAGE@
-et paginarum spatiorum nominis optiones mutasa.
+et paginarum et\aut generum optiones mutasa.
--
Hic cursus a uicis generatus
diff --git a/inc/lang/mg/lang.php b/inc/lang/mg/lang.php
index 2ecbcdcff..3727cfe9a 100644
--- a/inc/lang/mg/lang.php
+++ b/inc/lang/mg/lang.php
@@ -132,4 +132,4 @@ $lang['acl_perm8'] = 'Mandefa rakitra';
$lang['acl_perm16'] = 'Mamafa';
$lang['acl_new'] = 'Ampio andalana vaovao';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/lang/ru/conflict.txt b/inc/lang/ru/conflict.txt
index f1ac60bd4..6c5e33dce 100644
--- a/inc/lang/ru/conflict.txt
+++ b/inc/lang/ru/conflict.txt
@@ -2,4 +2,4 @@
Существует более новая версия документа, который вы редактировали. Такое случается, когда другой пользователь изменил документ, пока вы делали то же самое.
-Внимательно изучите различия, приведенные ниже и решите, какую версию оставить. Если вы выберете ''Сохранить'', то ваша версия будет сохранена. Нажав ''Отменить',' вы оставите текущую версию.
+Внимательно изучите различия, приведенные ниже, и решите, какую версию оставить. Если вы выберете «Сохранить», то ваша версия будет сохранена. Нажав «Отменить», вы оставите текущую версию.
diff --git a/inc/lang/ru/draft.txt b/inc/lang/ru/draft.txt
index bbd2e5913..cb35f72b6 100644
--- a/inc/lang/ru/draft.txt
+++ b/inc/lang/ru/draft.txt
@@ -1,6 +1,6 @@
====== Найден черновик ======
-Последний раз редактирование этой страницы не было корректно завершено. Во время вашей работы был автоматически сохранён черновик, который вы теперь можете восстановить и продолжить прерванную правку. Ниже вы видите автоматически сохраненную версию.
+Последний раз редактирование этой страницы не было корректно завершено. Во время вашей работы был автоматически сохранён черновик, который вы теперь можете восстановить и продолжить прерванную правку. Ниже вы видите автоматически сохранённую версию.
Пожалуйста, решите, хотите ли вы //восстановить// потерянную версию, //удалить// черновик, или //отменить// редактирование.
diff --git a/inc/lang/ru/edit.txt b/inc/lang/ru/edit.txt
index 6398e8e83..aac399d7c 100644
--- a/inc/lang/ru/edit.txt
+++ b/inc/lang/ru/edit.txt
@@ -1,2 +1,2 @@
-Отредактируйте страницу и нажмите ''Сохранить''. Прочтите [[wiki:syntax]] для ознакомления с синтаксисом вики. Пожалуйста, редактируйте только в том случае, если планируете **улучшить** содержимое. Если вы просто хотите потестировать что-либо, воспользуйтесь специальной страницей: [[playground:playground]].
+Отредактируйте страницу и нажмите «Сохранить». Прочтите [[wiki:syntax|справочную страницу]] для ознакомления с синтаксисом вики. Пожалуйста, редактируйте только в том случае, если планируете **улучшить** содержимое. Если вы просто хотите потестировать что-либо, воспользуйтесь специальной страницей: [[playground:playground]].
diff --git a/inc/lang/ru/editrev.txt b/inc/lang/ru/editrev.txt
index db843ec1c..97b799a70 100644
--- a/inc/lang/ru/editrev.txt
+++ b/inc/lang/ru/editrev.txt
@@ -1,2 +1,2 @@
-**Вы загрузили старую ревизию документа!** Сохранив её, вы создадите новую текущую версию с этим содержимым.
+**Вы загрузили старую ревизию документа.** Сохранив её, вы создадите новую текущую версию с этим содержимым.
----
diff --git a/inc/lang/ru/install.html b/inc/lang/ru/install.html
index da0c5e239..b830b06c0 100644
--- a/inc/lang/ru/install.html
+++ b/inc/lang/ru/install.html
@@ -1,6 +1,6 @@
-<p>Эта страница предназначена помочь в первоначальной установке и конфигурации «<a href="http://www.dokuwiki.org">ДокуВики</a>». Дополнительная информация о программе установки доступна на её <a href="http://www.dokuwiki.org/installer">странице документации</a>.</p>
+<p>Эта страница предназначена помочь в первоначальной установке и конфигурации «<a href="http://www.dokuwiki.org/">ДокуВики</a>». Дополнительная информация о программе установки доступна на её <a href="http://www.dokuwiki.org/installer">странице документации</a>.</p>
-<p>«ДокуВики» использует обычные файлы для хранения страниц и дополнительной информации (например, изображений, поискового индекса, предыдущих версий страницы, и т. д.). Для успешной работы «ДокуВики» <strong>необходим</strong> доступ на запись к директориям с этими файлами. Данная программа установки не может самостоятельно изменять системные права доступа к директориям. Обычно это делается напрямую из командной строки (shell), или, если вы используете удалённый хостинг, через FTP или панель управления вашего хостинга (например, cPanel).</p>
+<p>«ДокуВики» использует обычные файлы для хранения страниц и дополнительной информации (например, изображений, поискового индекса, предыдущих версий страницы, и т. д.). Для успешной работы «ДокуВики» <strong>необходим</strong> доступ на запись к директориям с этими файлами. Данная программа установки не может самостоятельно изменять системные права доступа к директориям. Обычно это делается напрямую из командной строки (shell), или, если вы используете удалённый хостинг, через FTP или панель управления своего хостинга (например, cPanel).</p>
<p>Программа установки включит использование списков контроля доступа (<acronym title="access control list">ACL</acronym>) в вашей «ДокуВики». Это позволит администратору, после авторизации в «ДокуВики», использовать специальное меню для установки плагинов, управления пользователями и доступом к страницам вики, а также для настройки конфигурационных параметров. Списки контроля доступа не обязательны для работы «ДокуВики», однако они позволяют упростить управление вашей «ДокуВики».</p>
diff --git a/inc/lang/ru/lang.php b/inc/lang/ru/lang.php
index 88692ae93..2968d72bd 100644
--- a/inc/lang/ru/lang.php
+++ b/inc/lang/ru/lang.php
@@ -76,7 +76,7 @@ $lang['regmissing'] = 'Извините, вам следует зап
$lang['reguexists'] = 'Извините, пользователь с таким логином уже существует.';
$lang['regsuccess'] = 'Пользователь создан, пароль выслан на адрес электронной почты.';
$lang['regsuccess2'] = 'Пользователь создан.';
-$lang['regmailfail'] = 'Похоже, проблема с отправкой пароля по почте. Пожалуйста, сообщите администратору.';
+$lang['regmailfail'] = 'Похоже есть проблема с отправкой пароля по почте. Пожалуйста, сообщите об этом администратору.';
$lang['regbadmail'] = 'Данный вами адрес электронной почты выглядит неправильным. Если вы считаете это ошибкой, сообщите администратору.';
$lang['regbadpass'] = 'Два введённых пароля не идентичны. Пожалуйста, попробуйте ещё раз.';
$lang['regpwmail'] = 'Ваш пароль для системы «ДокуВики»';
@@ -94,7 +94,7 @@ $lang['resendpwdbadauth'] = 'Извините, неверный код ав
$lang['resendpwdconfirm'] = 'Ссылка для подтверждения пароля была выслана по электронной почте. ';
$lang['resendpwdsuccess'] = 'Ваш новый пароль был выслан по электронной почте.';
$lang['license'] = 'За исключением случаев, когда указано иное, содержимое этой вики предоставляется на условиях следующей лицензии:';
-$lang['licenseok'] = 'Примечание: редактируя эту страницу, вы соглашаетесь на использование вашего вклада на условиях следующей лицензии:';
+$lang['licenseok'] = 'Примечание: редактируя эту страницу, вы соглашаетесь на использование своего вклада на условиях следующей лицензии:';
$lang['searchmedia'] = 'Поиск по имени файла:';
$lang['searchmedia_in'] = 'Поиск в %s';
$lang['txt_upload'] = 'Выберите файл для загрузки';
@@ -103,8 +103,7 @@ $lang['txt_overwrt'] = 'Перезаписать существующ
$lang['lockedby'] = 'В данный момент заблокирован';
$lang['lockexpire'] = 'Блокировка истекает в';
$lang['willexpire'] = 'Ваша блокировка редактирования этой страницы истекает в течение минуты.\nЧтобы избежать конфликтов и сбросить таймер блокировки, нажмите кнопку просмотра.';
-$lang['js']['notsavedyet'] = 'Несохранённые изменения будут потеряны.
-Вы действительно хотите продолжить?';
+$lang['js']['notsavedyet'] = 'Несохранённые изменения будут потеряны. Вы действительно хотите продолжить?';
$lang['js']['searchmedia'] = 'Поиск файлов';
$lang['js']['keepopen'] = 'Не закрывать окно после выбора';
$lang['js']['hidedetails'] = 'Скрыть детали';
@@ -112,7 +111,7 @@ $lang['js']['mediatitle'] = 'Настройки ссылок';
$lang['js']['mediadisplay'] = 'Тип ссылки';
$lang['js']['mediaalign'] = 'Выравнивание';
$lang['js']['mediasize'] = 'Размер изображения';
-$lang['js']['mediatarget'] = 'target ссылки';
+$lang['js']['mediatarget'] = 'Значение target ссылки';
$lang['js']['mediaclose'] = 'Закрыть';
$lang['js']['mediainsert'] = 'Вставить';
$lang['js']['mediadisplayimg'] = 'Показывать изображение.';
@@ -129,8 +128,7 @@ $lang['js']['medialeft'] = 'Выровнять изображение по
$lang['js']['mediaright'] = 'Выровнять изображение по правому краю.';
$lang['js']['mediacenter'] = 'Выровнять изображение по центру.';
$lang['js']['medianoalign'] = 'Не выравнивать.';
-$lang['js']['nosmblinks'] = 'Ссылка на сетевые каталоги Windows работает только из Интернет Эксплорера
-Но вы можете скопировать ссылку.';
+$lang['js']['nosmblinks'] = 'Ссылка на сетевые каталоги Windows работает только из Интернет Эксплорера. Но вы можете скопировать ссылку.';
$lang['js']['linkwiz'] = 'Мастер ссылок';
$lang['js']['linkto'] = 'Ссылка на:';
$lang['js']['del_confirm'] = 'Вы на самом деле желаете удалить выбранное?';
@@ -149,18 +147,18 @@ $lang['uploadxss'] = 'Загрузка заблокирована п
$lang['uploadsize'] = 'Загруженный файл был слишком большой. (макс. %s)';
$lang['deletesucc'] = 'Файл "%s" был удалён.';
$lang['deletefail'] = 'Невозможно удалить файл "%s". Проверьте права доступа к файлу.';
-$lang['mediainuse'] = 'Файл "%s" не был удалён - файл всё ещё используется.';
+$lang['mediainuse'] = 'Файл "%s" не был удалён — файл всё ещё используется.';
$lang['namespaces'] = 'Пространства имён';
$lang['mediafiles'] = 'Доступные файлы';
$lang['accessdenied'] = 'Вы не можете просмотреть эту страницу.';
$lang['mediausage'] = 'Для ссылки на этот файл используйте следующий синтаксис:';
$lang['mediaview'] = 'Посмотреть исходный файл';
$lang['mediaroot'] = 'корень';
-$lang['mediaupload'] = 'Здесь можно загрузить файл в текущий каталог («пространство имен»). Чтобы создать подкаталоги, добавьте их к началу имени файла («Загрузить как»). Имена подкаталогов разделяются двоеточиями. ';
+$lang['mediaupload'] = 'Здесь можно загрузить файл в текущий каталог («пространство имён»). Чтобы создать подкаталоги, добавьте их к началу имени файла («Загрузить как»). Имена подкаталогов разделяются двоеточиями. ';
$lang['mediaextchange'] = 'Расширение изменилось: с .%s на .%s!';
$lang['reference'] = 'Ссылки для';
-$lang['ref_inuse'] = 'Этот файл не может быть удалён, так как он используется следующими страницами:';
-$lang['ref_hidden'] = 'Некоторые ссылки находятся на страницах, на чтение которых у вас нет прав';
+$lang['ref_inuse'] = 'Этот файл не может быть удалён, так как он используется на следующих страницах:';
+$lang['ref_hidden'] = 'Некоторые ссылки находятся на страницах, на чтение которых у вас нет прав доступа';
$lang['hits'] = 'соответствий';
$lang['quickhits'] = 'Соответствия в названиях страниц';
$lang['toc'] = 'Содержание';
@@ -183,7 +181,7 @@ $lang['noflash'] = 'Для просмотра этого соде
$lang['download'] = 'Скачать код';
$lang['mail_newpage'] = 'страница добавлена:';
$lang['mail_changed'] = 'страница изменена:';
-$lang['mail_subscribe_list'] = 'изменились страницы в пространстве имен:';
+$lang['mail_subscribe_list'] = 'изменились страницы в пространстве имён:';
$lang['mail_new_user'] = 'новый пользователь:';
$lang['mail_upload'] = 'файл закачан:';
$lang['qb_bold'] = 'Полужирный';
@@ -210,7 +208,7 @@ $lang['qb_media'] = 'Добавить изображения или
$lang['qb_sig'] = 'Вставить подпись';
$lang['qb_smileys'] = 'Смайлики';
$lang['qb_chars'] = 'Специальные символы';
-$lang['upperns'] = 'Перейти в родительское пространство имен';
+$lang['upperns'] = 'Перейти в родительское пространство имён';
$lang['admin_register'] = 'Добавить пользователя';
$lang['metaedit'] = 'Править метаданные';
$lang['metasaveerr'] = 'Ошибка записи метаданных';
@@ -233,7 +231,7 @@ $lang['subscr_unsubscribe_success'] = 'Удалён %s из подписки н
$lang['subscr_unsubscribe_error'] = 'Ошибка удаления %s из подписки на %s';
$lang['subscr_already_subscribed'] = '%s уже подписан на %s';
$lang['subscr_not_subscribed'] = '%s не подписан на %s';
-$lang['subscr_m_not_subscribed'] = 'Вы не подписаны на текущую страницу или пространство имен.';
+$lang['subscr_m_not_subscribed'] = 'Вы не подписаны на текущую страницу или пространство имён.';
$lang['subscr_m_new_header'] = 'Добавить подписку';
$lang['subscr_m_current_header'] = 'Текущие подписки';
$lang['subscr_m_unsubscribe'] = 'Отменить подписку';
@@ -242,8 +240,8 @@ $lang['subscr_m_receive'] = 'Получить';
$lang['subscr_style_every'] = 'уведомлять о каждом изменении';
$lang['subscr_style_digest'] = 'сводка изменений по каждой странице';
$lang['subscr_style_list'] = 'перечислять изменившиеся страницы с прошлого уведомления';
-$lang['authmodfailed'] = 'Неправильная конфигурация аутентификации пользователя. Пожалуйста, сообщите об этом вашему администратору вики.';
-$lang['authtempfail'] = 'Аутентификация пользователей временно недоступна. Если проблема продолжается какое-то время, пожалуйста, сообщите об этом вашему администратору вики.';
+$lang['authmodfailed'] = 'Неправильная конфигурация аутентификации пользователя. Пожалуйста, сообщите об этом своему администратору вики.';
+$lang['authtempfail'] = 'Аутентификация пользователей временно недоступна. Если проблема продолжается какое-то время, пожалуйста, сообщите об этом своему администратору вики.';
$lang['i_chooselang'] = 'Выберите свой язык/Choose your language';
$lang['i_installer'] = 'Установка «ДокуВики»';
$lang['i_wikiname'] = 'Название вики';
@@ -258,18 +256,18 @@ $lang['i_phpver'] = 'Ваша версия PHP (<code>%s</code>) н
$lang['i_permfail'] = '<code>%s</code> недоступна для записи «ДокуВики». Вам необходимо исправить системные права доступа для этой директории!';
$lang['i_confexists'] = '<code>%s</code> уже существует';
$lang['i_writeerr'] = 'Не удалось создать <code>%s</code>. Вам необходимо проверить системные права доступа к файлу/директориям и создать файл вручную. ';
-$lang['i_badhash'] = 'dokuwiki.php не распознана или изменена (хэш=<code>%s</code>)';
+$lang['i_badhash'] = 'dokuwiki.php не распознан или изменён (хэш=<code>%s</code>)';
$lang['i_badval'] = '<code>%s</code> — недопустимое или пустое значение';
$lang['i_success'] = 'Конфигурация прошла успешно. Теперь вы можете удалить файл install.php. Переходите к
- <a href="doku.php">вашей новой «ДокуВики»</a>.';
-$lang['i_failure'] = 'При записи в файлы конфигурации были обнаружены ошибки. Возможно, вам придется исправить их вручную, прежде чем вы сможете использовать <a href="doku.php">вашу новую «ДокуВики»</a>.';
+ <a href="doku.php">своей новой «ДокуВики»</a>.';
+$lang['i_failure'] = 'При записи в файлы конфигурации были обнаружены ошибки. Возможно, вам придётся исправить их вручную, прежде чем вы сможете использовать <a href="doku.php">свою новую «ДокуВики»</a>.';
$lang['i_policy'] = 'Исходная политика прав доступа';
$lang['i_pol0'] = 'Открытая вики (чтение, запись, закачка файлов для всех)';
$lang['i_pol1'] = 'Общедоступная вики (чтение для всех, запись и загрузка файлов для зарегистрированных пользователей)';
$lang['i_pol2'] = 'Закрытая вики (чтение, запись и загрузка файлов только для зарегистрированных пользователей)';
$lang['i_retry'] = 'Повторить попытку';
-$lang['i_license'] = 'Пожалуйста, выберите тип лицензии для вашей вики:';
-$lang['mu_intro'] = 'Здесь вы можете загрузить несколько файлов сразу. Кликните на «обзор», чтобы добавить их в список. Нажмите «загрузить» когда будете готовы.';
+$lang['i_license'] = 'Пожалуйста, выберите тип лицензии для своей вики:';
+$lang['mu_intro'] = 'Здесь вы можете загрузить несколько файлов сразу. Кликните на «обзор», чтобы добавить их в список. Нажмите «загрузить», когда будете готовы.';
$lang['mu_gridname'] = 'Имя файла';
$lang['mu_gridsize'] = 'Размер';
$lang['mu_gridstat'] = 'Статус';
@@ -284,7 +282,7 @@ $lang['mu_progress'] = '@PCT@% загружено';
$lang['mu_filetypes'] = 'Допустимые типы файлов';
$lang['mu_info'] = 'файлов загружено.';
$lang['mu_lasterr'] = 'Последняя ошибка:';
-$lang['recent_global'] = 'Вы просматриваете изменения в пространстве имён <b>%s</b>. Вы можете также <a href="%s">просмотреть недавние изменения на всей вики</a>.';
+$lang['recent_global'] = 'Вы просматриваете изменения в пространстве имён <b>%s</b>. Вы можете также <a href="%s">просмотреть недавние изменения во всей вики</a>.';
$lang['years'] = '%d лет назад';
$lang['months'] = '%d месяц(ев) назад';
$lang['weeks'] = '%d недель назад';
diff --git a/inc/lang/ru/norev.txt b/inc/lang/ru/norev.txt
index db36a0ddd..388d6149d 100644
--- a/inc/lang/ru/norev.txt
+++ b/inc/lang/ru/norev.txt
@@ -1,4 +1,4 @@
====== Такой версии не существует ======
-Указанная версия страницы не существует. Нажмите на кнопку ''История страницы'', чтобы получить список доступных предыдущих версий этого документа.
+Указанная версия страницы не существует. Нажмите на кнопку «История страницы», чтобы получить список доступных предыдущих версий этого документа.
diff --git a/inc/lang/ru/password.txt b/inc/lang/ru/password.txt
index af6a7d14d..91117ca56 100644
--- a/inc/lang/ru/password.txt
+++ b/inc/lang/ru/password.txt
@@ -1,9 +1,10 @@
-Здравствуйте, @FULLNAME@!
+Здравствуйте, @FULLNAME@.
Ваши данные для @TITLE@ (@DOKUWIKIURL@)
-Имя пользователя : @LOGIN@
-Пароль : @PASSWORD@
+Имя пользователя: @LOGIN@
+
+Пароль: @PASSWORD@
--
Это письмо было сгенерировано «ДокуВики» по адресу
diff --git a/inc/lang/ru/preview.txt b/inc/lang/ru/preview.txt
index 2bc383eb2..401827607 100644
--- a/inc/lang/ru/preview.txt
+++ b/inc/lang/ru/preview.txt
@@ -1,4 +1,4 @@
====== Просмотр ======
-Здесь показано, как ваш текст будет выглядеть. Внимание: текст ещё **не сохранён!**
+Здесь показано, как ваш текст будет выглядеть. Внимание: текст ещё **не сохранён.**
diff --git a/inc/lang/ru/pwconfirm.txt b/inc/lang/ru/pwconfirm.txt
index 3e2331269..9c27af752 100644
--- a/inc/lang/ru/pwconfirm.txt
+++ b/inc/lang/ru/pwconfirm.txt
@@ -1,4 +1,4 @@
-Здравствуйте, @FULLNAME@!
+Здравствуйте, @FULLNAME@.
Кто-то запросил новый пароль для входа в @TITLE@ по адресу @DOKUWIKIURL@
diff --git a/inc/lang/ru/revisions.txt b/inc/lang/ru/revisions.txt
index 06022323f..55072cd8a 100644
--- a/inc/lang/ru/revisions.txt
+++ b/inc/lang/ru/revisions.txt
@@ -1,3 +1,3 @@
====== История страницы ======
-Перед вами — история правок текущего документа. Чтобы вернуться к одной из предыдущих версий, выберите нужную, нажмите ''Править страницу'' и сохраните.
+Перед вами — история правок текущего документа. Чтобы вернуться к одной из предыдущих версий, выберите нужную, нажмите «Править страницу» и сохраните.
diff --git a/inc/lang/ru/searchpage.txt b/inc/lang/ru/searchpage.txt
index 608220495..04feb21cd 100644
--- a/inc/lang/ru/searchpage.txt
+++ b/inc/lang/ru/searchpage.txt
@@ -1,5 +1,5 @@
====== Поиск ======
-Перед вами результаты поиска. Если вы не нашли то, что искали, вы можете создать новую страницу с именем, совпадающим с запросом. Чтобы сделать это, просто нажмите на кнопку ''Создать страницу''.
+Перед вами результаты поиска. Если вы не нашли то, что искали, вы можете создать новую страницу с именем, совпадающим с запросом. Чтобы сделать это, просто нажмите на кнопку «Создать страницу».
===== Результаты ===== \ No newline at end of file
diff --git a/inc/lang/ru/showrev.txt b/inc/lang/ru/showrev.txt
index b3f3852eb..596815870 100644
--- a/inc/lang/ru/showrev.txt
+++ b/inc/lang/ru/showrev.txt
@@ -1,2 +1,2 @@
-**Это старая версия документа!**
+**Это старая версия документа.**
----
diff --git a/inc/lang/ru/subscr_digest.txt b/inc/lang/ru/subscr_digest.txt
index 3d1d35d30..41774a4e9 100644
--- a/inc/lang/ru/subscr_digest.txt
+++ b/inc/lang/ru/subscr_digest.txt
@@ -1,4 +1,4 @@
-Привет!
+Привет.
Страница @PAGE@ в вики @TITLE@ изменилась.
Список изменений:
diff --git a/inc/lang/ru/subscr_list.txt b/inc/lang/ru/subscr_list.txt
index 9d0eb10e0..df5c2aa54 100644
--- a/inc/lang/ru/subscr_list.txt
+++ b/inc/lang/ru/subscr_list.txt
@@ -1,6 +1,7 @@
-Привет!
-Страницы в пространстве имен @PAGE@ в вики @TITLE@ были изменены.
+Привет.
+
+Страницы в пространстве имён @PAGE@ в вики @TITLE@ были изменены.
Список изменившихся страниц:
--------------------------------------------------------
@@ -10,7 +11,7 @@
Чтобы отписаться от уведомлений об изменениях, войдите в вики
@DOKUWIKIURL@ в раздел
@SUBSCRIBE@
-и отмените подписку на страницу и/или пространство имен.
+и отмените подписку на страницу и/или пространство имён.
--
Это письмо создано «ДокуВики» с сайта
diff --git a/inc/lang/ru/subscr_single.txt b/inc/lang/ru/subscr_single.txt
index ed8ead4cd..0e67d8f59 100644
--- a/inc/lang/ru/subscr_single.txt
+++ b/inc/lang/ru/subscr_single.txt
@@ -1,4 +1,5 @@
-Привет!
+Привет.
+
Страница @PAGE@ в вики @TITLE@ изменилась.
Список изменений:
@@ -7,8 +8,9 @@
@DIFF@
--------------------------------------------------------
-Дата : @DATE@
-Автор : @USER@
+Дата: @DATE@
+Автор: @USER@
+
Примечание: @SUMMARY@
Старая версия: @OLDPAGE@
Новая версия: @NEWPAGE@
@@ -16,7 +18,7 @@
Чтобы отписаться от уведомлений об изменениях, войдите в вики
@DOKUWIKIURL@ в раздел
@SUBSCRIBE@
-и отмените подписку на страницу и/или пространство имен.
+и отмените подписку на страницу и/или пространство имён.
--
Это письмо создано «ДокуВики» с сайта
diff --git a/inc/lang/sl/admin.txt b/inc/lang/sl/admin.txt
new file mode 100644
index 000000000..fc78273ac
--- /dev/null
+++ b/inc/lang/sl/admin.txt
@@ -0,0 +1,3 @@
+===== Administracija =====
+
+Spodaj lahko vidite seznam administrativnih opravil v DokuWikiju. \ No newline at end of file
diff --git a/inc/lang/sl/adminplugins.txt b/inc/lang/sl/adminplugins.txt
new file mode 100644
index 000000000..9438b4759
--- /dev/null
+++ b/inc/lang/sl/adminplugins.txt
@@ -0,0 +1 @@
+===== Dodatni vtičniki ===== \ No newline at end of file
diff --git a/inc/lang/sl/draft.txt b/inc/lang/sl/draft.txt
new file mode 100644
index 000000000..9fea86fd1
--- /dev/null
+++ b/inc/lang/sl/draft.txt
@@ -0,0 +1,5 @@
+=====Najden je bil osnutek strani=====
+
+Vaša zadnja seja na tej strani ni bila pravilno zaključena. DokuWiki je samodejno shranil osnutek med vašim delom, katerega sedaj lahko nadaljujete. Spodaj lahko vidite podatke, ki so bili samodejno shranjeni v vaši zadnji seji.
+
+Prosimo, odločite se ali boste //obnovili// vašo sejo, //izbrisali// samodejno shranjen osnutek alo //prekinili// proces urejanja. \ No newline at end of file
diff --git a/inc/lang/sl/lang.php b/inc/lang/sl/lang.php
index 9d94bab49..8014d8a70 100644
--- a/inc/lang/sl/lang.php
+++ b/inc/lang/sl/lang.php
@@ -6,8 +6,10 @@
* @author Jaka Kranjc <lynxlupodian@hotmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
* @author Dejan Levec <webphp@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
$lang['encoding'] = 'utf-8';
+$lang['direction'] = 'ltr';
$lang['doublequoteopening'] = '„';
$lang['doublequoteclosing'] = '“';
$lang['singlequoteopening'] = '‚';
@@ -35,12 +37,16 @@ $lang['btn_admin'] = 'Administrator';
$lang['btn_update'] = 'Posodobi';
$lang['btn_delete'] = 'Izbriši';
$lang['btn_back'] = 'Nazaj';
+$lang['btn_backlink'] = 'Navzkrižne povezave';
+$lang['btn_backtomedia'] = 'Nazaj na izbiro medijskih datotek';
+$lang['btn_subscribe'] = 'Uredi naročnine';
$lang['btn_profile'] = 'Posodobi profil';
$lang['btn_reset'] = 'Ponastavi';
$lang['btn_resendpwd'] = 'Pošlji novo geslo';
$lang['btn_draft'] = 'Uredi osnutek';
$lang['btn_recover'] = 'Obnovi osnutek';
$lang['btn_draftdel'] = 'Izbriši osnutek';
+$lang['btn_revert'] = 'Povrni';
$lang['loggedinas'] = 'Prijavljen kot';
$lang['user'] = 'Uporabniško ime';
$lang['pass'] = 'Geslo';
@@ -55,6 +61,7 @@ $lang['profile'] = 'Profil uporabnika';
$lang['badlogin'] = 'Oprostite, uporabniško ime ali geslo ni pravo.';
$lang['minoredit'] = 'Manjše spremembe';
$lang['draftdate'] = 'Samodejno shranjevanje osnutka vključeno';
+$lang['nosecedit'] = 'Stran se je medtem spremenila, informacije odseka so bile stare, naložila se je celotna stran.';
$lang['regmissing'] = 'Oprostite, zapolniti morate vsa polja.';
$lang['reguexists'] = 'Oprostite, uporabnik s tem imenom že obstaja.';
$lang['regsuccess'] = 'Uporabnik je bil ustvarjen. Geslo je bilo poslano na vaš elektronski naslov.';
@@ -64,21 +71,60 @@ $lang['regbadmail'] = 'Podan elektronski naslov izgleda neveljaven -
$lang['regbadpass'] = 'Gesli nista enaki.';
$lang['regpwmail'] = 'Vaše geslo za DokuWiki';
$lang['reghere'] = 'Nimate še računa? Priskrbite si ga';
+$lang['profna'] = 'Ta wiki ne podpira sprememb profila';
$lang['profnochange'] = 'Brez sprememb, ničesar za storiti.';
+$lang['profnoempty'] = 'Prazno polje "e-pošta" ali "ime" ni dovoljeno.';
$lang['profchanged'] = 'Uporabniški profil uspešno posodobljen';
$lang['pwdforget'] = 'Pozabili geslo? Pridobite novega';
+$lang['resendna'] = 'Ta wiki ne podpira ponovnega pošiljanja gesel.';
$lang['resendpwd'] = 'Pošlji novo geslo za';
$lang['resendpwdmissing'] = 'Se opravičujemo, vendar morate izpolniti vsa polja.';
$lang['resendpwdnouser'] = 'Se opravičujemo, vendar tega uporabniškega imena ni v bazi.';
+$lang['resendpwdbadauth'] = 'Oprostite, ta avtorizacijska koda ni prava. Prepričajte se, da ste uporabili celotno povezavo za potrditev.';
$lang['resendpwdconfirm'] = 'Potrditvena povezava je bila poslana na vaš elektronski naslov';
$lang['resendpwdsuccess'] = 'Vaše novo geslo je bilo poslano na vaš elektronski naslov';
+$lang['license'] = 'Če ni drugače navedeno, je vsebina tega wikija licencirana z naslednjo licenco:';
+$lang['licenseok'] = 'Pomembno: Z urejanjem te strani se strinjate s tem, da se vsebina zaščiti z naslednjo licenco:';
+$lang['searchmedia'] = 'Išči datoteko:';
+$lang['searchmedia_in'] = 'Išči v %s';
$lang['txt_upload'] = 'Izberite datoteko za pošiljanje';
$lang['txt_filename'] = 'Vnesite wikiname (neobvezno)';
$lang['txt_overwrt'] = 'Prepiši obstoječo datoteko';
$lang['lockedby'] = 'Trenutno zaklenjeno od';
$lang['lockexpire'] = 'Zaklep preteče';
$lang['willexpire'] = 'Vaš zaklep za urejevanje bo pretekel čez eno minuto.\nDa se izognete konfliktom, uporabite predogled, da se merilnik časa za zaklep ponastavi.';
-$lang['js']['notsavedyet'] = "Obstajajo neshranjene spremembe, ki bodo izgubljene.\nRes želite nadaljevati?";
+$lang['js']['notsavedyet'] = 'Obstajajo neshranjene spremembe, ki bodo izgubljene.
+Res želite nadaljevati?';
+$lang['js']['searchmedia'] = 'Išči datoteke';
+$lang['js']['keepopen'] = 'Od izbiri obdrži okno odprto';
+$lang['js']['hidedetails'] = 'Skrij podrobnosti';
+$lang['js']['mediatitle'] = 'Nastavitve povezave';
+$lang['js']['mediadisplay'] = 'Vrsta povezave';
+$lang['js']['mediaalign'] = 'Poravnava';
+$lang['js']['mediasize'] = 'Velikost slike';
+$lang['js']['mediatarget'] = 'Mesto povezave';
+$lang['js']['mediaclose'] = 'Zapri';
+$lang['js']['mediainsert'] = 'Vstavi';
+$lang['js']['mediadisplayimg'] = 'Pokaži sliko.';
+$lang['js']['mediadisplaylnk'] = 'Pokaži le povezavo.';
+$lang['js']['mediasmall'] = 'Manjša različica';
+$lang['js']['mediamedium'] = 'Srednja različica';
+$lang['js']['medialarge'] = 'Velika različica';
+$lang['js']['mediaoriginal'] = 'Originalna različica';
+$lang['js']['medialnk'] = 'Povezava na detajle strani';
+$lang['js']['mediadirect'] = 'Direktna povezava na original';
+$lang['js']['medianolnk'] = 'Brez povezave';
+$lang['js']['medianolink'] = 'Ne poveži na sliko';
+$lang['js']['medialeft'] = 'Poravnaj sliko na levi';
+$lang['js']['mediaright'] = 'Poravnaj sliko na desni';
+$lang['js']['mediacenter'] = 'Poravnaj sliko na sredino';
+$lang['js']['medianoalign'] = 'Ne uporabi poravnave';
+$lang['js']['nosmblinks'] = 'Povezovanje do Windows deljenih datotek deluje samo v Microsoft Internet Explorer-ju.
+Še vedno pa lahko ročno kopirate povezavo.';
+$lang['js']['linkwiz'] = 'Čarovnik za povezave';
+$lang['js']['linkto'] = 'Poveži na:';
+$lang['js']['del_confirm'] = 'Resnično brišem izbrano(e) sliko(e)?';
+$lang['js']['mu_btn'] = 'Prenesite več dokumentov naenkrat.';
$lang['rssfailed'] = 'Prišlo je do napake pri prenašanju tega dovoda: ';
$lang['nothingfound'] = 'Nič ni bilo najdeno.';
$lang['mediaselect'] = 'Mediafile Izbira';
@@ -87,23 +133,32 @@ $lang['uploadsucc'] = 'Pošiljanje uspelo';
$lang['uploadfail'] = 'Pošiljanje je spodletelo. Mogoče nimate dovoljenj?';
$lang['uploadwrong'] = 'Pošiljanje zavrnjeno. Ta datotečna končnica je prepovedana';
$lang['uploadexist'] = 'Dokument že obstaja. Brez sprememb.';
+$lang['uploadbadcontent'] = 'Naložena datoteka se ne ujema z/s %s končnico datoteke.';
+$lang['uploadspam'] = 'Nalaganje je bilo ustavljeno zaradi "črne liste" neželenih datotek.';
$lang['uploadxss'] = 'Prenos je bil zaustavljen zaradi možne zlonamerne vsebine.';
$lang['uploadsize'] = 'Prenesen dokument je prevelik. (max. %s)';
$lang['deletesucc'] = 'Datoteka "%s" je bila izbrisana.';
+$lang['deletefail'] = '"%s" ni bilo možno izbrisati - preverite nastavitve CHMOD';
$lang['mediainuse'] = 'Dokument "%s" ni bil izbrisan - je še vedno v uporabi.';
$lang['namespaces'] = 'Imenski prostori';
$lang['mediafiles'] = 'Datoteke ki so na voljo v';
-$lang['js']['hidedetails'] = 'Skrij podrobnosti';
-$lang['js']['nosmblinks'] = 'Povezovanje do Windows deljenih datotek deluje samo v Microsoft Internet Explorer-ju.
-Še vedno pa lahko ročno kopirate povezavo.';
-$lang['js']['mu_btn'] = 'Prenesite več dokumentov naenkrat.';
+$lang['accessdenied'] = 'Nimate dovoljenja za ogled te strani.';
+$lang['mediausage'] = 'Uporabite naslednjo kodo za navajanje te datoteke:';
$lang['mediaview'] = 'Poglej originalno datoteko';
+$lang['mediaroot'] = 'korenska mapa';
+$lang['mediaupload'] = 'Naložite datoteko v trenutno mapo. Za ustvarjanje novih podmap, jih pripnite pred "Naloži kot" ime in jih ločite z navpičnico.';
+$lang['mediaextchange'] = 'Končnica datoteke se je spremenila iz .%s v .%s!';
+$lang['reference'] = 'Reference za';
+$lang['ref_inuse'] = 'Te datoteke ni možno izbrisati, ker jo še vedno uporablja(jo) stran(i):';
+$lang['ref_hidden'] = 'Nekaj referenc je na straneh, do katerih nimate dostopa.';
$lang['hits'] = 'Zadetkov';
$lang['quickhits'] = 'Ujemanja v imenih strani';
$lang['toc'] = 'Kazalo';
$lang['current'] = 'trenutna';
$lang['yours'] = 'Vaša različica';
$lang['diff'] = 'prikaži razlike s trenutno različico';
+$lang['diff2'] = 'Pokaži razlike med izbranimi revizijami';
+$lang['difflink'] = 'Naredi povezavo na to primerjavo';
$lang['line'] = 'Vrstica';
$lang['breadcrumb'] = 'Sled';
$lang['youarehere'] = 'Tukaj ste';
@@ -112,10 +167,13 @@ $lang['by'] = 'od';
$lang['deleted'] = 'odstranjena';
$lang['created'] = 'ustvarjena';
$lang['restored'] = 'stara različica povrnjena';
+$lang['external_edit'] = 'urejanje v zunanjem urejevalniku';
$lang['summary'] = 'Povzetek urejanja';
$lang['noflash'] = 'Za prikaz vsebine potrebujete <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a>';
+$lang['download'] = 'Naloži izrezek';
$lang['mail_newpage'] = '[DokuWiki] stran dodana:';
$lang['mail_changed'] = '[DokuWiki] stran spremenjena:';
+$lang['mail_subscribe_list'] = 'strani s spremenjenim imenom:';
$lang['mail_new_user'] = 'nov uporabnik.';
$lang['mail_upload'] = 'naložena datoteka:';
$lang['qb_bold'] = 'Krepki tisk';
@@ -128,6 +186,11 @@ $lang['qb_h2'] = 'Naslov drugee stopnje';
$lang['qb_h3'] = 'Naslov tretje stopnje';
$lang['qb_h4'] = 'Naslov četrte stopnje';
$lang['qb_h5'] = 'Naslov pete stopnje';
+$lang['qb_h'] = 'Naslov';
+$lang['qb_hs'] = 'Izberi naslov';
+$lang['qb_hplus'] = 'Naslov na višjem nivoju';
+$lang['qb_hminus'] = 'Naslov na nižjem nivoju';
+$lang['qb_hequal'] = 'Naslov na istem nivoju';
$lang['qb_link'] = 'Notranja povezava';
$lang['qb_extlink'] = 'Zunanja povezava';
$lang['qb_hr'] = 'Vodoravna črta';
@@ -137,6 +200,7 @@ $lang['qb_media'] = 'Dodaj slike in druge datoteke';
$lang['qb_sig'] = 'Vstavi podpis';
$lang['qb_smileys'] = 'Smeški';
$lang['qb_chars'] = 'Posebni znaki';
+$lang['upperns'] = 'skoči na starševski članek';
$lang['admin_register'] = 'Dodaj novega uporabnika';
$lang['metaedit'] = 'Popravi metapodatke';
$lang['metasaveerr'] = 'Zapisovanje metapodatkov ni uspelo';
@@ -148,15 +212,71 @@ $lang['img_date'] = 'Datum';
$lang['img_fname'] = 'Ime datoteke';
$lang['img_fsize'] = 'Velikost';
$lang['img_artist'] = 'Fotograf';
+$lang['img_copyr'] = 'Avtorska zaščita';
$lang['img_format'] = 'Velikost';
$lang['img_camera'] = 'Fotoaparat';
$lang['img_keywords'] = 'Ključne besede';
+$lang['subscr_subscribe_success'] = 'Dodan %s na seznam naročnin za %s';
+$lang['subscr_subscribe_error'] = 'Napaka pri dodajanju %s na seznam naročnin za %s';
+$lang['subscr_subscribe_noaddress'] = 'Z vašo prijavo ni povezan noben e-naslov, zato vas ne moremo dodati na seznam naročnikov';
+$lang['subscr_unsubscribe_success'] = 'Odstranjeno %s s seznama naročnin za %s';
+$lang['subscr_unsubscribe_error'] = 'Napaka pri odstranjevanju %s s seznama naročnin za %s';
+$lang['subscr_already_subscribed'] = '%s je že naročen na %s';
+$lang['subscr_not_subscribed'] = '%s ni naročen na %s';
+$lang['subscr_m_not_subscribed'] = 'Niste naročeni na trenutno stran ali članek.';
+$lang['subscr_m_new_header'] = 'Naroči se na spremembe';
+$lang['subscr_m_current_header'] = 'Trenutne naročnine';
+$lang['subscr_m_unsubscribe'] = 'Odjavi se';
+$lang['subscr_m_subscribe'] = 'Naroči se';
+$lang['subscr_m_receive'] = 'Prejmi';
+$lang['subscr_style_every'] = 'e-pošto ob vsaki spremembi';
+$lang['subscr_style_digest'] = 'strnjeno e-pošti sprememb za vsako stran (vsake %.2f dni)';
+$lang['subscr_style_list'] = 'seznam spremenjenih strani od zadnje pošte (vsake %.2f dni)';
+$lang['authmodfailed'] = 'Slaba nastavitev potrditve. Prosimo obvestite administratorja wikija.';
+$lang['authtempfail'] = 'Potrditev uporabnika je trenutno nedostopna. Če se ta napaka ponavlja, prosimo obvestite administratorja wikija.';
$lang['i_chooselang'] = 'Izberite jezik';
$lang['i_installer'] = 'DokuWiki namestitev';
$lang['i_wikiname'] = 'Wiki ime';
$lang['i_enableacl'] = 'Omogoči ACL (priporočeno)';
$lang['i_superuser'] = 'Naduporabnik';
+$lang['i_problems'] = 'Installer je naletel na težave, ki so opisane spodaj. Ne morete nadaljevati, dokler jih ne odpravite.';
+$lang['i_modified'] = 'Iz varnostnih razlogov bo ta skrip deloval le v novi in nespremenjeneni namestitvi DokuWikija. Potrebno je ali ponovno razširiti datoteke iz naloženega paketa, ali preberete popolna <a href="http://dokuwiki.org/install">Dokuwiki navodila za namestitev</a>.';
+$lang['i_funcna'] = 'PHP funkcija <code>%s</code> ni na voljo. Morda jo je vaš ponudnik onemogočil?';
+$lang['i_phpver'] = 'Verzija vašega PHP-ja <code>%s</code> je nižja od potrebne <code>%s</code>. Potrebno je posodobiti PHP inštalacijo.';
+$lang['i_permfail'] = '<code>%s</code> ni zapisljiva. Potrebno je nastaviti CHMOD nastavitve dostopa do direktorija.';
$lang['i_confexists'] = '<code>%s</code> že obstaja';
+$lang['i_writeerr'] = 'Ni mogoče ustvariti <code>%s</code>. Preveriti morate CHMOD nastavitve dostopa direktorija ali datoteke in ustvariti datoteko ročno.';
+$lang['i_badhash'] = 'nepoznana ali spremenjena dokuwiki.php (hash=<code>%s</code>)';
+$lang['i_badval'] = '<code>%s</code> - neveljavna ali prazna vrednost';
+$lang['i_success'] = 'Konfiguracija se je zaključila uspešno. Datoteko install.php lahko sedaj izbrišete. Nadaljujte v vaš <a href="doku.php">novi DokuWiki</a>.';
+$lang['i_failure'] = 'Med zapisovanjem nastavitvenih datotek je prišlo do nekaj napak. Preden lahko uporabite vaš <a href="doku.php">novi DokuWiki</a>, jih boste morali ročno popraviti.';
+$lang['i_policy'] = 'Namesti ACL';
+$lang['i_pol0'] = 'Odprt Wiki (branje, zapis, nalaganje datotek je javno za vse)';
+$lang['i_pol1'] = 'Javni Wiki (branje za vse, zapis in nalaganje datotek za prijavljene uporabnike)';
+$lang['i_pol2'] = 'Zaprt Wiki (berejo in urejajo lahko le prijavljeni uporabniki)';
+$lang['i_retry'] = 'Ponovni poskus';
+$lang['i_license'] = 'Prosimo, izberite licenco, pod katero bo objsavljena vsebina:';
+$lang['mu_intro'] = 'Tukaj lahko naložite več datotek hkrati. Kliknite gumb "Brskaj", da jih dodate v vrsto. Kliknite "Naloži", ko ste končali';
+$lang['mu_gridname'] = 'Ime datoteke';
$lang['mu_gridsize'] = 'Velikost';
+$lang['mu_gridstat'] = 'Status';
+$lang['mu_namespace'] = 'Ime';
+$lang['mu_browse'] = 'Brskaj';
+$lang['mu_toobig'] = 'prevelika datoteka';
+$lang['mu_ready'] = 'pripravljena na nalaganje';
$lang['mu_done'] = 'končano';
+$lang['mu_fail'] = 'ni uspelo';
+$lang['mu_authfail'] = 'seja je potekla';
+$lang['mu_progress'] = '@PCT@% naloženo';
$lang['mu_filetypes'] = 'Dovoljeni tipi datotek';
+$lang['mu_info'] = 'datoteke naložene';
+$lang['mu_lasterr'] = 'Zadnja napaka:';
+$lang['recent_global'] = 'Trenutno gledate spremembe znotraj imenskega prostora <b>%s</b>. Lahko si <a href="%s">ogledate tudi spremembe, narejene v celotnem wikiju</a>.';
+$lang['years'] = '%d let nazaj';
+$lang['months'] = '%d mesecev nazaj';
+$lang['weeks'] = '%d tednov nazaj';
+$lang['days'] = '%d dni nazaj';
+$lang['hours'] = '%d ur nazaj';
+$lang['minutes'] = '%d minut nazaj';
+$lang['seconds'] = '%d sekund nazaj';
+$lang['wordblock'] = 'Vaša sprememba ni bila shranjena, ker vsebuje neželeno besedilo (spam).';
diff --git a/inc/lang/sl/subscr_digest.txt b/inc/lang/sl/subscr_digest.txt
new file mode 100644
index 000000000..983cab233
--- /dev/null
+++ b/inc/lang/sl/subscr_digest.txt
@@ -0,0 +1,20 @@
+Pozdravljeni!
+
+Stran @PAGE@ v wikiju @TITLE@ je bila spremenjena.
+Tu so spremembe:
+
+------------------------------------------------
+@DIFF@
+------------------------------------------------
+
+Stara revizija: @OLDPAGE@
+Nova revizija: @NEWPAGE@
+
+Za odjavo pošiljanja sprememb se prijavite v wiki na naslovu
+@DOKUWIKIURL@, nato obiščite
+@SUBSCRIBE@
+in se odjavite od sprememb strani in/ali imenskega prostora.
+
+--
+To sporočilo je generiral DokuWiki na naslovu
+@DUKOWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/sl/subscr_form.txt b/inc/lang/sl/subscr_form.txt
new file mode 100644
index 000000000..46be8c954
--- /dev/null
+++ b/inc/lang/sl/subscr_form.txt
@@ -0,0 +1,3 @@
+===== Urejanje naročnin ====
+
+Ta stran vam omogoča urejanje vaših naročnin za trenutno stran in imenski prostor. \ No newline at end of file
diff --git a/inc/lang/sl/subscr_list.txt b/inc/lang/sl/subscr_list.txt
new file mode 100644
index 000000000..f4cfbc268
--- /dev/null
+++ b/inc/lang/sl/subscr_list.txt
@@ -0,0 +1,17 @@
+Pozdravljeni!
+
+Strani v imenskem prostoru @PAGE@ wikija @TITLE@ so se spremenile.
+Tu so spremenjene strani:
+
+------------------------------------------------
+@DIFF@
+------------------------------------------------
+
+Za odjavo pošiljanja sprememb se prijavite v wiki na naslovu
+@DOKUWIKIURL@, nato obiščite
+@SUBSCRIBE@
+in se odjavite od sprememb strani in/ali imenskega prostora.
+
+--
+To sporočilo je generiral DokuWiki na naslovu
+@DUKOWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/sl/updateprofile.txt b/inc/lang/sl/updateprofile.txt
new file mode 100644
index 000000000..45aa7d92f
--- /dev/null
+++ b/inc/lang/sl/updateprofile.txt
@@ -0,0 +1,3 @@
+===== Posodobite svoj profil računa =====
+
+Posodobite le tista polja, ki jih želite spremeniti. Svojega uporabiškega imena ne morete spreminjati. \ No newline at end of file
diff --git a/inc/lang/sl/uploadmail.txt b/inc/lang/sl/uploadmail.txt
new file mode 100644
index 000000000..6006bd379
--- /dev/null
+++ b/inc/lang/sl/uploadmail.txt
@@ -0,0 +1,13 @@
+Datoteka je bila naložena v vaš DokuWiki. Tu so podatki:
+
+Datoteka: @MEDIA@
+Datum: @DATE@
+Brskalnik: @BROWSER@
+IP naslov: @IPADDRESS@
+Ponudnik: @HOSTNAME@
+Velikost: @SIZE@
+MIME tip: @MIME@
+Uporabnik: @USER@
+
+--
+Sporočilo je generiral DokuWiki na naslovu @DOKUWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/tr/lang.php b/inc/lang/tr/lang.php
index c6d20c805..0c8c1ff3f 100644
--- a/inc/lang/tr/lang.php
+++ b/inc/lang/tr/lang.php
@@ -4,11 +4,10 @@
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Selim Farsakoğlu <farsakogluselim@yahoo.de>
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -186,6 +185,9 @@ $lang['qb_h2'] = '2. Seviye Başlık';
$lang['qb_h3'] = '3. Seviye Başlık';
$lang['qb_h4'] = '4. Seviye Başlık';
$lang['qb_h5'] = '5. Seviye Başlık';
+$lang['qb_h'] = 'Başlık';
+$lang['qb_hs'] = 'Başlığı seç';
+$lang['qb_hplus'] = 'Daha yüksek başlık';
$lang['qb_link'] = 'İç Bağlantı';
$lang['qb_extlink'] = 'Dış Bağlantı';
$lang['qb_hr'] = 'Yatay Çizgi';
diff --git a/inc/lang/vi/lang.php b/inc/lang/vi/lang.php
index 168fe3595..750433910 100644
--- a/inc/lang/vi/lang.php
+++ b/inc/lang/vi/lang.php
@@ -103,4 +103,4 @@ $lang['qb_sig'] = 'Đặt chữ ký';
$lang['js']['del_confirm']= 'Xoá mục này?';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/mail.php b/inc/mail.php
index fb163585a..aa9d195d1 100644
--- a/inc/mail.php
+++ b/inc/mail.php
@@ -37,14 +37,16 @@ if (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', '['
*/
function mail_setup(){
global $conf;
- global $INFO;
+ global $USERINFO;
$replace = array();
- if(!empty($INFO['userinfo']['mail'])){
- $replace['@MAIL@'] = $INFO['userinfo']['mail'];
+ if(!empty($USERINFO['mail'])){
+ $replace['@MAIL@'] = $USERINFO['mail'];
}else{
- $replace['@MAIL@'] = 'noreply@'.parse_url(DOKU_URL,PHP_URL_HOST);
+ $host = @parse_url(DOKU_URL,PHP_URL_HOST);
+ if(!$host) $host = 'example.com';
+ $replace['@MAIL@'] = 'noreply@'.$host;
}
if(!empty($_SERVER['REMOTE_USER'])){
@@ -53,8 +55,8 @@ function mail_setup(){
$replace['@USER@'] = 'noreply';
}
- if(!empty($INFO['userinfo']['name'])){
- $replace['@NAME@'] = $INFO['userinfo']['name'];
+ if(!empty($USERINFO['name'])){
+ $replace['@NAME@'] = $USERINFO['name'];
}else{
$replace['@NAME@'] = '';
}
@@ -225,6 +227,7 @@ function mail_encode_address($string,$header='',$names=true){
*/
function mail_isvalid($email){
$validator = new EmailAddressValidator;
+ $validator->allowLocalAddresses = true;
return $validator->check_email_address($email);
}
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 42a485bdf..cd01dcae7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -311,14 +311,13 @@ function metaFN($id,$ext){
* returns an array of full paths to all metafiles of a given ID
*
* @author Esther Brunner <esther@kaffeehaus.ch>
+ * @author Michael Hamann <michael@content-space.de>
*/
function metaFiles($id){
- $name = noNS($id);
- $ns = getNS($id);
- $dir = ($ns) ? metaFN($ns,'').'/' : metaFN($ns,'');
- $files = array();
- $files = glob($dir.$name.'.*');
- return $files;
+ $basename = metaFN($id, '');
+ $files = glob($basename.'.*', GLOB_MARK);
+ // filter files like foo.bar.meta when $id == 'foo'
+ return $files ? preg_grep('/^'.preg_quote($basename, '/').'\.[^.\/]*$/u', $files) : array();
}
/**
@@ -344,10 +343,13 @@ function mediaFN($id){
*/
function localeFN($id){
global $conf;
- $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt';
+ $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.txt';
if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_INC.'inc/lang/en/'.$id.'.txt';
+ $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_INC.'inc/lang/en/'.$id.'.txt';
+ }
}
return $file;
}
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index a96e6b9db..4d0b56b44 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -1707,4 +1707,4 @@ class Doku_Handler_Block {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php
index 211945d8f..b5bcb9612 100644
--- a/inc/parser/lexer.php
+++ b/inc/parser/lexer.php
@@ -597,4 +597,4 @@ function Doku_Lexer_Escape($str) {
return preg_replace($chars, $escaped, $str);
}
-//Setup VIM: ex: et ts=4 sw=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 sw=4 :
diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php
index f635ea1d5..fc2c8cbc5 100644
--- a/inc/parser/metadata.php
+++ b/inc/parser/metadata.php
@@ -45,6 +45,9 @@ class Doku_Renderer_metadata extends Doku_Renderer {
if(!$this->persistent['date']['created']){
$this->persistent['date']['created'] = filectime(wikiFN($ID));
}
+ if(!isset($this->persistent['user'])){
+ $this->persistent['user'] = '';
+ }
if(!isset($this->persistent['creator'])){
$this->persistent['creator'] = '';
}
@@ -461,7 +464,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
} else if (is_string($title)){
return $title;
} else if (is_array($title)){
- return '['.$title['title'].']';
+ if($title['title']) return '['.$title['title'].']';
}
}
@@ -479,4 +482,4 @@ class Doku_Renderer_metadata extends Doku_Renderer {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 20f0e6ca3..b93760f3a 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -90,7 +90,6 @@ class Doku_Parser {
if ( $mode == 'base' ) {
continue;
}
-
$this->modes[$mode]->preConnect();
foreach ( array_keys($this->modes) as $cm ) {
@@ -218,11 +217,11 @@ class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_header extends Doku_Parser_Mode {
- function preConnect() {
+ function connectTo($mode) {
//we're not picky about the closing ones, two are enough
$this->Lexer->addSpecialPattern(
'[ \t]*={2,}[^\n]+={2,}[ \t]*(?=\n)',
- 'base',
+ $mode,
'header'
);
}
@@ -957,4 +956,4 @@ class Doku_Parser_Mode_emaillink extends Doku_Parser_Mode {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index a178b2457..7002fd0cb 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -319,4 +319,4 @@ class Doku_Renderer extends DokuWiki_Plugin {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 37900b2c3..9405d9420 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -734,9 +734,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$name = $this->_getLinkTitle($name, '', $isImage);
if ( !$isImage ) {
- $link['class']='mail JSnocheck';
+ $link['class']='mail';
} else {
- $link['class']='media JSnocheck';
+ $link['class']='media';
}
$address = $this->_xmlEntities($address);
@@ -1205,4 +1205,4 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/xhtmlsummary.php b/inc/parser/xhtmlsummary.php
index b187fef01..95f86cbef 100644
--- a/inc/parser/xhtmlsummary.php
+++ b/inc/parser/xhtmlsummary.php
@@ -87,4 +87,4 @@ class Doku_Renderer_xhtmlsummary extends Doku_Renderer_xhtml {
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/inc/parserutils.php b/inc/parserutils.php
index a50e3f4f3..6e349e984 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -10,6 +10,13 @@
if(!defined('DOKU_INC')) die('meh.');
/**
+ * For how many different pages shall the first heading be loaded from the
+ * metadata? When this limit is reached the title index is loaded and used for
+ * all following requests.
+ */
+if (!defined('P_GET_FIRST_HEADING_METADATA_LIMIT')) define('P_GET_FIRST_HEADING_METADATA_LIMIT', 10);
+
+/**
* Returns the parsed Wikitext in XHTML for the given id and revision.
*
* If $excuse is true an explanation is returned if the file
@@ -220,9 +227,15 @@ function p_get_instructions($text){
/**
* returns the metadata of a page
*
+ * @param string $id The id of the page the metadata should be returned from
+ * @param string $key The key of the metdata value that shall be read (by default everything) - separate hierarchies by " " like "date created"
+ * @param boolean $render If the page should be rendererd when the cache can't be used - default true
+ * @return mixed The requested metadata fields
+ *
* @author Esther Brunner <esther@kaffeehaus.ch>
+ * @author Michael Hamann <michael@content-space.de>
*/
-function p_get_metadata($id, $key='', $render=false){
+function p_get_metadata($id, $key='', $render=true){
global $ID;
// cache the current page
@@ -231,10 +244,26 @@ function p_get_metadata($id, $key='', $render=false){
$cache = ($ID == $id);
$meta = p_read_metadata($id, $cache);
- // metadata has never been rendered before - do it! (but not for non-existent pages)
- if ($render && !isset($meta['current']['description']['abstract']) && page_exists($id)){
- $meta = p_render_metadata($id, $meta);
- p_save_metadata($id, $meta);
+ // prevent recursive calls in the cache
+ static $recursion = false;
+ if (!$recursion && $render){
+ $recursion = true;
+
+ $cachefile = new cache_renderer($id, wikiFN($id), 'metadata');
+
+ if (page_exists($id) && !$cachefile->useCache()){
+ $old_meta = $meta;
+ $meta = p_render_metadata($id, $meta);
+ // only update the file when the metadata has been changed
+ if ($meta == $old_meta || p_save_metadata($id, $meta)) {
+ // store a timestamp in order to make sure that the cachefile is touched
+ $cachefile->storeCache(time());
+ } else {
+ msg('Unable to save metadata file. Hint: disk full; file permissions; safe_mode setting.',-1);
+ }
+ }
+
+ $recursion = false;
}
$val = $meta['current'];
@@ -603,9 +632,41 @@ function & p_get_renderer($mode) {
* headings ... and so on.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Michael Hamann <michael@content-space.de>
*/
function p_get_first_heading($id, $render=true){
- return p_get_metadata($id,'title',$render);
+ // counter how many titles have been requested using p_get_metadata
+ static $count = 1;
+ // the index of all titles, only loaded when many titles are requested
+ static $title_index = null;
+ // cache for titles requested using p_get_metadata
+ static $title_cache = array();
+
+ $id = cleanID($id);
+
+ // check if this title has already been requested
+ if (isset($title_cache[$id]))
+ return $title_cache[$id];
+
+ // check if already too many titles have been requested and probably
+ // using the title index is better
+ if ($count > P_GET_FIRST_HEADING_METADATA_LIMIT) {
+ if (is_null($title_index)) {
+ $pages = array_map('rtrim', idx_getIndex('page', ''));
+ $titles = array_map('rtrim', idx_getIndex('title', ''));
+ // check for corrupt title index #FS2076
+ if(count($pages) != count($titles)){
+ $titles = array_fill(0,count($pages),'');
+ @unlink($conf['indexdir'].'/title.idx'); // will be rebuilt in inc/init.php
+ }
+ $title_index = array_combine($pages, $titles);
+ }
+ return $title_index[$id];
+ }
+
+ ++$count;
+ $title_cache[$id] = p_get_metadata($id,'title',$render);
+ return $title_cache[$id];
}
/**
diff --git a/inc/plugin.php b/inc/plugin.php
index aff07c1e5..628ae39b0 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -88,10 +88,13 @@ class DokuWiki_Plugin {
function localFN($id) {
global $conf;
$plugin = $this->getPluginName();
- $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
- if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
+ if (!@file_exists($file)){
+ $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ }
}
return $file;
}
diff --git a/inc/search.php b/inc/search.php
index a6787c5d2..db0b008f0 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -624,4 +624,4 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
return $return;
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/subscription.php b/inc/subscription.php
index 08d4cb241..1b5476553 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -46,7 +46,7 @@ function subscription_filename($id) {
*/
function subscription_lock_filename ($id){
global $conf;
- return $conf['lockdir'].'/_subscr_' . $id . '.lock';
+ return $conf['lockdir'].'/_subscr_' . md5($id) . '.lock';
}
function subscription_lock($id) {
diff --git a/inc/template.php b/inc/template.php
index e2ea6e386..6d25a7171 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -685,7 +685,7 @@ function tpl_searchform($ajax=true,$autocomplete=true){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function tpl_breadcrumbs($sep='&raquo;'){
+function tpl_breadcrumbs($sep='&diams;'){
global $lang;
global $conf;
@@ -748,39 +748,27 @@ function tpl_youarehere($sep=' &raquo; '){
echo '<span class="bchead">'.$lang['youarehere'].': </span>';
// always print the startpage
- $title = useHeading('navigation') ? p_get_first_heading($conf['start']) : $conf['start'];
- if(!$title) $title = $conf['start'];
- tpl_link(wl($conf['start']),hsc($title),'title="'.$conf['start'].'"');
+ tpl_pagelink(':'.$conf['start']);
// print intermediate namespace links
$part = '';
for($i=0; $i<$count - 1; $i++){
$part .= $parts[$i].':';
$page = $part;
- resolve_pageid('',$page,$exists);
if ($page == $conf['start']) continue; // Skip startpage
// output
echo $sep;
- if($exists){
- $title = useHeading('navigation') ? p_get_first_heading($page) : $parts[$i];
- tpl_link(wl($page),hsc($title),'title="'.$page.'"');
- }else{
- tpl_link(wl($page),$parts[$i],'title="'.$page.'" class="wikilink2" rel="nofollow"');
- }
+ tpl_pagelink($page);
}
// print current page, skipping start page, skipping for namespace index
+ resolve_pageid('',$page,$exists);
if(isset($page) && $page==$part.$parts[$i]) return;
$page = $part.$parts[$i];
if($page == $conf['start']) return;
echo $sep;
- if(page_exists($page)){
- $title = useHeading('navigation') ? p_get_first_heading($page) : $parts[$i];
- tpl_link(wl($page),hsc($title),'title="'.$page.'"');
- }else{
- tpl_link(wl($page),$parts[$i],'title="'.$page.'" class="wikilink2" rel="nofollow"');
- }
+ tpl_pagelink($page);
return true;
}
@@ -1000,8 +988,6 @@ function tpl_indexerWebBug(){
global $INFO;
if(!$INFO['exists']) return false;
- if(isHiddenPage($ID)) return false; //no need to index hidden pages
-
$p = array();
$p['src'] = DOKU_BASE.'lib/exe/indexer.php?id='.rawurlencode($ID).
'&'.time();
@@ -1248,7 +1234,7 @@ function tpl_license($img='badge',$imgonly=false,$return=false){
}
if(!$imgonly) {
$out .= $lang['license'];
- $out .= '<a href="'.$lic['url'].'" rel="license" class="urlextern"';
+ $out .= ' <a href="'.$lic['url'].'" rel="license" class="urlextern"';
if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"';
$out .= '>'.$lic['name'].'</a>';
}
@@ -1372,5 +1358,5 @@ function tpl_getFavicon() {
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/inc/toolbar.php b/inc/toolbar.php
index 8bcf6f030..58d80043c 100644
--- a/inc/toolbar.php
+++ b/inc/toolbar.php
@@ -252,4 +252,4 @@ function toolbar_signature(){
return $sig;
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/install.php b/install.php
index ef3c848a9..9b852977f 100644
--- a/install.php
+++ b/install.php
@@ -460,7 +460,8 @@ function check_functions(){
'glob header ignore_user_abort ini_get mail mkdir '.
'ob_start opendir parse_ini_file readfile realpath '.
'rename rmdir serialize session_start unlink usleep '.
- 'preg_replace file_get_contents htmlspecialchars_decode');
+ 'preg_replace file_get_contents htmlspecialchars_decode '.
+ 'spl_autoload_register');
if (!function_exists('mb_substr')) {
$funcs[] = 'utf8_encode';
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index e9c59ca5d..1939a7bcb 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -8,7 +8,7 @@
//fix for Opera XMLHttpRequests
if(!count($_POST) && !empty($HTTP_RAW_POST_DATA)){
- parse_str($HTTP_RAW_POST_DATA, $_POST);
+ parse_str($HTTP_RAW_POST_DATA, $_POST);
}
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
@@ -20,25 +20,25 @@ header('Content-Type: text/html; charset=utf-8');
//call the requested function
-if(isset($_POST['call']))
- $call = $_POST['call'];
-else if(isset($_GET['call']))
- $call = $_GET['call'];
-else
- exit;
-
+if(isset($_POST['call'])){
+ $call = $_POST['call'];
+}else if(isset($_GET['call'])){
+ $call = $_GET['call'];
+}else{
+ exit;
+}
$callfn = 'ajax_'.$call;
if(function_exists($callfn)){
- $callfn();
+ $callfn();
}else{
- $evt = new Doku_Event('AJAX_CALL_UNKNOWN', $call);
- if ($evt->advise_before()) {
- print "AJAX call '".htmlspecialchars($call)."' unknown!\n";
- exit;
- }
- $evt->advise_after();
- unset($evt);
+ $evt = new Doku_Event('AJAX_CALL_UNKNOWN', $call);
+ if ($evt->advise_before()) {
+ print "AJAX call '".htmlspecialchars($call)."' unknown!\n";
+ exit;
+ }
+ $evt->advise_after();
+ unset($evt);
}
/**
@@ -47,33 +47,33 @@ if(function_exists($callfn)){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_qsearch(){
- global $conf;
- global $lang;
-
- $query = $_POST['q'];
- if(empty($query)) $query = $_GET['q'];
- if(empty($query)) return;
-
- $data = ft_pageLookup($query, true, useHeading('navigation'));
-
- if(!count($data)) return;
-
- print '<strong>'.$lang['quickhits'].'</strong>';
- print '<ul>';
- foreach($data as $id => $title){
- if (useHeading('navigation')) {
- $name = $title;
- } else {
- $ns = getNS($id);
- if($ns){
- $name = shorten(noNS($id), ' ('.$ns.')',30);
- }else{
- $name = $id;
+ global $conf;
+ global $lang;
+
+ $query = $_POST['q'];
+ if(empty($query)) $query = $_GET['q'];
+ if(empty($query)) return;
+
+ $data = ft_pageLookup($query, true, useHeading('navigation'));
+
+ if(!count($data)) return;
+
+ print '<strong>'.$lang['quickhits'].'</strong>';
+ print '<ul>';
+ foreach($data as $id => $title){
+ if (useHeading('navigation')) {
+ $name = $title;
+ } else {
+ $ns = getNS($id);
+ if($ns){
+ $name = noNS($id).' ('.$ns.')';
+ }else{
+ $name = $id;
+ }
}
+ echo '<li>' . html_wikilink(':'.$id,$name) . '</li>';
}
- echo '<li>' . html_wikilink(':'.$id,$name) . '</li>';
- }
- print '</ul>';
+ print '</ul>';
}
/**
@@ -83,36 +83,36 @@ function ajax_qsearch(){
* @author Mike Frysinger <vapier@gentoo.org>
*/
function ajax_suggestions() {
- global $conf;
- global $lang;
-
- $query = cleanID($_POST['q']);
- if(empty($query)) $query = cleanID($_GET['q']);
- if(empty($query)) return;
-
- $data = array();
- $data = ft_pageLookup($query);
- if(!count($data)) return;
- $data = array_keys($data);
-
- // limit results to 15 hits
- $data = array_slice($data, 0, 15);
- $data = array_map('trim',$data);
- $data = array_map('noNS',$data);
- $data = array_unique($data);
- sort($data);
-
- /* now construct a json */
- $suggestions = array(
- $query, // the original query
- $data, // some suggestions
- array(), // no description
- array() // no urls
- );
- $json = new JSON();
-
- header('Content-Type: application/x-suggestions+json');
- print $json->encode($suggestions);
+ global $conf;
+ global $lang;
+
+ $query = cleanID($_POST['q']);
+ if(empty($query)) $query = cleanID($_GET['q']);
+ if(empty($query)) return;
+
+ $data = array();
+ $data = ft_pageLookup($query);
+ if(!count($data)) return;
+ $data = array_keys($data);
+
+ // limit results to 15 hits
+ $data = array_slice($data, 0, 15);
+ $data = array_map('trim',$data);
+ $data = array_map('noNS',$data);
+ $data = array_unique($data);
+ sort($data);
+
+ /* now construct a json */
+ $suggestions = array(
+ $query, // the original query
+ $data, // some suggestions
+ array(), // no description
+ array() // no urls
+ );
+ $json = new JSON();
+
+ header('Content-Type: application/x-suggestions+json');
+ print $json->encode($suggestions);
}
/**
@@ -121,32 +121,32 @@ function ajax_suggestions() {
* Andreas Gohr <andi@splitbrain.org>
*/
function ajax_lock(){
- global $conf;
- global $lang;
- $id = cleanID($_POST['id']);
- if(empty($id)) return;
-
- if(!checklock($id)){
- lock($id);
- echo 1;
- }
-
- if($conf['usedraft'] && $_POST['wikitext']){
- $client = $_SERVER['REMOTE_USER'];
- if(!$client) $client = clientIP(true);
+ global $conf;
+ global $lang;
+ $id = cleanID($_POST['id']);
+ if(empty($id)) return;
+
+ if(!checklock($id)){
+ lock($id);
+ echo 1;
+ }
- $draft = array('id' => $id,
- 'prefix' => substr($_POST['prefix'], 0, -1),
- 'text' => $_POST['wikitext'],
- 'suffix' => $_POST['suffix'],
- 'date' => (int) $_POST['date'],
- 'client' => $client,
- );
- $cname = getCacheName($draft['client'].$id,'.draft');
- if(io_saveFile($cname,serialize($draft))){
- echo $lang['draftdate'].' '.dformat();
+ if($conf['usedraft'] && $_POST['wikitext']){
+ $client = $_SERVER['REMOTE_USER'];
+ if(!$client) $client = clientIP(true);
+
+ $draft = array('id' => $id,
+ 'prefix' => substr($_POST['prefix'], 0, -1),
+ 'text' => $_POST['wikitext'],
+ 'suffix' => $_POST['suffix'],
+ 'date' => (int) $_POST['date'],
+ 'client' => $client,
+ );
+ $cname = getCacheName($draft['client'].$id,'.draft');
+ if(io_saveFile($cname,serialize($draft))){
+ echo $lang['draftdate'].' '.dformat();
+ }
}
- }
}
@@ -156,14 +156,14 @@ function ajax_lock(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_draftdel(){
- $id = cleanID($_REQUEST['id']);
- if(empty($id)) return;
+ $id = cleanID($_REQUEST['id']);
+ if(empty($id)) return;
- $client = $_SERVER['REMOTE_USER'];
- if(!$client) $client = clientIP(true);
+ $client = $_SERVER['REMOTE_USER'];
+ if(!$client) $client = clientIP(true);
- $cname = getCacheName($client.$id,'.draft');
- @unlink($cname);
+ $cname = getCacheName($client.$id,'.draft');
+ @unlink($cname);
}
/**
@@ -172,22 +172,22 @@ function ajax_draftdel(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_medians(){
- global $conf;
-
- // wanted namespace
- $ns = cleanID($_POST['ns']);
- $dir = utf8_encodeFN(str_replace(':','/',$ns));
-
- $lvl = count(explode(':',$ns));
-
- $data = array();
- search($data,$conf['mediadir'],'search_index',array('nofiles' => true),$dir);
- foreach($data as $item){
- $item['level'] = $lvl+1;
- echo media_nstree_li($item);
- echo media_nstree_item($item);
- echo '</li>';
- }
+ global $conf;
+
+ // wanted namespace
+ $ns = cleanID($_POST['ns']);
+ $dir = utf8_encodeFN(str_replace(':','/',$ns));
+
+ $lvl = count(explode(':',$ns));
+
+ $data = array();
+ search($data,$conf['mediadir'],'search_index',array('nofiles' => true),$dir);
+ foreach($data as $item){
+ $item['level'] = $lvl+1;
+ echo media_nstree_li($item);
+ echo media_nstree_item($item);
+ echo '</li>';
+ }
}
/**
@@ -196,11 +196,11 @@ function ajax_medians(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_medialist(){
- global $conf;
- global $NS;
+ global $conf;
+ global $NS;
- $NS = $_POST['ns'];
- tpl_mediaContent(true);
+ $NS = $_POST['ns'];
+ tpl_mediaContent(true);
}
/**
@@ -209,24 +209,24 @@ function ajax_medialist(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_index(){
- global $conf;
-
- // wanted namespace
- $ns = cleanID($_POST['idx']);
- $dir = utf8_encodeFN(str_replace(':','/',$ns));
-
- $lvl = count(explode(':',$ns));
-
- $data = array();
- search($data,$conf['datadir'],'search_index',array('ns' => $ns),$dir);
- foreach($data as $item){
- $item['level'] = $lvl+1;
- echo html_li_index($item);
- echo '<div class="li">';
- echo html_list_index($item);
- echo '</div>';
- echo '</li>';
- }
+ global $conf;
+
+ // wanted namespace
+ $ns = cleanID($_POST['idx']);
+ $dir = utf8_encodeFN(str_replace(':','/',$ns));
+
+ $lvl = count(explode(':',$ns));
+
+ $data = array();
+ search($data,$conf['datadir'],'search_index',array('ns' => $ns),$dir);
+ foreach($data as $item){
+ $item['level'] = $lvl+1;
+ echo html_li_index($item);
+ echo '<div class="li">';
+ echo html_list_index($item);
+ echo '</div>';
+ echo '</li>';
+ }
}
/**
@@ -235,108 +235,106 @@ function ajax_index(){
* @author Andreas Gohr <gohr@cosmocode.de>
*/
function ajax_linkwiz(){
- global $conf;
- global $lang;
-
- $q = ltrim($_POST['q'],':');
- $id = noNS($q);
- $ns = getNS($q);
-
- $ns = cleanID($ns);
- $id = cleanID($id);
-
- $nsd = utf8_encodeFN(str_replace(':','/',$ns));
- $idd = utf8_encodeFN(str_replace(':','/',$id));
-
- $data = array();
- if($q && !$ns){
-
- // use index to lookup matching pages
- $pages = array();
- $pages = ft_pageLookup($id,true);
-
- // result contains matches in pages and namespaces
- // we now extract the matching namespaces to show
- // them seperately
- $dirs = array();
-
-
- foreach($pages as $pid => $title){
- if(strpos(noNS($pid),$id) === false){
- // match was in the namespace
- $dirs[getNS($pid)] = 1; // assoc array avoids dupes
- }else{
- // it is a matching page, add it to the result
- $data[] = array(
- 'id' => $pid,
- 'title' => $title,
- 'type' => 'f',
- );
- }
- unset($pages[$pid]);
- }
- foreach($dirs as $dir => $junk){
- $data[] = array(
- 'id' => $dir,
- 'type' => 'd',
- );
- }
+ global $conf;
+ global $lang;
+
+ $q = ltrim($_POST['q'],':');
+ $id = noNS($q);
+ $ns = getNS($q);
+
+ $ns = cleanID($ns);
+ $id = cleanID($id);
+
+ $nsd = utf8_encodeFN(str_replace(':','/',$ns));
+ $idd = utf8_encodeFN(str_replace(':','/',$id));
+
+ $data = array();
+ if($q && !$ns){
+
+ // use index to lookup matching pages
+ $pages = array();
+ $pages = ft_pageLookup($id,true);
+
+ // result contains matches in pages and namespaces
+ // we now extract the matching namespaces to show
+ // them seperately
+ $dirs = array();
+
+ foreach($pages as $pid => $title){
+ if(strpos(noNS($pid),$id) === false){
+ // match was in the namespace
+ $dirs[getNS($pid)] = 1; // assoc array avoids dupes
+ }else{
+ // it is a matching page, add it to the result
+ $data[] = array(
+ 'id' => $pid,
+ 'title' => $title,
+ 'type' => 'f',
+ );
+ }
+ unset($pages[$pid]);
+ }
+ foreach($dirs as $dir => $junk){
+ $data[] = array(
+ 'id' => $dir,
+ 'type' => 'd',
+ );
+ }
- }else{
-
- $opts = array(
- 'depth' => 1,
- 'listfiles' => true,
- 'listdirs' => true,
- 'pagesonly' => true,
- 'firsthead' => true,
- 'sneakyacl' => $conf['sneaky_index'],
- );
- if($id) $opts['filematch'] = '^.*\/'.$id;
- if($id) $opts['dirmatch'] = '^.*\/'.$id;
- search($data,$conf['datadir'],'search_universal',$opts,$nsd);
-
- // add back to upper
- if($ns){
- array_unshift($data,array(
- 'id' => getNS($ns),
- 'type' => 'u',
- ));
- }
- }
+ }else{
- // fixme sort results in a useful way ?
+ $opts = array(
+ 'depth' => 1,
+ 'listfiles' => true,
+ 'listdirs' => true,
+ 'pagesonly' => true,
+ 'firsthead' => true,
+ 'sneakyacl' => $conf['sneaky_index'],
+ );
+ if($id) $opts['filematch'] = '^.*\/'.$id;
+ if($id) $opts['dirmatch'] = '^.*\/'.$id;
+ search($data,$conf['datadir'],'search_universal',$opts,$nsd);
+
+ // add back to upper
+ if($ns){
+ array_unshift($data,array(
+ 'id' => getNS($ns),
+ 'type' => 'u',
+ ));
+ }
+ }
- if(!count($data)){
- echo $lang['nothingfound'];
- exit;
- }
+ // fixme sort results in a useful way ?
- // output the found data
- $even = 1;
- foreach($data as $item){
- $even *= -1; //zebra
+ if(!count($data)){
+ echo $lang['nothingfound'];
+ exit;
+ }
- if(($item['type'] == 'd' || $item['type'] == 'u') && $item['id']) $item['id'] .= ':';
- $link = wl($item['id']);
+ // output the found data
+ $even = 1;
+ foreach($data as $item){
+ $even *= -1; //zebra
- echo '<div class="'.(($even > 0)?'even':'odd').' type_'.$item['type'].'">';
+ if(($item['type'] == 'd' || $item['type'] == 'u') && $item['id']) $item['id'] .= ':';
+ $link = wl($item['id']);
+ echo '<div class="'.(($even > 0)?'even':'odd').' type_'.$item['type'].'">';
- if($item['type'] == 'u'){
- $name = $lang['upperns'];
- }else{
- $name = htmlspecialchars($item['id']);
- }
+ if($item['type'] == 'u'){
+ $name = $lang['upperns'];
+ }else{
+ $name = htmlspecialchars($item['id']);
+ }
- echo '<a href="'.$link.'" title="'.htmlspecialchars($item['id']).'" class="wikilink1">'.$name.'</a>';
+ echo '<a href="'.$link.'" title="'.htmlspecialchars($item['id']).'" class="wikilink1">'.$name.'</a>';
- if($item['title']){
- echo '<span>'.htmlspecialchars($item['title']).'</span>';
+ if($item['title']){
+ echo '<span>'.htmlspecialchars($item['title']).'</span>';
+ }
+ echo '</div>';
}
- echo '</div>';
- }
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 76f40c7bb..4db81de0b 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -122,6 +122,9 @@ function css_out(){
// apply style replacements
$css = css_applystyle($css,$tplinc);
+
+ // place all @import statements at the top of the file
+ $css = css_moveimports($css);
// compress whitespace and comments
if($conf['compress']){
@@ -264,7 +267,8 @@ function css_loadfile($file,$location=''){
$css = io_readFile($file);
if(!$location) return $css;
- $css = preg_replace('#(url\([ \'"]*)((?!/|http://|https://| |\'|"))#','\\1'.$location.'\\3',$css);
+ $css = preg_replace('#(url\([ \'"]*)(?!/|http://|https://| |\'|")#','\\1'.$location,$css);
+ $css = preg_replace('#(@import\s+[\'"])(?!/|http://|https://)#', '\\1'.$location, $css);
return $css;
}
@@ -297,6 +301,29 @@ function css_pluginstyles($mode='screen'){
}
/**
+ * Move all @import statements in a combined stylesheet to the top so they
+ * aren't ignored by the browser.
+ *
+ * @author Gabriel Birke <birke@d-scribe.de>
+ */
+function css_moveimports($css)
+{
+ if(!preg_match_all('/@import\s+(?:url\([^)]+\)|"[^"]+")\s*[^;]*;\s*/', $css, $matches, PREG_OFFSET_CAPTURE)) {
+ return $css;
+ }
+ $newCss = "";
+ $imports = "";
+ $offset = 0;
+ foreach($matches[0] as $match) {
+ $newCss .= substr($css, $offset, $match[1] - $offset);
+ $imports .= $match[0];
+ $offset = $match[1] + strlen($match[0]);
+ }
+ $newCss .= substr($css, $offset);
+ return $imports.$newCss;
+}
+
+/**
* Very simple CSS optimizer
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -330,4 +357,4 @@ function css_comment_cb($matches){
return $matches[0];
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index 680fd9ae4..3ad4f1937 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -198,4 +198,4 @@ function calc_cache($cache){
return -1; //cache endless
}
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index a5a7d6b2a..95e2af05b 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -31,7 +31,6 @@ $tmp = array(); // No event data
$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
runIndexer() or
- metaUpdate() or
runSitemapper() or
sendDigest() or
runTrimRecentChanges() or
@@ -139,51 +138,6 @@ function runIndexer(){
}
/**
- * Will render the metadata for the page if not exists yet
- *
- * This makes sure pages which are created from outside DokuWiki will
- * gain their data when viewed for the first time.
- */
-function metaUpdate(){
- global $ID;
- print "metaUpdate(): started".NL;
-
- if(!$ID) return false;
- $file = metaFN($ID, '.meta');
- echo "meta file: $file".NL;
-
- // rendering needed?
- if (@file_exists($file)) return false;
- if (!page_exists($ID)) return false;
-
- global $conf;
-
- // gather some additional info from changelog
- $info = io_grep($conf['changelog'],
- '/^(\d+)\t(\d+\.\d+\.\d+\.\d+)\t'.preg_quote($ID,'/').'\t([^\t]+)\t([^\t\n]+)/',
- 0,true);
-
- $meta = array();
- if(!empty($info)){
- $meta['date']['created'] = $info[0][1];
- foreach($info as $item){
- if($item[4] != '*'){
- $meta['date']['modified'] = $item[1];
- if($item[3]){
- $meta['contributor'][$item[3]] = $item[3];
- }
- }
- }
- }
-
- $meta = p_render_metadata($ID, $meta);
- p_save_metadata($ID, $meta);
-
- echo "metaUpdate(): finished".NL;
- return true;
-}
-
-/**
* Builds a Google Sitemap of all public pages known to the indexer
*
* The map is placed in the root directory named sitemap.xml.gz - This
@@ -312,6 +266,6 @@ function sendGIF(){
// Thinks it's got the whole image
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
// No trailing PHP closing tag - no output please!
// See Note at http://www.php.net/manual/en/language.basic-syntax.instruction-separation.php
diff --git a/lib/exe/js.php b/lib/exe/js.php
index f9682e1e9..117021308 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -396,4 +396,4 @@ function js_compress($s){
return trim($result);
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/opensearch.php b/lib/exe/opensearch.php
index f16b4f681..03a1632c4 100644
--- a/lib/exe/opensearch.php
+++ b/lib/exe/opensearch.php
@@ -35,4 +35,4 @@ echo ' <Url type="application/x-suggestions+json" template="'.
DOKU_URL.'lib/exe/ajax.php?call=suggestions&amp;q={searchTerms}" />'.NL;
echo '</OpenSearchDescription>'.NL;
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index 84068f96e..3d275cb2b 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -7,7 +7,7 @@ if(isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
/**
* Increased whenever the API is changed
*/
-define('DOKU_XMLRPC_API_VERSION',4);
+define('DOKU_XMLRPC_API_VERSION',5);
require_once(DOKU_INC.'inc/init.php');
session_write_close(); //close session
@@ -143,6 +143,13 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
true
);
+ $this->addCallback(
+ 'dokuwiki.appendPage',
+ 'this:appendPage',
+ array('int', 'string', 'string', 'struct'),
+ 'Append text to a wiki page.'
+ );
+
/* Wiki API v2 http://www.jspwiki.org/wiki/WikiRPCInterface2 */
$this->addCallback(
'wiki.getRPCVersionSupported',
@@ -289,6 +296,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Return a raw wiki page
*/
function rawPage($id,$rev=''){
+ $id = cleanID($id);
if(auth_quickaclcheck($id) < AUTH_READ){
return new IXR_Error(1, 'You are not allowed to read this page');
}
@@ -344,6 +352,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Return a wiki page rendered to html
*/
function htmlPage($id,$rev=''){
+ $id = cleanID($id);
if(auth_quickaclcheck($id) < AUTH_READ){
return new IXR_Error(1, 'You are not allowed to read this page');
}
@@ -480,6 +489,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Return some basic data about a page
*/
function pageInfo($id,$rev=''){
+ $id = cleanID($id);
if(auth_quickaclcheck($id) < AUTH_READ){
return new IXR_Error(1, 'You are not allowed to read this page');
}
@@ -557,11 +567,23 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
}
/**
+ * Appends text to a wiki page.
+ */
+ function appendPage($id, $text, $params) {
+ $currentpage = $this->rawPage($id);
+ if (!is_string($currentpage)) {
+ return $currentpage;
+ }
+ return $this->putPage($id, $currentpage.$text, $params);
+ }
+
+ /**
* Uploads a file to the wiki.
*
* Michael Klier <chi@chimeric.de>
*/
function putAttachment($id, $file, $params) {
+ $id = cleanID($id);
global $conf;
global $lang;
@@ -629,6 +651,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* @author Gina Haeussge <osd@foosel.net>
*/
function deleteAttachment($id){
+ $id = cleanID($id);
$auth = auth_quickaclcheck(getNS($id).':*');
if($auth < AUTH_DELETE) return new IXR_ERROR(1, "You don't have permissions to delete files.");
global $conf;
@@ -686,6 +709,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Returns the permissions of a given wiki page
*/
function aclCheck($id) {
+ $id = cleanID($id);
return auth_quickaclcheck($id);
}
@@ -695,13 +719,14 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* @author Michael Klier <chi@chimeric.de>
*/
function listLinks($id) {
+ $id = cleanID($id);
if(auth_quickaclcheck($id) < AUTH_READ){
return new IXR_Error(1, 'You are not allowed to read this page');
}
$links = array();
// resolve page instructions
- $ins = p_cached_instructions(wikiFN(cleanID($id)));
+ $ins = p_cached_instructions(wikiFN($id));
// instantiate new Renderer - needed for interwiki links
include(DOKU_INC.'inc/parser/xhtml.php');
@@ -809,6 +834,10 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* @author Michael Klier <chi@chimeric.de>
*/
function pageVersions($id, $first) {
+ $id = cleanID($id);
+ if(auth_quickaclcheck($id) < AUTH_READ){
+ return new IXR_Error(1, 'You are not allowed to read this page');
+ }
global $conf;
$versions = array();
@@ -884,7 +913,8 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
$unlockfail = array();
foreach((array) $set['lock'] as $id){
- if(checklock($id)){
+ $id = cleanID($id);
+ if(auth_quickaclcheck($id) < AUTH_EDIT || checklock($id)){
$lockfail[] = $id;
}else{
lock($id);
@@ -893,10 +923,11 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
}
foreach((array) $set['unlock'] as $id){
- if(unlock($id)){
- $unlocked[] = $id;
- }else{
+ $id = cleanID($id);
+ if(auth_quickaclcheck($id) < AUTH_EDIT || !unlock($id)){
$unlockfail[] = $id;
+ }else{
+ $unlocked[] = $id;
}
}
@@ -929,4 +960,4 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
$server = new dokuwiki_xmlrpc_server();
-// vim:ts=4:sw=4:et:enc=utf-8:
+// vim:ts=4:sw=4:et:
diff --git a/lib/images/interwiki/paypal.gif b/lib/images/interwiki/paypal.gif
new file mode 100644
index 000000000..4a063b4a5
--- /dev/null
+++ b/lib/images/interwiki/paypal.gif
Binary files differ
diff --git a/lib/images/interwiki/sb.gif b/lib/images/interwiki/sb.gif
index e272a29b7..8771b346d 100644
--- a/lib/images/interwiki/sb.gif
+++ b/lib/images/interwiki/sb.gif
Binary files differ
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 84932f7ac..3e7bd8121 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -765,7 +765,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
//build code
$ret .= '<label for="pbox'.$label.'" title="'.$this->getLang('acl_perm'.$perm).'"'.$class.'>';
- $ret .= '<input '.html_attbuild($atts).' />&nbsp;';
+ $ret .= '<input '.buildAttributes($atts).' />&nbsp;';
$ret .= $this->getLang('acl_perm'.$perm);
$ret .= '</label>'.NL;
}
diff --git a/lib/plugins/acl/lang/de-informal/lang.php b/lib/plugins/acl/lang/de-informal/lang.php
index fdb6f5a89..e24584a55 100644
--- a/lib/plugins/acl/lang/de-informal/lang.php
+++ b/lib/plugins/acl/lang/de-informal/lang.php
@@ -6,6 +6,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['admin_acl'] = 'Zugriffskontrollsystem Management';
$lang['acl_group'] = 'Gruppe';
diff --git a/lib/plugins/acl/lang/de/lang.php b/lib/plugins/acl/lang/de/lang.php
index 0d30fe7a1..3c6bf8cf0 100644
--- a/lib/plugins/acl/lang/de/lang.php
+++ b/lib/plugins/acl/lang/de/lang.php
@@ -17,6 +17,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['admin_acl'] = 'Zugangsverwaltung';
$lang['acl_group'] = 'Gruppe';
diff --git a/lib/plugins/acl/lang/en/lang.php b/lib/plugins/acl/lang/en/lang.php
index 38ff20c88..779614d32 100644
--- a/lib/plugins/acl/lang/en/lang.php
+++ b/lib/plugins/acl/lang/en/lang.php
@@ -43,4 +43,4 @@ $lang['acl_perm8'] = 'Upload';
$lang['acl_perm16'] = 'Delete';
$lang['acl_new'] = 'Add new Entry';
$lang['acl_mod'] = 'Modify Entry';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/lib/plugins/acl/lang/et/lang.php b/lib/plugins/acl/lang/et/lang.php
index e90d5eaa9..2f7208b7c 100644
--- a/lib/plugins/acl/lang/et/lang.php
+++ b/lib/plugins/acl/lang/et/lang.php
@@ -20,4 +20,4 @@ $lang['acl_perm2'] = 'Toimetamine';
$lang['acl_perm4'] = 'Tekitamine';
$lang['acl_perm8'] = 'Üles laadimine';
$lang['acl_new'] = 'Uue kirje lisamine';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/lib/plugins/acl/lang/he/lang.php b/lib/plugins/acl/lang/he/lang.php
index ac00730dd..91025f4b8 100644
--- a/lib/plugins/acl/lang/he/lang.php
+++ b/lib/plugins/acl/lang/he/lang.php
@@ -7,6 +7,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['admin_acl'] = 'ניהול רשימת בקרת גישות';
$lang['acl_group'] = 'קבוצה';
diff --git a/lib/plugins/acl/lang/ko/lang.php b/lib/plugins/acl/lang/ko/lang.php
index 43a5ceeeb..6f4e991cb 100644
--- a/lib/plugins/acl/lang/ko/lang.php
+++ b/lib/plugins/acl/lang/ko/lang.php
@@ -10,6 +10,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['admin_acl'] = '접근 제어 목록 관리';
$lang['acl_group'] = '그룹';
diff --git a/lib/plugins/acl/lang/la/help.txt b/lib/plugins/acl/lang/la/help.txt
index ba974f48c..553884c30 100644
--- a/lib/plugins/acl/lang/la/help.txt
+++ b/lib/plugins/acl/lang/la/help.txt
@@ -1,8 +1,8 @@
=== Auxilium: ===
-Hic facultates spatiorum nominis paginarumque addere delereue potes.
+Hic facultates generum paginarumque addere delereue potes.
-Tabella sinistra omnes paginas spatia nominisque ostendit.
+Tabella sinistra omnes paginas generaque ostendit.
His campis mutare facultates electorum Sodalium Gregumque potes.
diff --git a/lib/plugins/acl/lang/la/lang.php b/lib/plugins/acl/lang/la/lang.php
index dd6043602..941de1f79 100644
--- a/lib/plugins/acl/lang/la/lang.php
+++ b/lib/plugins/acl/lang/la/lang.php
@@ -2,25 +2,26 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
-$lang['admin_acl'] = 'Aditus Administrationis Aditus';
+$lang['admin_acl'] = 'Administratio Indicis Custodiae Aditus';
$lang['acl_group'] = 'Grex';
$lang['acl_user'] = 'Sodalis';
$lang['acl_perms'] = 'Facultas:';
$lang['page'] = 'Pagina';
-$lang['namespace'] = 'Spatium nominis';
+$lang['namespace'] = 'Genus';
$lang['btn_select'] = 'eligere';
$lang['p_user_id'] = 'Sodalis <b class="acluser">%s</b> nunc has facultates paginae "<b class="aclpage">%s</b> habes: <i>%s</i>.';
-$lang['p_user_ns'] = 'Sodalis <b class="acluser">%s</b> nunc has facultates spatio nominis "<b class="aclns">%s</b> habes: <i>%s</i>.';
+$lang['p_user_ns'] = 'Sodalis <b class="acluser">%s</b> nunc has facultates generis "<b class="aclns">%s</b> habes: <i>%s</i>.';
$lang['p_group_id'] = 'Socius\a gregis <b class="aclgroup">%s</b> nunc has facultates paginae "<b class="aclpage">%s</b> habes: <i>%s</i>.';
-$lang['p_group_ns'] = 'Socius\a gregis <b class="aclgroup">%s</b> nunc has facultates paginae "<b class="aclns">%s</b> habes: <i>%s</i>.';
+$lang['p_group_ns'] = 'Socius\a gregis <b class="aclgroup">%s</b> nunc has facultates generis "<b class="aclns">%s</b> habes: <i>%s</i>.';
$lang['p_choose_id'] = '<b>Sodalis grexue</b> in campo insere ut facultates paginae <b class="aclpage">%s</b> uideas.';
-$lang['p_choose_ns'] = '<b>Sodalis grexue</b> in campo insere ut facultates paginae <b class="aclns">%s</b> uideas.';
-$lang['p_inherited'] = 'Caue: hae facultates et huic rei et aliis gregibus uel spatiis nominis legitimae sunt.';
+$lang['p_choose_ns'] = '<b>Sodalis grexue</b> in campo insere ut facultates generis <b class="aclns">%s</b> uideas.';
+$lang['p_inherited'] = 'Caue: hae facultates et huic rei et aliis gregibus uel generibus legitimae sunt.';
$lang['p_isadmin'] = 'Caue: electi greges semper plenum ius habent, eo quod ut magister\stra elegitur.';
-$lang['p_include'] = 'Maiores facultates minores includunt. Creare, onerare uel delere facultates solum spatis nominis, non paginis potes';
-$lang['current'] = 'Communes AAA leges';
-$lang['where'] = 'Pagina/Spatium nominis';
+$lang['p_include'] = 'Maiores facultates minores includunt. Creandi, onerandi uel delendi facultates solum generibus, non paginis sunt.';
+$lang['current'] = 'Communes ICA leges';
+$lang['where'] = 'Pagina/Genus';
$lang['who'] = 'Sodalis/Grex';
$lang['perm'] = 'Facultates';
$lang['acl_perm0'] = 'Nihil';
diff --git a/lib/plugins/acl/lang/ru/help.txt b/lib/plugins/acl/lang/ru/help.txt
index a3c1b4f64..7807105a8 100644
--- a/lib/plugins/acl/lang/ru/help.txt
+++ b/lib/plugins/acl/lang/ru/help.txt
@@ -1,11 +1,7 @@
-=== Краткая справка: ===
+=== Краткая справка ===
-На этой странице вы можете добавить или удалить права доступа к пространствам имён и страницам вашей вики.
-
-На панели слева отображены доступные пространства имён и страницы.
-
-Форма выше позволяет вам просмотреть и изменить права доступа для выбранного пользователя или группы.
-
-Текущие права доступа отображены в таблице ниже. Вы можете использовать её для быстрого удаления или изменения правил.
-
-Прочтение [[doku>acl|официальной документации по ACL]] может помочь вам в полном понимании работы управления правами доступа в «ДокуВики».
+На этой странице вы можете добавить или удалить права доступа к пространствам имён и страницам своей вики.\\
+На панели слева отображены доступные пространства имён и страницы.\\
+Форма выше позволяет вам просмотреть и изменить права доступа для выбранного пользователя или группы.\\
+Текущие права доступа отображены в таблице ниже. Вы можете использовать её для быстрого удаления или изменения правил.\\
+Прочтение [[doku>acl|официальной документации по ACL]] может помочь вам в полном понимании работы управления правами доступа в «ДокуВики».
diff --git a/lib/plugins/acl/lang/ru/lang.php b/lib/plugins/acl/lang/ru/lang.php
index 0c02dfbb1..f49e4b55a 100644
--- a/lib/plugins/acl/lang/ru/lang.php
+++ b/lib/plugins/acl/lang/ru/lang.php
@@ -19,7 +19,7 @@ $lang['acl_group'] = 'Группа';
$lang['acl_user'] = 'Пользователь';
$lang['acl_perms'] = 'Права доступа для';
$lang['page'] = 'Страница';
-$lang['namespace'] = 'Пространство имен';
+$lang['namespace'] = 'Пространство имён';
$lang['btn_select'] = 'Выбрать';
$lang['p_user_id'] = 'Сейчас пользователь <b class="acluser">%s</b> имеет следующие права на доступ к странице <b class="aclpage">%s</b>: <i>%s</i>.';
$lang['p_user_ns'] = 'Сейчас пользователь <b class="acluser">%s</b> имеет следующие права на доступ к пространству имён <b class="aclns">%s</b>: <i>%s</i>.';
diff --git a/lib/plugins/acl/lang/sl/lang.php b/lib/plugins/acl/lang/sl/lang.php
index 32141fbce..f6dec25ef 100644
--- a/lib/plugins/acl/lang/sl/lang.php
+++ b/lib/plugins/acl/lang/sl/lang.php
@@ -4,14 +4,29 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
+$lang['admin_acl'] = 'ACL administracija';
$lang['acl_group'] = 'Skupina';
$lang['acl_user'] = 'Uporabnik';
$lang['acl_perms'] = 'Dovoljenja za';
$lang['page'] = 'Stran';
+$lang['namespace'] = 'Imenski prostor';
$lang['btn_select'] = 'Izberi';
+$lang['p_user_id'] = 'Uporabnik %s ima trenutno naslednje pravice na strani %s: %s.';
+$lang['p_user_ns'] = 'Uporabnik %s ima trenutno naslednje pravice v imenskem prostoru %s: %s.';
+$lang['p_group_id'] = 'Uporabnikka skupina %s ima trenutno naslednje pravice na strani %s: %s.';
+$lang['p_group_ns'] = 'Uporabniška skupina %s ima trenutno naslednje pravice v imenskem prostoru %s: %s.';
+$lang['p_choose_id'] = 'Prosimo vnesite <b>uporabnika ali skupino</b> v zgornji obrazec za ogled ali urejanje pravic za stran %s.';
+$lang['p_choose_ns'] = 'Prosimo vnesite <b>uporabnika ali skupino</b> v zgornji obrazec za ogled ali urejanje pravic za imenski prostor %s.';
+$lang['p_inherited'] = 'Opomba: Te pravice niso bile posebej nastavljene, temveč prevzete iz drugih skupin ali višjih imenskih prostorov.';
+$lang['p_isadmin'] = 'Opomba: Izbrana skupina ali uporabnik imajo vedno vse pravice, ker so določeni kot superuporabniki.';
+$lang['p_include'] = 'Višje pravice vključujejo tudi nižje. ';
+$lang['current'] = 'Trenutna ACL pravila';
+$lang['where'] = 'Stran / Imenski prostor';
$lang['who'] = 'Uporabnik/Skupina';
$lang['perm'] = 'Dovoljenja';
+$lang['acl_perm0'] = 'Nič';
$lang['acl_perm1'] = 'Preberi';
$lang['acl_perm2'] = 'Uredi';
$lang['acl_perm4'] = 'Ustvari';
diff --git a/lib/plugins/acl/lang/tr/lang.php b/lib/plugins/acl/lang/tr/lang.php
index 45fbe7489..de96d2906 100644
--- a/lib/plugins/acl/lang/tr/lang.php
+++ b/lib/plugins/acl/lang/tr/lang.php
@@ -4,11 +4,10 @@
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Selim Farsakoğlu <farsakogluselim@yahoo.de>
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['admin_acl'] = 'Erişim Kontrol Listesi (ACL) Yönetimi';
$lang['acl_group'] = 'Grup';
diff --git a/lib/plugins/acl/lang/vi/lang.php b/lib/plugins/acl/lang/vi/lang.php
index 4458d806b..6237f79ba 100644
--- a/lib/plugins/acl/lang/vi/lang.php
+++ b/lib/plugins/acl/lang/vi/lang.php
@@ -18,4 +18,4 @@ $lang['acl_perm2'] = 'Biên soạn';
$lang['acl_perm4'] = 'Tạo';
$lang['acl_perm8'] = 'Tải lên';
$lang['acl_new'] = 'Thêm mục mới';
-//Setup VIM: ex: et ts=2 enc=utf-8 :
+//Setup VIM: ex: et ts=2 :
diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php
index 25f01b657..9a1fb9fdc 100644
--- a/lib/plugins/admin.php
+++ b/lib/plugins/admin.php
@@ -43,4 +43,4 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin {
return array();
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/config/lang/ar/lang.php b/lib/plugins/config/lang/ar/lang.php
index 5d0ff76b9..26cc16e5c 100644
--- a/lib/plugins/config/lang/ar/lang.php
+++ b/lib/plugins/config/lang/ar/lang.php
@@ -116,6 +116,7 @@ $lang['rss_update'] = 'تحديث تلقيم XML (ثوان)';
$lang['recent_days'] = 'مدة إبقاء أحدث التغييرات (ايام)';
$lang['rss_show_summary'] = 'تلقيم XML يظهر ملخصا في العنوان';
$lang['target____wiki'] = 'النافذة الهدف للروابط الداخلية';
+$lang['target____interwiki'] = 'النافذة الهدف للروابط الممرة interwiki';
$lang['target____extern'] = 'النافذة الهدف للروابط الخارجية';
$lang['target____media'] = 'النافذة الهدف لروابط الوسائط';
$lang['target____windows'] = 'النافذة الهدف لروابط النوافذ';
@@ -124,6 +125,7 @@ $lang['proxy____port'] = 'منفذ الوكيل';
$lang['proxy____user'] = 'اسم مستخدم الوكيل';
$lang['proxy____pass'] = 'كلمة سر الوكيل';
$lang['proxy____ssl'] = 'استخدم ssl للاتصال بالوكيل';
+$lang['proxy____except'] = 'تعبير شرطي لمقابلة العناوين التي ستتجاوز البروكسي.';
$lang['safemodehack'] = 'مكّن hack الوضع الآمن';
$lang['ftp____host'] = 'خادوم FTP ل hack الوضع الآمن';
$lang['ftp____port'] = 'منفذ FTP ل hack الوضع الآمن';
@@ -136,6 +138,7 @@ $lang['typography_o_1'] = 'استبعاد الاقتباس المفرد';
$lang['typography_o_2'] = 'تضمين علامات اقتباس مفردة (قد لا يعمل دائما)';
$lang['userewrite_o_0'] = 'لاشيء';
$lang['userewrite_o_1'] = '.htaccess';
+$lang['userewrite_o_2'] = 'دو';
$lang['deaccent_o_0'] = 'معطل';
$lang['gdlib_o_0'] = 'مكتبة GD غير متوفرة';
$lang['gdlib_o_1'] = 'الاصدار 1.x';
@@ -156,11 +159,15 @@ $lang['compression_o_0'] = 'لا شيء';
$lang['compression_o_gz'] = 'gzip';
$lang['compression_o_bz2'] = 'bz2';
$lang['xsendfile_o_0'] = 'لا تستخدم';
+$lang['xsendfile_o_1'] = 'ترويسة lighttpd مملوكة (قبل الاصدار 1.5)';
+$lang['xsendfile_o_2'] = 'ترويسة X-Sendfile قياسية';
+$lang['xsendfile_o_3'] = 'ترويسة Nginx X-Accel-Redirect مملوكة';
$lang['showuseras_o_loginname'] = 'اسم الدخول';
$lang['showuseras_o_username'] = 'اسم المستخدم الكامل';
$lang['showuseras_o_email'] = 'عنوان بريد المستخدم (مبهم تبعا لاعدادات حارس_البريد)';
$lang['showuseras_o_email_link'] = 'عنوان بريد المستخدم كـ مالتيو: رابط';
$lang['useheading_o_0'] = 'أبدا';
-$lang['useheading_o_navigation'] = 'ال';
+$lang['useheading_o_navigation'] = 'التنقل فقط';
$lang['useheading_o_content'] = 'محتوى الويكي فقط';
$lang['useheading_o_1'] = 'دائما';
+$lang['readdircache'] = 'المدة القصوى لتخزين ';
diff --git a/lib/plugins/config/lang/cs/intro.txt b/lib/plugins/config/lang/cs/intro.txt
index bad92ac8e..63381b84e 100644
--- a/lib/plugins/config/lang/cs/intro.txt
+++ b/lib/plugins/config/lang/cs/intro.txt
@@ -2,7 +2,7 @@
Tuto stránku můžete používat ke správě nastavení vaší instalace DokuWiki. Nápovědu pro konkrétní položky nastavení naleznete na [[doku>config]]. Pro další detaily o tomto pluginu viz [[doku>plugin:config]].
-Položky se světle červeným pozadím jsou chráněné a nelze je upravovat tímto pluginem. Položky s modrým pozadím jsou výchozí hodnoty a položky s bílým pozadím byly nastaveny lokálně v této konktétní instalaci. Modré i bílé položky je možné upravovat.
+Položky se světle červeným pozadím jsou chráněné a nelze je upravovat tímto pluginem. Položky s modrým pozadím jsou výchozí hodnoty a položky s bílým pozadím byly nastaveny lokálně v této konkrétní instalaci. Modré i bílé položky je možné upravovat.
Než opustíte tuto stránku, nezapomeňte stisknout tlačítko **Uložit**, jinak budou změny ztraceny.
diff --git a/lib/plugins/config/lang/cs/lang.php b/lib/plugins/config/lang/cs/lang.php
index 3f8c05f26..06839c1d0 100644
--- a/lib/plugins/config/lang/cs/lang.php
+++ b/lib/plugins/config/lang/cs/lang.php
@@ -11,7 +11,7 @@
*/
$lang['menu'] = 'Správa nastavení';
$lang['error'] = 'Nastavení nebyla změněna kvůli alespoň jedné neplatné položce,
-zkotrolujte prosím své úpravy a odešlete je znovu.<br />
+zkontrolujte prosím své úpravy a odešlete je znovu.<br />
Neplatné hodnoty se zobrazí v červeném rámečku.';
$lang['updated'] = 'Nastavení byla úspěšně upravena.';
$lang['nochoice'] = '(nejsou k dispozici žádné další volby)';
@@ -69,10 +69,10 @@ $lang['useheading'] = 'Používat první nadpis jako název stránky'
$lang['refcheck'] = 'Kontrolovat odkazy na média (před vymazáním)';
$lang['refshow'] = 'Počet zobrazených odkazů na média';
$lang['allowdebug'] = 'Povolit debugování. <b>Vypněte, pokud to nepotřebujete!</b>';
-$lang['usewordblock'] = 'Blokovat spam za použítí seznamu známých spamových slov';
+$lang['usewordblock'] = 'Blokovat spam za použití seznamu známých spamových slov';
$lang['indexdelay'] = 'Časová prodleva před indexací (v sekundách)';
$lang['relnofollow'] = 'Používat rel="nofollow" na externí odkazy';
-$lang['mailguard'] = 'Metoda "zamaskování" emailových addres';
+$lang['mailguard'] = 'Metoda "zamaskování" emailových adres';
$lang['iexssprotect'] = 'Zkontrolovat nahrané soubory vůči možnému škodlivému JavaScriptu či HTML';
$lang['showuseras'] = 'Co se má přesně zobrazit, když se ukazuje uživatel, který naposledy editoval stránku';
$lang['useacl'] = 'Používat přístupová práva (ACL)';
@@ -95,7 +95,7 @@ vnořené jmenné prostory, k nimž právo má, budou přesto skryty.
To může mít za následek, že index bude při některých
nastaveních ACL nepoužitelný.';
$lang['auth_security_timeout'] = 'Časový limit pro autentikaci (v sekundách)';
-$lang['securecookie'] = 'Má prohlížeč posílat cookies nastavené přes HTTPS opět jen přes HTTPS? Vypňete tuto volbu, pokud chcete, aby bylo pomocí SSL zabezpečeno pouze přihlašování do wiki, ale obsah budete prohlížet nezabezpečeně.';
+$lang['securecookie'] = 'Má prohlížeč posílat cookies nastavené přes HTTPS opět jen přes HTTPS? Vypněte tuto volbu, pokud chcete, aby bylo pomocí SSL zabezpečeno pouze přihlašování do wiki, ale obsah budete prohlížet nezabezpečeně.';
$lang['xmlrpc'] = 'Povolit/Zakázat rozhraní XML-RPC.';
$lang['xmlrpcuser'] = 'Omezit přístup pomocí XML-RPC pouze na zde zadané skupiny či uživatele (oddělené čárkami). Necháte-li pole prázdné, dáte přístup komukoliv.';
$lang['updatecheck'] = 'Kontrolovat aktualizace a bezpečnostní varování? DokuWiki potřebuje pro tuto funkci přístup k splitbrain.org';
@@ -112,7 +112,7 @@ $lang['locktime'] = 'Maximální životnost zámkových souborů (v
$lang['fetchsize'] = 'Maximální velikost souboru (v bajtech), co ještě fetch.php bude stahovat z externích zdrojů';
$lang['notify'] = 'Posílat oznámení o změnách na následující emailovou adresu';
$lang['registernotify'] = 'Posílat informace o nově registrovaných uživatelích na tuto mailovou adresu';
-$lang['mailfrom'] = 'Emailová addresa, která se bude používat pro automatické maily';
+$lang['mailfrom'] = 'Emailová adresa, která se bude používat pro automatické maily';
$lang['gzip_output'] = 'Používat pro xhtml Content-Encoding gzip';
$lang['gdlib'] = 'Verze GD knihovny';
$lang['im_convert'] = 'Cesta k nástroji convert z balíku ImageMagick';
diff --git a/lib/plugins/config/lang/de-informal/lang.php b/lib/plugins/config/lang/de-informal/lang.php
index 01beeeeb9..f6ddaa8e9 100644
--- a/lib/plugins/config/lang/de-informal/lang.php
+++ b/lib/plugins/config/lang/de-informal/lang.php
@@ -6,6 +6,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Einstellungen';
$lang['error'] = 'Einstellungen wurden nicht aktualisiert auf Grund eines ungültigen Wertes. Bitte überprüfe deine Änderungen und versuche es erneut.<br />Die/der ungültige(n) Wert(e) werden durch eine rote Umrandung hervorgehoben.';
@@ -102,6 +103,7 @@ $lang['fetchsize'] = 'Maximale Größe (in Bytes), die fetch.php von
$lang['notify'] = 'Sende Änderungsbenachrichtigungen an diese E-Mail-Adresse.';
$lang['registernotify'] = 'Sende Information bei neu registrierten Benutzern an diese E-Mail-Adresse.';
$lang['mailfrom'] = 'Absenderadresse für automatisch erzeugte E-Mails';
+$lang['mailprefix'] = 'Präfix für E-Mail-Betreff beim automatischen Versand von Benachrichtigungen';
$lang['gzip_output'] = 'Seiten mit gzip komprimiert ausliefern';
$lang['gdlib'] = 'GD Lib Version';
$lang['im_convert'] = 'Pfad zu ImageMagicks Konvertierwerkzeug';
diff --git a/lib/plugins/config/lang/de/lang.php b/lib/plugins/config/lang/de/lang.php
index aa763da03..b26df4993 100644
--- a/lib/plugins/config/lang/de/lang.php
+++ b/lib/plugins/config/lang/de/lang.php
@@ -13,6 +13,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Konfiguration';
$lang['error'] = 'Die Einstellungen wurden wegen einer fehlerhaften Eingabe nicht gespeichert.
@@ -111,6 +113,7 @@ $lang['fetchsize'] = 'Maximale Größe (in Bytes), die fetch.php von
$lang['notify'] = 'Änderungsmitteilungen an diese E-Mail-Adresse versenden';
$lang['registernotify'] = 'Information über neu registrierte Nutzer an diese E-Mail-Adresse senden';
$lang['mailfrom'] = 'Absender-E-Mail-Adresse für automatische Mails';
+$lang['mailprefix'] = 'Präfix für E-Mail-Betreff beim automatischen Versand von Benachrichtigungen';
$lang['gzip_output'] = 'Seiten mit gzip komprimiert ausliefern';
$lang['gdlib'] = 'GD Lib Version';
$lang['im_convert'] = 'Pfad zu ImageMagicks Konvertierwerkzeug';
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index 85214bf98..d7a544850 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -125,6 +125,7 @@ $lang['fetchsize'] = 'Maximum size (bytes) fetch.php may download from extern'
$lang['notify'] = 'Send change notifications to this email address';
$lang['registernotify'] = 'Send info on newly registered users to this email address';
$lang['mailfrom'] = 'Email address to use for automatic mails';
+$lang['mailprefix'] = 'Email subject prefix to use for automatic mails';
$lang['gzip_output'] = 'Use gzip Content-Encoding for xhtml';
$lang['gdlib'] = 'GD Lib version';
$lang['im_convert'] = 'Path to ImageMagick\'s convert tool';
diff --git a/lib/plugins/config/lang/he/lang.php b/lib/plugins/config/lang/he/lang.php
index a39d0ab5c..ab4a8928e 100644
--- a/lib/plugins/config/lang/he/lang.php
+++ b/lib/plugins/config/lang/he/lang.php
@@ -7,6 +7,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['menu'] = 'הגדרות תצורה';
$lang['error'] = 'ההגדרות לא עודכנו בגלל ערך לא תקף, נא לעיין בשינויים ולשלוח שנית.
diff --git a/lib/plugins/config/lang/ko/lang.php b/lib/plugins/config/lang/ko/lang.php
index efac643ab..13f5efefe 100644
--- a/lib/plugins/config/lang/ko/lang.php
+++ b/lib/plugins/config/lang/ko/lang.php
@@ -7,6 +7,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['menu'] = '환경 설정';
$lang['error'] = '잘못된 값때문에 설정들을 변경할 수 없습니다. 수정한 값들을 검사하고 확인을 누르기 바랍니다.
@@ -89,12 +90,15 @@ $lang['sneaky_index'] = '기본적으로, DokuWiki는 색인 목록에
특정 ACL 설정은 색인 사용이 불가능하게 할 수도 있습니다.';
$lang['auth_security_timeout'] = '인증 보안 초과 시간(초)';
$lang['securecookie'] = 'HTTPS로 보내진 쿠키는 HTTPS에만 적용 할까요? 위키의 로그인 페이지만 SSL로 암호화 하고 위키 페이지는 그렇지 않은경우 꺼야 합니다.';
+$lang['xmlrpc'] = 'XML-RPC 인터페이스 지원/무시';
+$lang['xmlrpcuser'] = '주어진 그룹이나 유저들에게만 XML-RPC접근을 허락하려면 컴마로 구분하여 적으세요. 비어두면 모두에게 허용됩니다.';
$lang['updatecheck'] = '업데이트와 보안 문제를 검사(DokuWiki를 splitbrain.org에 연결해야 합니다.)';
$lang['userewrite'] = 'URL rewriting기능 사용';
$lang['useslash'] = 'URL에서 네임스페이스 구분자로 슬래쉬 문자 사용';
$lang['usedraft'] = '편집하는 동안 자동으로 문서 초안 저장';
$lang['sepchar'] = '페이지 이름 단어 구분자';
$lang['canonical'] = '완전한 canonical URL 사용';
+$lang['fnencode'] = '아스키가 아닌 파일이르믈 인코딩 하는 방법.';
$lang['autoplural'] = '링크 연결시 plural폼 검사';
$lang['compression'] = 'attic파일 압축 방법 선택';
$lang['cachetime'] = '최대 캐쉬 생존 시간(초)';
@@ -108,6 +112,7 @@ $lang['gdlib'] = 'GD 라이브러리 버전';
$lang['im_convert'] = 'ImageMagick 위치';
$lang['jpg_quality'] = 'JPG 압축 품질 (0-100)';
$lang['subscribers'] = '페이지 갱신 알람 기능';
+$lang['subscribe_time'] = ' 구독 목록과 요약이 보내질 경과 시간 (초); 이 것은 recent_days에서 설정된 시간보다 작아야 합니다.';
$lang['compress'] = '최적화된 CSS, javascript 출력';
$lang['hidepages'] = '매칭된 페이지 숨기기(정규표현식)';
$lang['send404'] = '존재하지 않는 페이지에 대해 "HTTP 404/Page Not Found" 응답';
@@ -115,7 +120,6 @@ $lang['sitemap'] = '구글 사이트맵 생성(날짜)';
$lang['broken_iua'] = '설치된 시스템에서 ignore_user_abort 기능에 문제가 있으면 색인이 정상적으로 동작하지 않습니다. 이 기능이 IIS+PHP/CGI에서 문제가 있는 것으로 알려졌습니다. 자세한 정보는 <a href="http://bugs.splitbrain.org/?do=details&amp;task_id=852">Bug 852</a>를 참고하기 바랍니다.';
$lang['xsendfile'] = '웹 서버 static 파일 전송 지원을 위해 X-Sendfile 헤더를 사용한다면 이 옵션을 사용합니다.
웹 서버가 이 기능을 지원해야 합니다.';
-$lang['xmlrpc'] = 'XML-RPC 인터페이스 지원/무시';
$lang['renderer_xhtml'] = '주 (xhtml) 위키 출력 처리기';
$lang['renderer__core'] = '%s (DokuWiki 내부 기능)';
$lang['renderer__plugin'] = '%s (DokuWiki 플러그인)';
@@ -136,6 +140,7 @@ $lang['proxy____port'] = '프록시 서버 포트';
$lang['proxy____user'] = '프록시 사용자 이름';
$lang['proxy____pass'] = '프록시 패스워드';
$lang['proxy____ssl'] = '프록시 연결시 ssl사용';
+$lang['proxy____except'] = '프록시설정이 무시될 URL주소들의 RegEx형식표현';
$lang['safemodehack'] = 'safemode hack기능 사용';
$lang['ftp____host'] = 'safemode hack의 FTP 서버';
$lang['ftp____port'] = 'safemode hack의 FTP port';
@@ -183,3 +188,4 @@ $lang['useheading_o_0'] = '아니요';
$lang['useheading_o_navigation'] = '네비게이션에만';
$lang['useheading_o_content'] = '위키 내용에만';
$lang['useheading_o_1'] = '항상';
+$lang['readdircache'] = 'readdir 캐쉬를 위한 최대 시간 (초)';
diff --git a/lib/plugins/config/lang/la/intro.txt b/lib/plugins/config/lang/la/intro.txt
index d23029ab1..573d34ac1 100644
--- a/lib/plugins/config/lang/la/intro.txt
+++ b/lib/plugins/config/lang/la/intro.txt
@@ -1,6 +1,6 @@
-====== Administrationis Administrator ======
+====== Optionum Administratio ======
-In hac pagina administratoris optiones mutare et inspicere potes. Auxilia in pagina [[doku>config]] sunt, si singulas res uidere uis, i ad paginam [[doku>plugin:config]].
+In hac pagina administratoris optiones mutare et inspicere potes. Auxilia in pagina [[doku>config|conformationis]] sunt, si singulas res uidere uis, i ad paginam [[doku>plugin:config|conformationis]].
Optiones ostensae rubro colore tutae et non nunc mutabiles sunt. Optiones ostensae caeruleo colore praecipuae sunt et optiones ostensae in area alba singulares huic uici sunt. Et caerulae et albae optiones mutabiles sunt.
diff --git a/lib/plugins/config/lang/la/lang.php b/lib/plugins/config/lang/la/lang.php
index ca0eb1c31..689ea004d 100644
--- a/lib/plugins/config/lang/la/lang.php
+++ b/lib/plugins/config/lang/la/lang.php
@@ -2,6 +2,7 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
$lang['menu'] = 'Optiones Administrationis';
$lang['error'] = 'Optiones non nouatae ob errores: rursum temptat. Errores rubro colore signati sunt.';
@@ -9,17 +10,17 @@ $lang['updated'] = 'Optiones feliciter nouatae.';
$lang['nochoice'] = '(nulla optio est)';
$lang['locked'] = 'Optio documenti non nouata est, <br/> optiones et facultates documenti inspicis.';
$lang['danger'] = 'CAVE: si has optiones mutabis, in administrationis indicem non inire potes.';
-$lang['warning'] = 'CAVE: si hae optiones mutantur, graues errores erunt.';
-$lang['security'] = 'CAVE: si hae optiones mutantur, graues errores erunt.';
-$lang['_configuration_manager'] = 'Administrationis Administrator';
+$lang['warning'] = 'CAVE: si hae optiones mutabis, graues errores erunt.';
+$lang['security'] = 'CAVE: si hae optiones mutabis, graues errores erunt.';
+$lang['_configuration_manager'] = 'Optionum administratio';
$lang['_header_dokuwiki'] = 'Vicis Optiones';
$lang['_header_plugin'] = 'Addendorum Optiones';
$lang['_header_template'] = 'Vicis Formae Optiones';
$lang['_header_undefined'] = 'Variae Optiones';
-$lang['_basic'] = 'Fundamenti Optiones';
-$lang['_display'] = 'Visiuae Optiones';
+$lang['_basic'] = 'Praecipuae Optiones';
+$lang['_display'] = 'Speciei Optiones';
$lang['_authentication'] = 'Confirmationis Optiones';
-$lang['_anti_spam'] = 'Malorum Optiones';
+$lang['_anti_spam'] = 'In Mala Optiones';
$lang['_editing'] = 'Recensendi Optiones';
$lang['_links'] = 'Nexi Optiones';
$lang['_media'] = 'Visiuorum Optiones';
@@ -70,7 +71,7 @@ $lang['autopasswd'] = 'Tessera machinatione generata';
$lang['authtype'] = 'Confirmationis finis';
$lang['passcrypt'] = 'Ratio tesserae tuendae';
$lang['defaultgroup'] = 'Grex communis';
-$lang['superuser'] = 'Magister\stra - grex, Sodalis uel index diuisus a uigulis sodalis1,@grex,sodalis2 cum plenis facultatibus sine AAA optionum termino';
+$lang['superuser'] = 'Magister\stra - grex, Sodalis uel index diuisus a uigulis sodalis1,@grex,sodalis2 cum plenis facultatibus sine ICA optionum termino';
$lang['manager'] = 'Administrator - grex, Sodalis uel index diuisus a uigulis sodalis1,@grex,sodalis2 cum certis facultatibus';
$lang['profileconfirm'] = 'Mutationes tessera confirmanda sunt';
$lang['disableactions'] = 'Vicis actiones ineptas facere';
@@ -78,14 +79,14 @@ $lang['disableactions_check'] = 'Inspicere';
$lang['disableactions_subscription'] = 'Inscribe/Delere';
$lang['disableactions_wikicode'] = 'Fontem uidere/Rudem transcribere';
$lang['disableactions_other'] = 'Aliae actiones (uirgulis diuisae)';
-$lang['sneaky_index'] = 'Hic uicis omnes spatia nomini in indice inserit. Si ineptam hanc optionem facias, solum ea spatia, quae Sodales uidere possunt, in indice erunt. Hoc suggreges et subspatia abscondere potest.';
+$lang['sneaky_index'] = 'Hic uicis omnia genera in indice inserit. Si ineptam hanc optionem facias, solum ea, quae Sodales uidere possunt, in indice erunt. Hoc suggreges et suggenera abscondere potest.';
$lang['auth_security_timeout'] = 'Confirmationis Tempus (secundis)';
$lang['securecookie'] = 'Formulae HTTPS mittine solum per HTTPS possunt? Ineptam hanc optio facias, si accessus uicis tutus est, sed interretis non.';
$lang['xmlrpc'] = 'Aptam\Ineptam XML-RPC administrationem facere';
$lang['xmlrpcuser'] = 'Accessus XML-RPC gregibus uel Sodalibus in hoc indice astringere. Nihil scribere ut omnes accessum habeant';
$lang['updatecheck'] = 'Nouationes et fiducias inspicerene? Hic uicis connectere splitbrain.org debes.';
$lang['userewrite'] = 'VRL formosis uti';
-$lang['useslash'] = 'Repagula ut spatium nominis diuidas uti';
+$lang['useslash'] = 'Repagula in URL, ut genera diuidas, uti';
$lang['usedraft'] = 'Propositum in recensione machinatione seruatur';
$lang['sepchar'] = 'Signum, quod paginas diuidit';
$lang['canonical'] = 'VRL perfecto uti';
@@ -99,7 +100,7 @@ $lang['notify'] = 'Adnotationis mutationes ad hunc cursum mittere
$lang['registernotify'] = 'De nouis Sodalibus ad hunc cursum notas mittere';
$lang['mailfrom'] = 'Cursus interretialis, quo in cursibus uti';
$lang['gzip_output'] = 'gzip Argumentum-Codificans xhtml uti';
-$lang['gdlib'] = 'GD Lib uersio';
+$lang['gdlib'] = 'GD Lib forma';
$lang['im_convert'] = 'Domicilium machinae ImageMagick\'s';
$lang['jpg_quality'] = 'JPG compressio colorum (0-100)';
$lang['subscribers'] = 'Inscriptionis paginarum auxilium aptus facere';
@@ -148,7 +149,7 @@ $lang['deaccent_o_0'] = 'ex';
$lang['deaccent_o_1'] = 'accentum tollere';
$lang['deaccent_o_2'] = 'Latinis litteris';
$lang['gdlib_o_0'] = 'GD Lib inepta';
-$lang['gdlib_o_1'] = 'Versio 1.x';
+$lang['gdlib_o_1'] = 'Forma 1.x';
$lang['gdlib_o_2'] = 'Machinatione inspicere';
$lang['rss_type_o_rss'] = 'RSS 0.91';
$lang['rss_type_o_rss1'] = 'RSS 1.0';
diff --git a/lib/plugins/config/lang/ru/intro.txt b/lib/plugins/config/lang/ru/intro.txt
index c66a69e64..a629d9332 100644
--- a/lib/plugins/config/lang/ru/intro.txt
+++ b/lib/plugins/config/lang/ru/intro.txt
@@ -1,9 +1,9 @@
====== Настройки вики ======
-Здесь вы можете изменить настройки вашей «ДокуВики». Для справки по поводу конкретных опций смотрите [[doku>config]]. Дополнительные детали об этом плагине доступны здесь: [[doku>plugin:config]].
+Здесь вы можете изменить настройки своей «ДокуВики». Для справки по поводу конкретных опций смотрите [[doku>config]]. Дополнительные детали об этом плагине доступны здесь: [[doku>plugin:config]].
Настройки, отображаемые на светло-красном фоне, защищены от изменений и не могут быть отредактированы с помощью этого плагина. Голубым фоном отмечены настройки со значениями по умолчанию, а белым фоном — настройки, которые были локально изменены для этой конкретной «ДокуВики». Как голубые, так и белые настройки доступны для изменения.
-Не забудьте нажать кнопку **Сохранить** перед тем, как покинуть эту страницу, иначе все ваши изменения будут потеряны.
+Не забудьте нажать кнопку «**Сохранить**» перед тем, как покинуть эту страницу, иначе все ваши изменения будут потеряны.
diff --git a/lib/plugins/config/lang/ru/lang.php b/lib/plugins/config/lang/ru/lang.php
index 167c54eea..5e624eda0 100644
--- a/lib/plugins/config/lang/ru/lang.php
+++ b/lib/plugins/config/lang/ru/lang.php
@@ -16,11 +16,10 @@
* @author Aleksandr Selivanov <alexgearbox@gmail.com>
*/
$lang['menu'] = 'Настройки вики';
-$lang['error'] = 'Настройки не были сохранены из-за ошибки в одном из значений. Пожалуйста, проверьте ваши изменения и попробуйте еще раз.<br />Неправильные значения будут обведены красной рамкой.';
+$lang['error'] = 'Настройки не были сохранены из-за ошибки в одном из значений. Пожалуйста, проверьте свои изменения и попробуйте ещё раз.<br />Неправильные значения будут обведены красной рамкой.';
$lang['updated'] = 'Настройки успешно сохранены.';
$lang['nochoice'] = '(нет других вариантов)';
-$lang['locked'] = 'Файл настройки недоступен для изменения. Если это не специально, <br />
-убедитесь, что файл локальной настройки имеет правильное имя и права доступа.';
+$lang['locked'] = 'Файл настройки недоступен для изменения. Если это не специально, <br />убедитесь, что файл локальной настройки имеет правильное имя и права доступа.';
$lang['danger'] = 'Внимание: изменение этой опции может сделать вашу вики и меню конфигурации недоступными.';
$lang['warning'] = 'Предостережение: изменение этой опции может вызвать непредсказуемое поведение.';
$lang['security'] = 'Предостережение по безопасности: изменение этой опции может вызвать риск, связанный с безопасностью.';
@@ -63,7 +62,7 @@ $lang['phpok'] = 'Разрешить PHP';
$lang['dformat'] = 'Формат даты и времени';
$lang['signature'] = 'Шаблон подписи';
$lang['toptoclevel'] = 'Мин. уровень в содержании';
-$lang['tocminheads'] = 'Минимальное количество заголовков, при котором будет составлено содержание';
+$lang['tocminheads'] = 'Мин. количество заголовков, при котором будет составлено содержание';
$lang['maxtoclevel'] = 'Макс. уровень в содержании';
$lang['maxseclevel'] = 'Макс. уровень для правки';
$lang['camelcase'] = 'Использовать ВикиРегистр для ссылок';
@@ -84,22 +83,22 @@ $lang['authtype'] = 'Механизм аутентификации'
$lang['passcrypt'] = 'Метод шифрования пароля';
$lang['defaultgroup'] = 'Группа по умолчанию';
$lang['superuser'] = 'Суперпользователь — группа или пользователь с полным доступом ко всем страницам и функциям администрирования, независимо от установок ACL. Перечень разделяйте запятыми: user1,@group1,user2';
-$lang['manager'] = 'Менеджер — группа или пользователь с доступом к определенным функциям управления. Перечень разделяйте запятыми: user1,@group1,user2';
+$lang['manager'] = 'Менеджер — группа или пользователь с доступом к определённым функциям управления. Перечень разделяйте запятыми: user1,@group1,user2';
$lang['profileconfirm'] = 'Пароль для изменения профиля';
$lang['disableactions'] = 'Заблокировать операции «ДокуВики»';
$lang['disableactions_check'] = 'Проверка';
$lang['disableactions_subscription'] = 'Подписка/Отмена подписки';
$lang['disableactions_wikicode'] = 'Показ/экспорт исходного текста';
$lang['disableactions_other'] = 'Другие операции (через запятую)';
-$lang['sneaky_index'] = 'По умолчанию, «ДокуВики» показывает в индексе страниц все пространства имен. Включение этой опции скроет пространства имен, для которых пользователь не имеет прав чтения. Это может привести к скрытию доступных вложенных пространств имен и потере функциональности индекса страниц при некоторых конфигурациях прав доступа.';
+$lang['sneaky_index'] = 'По умолчанию, «ДокуВики» показывает в индексе страниц все пространства имён. Включение этой опции скроет пространства имён, для которых пользователь не имеет прав чтения. Это может привести к скрытию доступных вложенных пространств имён и потере функциональности индекса страниц при некоторых конфигурациях прав доступа.';
$lang['auth_security_timeout'] = 'Интервал для безопасности авторизации (сек.)';
$lang['securecookie'] = 'Должны ли куки (cookies), выставленные через HTTPS, отправляться браузером только через HTTPS. Отключите эту опцию в случае, когда только логин вашей вики передаётся через SSL, а обычный просмотр осуществляется в небезопасном режиме.';
$lang['xmlrpc'] = 'Включить/выключить XML-RPC интерфейс.';
-$lang['xmlrpcuser'] = 'Запретить XML-RPC доступ для списка групп и пользователей, перечисленных через запятую. Оставьте пустым, если хотите оставить доступ всем.';
-$lang['updatecheck'] = 'Проверять наличие обновлений и предупреждений о безопасности? Для этого «ДокуВики» потребуется связываться со <a href="http://www.splitbrain.org/">splitbrain.org</a>.';
+$lang['xmlrpcuser'] = 'Запретить XML-RPC-доступ для списка групп и пользователей, перечисленных через запятую. Оставьте пустым, если хотите оставить доступ всем.';
+$lang['updatecheck'] = 'Проверять наличие обновлений и предупреждений о безопасности? Для этого «ДокуВики» потребуется связываться с сайтом <a href="http://www.splitbrain.org/">splitbrain.org</a>.';
$lang['userewrite'] = 'Удобочитаемые адреса (URL)';
$lang['useslash'] = 'Использовать слэш';
-$lang['usedraft'] = 'Автоматически сохранять черновик в время правки';
+$lang['usedraft'] = 'Автоматически сохранять черновик во время правки';
$lang['sepchar'] = 'Разделитель слов в имени страницы';
$lang['canonical'] = 'Полные канонические адреса (URL)';
$lang['fnencode'] = 'Метод кодирования имён файлов, записанных не ASCII-символами.';
@@ -114,15 +113,15 @@ $lang['mailfrom'] = 'Электронный адрес вики (О
$lang['gzip_output'] = 'Использовать gzip-сжатие для xhtml';
$lang['gdlib'] = 'Версия LibGD';
$lang['im_convert'] = 'Путь к ImageMagick';
-$lang['jpg_quality'] = 'Качество сжатия JPG (0–100). Значение о умолчнию — 70.';
+$lang['jpg_quality'] = 'Качество сжатия JPG (0–100). Значение по умолчанию — 70.';
$lang['subscribers'] = 'Разрешить подписку на изменения';
-$lang['subscribe_time'] = 'Интервал рассылки подписок и сводок (сек.); Должен быть меньше, чем значение, указанное в recent_days.';
+$lang['subscribe_time'] = 'Интервал рассылки подписок и сводок (сек.). Должен быть меньше, чем значение, указанное в recent_days.';
$lang['compress'] = 'Сжимать файлы CSS и javascript';
$lang['hidepages'] = 'Скрыть страницы (рег. выражение)';
$lang['send404'] = 'Посылать «HTTP404/Page Not Found»';
$lang['sitemap'] = 'Число дней, через которое нужно создавать (обновлять) карту сайта для поисковиков (Гугл, Яндекс и др.)';
$lang['broken_iua'] = 'Возможно, функция ignore_user_abort не работает в вашей системе? Это может привести к потере функциональности индексирования поиска. Эта проблема присутствует, например, в IIS+PHP/CGI. Для дополнительной информации смотрите <a href="http://bugs.splitbrain.org/?do=details&amp;task_id=852">баг 852</a>.';
-$lang['xsendfile'] = 'Используете заголовок X-Sendfile для загрузки файлов на вебсервер? Ваш вебсервер должен поддерживать это.';
+$lang['xsendfile'] = 'Используете заголовок X-Sendfile для загрузки файлов на веб-сервер? Ваш веб-сервер должен поддерживать это.';
$lang['renderer_xhtml'] = 'Обработчик основного (xhtml) вывода вики';
$lang['renderer__core'] = '%s (ядро dokuwiki)';
$lang['renderer__plugin'] = '%s (плагин)';
@@ -138,18 +137,18 @@ $lang['target____interwiki'] = 'target для ссылок между вики
$lang['target____extern'] = 'target для внешних ссылок';
$lang['target____media'] = 'target для ссылок на медиафайлы';
$lang['target____windows'] = 'target для ссылок на сетевые каталоги';
-$lang['proxy____host'] = 'proxy - адрес';
-$lang['proxy____port'] = 'proxy - порт';
-$lang['proxy____user'] = 'proxy - имя пользователя';
-$lang['proxy____pass'] = 'proxy - пароль';
-$lang['proxy____ssl'] = 'proxy - ssl';
+$lang['proxy____host'] = 'proxy-адрес';
+$lang['proxy____port'] = 'proxy-порт';
+$lang['proxy____user'] = 'proxy-имя пользователя';
+$lang['proxy____pass'] = 'proxy-пароль';
+$lang['proxy____ssl'] = 'proxy-ssl';
$lang['proxy____except'] = 'Регулярное выражение для адресов (URL), для которых прокси должен быть пропущен.';
$lang['safemodehack'] = 'Включить обход safemode (хак)';
-$lang['ftp____host'] = 'ftp - адрес';
-$lang['ftp____port'] = 'ftp - порт';
-$lang['ftp____user'] = 'ftp - имя пользователя';
-$lang['ftp____pass'] = 'ftp - пароль';
-$lang['ftp____root'] = 'ftp - корневая директория';
+$lang['ftp____host'] = 'ftp-адрес';
+$lang['ftp____port'] = 'ftp-порт';
+$lang['ftp____user'] = 'ftp-имя пользователя';
+$lang['ftp____pass'] = 'ftp-пароль';
+$lang['ftp____root'] = 'ftp-корневая директория';
$lang['license_o_'] = 'Не выбрано';
$lang['typography_o_0'] = 'нет';
$lang['typography_o_1'] = 'Только двойные кавычки';
@@ -185,10 +184,10 @@ $lang['xsendfile_o_2'] = 'Стандартный заголовок X-Se
$lang['xsendfile_o_3'] = 'Проприетарный заголовок Nginx X-Accel-Redirect';
$lang['showuseras_o_loginname'] = 'Логин';
$lang['showuseras_o_username'] = 'Полное имя пользователя';
-$lang['showuseras_o_email'] = 'Адрес электронной почты пользователя (зашифрован согласно настройкам mailguard)';
-$lang['showuseras_o_email_link'] = 'Адрес электронной почты пользователя в виде ссылки mailto:';
+$lang['showuseras_o_email'] = 'Адрес электропочты в шифрованном виде (см. mailguard)';
+$lang['showuseras_o_email_link'] = 'Адрес электропочты в виде ссылки mailto:';
$lang['useheading_o_0'] = 'Никогда';
$lang['useheading_o_navigation'] = 'Только навигация';
$lang['useheading_o_content'] = 'Только содержимое вики';
$lang['useheading_o_1'] = 'Всегда';
-$lang['readdircache'] = 'Максимальное время жизни кэша readdir (сек)';
+$lang['readdircache'] = 'Максимальное время жизни кэша readdir (сек.)';
diff --git a/lib/plugins/config/lang/sl/lang.php b/lib/plugins/config/lang/sl/lang.php
index 52b88a053..5b5b3d3d8 100644
--- a/lib/plugins/config/lang/sl/lang.php
+++ b/lib/plugins/config/lang/sl/lang.php
@@ -4,6 +4,7 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
$lang['lang'] = 'Jezik';
$lang['template'] = 'Predloga';
diff --git a/lib/plugins/config/lang/tr/lang.php b/lib/plugins/config/lang/tr/lang.php
index 9929c663e..6d7d7cc2e 100644
--- a/lib/plugins/config/lang/tr/lang.php
+++ b/lib/plugins/config/lang/tr/lang.php
@@ -2,11 +2,10 @@
/**
* Turkish language file
*
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['menu'] = 'Site Ayarları';
$lang['error'] = 'Ayarlar yanlış bir değer girildiği için güncellenemedi. Lütfen değişikliklerinizi gözden geçirin ve tekrar gönderin.
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 4f2129c70..01f15a54e 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -342,8 +342,8 @@ if (!class_exists('setting')) {
var $_cautionList = array(
'basedir' => 'danger', 'baseurl' => 'danger', 'savedir' => 'danger', 'useacl' => 'danger', 'authtype' => 'danger', 'superuser' => 'danger', 'userewrite' => 'danger',
- 'start' => 'warning', 'camelcase' => 'warning', 'deaccent' => 'warning', 'sepchar' => 'warning', 'compression' => 'warning', 'xsendfile' => 'warning', 'renderer_xhtml' => 'warning',
- 'allowdebug' => 'security', 'htmlok' => 'security', 'phpok' => 'security', 'iexssprotect' => 'security', 'xmlrpc' => 'security', 'fnencode' => 'warning'
+ 'start' => 'warning', 'camelcase' => 'warning', 'deaccent' => 'warning', 'sepchar' => 'warning', 'compression' => 'warning', 'xsendfile' => 'warning', 'renderer_xhtml' => 'warning', 'fnencode' => 'warning',
+ 'allowdebug' => 'security', 'htmlok' => 'security', 'phpok' => 'security', 'iexssprotect' => 'security', 'xmlrpc' => 'security', 'fullpath' => 'security'
);
function setting($key, $params=NULL) {
@@ -616,8 +616,25 @@ if (!class_exists('setting_numeric')) {
// This allows for many PHP syntax errors...
// var $_pattern = '/^[-+\/*0-9 ]*$/';
// much more restrictive, but should eliminate syntax errors.
- var $_pattern = '/^[-]?[0-9]+(?:[-+*][0-9]+)*$/';
- //FIXME - make the numeric error checking better.
+ var $_pattern = '/^[-+]? *[0-9]+ *(?:[-+*] *[0-9]+ *)*$/';
+ var $_min = null;
+ var $_max = null;
+
+ function update($input) {
+ $local = $this->_local;
+ $valid = parent::update($input);
+ if ($valid && !(is_null($this->_min) && is_null($this->_max))) {
+ $numeric_local = (int) eval('return '.$this->_local.';');
+ if ((!is_null($this->_min) && $numeric_local < $this->_min) ||
+ (!is_null($this->_max) && $numeric_local > $this->_max)) {
+ $this->_error = true;
+ $this->_input = $input;
+ $this->_local = $local;
+ $valid = false;
+ }
+ }
+ return $valid;
+ }
function out($var, $fmt='php') {
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 331da5ab8..ca2cd0c12 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -16,6 +16,7 @@
* '' - default class ('setting'), textarea, minimal input validation, setting output in quotes
* 'string' - single line text input, minimal input validation, setting output in quotes
* 'numeric' - text input, accepts numbers and arithmetic operators, setting output without quotes
+ * if given the '_min' and '_max' parameters are used for validation
* 'numericopt' - like above, but accepts empty values
* 'onoff' - checkbox input, setting output 0|1
* 'multichoice' - select input (single choice), setting output with quotes, required _choices parameter
@@ -54,6 +55,8 @@
* '_combine' - complimentary output setting values which can be combined into a single display checkbox
* optional for 'multicheckbox', ignored by other classes
* '_code' - encoding method to use, accepted values: 'base64','uuencode','plain'. defaults to plain.
+ * '_min' - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
+ * '_max' - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
*
* @author Chris Smith <chris@jalakai.co.uk>
*/
@@ -98,7 +101,7 @@ $meta['allowdebug'] = array('onoff');
$meta['_display'] = array('fieldset');
$meta['recent'] = array('numeric');
-$meta['breadcrumbs'] = array('numeric');
+$meta['breadcrumbs'] = array('numeric','_min' => 0);
$meta['youarehere'] = array('onoff');
$meta['fullpath'] = array('onoff');
$meta['typography'] = array('multichoice','_choices' => array(0,1,2));
@@ -119,7 +122,7 @@ $meta['_authentication'] = array('fieldset');
$meta['useacl'] = array('onoff');
$meta['autopasswd'] = array('onoff');
$meta['authtype'] = array('authtype');
-$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','crypt','mysql','my411','kmd5'));
+$meta['passcrypt'] = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','crypt','mysql','my411','kmd5','pmd5','hmd5'));
$meta['defaultgroup']= array('string');
$meta['superuser'] = array('string');
$meta['manager'] = array('string');
@@ -174,6 +177,7 @@ $meta['canonical'] = array('onoff');
$meta['fnencode'] = array('multichoice','_choices' => array('url','safe','utf-8'));
$meta['autoplural'] = array('onoff');
$meta['mailfrom'] = array('richemail');
+$meta['mailprefix'] = array('string');
$meta['compress'] = array('onoff');
$meta['gzip_output'] = array('onoff');
$meta['hidepages'] = array('string');
diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index ba2831a90..026a438bb 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -253,4 +253,4 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/plugin/lang/cs/lang.php b/lib/plugins/plugin/lang/cs/lang.php
index c15a5ca21..54de0ff18 100644
--- a/lib/plugins/plugin/lang/cs/lang.php
+++ b/lib/plugins/plugin/lang/cs/lang.php
@@ -26,7 +26,7 @@ $lang['source'] = 'Zdroj:';
$lang['unknown'] = 'neznámý';
$lang['updating'] = 'Aktualizuji ...';
$lang['updated'] = 'Modul %s úspěšně aktualizován';
-$lang['updates'] = 'Následjící pluginy byly úspěšně aktualizovány';
+$lang['updates'] = 'Následující pluginy byly úspěšně aktualizovány';
$lang['update_none'] = 'Žádné aktualizace nenalezeny.';
$lang['deleting'] = 'Probíhá mazání ...';
$lang['deleted'] = 'Plugin %s smazán.';
@@ -49,7 +49,7 @@ $lang['error_download'] = 'Nelze stáhnout soubor s pluginem: %s';
$lang['error_badurl'] = 'URL je zřejmě chybná - nelze z ní určit název souboru';
$lang['error_dircreate'] = 'Nelze vytvořit dočasný adresář ke stažení dat';
$lang['error_decompress'] = 'Správce pluginů nemůže rozbalit stažený soubor. Toto může být způsobeno chybou při stahování. Můžete se pokusit stahování opakovat. Chyba může být také v kompresním formátu souboru. V tom případě bude nutné stáhnout a nainstalovat plugin ručně.';
-$lang['error_copy'] = 'Došlo k chybě při instalaci pluginu <em>%s</em>. Je možné, že na disku není volné místo, nebo mohou být špatně nastavena přístupová práva. Pozor, mohlo dojít k častečné a tudíž chybné instalaci pluginu a tím může být ohrožena stabilita wiki.';
+$lang['error_copy'] = 'Došlo k chybě při instalaci pluginu <em>%s</em>. Je možné, že na disku není volné místo, nebo mohou být špatně nastavena přístupová práva. Pozor, mohlo dojít k částečné a tudíž chybné instalaci pluginu a tím může být ohrožena stabilita wiki.';
$lang['error_delete'] = 'Došlo k chybě při pokusu o smazání pluginu <em>%s</em>. Nejspíše je chyba v nastavení přístupových práv k některým souborům či adresářům.';
$lang['enabled'] = 'Plugin %s aktivován.';
$lang['notenabled'] = 'Plugin %s nelze aktivovat, zkontrolujte práva k souborům.';
diff --git a/lib/plugins/plugin/lang/de-informal/lang.php b/lib/plugins/plugin/lang/de-informal/lang.php
index 65050b896..3ba729fd6 100644
--- a/lib/plugins/plugin/lang/de-informal/lang.php
+++ b/lib/plugins/plugin/lang/de-informal/lang.php
@@ -6,6 +6,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Plugins verwalten';
$lang['download'] = 'Herunterladen und installieren einer neuen Erweiterung';
diff --git a/lib/plugins/plugin/lang/de/lang.php b/lib/plugins/plugin/lang/de/lang.php
index e981f4a60..6f785168b 100644
--- a/lib/plugins/plugin/lang/de/lang.php
+++ b/lib/plugins/plugin/lang/de/lang.php
@@ -14,6 +14,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Plugins verwalten';
$lang['download'] = 'Neues Plugin herunterladen und installieren';
diff --git a/lib/plugins/plugin/lang/en/lang.php b/lib/plugins/plugin/lang/en/lang.php
index e575d3d67..ccbd207e9 100644
--- a/lib/plugins/plugin/lang/en/lang.php
+++ b/lib/plugins/plugin/lang/en/lang.php
@@ -74,4 +74,4 @@ $lang['notenabled'] = 'Plugin %s could not be enabled, check file permissi
$lang['disabled'] = 'Plugin %s disabled.';
$lang['notdisabled'] = 'Plugin %s could not be disabled, check file permissions.';
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/plugin/lang/he/lang.php b/lib/plugins/plugin/lang/he/lang.php
index c6e462193..47253e335 100644
--- a/lib/plugins/plugin/lang/he/lang.php
+++ b/lib/plugins/plugin/lang/he/lang.php
@@ -7,6 +7,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['menu'] = 'ניהול הרחבות';
$lang['download'] = 'הורדת והתקנת הרחבה חדשה';
diff --git a/lib/plugins/plugin/lang/ko/lang.php b/lib/plugins/plugin/lang/ko/lang.php
index af14a0cd2..72c04ddab 100644
--- a/lib/plugins/plugin/lang/ko/lang.php
+++ b/lib/plugins/plugin/lang/ko/lang.php
@@ -7,6 +7,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['menu'] = '플러그인 관리자';
$lang['download'] = '새로운 플러그인 다운로드 및 설치';
diff --git a/lib/plugins/plugin/lang/la/admin_plugin.txt b/lib/plugins/plugin/lang/la/admin_plugin.txt
index 1a361140c..2a41977fc 100644
--- a/lib/plugins/plugin/lang/la/admin_plugin.txt
+++ b/lib/plugins/plugin/lang/la/admin_plugin.txt
@@ -1,3 +1,3 @@
====== Addendorum Administratio ======
-In hac pagina omnia uicis [[doku>plugins|plugins]] mutare et administrare potes. Ut addenda capere et his uti, in scrinio addendorum scribere et legere potest. \ No newline at end of file
+In hac pagina omnia uicis [[doku>plugins|plugins]] mutare et administrare potes. Vt addenda capere et his uti, in scrinio addendorum scribere et legere potest. \ No newline at end of file
diff --git a/lib/plugins/plugin/lang/la/lang.php b/lib/plugins/plugin/lang/la/lang.php
index 021dc84d5..cd2d81cbd 100644
--- a/lib/plugins/plugin/lang/la/lang.php
+++ b/lib/plugins/plugin/lang/la/lang.php
@@ -2,8 +2,9 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
-$lang['menu'] = 'Administrationis addenda';
+$lang['menu'] = 'Addendorum administratio';
$lang['download'] = 'Noua addenda cape';
$lang['manage'] = 'Addenta in usu';
$lang['btn_info'] = 'Notae';
diff --git a/lib/plugins/plugin/lang/pt-br/admin_plugin.txt b/lib/plugins/plugin/lang/pt-br/admin_plugin.txt
index 1809bb585..9e49f5136 100644
--- a/lib/plugins/plugin/lang/pt-br/admin_plugin.txt
+++ b/lib/plugins/plugin/lang/pt-br/admin_plugin.txt
@@ -1,3 +1,3 @@
====== Gerenciamento de Plug-ins ======
-Nesta página você pode gerenciar tudo relacionado aos [[doku>plug-ins|plug-ins]] do DokuWiki. Para você baixar e instalar um plug-in o servidor web deve ter permissão de escrita na pasta onde ficam os plug-ins.
+Nesta página você pode gerenciar tudo relacionado aos [[doku>plugins|plug-ins]] do DokuWiki. Para você baixar e instalar um plug-in o servidor web deve ter permissão de escrita na pasta onde ficam os plug-ins.
diff --git a/lib/plugins/plugin/lang/ru/lang.php b/lib/plugins/plugin/lang/ru/lang.php
index a33f95418..ed1fc22b3 100644
--- a/lib/plugins/plugin/lang/ru/lang.php
+++ b/lib/plugins/plugin/lang/ru/lang.php
@@ -30,11 +30,11 @@ $lang['lastupdate'] = 'Последнее обновление:';
$lang['source'] = 'Источник:';
$lang['unknown'] = 'неизвестно';
$lang['updating'] = 'Обновление...';
-$lang['updated'] = 'Плагин %s успешно обновлен';
+$lang['updated'] = 'Плагин %s успешно обновлён';
$lang['updates'] = 'Следующие плагины были успешно обновлены';
$lang['update_none'] = 'Обновления не найдены.';
$lang['deleting'] = 'Удаление...';
-$lang['deleted'] = 'Плагин %s удален.';
+$lang['deleted'] = 'Плагин %s удалён.';
$lang['downloading'] = 'Скачивание...';
$lang['downloaded'] = 'Плагин %s успешно установлен';
$lang['downloads'] = 'Следующие плагины были успешно установлены:';
@@ -50,9 +50,9 @@ $lang['author'] = 'Автор:';
$lang['www'] = 'Странца:';
$lang['error'] = 'Произошла неизвестная ошибка.';
$lang['error_download'] = 'Не могу скачать файл плагина: %s';
-$lang['error_badurl'] = 'Возможно, неправильный адрес — не могу определить имя файла из адреса';
+$lang['error_badurl'] = 'Возможно неправильный адрес — не могу определить имя файла из адреса';
$lang['error_dircreate'] = 'Не могу создать временную директорию для скачивания';
-$lang['error_decompress'] = 'Менеджеру плагинов не удалось распаковать скачанный файл. Это может быть результатом ошибки при скачивании, в этом случае вы можете попробовать снова; или же плагин упакован неизвестным архиватором, тогда вам необходимо скачать и установить плагин вручную.';
+$lang['error_decompress'] = 'Менеджеру плагинов не удалось распаковать скачанный файл. Это может быть результатом ошибки при скачивании, в этом случае вы можете попробовать снова, или же плагин упакован неизвестным архиватором, тогда вам необходимо скачать и установить плагин вручную.';
$lang['error_copy'] = 'Произошла ошибка копирования при попытке установки файлов для плагина <em>%s</em>: переполнение диска или неправильные права доступа. Это могло привести к частичной установке плагина и неустойчивости вашей вики.';
$lang['error_delete'] = 'Произошла ошибка при попытке удалить плагин <em>%s</em>. Наиболее вероятно, что нет необходимых прав доступа к файлам или директориям';
$lang['enabled'] = 'Плагин %s включён.';
diff --git a/lib/plugins/plugin/lang/sl/lang.php b/lib/plugins/plugin/lang/sl/lang.php
index 9423e4e75..41d857979 100644
--- a/lib/plugins/plugin/lang/sl/lang.php
+++ b/lib/plugins/plugin/lang/sl/lang.php
@@ -4,6 +4,7 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
$lang['btn_delete'] = 'Izbriši';
$lang['btn_settings'] = 'Nastavitve';
diff --git a/lib/plugins/plugin/lang/tr/lang.php b/lib/plugins/plugin/lang/tr/lang.php
index 28db9109d..9a655e400 100644
--- a/lib/plugins/plugin/lang/tr/lang.php
+++ b/lib/plugins/plugin/lang/tr/lang.php
@@ -2,11 +2,10 @@
/**
* Turkish language file
*
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['menu'] = 'Eklenti Yönetimi';
$lang['download'] = 'Yeni bir eklenti indirip kur';
diff --git a/lib/plugins/popularity/action.php b/lib/plugins/popularity/action.php
new file mode 100644
index 000000000..bf11efba6
--- /dev/null
+++ b/lib/plugins/popularity/action.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Popularity Feedback Plugin
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ */
+
+require_once(DOKU_PLUGIN.'action.php');
+require_once(DOKU_PLUGIN.'popularity/admin.php');
+
+class action_plugin_popularity extends Dokuwiki_Action_Plugin {
+ var $helper;
+
+ function action_plugin_popularity(){
+ $this->helper = $this->loadHelper('popularity', false);
+ }
+
+ /**
+ * Register its handlers with the dokuwiki's event controller
+ */
+ function register(&$controller) {
+ $controller->register_hook('INDEXER_TASKS_RUN', 'AFTER', $this, '_autosubmit', array());
+ }
+
+ function _autosubmit(&$event, $param){
+ //Do we have to send the data now
+ if ( !$this->helper->isAutosubmitEnabled() || $this->_isTooEarlyToSubmit() ){
+ return;
+ }
+
+ //Actually send it
+ $status = $this->helper->sendData( $this->helper->gatherAsString() );
+
+
+ if ( $status !== '' ){
+ //If an error occured, log it
+ io_saveFile( $this->helper->autosubmitErrorFile, $status );
+ } else {
+ //If the data has been sent successfully, previous log of errors are useless
+ @unlink($this->helper->autosubmitErrorFile);
+ //Update the last time we sent data
+ touch ( $this->helper->autosubmitFile );
+ }
+
+ $event->stopPropagation();
+ $event->preventDefault();
+ }
+
+ /**
+ * Check if it's time to send autosubmit data
+ * (we should have check if autosubmit is enabled first)
+ */
+ function _isTooEarlyToSubmit(){
+ $lastSubmit = $this->helper->lastSentTime();
+ return $lastSubmit + 24*60*60*30 > time();
+ }
+}
diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php
index 71ea40799..40c3f5452 100644
--- a/lib/plugins/popularity/admin.php
+++ b/lib/plugins/popularity/admin.php
@@ -13,21 +13,15 @@ if(!defined('DOKU_INC')) die();
* need to inherit from this class
*/
class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
- var $version = '2010-09-17';
+ var $version;
+ var $helper;
+ var $sentStatus = null;
+ function admin_plugin_popularity(){
+ $this->helper = $this->loadHelper('popularity', false);
- /**
- * return some info
- */
- function getInfo(){
- return array(
- 'author' => 'Andreas Gohr',
- 'email' => 'andi@splitbrain.org',
- 'date' => $this->version,
- 'name' => 'Popularity Feedback Plugin',
- 'desc' => 'Send anonymous data about your wiki to the developers.',
- 'url' => 'http://www.dokuwiki.org/plugin:popularity',
- );
+ $pluginInfo = $this->getInfo();
+ $this->version = $pluginInfo['date'];
}
/**
@@ -56,204 +50,99 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
* handle user request
*/
function handle() {
+ //Send the data
+ if ( isset($_REQUEST['data']) ){
+ $this->sentStatus = $this->helper->sendData( $_REQUEST['data'] );
+ if ( $this->sentStatus === '' ){
+ //Update the last time we sent the data
+ touch ( $this->helper->popularityLastSubmitFile );
+ }
+ //Deal with the autosubmit option
+ $this->_enableAutosubmit( isset($_REQUEST['autosubmit']) );
+ }
}
/**
- * Output HTML form
+ * Enable or disable autosubmit
+ * @param bool $enable If TRUE, it will enable autosubmit. Else, it will disable it.
*/
- function html() {
- echo $this->locale_xhtml('intro');
-
- flush();
- $data = $this->_gather();
- echo '<form method="post" action="http://update.dokuwiki.org/popularity.php" accept-charset="utf-8">';
- echo '<fieldset style="width: 60%;">';
- echo '<textarea class="edit" rows="10" cols="80" readonly="readonly" name="data">';
- foreach($data as $key => $val){
- if(is_array($val)) foreach($val as $v){
- echo hsc($key)."\t".hsc($v)."\n";
- }else{
- echo hsc($key)."\t".hsc($val)."\n";
- }
+ function _enableAutosubmit( $enable ){
+ if ( $enable ){
+ io_saveFile( $this->helper->autosubmitFile, ' ');
+ } else {
+ @unlink($this->helper->autosubmitFile);
}
- echo '</textarea><br />';
- echo '<input type="submit" class="button" value="'.$this->getLang('submit').'"/>';
- echo '</fieldset>';
- echo '</form>';
-
-// dbg($data);
}
-
/**
- * Gather all information
+ * Output HTML form
*/
- function _gather(){
- global $conf;
- global $auth;
- $data = array();
- $phptime = ini_get('max_execution_time');
- @set_time_limit(0);
-
- // version
- $data['anon_id'] = md5(auth_cookiesalt());
- $data['version'] = getVersion();
- $data['popversion'] = $this->version;
- $data['language'] = $conf['lang'];
- $data['now'] = time();
-
- // some config values
- $data['conf_useacl'] = $conf['useacl'];
- $data['conf_authtype'] = $conf['authtype'];
- $data['conf_template'] = $conf['template'];
-
- // number and size of pages
- $list = array();
- search($list,$conf['datadir'],array($this,'_search_count'),'','');
- $data['page_count'] = $list['file_count'];
- $data['page_size'] = $list['file_size'];
- $data['page_biggest'] = $list['file_max'];
- $data['page_smallest'] = $list['file_min'];
- $data['page_nscount'] = $list['dir_count'];
- $data['page_nsnest'] = $list['dir_nest'];
- if($list['file_count']) $data['page_avg'] = $list['file_size'] / $list['file_count'];
- $data['page_oldest'] = $list['file_oldest'];
- unset($list);
-
- // number and size of media
- $list = array();
- search($list,$conf['mediadir'],array($this,'_search_count'),array('all'=>true));
- $data['media_count'] = $list['file_count'];
- $data['media_size'] = $list['file_size'];
- $data['media_biggest'] = $list['file_max'];
- $data['media_smallest'] = $list['file_min'];
- $data['media_nscount'] = $list['dir_count'];
- $data['media_nsnest'] = $list['dir_nest'];
- if($list['file_count']) $data['media_avg'] = $list['file_size'] / $list['file_count'];
- unset($list);
-
- // number and size of cache
- $list = array();
- search($list,$conf['cachedir'],array($this,'_search_count'),array('all'=>true));
- $data['cache_count'] = $list['file_count'];
- $data['cache_size'] = $list['file_size'];
- $data['cache_biggest'] = $list['file_max'];
- $data['cache_smallest'] = $list['file_min'];
- if($list['file_count']) $data['cache_avg'] = $list['file_size'] / $list['file_count'];
- unset($list);
-
- // number and size of index
- $list = array();
- search($list,$conf['indexdir'],array($this,'_search_count'),array('all'=>true));
- $data['index_count'] = $list['file_count'];
- $data['index_size'] = $list['file_size'];
- $data['index_biggest'] = $list['file_max'];
- $data['index_smallest'] = $list['file_min'];
- if($list['file_count']) $data['index_avg'] = $list['file_size'] / $list['file_count'];
- unset($list);
-
- // number and size of meta
- $list = array();
- search($list,$conf['metadir'],array($this,'_search_count'),array('all'=>true));
- $data['meta_count'] = $list['file_count'];
- $data['meta_size'] = $list['file_size'];
- $data['meta_biggest'] = $list['file_max'];
- $data['meta_smallest'] = $list['file_min'];
- if($list['file_count']) $data['meta_avg'] = $list['file_size'] / $list['file_count'];
- unset($list);
-
- // number and size of attic
- $list = array();
- search($list,$conf['olddir'],array($this,'_search_count'),array('all'=>true));
- $data['attic_count'] = $list['file_count'];
- $data['attic_size'] = $list['file_size'];
- $data['attic_biggest'] = $list['file_max'];
- $data['attic_smallest'] = $list['file_min'];
- if($list['file_count']) $data['attic_avg'] = $list['file_size'] / $list['file_count'];
- $data['attic_oldest'] = $list['file_oldest'];
- unset($list);
+ function html() {
+ if ( ! isset($_REQUEST['data']) ){
+ echo $this->locale_xhtml('intro');
+
+ //If there was an error the last time we tried to autosubmit, warn the user
+ if ( $this->helper->isAutoSubmitEnabled() ){
+ if ( @file_exists($this->helper->autosubmitErrorFile) ){
+ echo $this->getLang('autosubmitError');
+ echo io_readFile( $this->helper->autosubmitErrorFile );
+ }
+ }
- // user count
- if($auth && $auth->canDo('getUserCount')){
- $data['user_count'] = $auth->getUserCount();
- }
+ flush();
+ echo $this->buildForm('server');
- // calculate edits per day
- $list = @file($conf['metadir'].'/_dokuwiki.changes');
- $count = count($list);
- if($count > 2){
- $first = (int) substr(array_shift($list),0,10);
- $last = (int) substr(array_pop($list),0,10);
- $dur = ($last - $first)/(60*60*24); // number of days in the changelog
- $data['edits_per_day'] = $count/$dur;
+ //Print the last time the data was sent
+ $lastSent = $this->helper->lastSentTime();
+ if ( $lastSent !== 0 ){
+ echo $this->getLang('lastSent') . datetime_h($lastSent);
+ }
+ } else {
+ //If we just submitted the form
+ if ( $this->sentStatus === '' ){
+ //If we successfully sent the data
+ echo $this->locale_xhtml('submitted');
+ } else {
+ //If we failed to submit the data, try directly with the browser
+ echo $this->getLang('submissionFailed') . $this->sentStatus . '<br />';
+ echo $this->getLang('submitDirectly');
+ echo $this->buildForm('browser', $_REQUEST['data']);
+ }
}
- unset($list);
-
- // plugins
- $data['plugin'] = plugin_list();
-
- // pcre info
- if(defined('PCRE_VERSION')) $data['pcre_version'] = PCRE_VERSION;
- $data['pcre_backtrack'] = ini_get('pcre.backtrack_limit');
- $data['pcre_recursion'] = ini_get('pcre.recursion_limit');
-
- // php info
- $data['os'] = PHP_OS;
- $data['webserver'] = $_SERVER['SERVER_SOFTWARE'];
- $data['php_version'] = phpversion();
- $data['php_sapi'] = php_sapi_name();
- $data['php_memory'] = $this->_to_byte(ini_get('memory_limit'));
- $data['php_exectime'] = $phptime;
- $data['php_extension'] = get_loaded_extensions();
-
- return $data;
}
- function _search_count(&$data,$base,$file,$type,$lvl,$opts){
- // traverse
- if($type == 'd'){
- if($data['dir_nest'] < $lvl) $data['dir_nest'] = $lvl;
- $data['dir_count']++;
- return true;
- }
-
- //only search txt files if 'all' option not set
- if($opts['all'] || substr($file,-4) == '.txt'){
- $size = filesize($base.'/'.$file);
- $date = filemtime($base.'/'.$file);
- $data['file_count']++;
- $data['file_size'] += $size;
- if(!isset($data['file_min']) || $data['file_min'] > $size) $data['file_min'] = $size;
- if($data['file_max'] < $size) $data['file_max'] = $size;
- if(!isset($data['file_oldest']) || $data['file_oldest'] > $date) $data['file_oldest'] = $date;
- }
-
- return false;
- }
-
/**
- * Convert php.ini shorthands to byte
- *
- * @author <gilthans dot NO dot SPAM at gmail dot com>
- * @link http://de3.php.net/manual/en/ini.core.php#79564
+ * Build the form which presents the data to be sent
+ * @param string $submit How is the data supposed to be sent? (may be: 'browser' or 'server')
+ * @param string $data The popularity data, if it has already been computed. NULL otherwise.
+ * @return The form, as an html string
*/
- function _to_byte($v){
- $l = substr($v, -1);
- $ret = substr($v, 0, -1);
- switch(strtoupper($l)){
- case 'P':
- $ret *= 1024;
- case 'T':
- $ret *= 1024;
- case 'G':
- $ret *= 1024;
- case 'M':
- $ret *= 1024;
- case 'K':
- $ret *= 1024;
- break;
+ function buildForm($submissionMode, $data = null){
+ $url = ($submissionMode === 'browser' ? $this->helper->submitUrl : script());
+ if ( is_null($data) ){
+ $data = $this->helper->gatherAsString();
+ }
+
+ $form = '<form method="post" action="'. $url .'" accept-charset="utf-8">'
+ .'<fieldset style="width: 60%;">'
+ .'<textarea class="edit" rows="10" cols="80" readonly="readonly" name="data">'
+ .$data
+ .'</textarea><br />';
+
+ //If we submit via the server, we give the opportunity to suscribe to the autosubmission option
+ if ( $submissionMode !== 'browser' ){
+ $form .= '<label for="autosubmit">'
+ .'<input type="checkbox" name="autosubmit" id="autosubmit" '
+ .($this->helper->isAutosubmitEnabled() ? 'checked' : '' )
+ .'/>' . $this->getLang('autosubmit') .'<br />'
+ .'</label>'
+ .'<input type="hidden" name="do" value="admin">'
+ .'<input type="hidden" name="page" value="popularity">';
}
- return $ret;
+ $form .= '<input type="submit" class="button" value="'.$this->getLang('submit').'"/>'
+ .'</fieldset>'
+ .'</form>';
+ return $form;
}
}
diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php
new file mode 100644
index 000000000..629d0bd67
--- /dev/null
+++ b/lib/plugins/popularity/helper.php
@@ -0,0 +1,291 @@
+<?php
+/**
+ * Popularity Feedback Plugin
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ */
+
+class helper_plugin_popularity extends Dokuwiki_Plugin {
+ /**
+ * The url where the data should be sent
+ */
+ var $submitUrl = 'http://update.dokuwiki.org/popularity.php';
+
+ /**
+ * Name of the file which determine if the the autosubmit is enabled,
+ * and when it was submited for the last time
+ */
+ var $autosubmitFile;
+
+ /**
+ * File where the last error which happened when we tried to autosubmit, will be log
+ */
+ var $autosubmitErrorFile;
+
+ /**
+ * Name of the file which determine when the popularity data was manually
+ * submitted for the last time
+ * (If this file doesn't exist, the data has never been sent)
+ */
+ var $popularityLastSubmitFile;
+
+
+ function helper_plugin_popularity(){
+ global $conf;
+ $this->autosubmitFile = $conf['cachedir'].'/autosubmit.txt';
+ $this->autosubmitErrorFile = $conf['cachedir'].'/autosubmitError.txt';
+ $this->popularityLastSubmitFile = $conf['cachedir'].'/lastSubmitTime.txt';
+ }
+
+ function getMethods(){
+ $result = array();
+ $result[] = array(
+ 'name' => 'isAutoSubmitEnabled',
+ 'desc' => 'Check if autosubmit is enabled',
+ 'params' => array(),
+ 'return' => array('result' => 'bool')
+ );
+ $result[] = array(
+ 'name' => 'sendData',
+ 'desc' => 'Send the popularity data',
+ 'params' => array('data' => 'string'),
+ 'return' => array()
+ );
+ $result[] = array(
+ 'name' => 'gatherAsString',
+ 'desc' => 'Gather the popularity data',
+ 'params' => array(),
+ 'return' => array('data' => 'string')
+ );
+ $result[] = array(
+ 'name' => 'lastSentTime',
+ 'desc' => 'Compute the last time popularity data was sent',
+ 'params' => 'array()',
+ 'return' => array('data' => 'int')
+ );
+ return $result;
+
+ }
+
+ /**
+ * Check if autosubmit is enabled
+ * @return TRUE if we should send data once a month, FALSE otherwise
+ */
+ function isAutoSubmitEnabled(){
+ return @file_exists($this->autosubmitFile);
+ }
+
+ /**
+ * Send the data, to the submit url
+ * @param string $data The popularity data
+ * @return An empty string if everything worked fine, a string describing the error otherwise
+ */
+ function sendData($data){
+ $error = '';
+ $httpClient = new DokuHTTPClient();
+ $status = $httpClient->sendRequest($this->submitUrl, $data, 'POST');
+ if ( ! $status ){
+ $error = $httpClient->error;
+ }
+ return $error;
+ }
+
+ /**
+ * Compute the last time the data was sent. If it has never been sent, we return 0.
+ */
+ function lastSentTime(){
+ $manualSubmission = @filemtime($this->popularityLastSubmitFile);
+ $autoSubmission = @filemtime($this->autosubmitFile);
+
+ return max((int) $manualSubmission, (int) $autoSubmission);
+ }
+
+ /**
+ * Gather all information
+ * @return The popularity data as a string
+ */
+ function gatherAsString(){
+ $data = $this->_gather();
+ $string = '';
+ foreach($data as $key => $val){
+ if(is_array($val)) foreach($val as $v){
+ $string .= hsc($key)."\t".hsc($v)."\n";
+ }else{
+ $string .= hsc($key)."\t".hsc($val)."\n";
+ }
+ }
+ return $string;
+ }
+
+ /**
+ * Gather all information
+ * @return The popularity data as an array
+ */
+ function _gather(){
+ global $conf;
+ global $auth;
+ $data = array();
+ $phptime = ini_get('max_execution_time');
+ @set_time_limit(0);
+
+ // version
+ $data['anon_id'] = md5(auth_cookiesalt());
+ $data['version'] = getVersion();
+ $data['popversion'] = $this->version;
+ $data['language'] = $conf['lang'];
+ $data['now'] = time();
+
+ // some config values
+ $data['conf_useacl'] = $conf['useacl'];
+ $data['conf_authtype'] = $conf['authtype'];
+ $data['conf_template'] = $conf['template'];
+
+ // number and size of pages
+ $list = array();
+ search($list,$conf['datadir'],array($this,'_search_count'),'','');
+ $data['page_count'] = $list['file_count'];
+ $data['page_size'] = $list['file_size'];
+ $data['page_biggest'] = $list['file_max'];
+ $data['page_smallest'] = $list['file_min'];
+ $data['page_nscount'] = $list['dir_count'];
+ $data['page_nsnest'] = $list['dir_nest'];
+ if($list['file_count']) $data['page_avg'] = $list['file_size'] / $list['file_count'];
+ $data['page_oldest'] = $list['file_oldest'];
+ unset($list);
+
+ // number and size of media
+ $list = array();
+ search($list,$conf['mediadir'],array($this,'_search_count'),array('all'=>true));
+ $data['media_count'] = $list['file_count'];
+ $data['media_size'] = $list['file_size'];
+ $data['media_biggest'] = $list['file_max'];
+ $data['media_smallest'] = $list['file_min'];
+ $data['media_nscount'] = $list['dir_count'];
+ $data['media_nsnest'] = $list['dir_nest'];
+ if($list['file_count']) $data['media_avg'] = $list['file_size'] / $list['file_count'];
+ unset($list);
+
+ // number and size of cache
+ $list = array();
+ search($list,$conf['cachedir'],array($this,'_search_count'),array('all'=>true));
+ $data['cache_count'] = $list['file_count'];
+ $data['cache_size'] = $list['file_size'];
+ $data['cache_biggest'] = $list['file_max'];
+ $data['cache_smallest'] = $list['file_min'];
+ if($list['file_count']) $data['cache_avg'] = $list['file_size'] / $list['file_count'];
+ unset($list);
+
+ // number and size of index
+ $list = array();
+ search($list,$conf['indexdir'],array($this,'_search_count'),array('all'=>true));
+ $data['index_count'] = $list['file_count'];
+ $data['index_size'] = $list['file_size'];
+ $data['index_biggest'] = $list['file_max'];
+ $data['index_smallest'] = $list['file_min'];
+ if($list['file_count']) $data['index_avg'] = $list['file_size'] / $list['file_count'];
+ unset($list);
+
+ // number and size of meta
+ $list = array();
+ search($list,$conf['metadir'],array($this,'_search_count'),array('all'=>true));
+ $data['meta_count'] = $list['file_count'];
+ $data['meta_size'] = $list['file_size'];
+ $data['meta_biggest'] = $list['file_max'];
+ $data['meta_smallest'] = $list['file_min'];
+ if($list['file_count']) $data['meta_avg'] = $list['file_size'] / $list['file_count'];
+ unset($list);
+
+ // number and size of attic
+ $list = array();
+ search($list,$conf['olddir'],array($this,'_search_count'),array('all'=>true));
+ $data['attic_count'] = $list['file_count'];
+ $data['attic_size'] = $list['file_size'];
+ $data['attic_biggest'] = $list['file_max'];
+ $data['attic_smallest'] = $list['file_min'];
+ if($list['file_count']) $data['attic_avg'] = $list['file_size'] / $list['file_count'];
+ $data['attic_oldest'] = $list['file_oldest'];
+ unset($list);
+
+ // user count
+ if($auth && $auth->canDo('getUserCount')){
+ $data['user_count'] = $auth->getUserCount();
+ }
+
+ // calculate edits per day
+ $list = @file($conf['metadir'].'/_dokuwiki.changes');
+ $count = count($list);
+ if($count > 2){
+ $first = (int) substr(array_shift($list),0,10);
+ $last = (int) substr(array_pop($list),0,10);
+ $dur = ($last - $first)/(60*60*24); // number of days in the changelog
+ $data['edits_per_day'] = $count/$dur;
+ }
+ unset($list);
+
+ // plugins
+ $data['plugin'] = plugin_list();
+
+ // pcre info
+ if(defined('PCRE_VERSION')) $data['pcre_version'] = PCRE_VERSION;
+ $data['pcre_backtrack'] = ini_get('pcre.backtrack_limit');
+ $data['pcre_recursion'] = ini_get('pcre.recursion_limit');
+
+ // php info
+ $data['os'] = PHP_OS;
+ $data['webserver'] = $_SERVER['SERVER_SOFTWARE'];
+ $data['php_version'] = phpversion();
+ $data['php_sapi'] = php_sapi_name();
+ $data['php_memory'] = $this->_to_byte(ini_get('memory_limit'));
+ $data['php_exectime'] = $phptime;
+ $data['php_extension'] = get_loaded_extensions();
+
+ return $data;
+ }
+
+ function _search_count(&$data,$base,$file,$type,$lvl,$opts){
+ // traverse
+ if($type == 'd'){
+ if($data['dir_nest'] < $lvl) $data['dir_nest'] = $lvl;
+ $data['dir_count']++;
+ return true;
+ }
+
+ //only search txt files if 'all' option not set
+ if($opts['all'] || substr($file,-4) == '.txt'){
+ $size = filesize($base.'/'.$file);
+ $date = filemtime($base.'/'.$file);
+ $data['file_count']++;
+ $data['file_size'] += $size;
+ if(!isset($data['file_min']) || $data['file_min'] > $size) $data['file_min'] = $size;
+ if($data['file_max'] < $size) $data['file_max'] = $size;
+ if(!isset($data['file_oldest']) || $data['file_oldest'] > $date) $data['file_oldest'] = $date;
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert php.ini shorthands to byte
+ *
+ * @author <gilthans dot NO dot SPAM at gmail dot com>
+ * @link http://de3.php.net/manual/en/ini.core.php#79564
+ */
+ function _to_byte($v){
+ $l = substr($v, -1);
+ $ret = substr($v, 0, -1);
+ switch(strtoupper($l)){
+ case 'P':
+ $ret *= 1024;
+ case 'T':
+ $ret *= 1024;
+ case 'G':
+ $ret *= 1024;
+ case 'M':
+ $ret *= 1024;
+ case 'K':
+ $ret *= 1024;
+ break;
+ }
+ return $ret;
+ }
+}
diff --git a/lib/plugins/popularity/lang/ar/lang.php b/lib/plugins/popularity/lang/ar/lang.php
index c0e7dc6af..b2581294a 100644
--- a/lib/plugins/popularity/lang/ar/lang.php
+++ b/lib/plugins/popularity/lang/ar/lang.php
@@ -7,3 +7,8 @@
*/
$lang['name'] = 'رد الشعبية (قد يأخذ بعض الوقت ليحمل)';
$lang['submit'] = 'أرسل البيانات';
+$lang['autosubmit'] = 'ارسل البيانات آليا كل شهر';
+$lang['submissionFailed'] = 'تعذر إرسال البيانات بسبب الخطأ التالي:';
+$lang['submitDirectly'] = 'يمكنك إرسال البيانات يدويا بارسال النموذج التالي.';
+$lang['autosubmitError'] = 'فشلت آخر محاولة للإرسال، بسبب الخطأ التالي:';
+$lang['lastSent'] = 'أرسلت البيانات';
diff --git a/lib/plugins/popularity/lang/ar/submitted.txt b/lib/plugins/popularity/lang/ar/submitted.txt
new file mode 100644
index 000000000..085e3bd98
--- /dev/null
+++ b/lib/plugins/popularity/lang/ar/submitted.txt
@@ -0,0 +1,3 @@
+====== رد الشعبية ======
+
+أرسلت البيانات بنجاح. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/cs/intro.txt b/lib/plugins/popularity/lang/cs/intro.txt
index 70cf1a42c..4b386568a 100644
--- a/lib/plugins/popularity/lang/cs/intro.txt
+++ b/lib/plugins/popularity/lang/cs/intro.txt
@@ -1,6 +1,6 @@
===== Průzkum používání =====
-Tento nástroj jednorázově shromáží anonymní data o vaší wiki a umožní vám odeslat je vývojářům DokuWiki. To jim pomůže lépe porozumět, jak uživatelé DokuWiki používají, a jejich rozhodnutí při dalším vývoji budou založena na statistikách z reálného používání DokuWiki.
+Tento nástroj jednorázově shromáždí anonymní data o vaší wiki a umožní vám odeslat je vývojářům DokuWiki. To jim pomůže lépe porozumět, jak uživatelé DokuWiki používají, a jejich rozhodnutí při dalším vývoji budou založena na statistikách z reálného používání DokuWiki.
Chcete-li pomoci vývojářům, čas od času, jak vaše wiki poroste, použijte tento nástroj. Vaše data budou pokaždé označena stejným anonymním identifikátorem.
diff --git a/lib/plugins/popularity/lang/de-informal/lang.php b/lib/plugins/popularity/lang/de-informal/lang.php
index 076b37115..f884ed690 100644
--- a/lib/plugins/popularity/lang/de-informal/lang.php
+++ b/lib/plugins/popularity/lang/de-informal/lang.php
@@ -6,6 +6,12 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['name'] = 'Popularitätsrückmeldung (kann eine Weile dauern, bis es fertig geladen wurde)';
$lang['submit'] = 'Sende Daten';
+$lang['autosubmit'] = 'Daten einmal im Monat automatisch senden';
+$lang['submissionFailed'] = 'Die Daten konnten aufgrund des folgenden Fehlers nicht gesendet werden: ';
+$lang['submitDirectly'] = 'Du kannst die Daten durch Betätigung des Buttons manuell versenden.';
+$lang['autosubmitError'] = 'Beim letzten automatischen Versuch die Daten zu senden, ist folgender Fehler aufgetreten: ';
+$lang['lastSent'] = 'Die Daten wurden gesendet';
diff --git a/lib/plugins/popularity/lang/de-informal/submitted.txt b/lib/plugins/popularity/lang/de-informal/submitted.txt
new file mode 100644
index 000000000..e7b45b5b7
--- /dev/null
+++ b/lib/plugins/popularity/lang/de-informal/submitted.txt
@@ -0,0 +1,3 @@
+====== Popularitäts-Feedback ======
+
+Die Daten wurden erfolgreich versandt. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/de/lang.php b/lib/plugins/popularity/lang/de/lang.php
index 1372e9d8a..4649062f7 100644
--- a/lib/plugins/popularity/lang/de/lang.php
+++ b/lib/plugins/popularity/lang/de/lang.php
@@ -11,6 +11,13 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['name'] = 'Popularitäts-Feedback (Eventuell längere Ladezeit)';
$lang['submit'] = 'Daten senden';
+$lang['autosubmit'] = 'Daten einmal im Monat automatisch senden';
+$lang['submissionFailed'] = 'Die Daten konnten aufgrund des folgenden Fehlers nicht gesendet werden: ';
+$lang['submitDirectly'] = 'Sie können die Daten durch Betätigung des Buttons manuell versenden.';
+$lang['autosubmitError'] = 'Beim letzten automatischen Versuch die Daten zu senden, ist folgender Fehler aufgetreten: ';
+$lang['lastSent'] = 'Die Daten wurden gesendet';
diff --git a/lib/plugins/popularity/lang/de/submitted.txt b/lib/plugins/popularity/lang/de/submitted.txt
new file mode 100644
index 000000000..e7b45b5b7
--- /dev/null
+++ b/lib/plugins/popularity/lang/de/submitted.txt
@@ -0,0 +1,3 @@
+====== Popularitäts-Feedback ======
+
+Die Daten wurden erfolgreich versandt. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/en/lang.php b/lib/plugins/popularity/lang/en/lang.php
index c9912b7ad..78a5e862c 100644
--- a/lib/plugins/popularity/lang/en/lang.php
+++ b/lib/plugins/popularity/lang/en/lang.php
@@ -1,4 +1,9 @@
<?php
-$lang['name'] = 'Popularity Feedback (may take some time to load)';
-$lang['submit'] = 'Send Data';
+$lang['name'] = 'Popularity Feedback (may take some time to load)';
+$lang['submit'] = 'Send Data';
+$lang['autosubmit'] = 'Automatically send data once a month';
+$lang['submissionFailed'] = 'The data couldn\'t be sent due to the following error:';
+$lang['submitDirectly'] = 'You can send the data manually by submitting the following form.';
+$lang['autosubmitError'] = 'The last autosubmit failed, because of the following error: ';
+$lang['lastSent'] = 'The data has been sent ';
diff --git a/lib/plugins/popularity/lang/en/submitted.txt b/lib/plugins/popularity/lang/en/submitted.txt
new file mode 100644
index 000000000..30f2784aa
--- /dev/null
+++ b/lib/plugins/popularity/lang/en/submitted.txt
@@ -0,0 +1,3 @@
+====== Popularity Feedback ======
+
+The data has been sent succesfully.
diff --git a/lib/plugins/popularity/lang/es/lang.php b/lib/plugins/popularity/lang/es/lang.php
index c76190c2c..6aa9a823d 100644
--- a/lib/plugins/popularity/lang/es/lang.php
+++ b/lib/plugins/popularity/lang/es/lang.php
@@ -19,3 +19,8 @@
*/
$lang['name'] = 'Retroinformación (Feedback) plugin Popularity';
$lang['submit'] = 'Enviar datos';
+$lang['autosubmit'] = 'Enviar automáticamente datos una vez al mes';
+$lang['submissionFailed'] = 'Los datos no se pudo enviar debido al error siguiente:';
+$lang['submitDirectly'] = 'Puede enviar los datos de forma manual mediante la presentación de la siguiente forma.';
+$lang['autosubmitError'] = 'El último auto no pudo presentar, debido al error siguiente:';
+$lang['lastSent'] = 'Los datos se han enviado';
diff --git a/lib/plugins/popularity/lang/es/submitted.txt b/lib/plugins/popularity/lang/es/submitted.txt
new file mode 100644
index 000000000..bb1754cdd
--- /dev/null
+++ b/lib/plugins/popularity/lang/es/submitted.txt
@@ -0,0 +1,3 @@
+====== Retroinformación Popularity ======
+
+Los datos se han enviado con éxito. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/he/lang.php b/lib/plugins/popularity/lang/he/lang.php
index 024f94ae8..f619127cd 100644
--- a/lib/plugins/popularity/lang/he/lang.php
+++ b/lib/plugins/popularity/lang/he/lang.php
@@ -5,6 +5,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['name'] = 'משוב פופולריות (יתכן זמן טעינה ארוך)';
$lang['submit'] = 'שלח מידע';
diff --git a/lib/plugins/popularity/lang/ko/lang.php b/lib/plugins/popularity/lang/ko/lang.php
index 3a28b1b0e..91d798a5f 100644
--- a/lib/plugins/popularity/lang/ko/lang.php
+++ b/lib/plugins/popularity/lang/ko/lang.php
@@ -6,6 +6,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['name'] = '인기도 조사 (불러오는데 시간이 걸릴 수 있습니다.)';
$lang['submit'] = '자료 보내기';
diff --git a/lib/plugins/popularity/lang/la/intro.txt b/lib/plugins/popularity/lang/la/intro.txt
index 6f4ce8488..c3029caf4 100644
--- a/lib/plugins/popularity/lang/la/intro.txt
+++ b/lib/plugins/popularity/lang/la/intro.txt
@@ -1,5 +1,10 @@
====== Index Fauoris Popularis ======
-Haec machina fauorem popularem mittis sic ut creatores uicis meliorem illum facere possint.
+Haoc instrumentum fauorem popularem mittis sic ut creatores uicis meliorem illum facere possint.
+
+Rursum te fauorem mittere experamus sic ut si mutationes meliores uel peiores esse uidere possimus.
+
+Res mittendae tua forma in usu, numerus et pondus paginarum et aliarum rerum, addenda in usu et de PHP.
+
+Res rudes mittendae subter ostenduntur. "Res mittere" premas ut eas transferas.
-Rursum te fauorem mittere experamus sic ut si mutationes meliores uel peiores esse uidere possimus. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/la/lang.php b/lib/plugins/popularity/lang/la/lang.php
index e634f9d41..c7f307c29 100644
--- a/lib/plugins/popularity/lang/la/lang.php
+++ b/lib/plugins/popularity/lang/la/lang.php
@@ -2,6 +2,12 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
$lang['name'] = 'Index fauoris popularis (multum tempus quaerere potest)';
$lang['submit'] = 'Missum die';
+$lang['autosubmit'] = 'Constanter res omni mense mittuntur';
+$lang['submissionFailed'] = 'Res non mittuntur ea causa:';
+$lang['submitDirectly'] = 'Res tu mittere potes cum hoc exemplar compleas.';
+$lang['autosubmitError'] = 'Extrema missio lapsa est ea causa:';
+$lang['lastSent'] = 'Res missae sunt';
diff --git a/lib/plugins/popularity/lang/la/submitted.txt b/lib/plugins/popularity/lang/la/submitted.txt
new file mode 100644
index 000000000..2b2faf439
--- /dev/null
+++ b/lib/plugins/popularity/lang/la/submitted.txt
@@ -0,0 +1,3 @@
+====== Index fauoris popularis ======
+
+Res feliciter missae sunt. \ No newline at end of file
diff --git a/lib/plugins/popularity/lang/ru/intro.txt b/lib/plugins/popularity/lang/ru/intro.txt
index 587a7ae85..e8118e4eb 100644
--- a/lib/plugins/popularity/lang/ru/intro.txt
+++ b/lib/plugins/popularity/lang/ru/intro.txt
@@ -1,10 +1,10 @@
====== Сбор информации о популярности ======
-Этот инструмент собирает анонимные данные о вашей вики и позволяет вам отправить их разработчикам «ДокуВики». Эти данные помогут им понять то, как именно используется «ДокуВики», и удостовериться, что принимаемые проектные решения соответствуют жизненным реалиям.
+Этот инструмент собирает анонимные данные о вашей вики и позволяет вам отправить их разработчикам «ДокуВики». Эти данные помогут им понять, как именно используется «ДокуВики», и удостовериться, что принимаемые проектные решения соответствуют жизненным реалиям.
-Отправляйте данные время от времени для того, чтобы сообщить разработчикам о том, что ваша вики «подросла». Отправленные вами данные будут идентифицированы по анонимному ID.
+Отправляйте данные время от времени для того, чтобы сообщать разработчикам о том, что ваша вики «подросла». Отправленные вами данные будут идентифицированы по анонимному ID.
Собранные данные содержат такую информацию, как: версия «ДокуВики», количество и размер ваших страниц и файлов, установленные плагины, информацию об установленном PHP.
-Данные, которые будут посланы, представлены ниже. Пожалуйста, используйте кнопку «Отправить данные», чтобы передать информацию.
+Данные, которые будут отосланы, представлены ниже. Пожалуйста, используйте кнопку «Отправить данные», чтобы передать информацию.
diff --git a/lib/plugins/popularity/lang/ru/lang.php b/lib/plugins/popularity/lang/ru/lang.php
index df89c7022..b63558134 100644
--- a/lib/plugins/popularity/lang/ru/lang.php
+++ b/lib/plugins/popularity/lang/ru/lang.php
@@ -14,3 +14,8 @@
*/
$lang['name'] = 'Сбор информации о популярности (для загрузки может потребоваться некоторое время)';
$lang['submit'] = 'Отправить данные';
+$lang['autosubmit'] = 'Автоматически отправлять данные один раз в месяц';
+$lang['submissionFailed'] = 'Данные не могут быть отправлены из-за ошибки:';
+$lang['submitDirectly'] = 'Вы можете отправлять данные вручную, заполнив форму:';
+$lang['autosubmitError'] = 'Последнее автоотправление данных не удалось из-за ошибки:';
+$lang['lastSent'] = 'Данные отправлены';
diff --git a/lib/plugins/popularity/lang/sl/lang.php b/lib/plugins/popularity/lang/sl/lang.php
index befb1eec0..dc81ec060 100644
--- a/lib/plugins/popularity/lang/sl/lang.php
+++ b/lib/plugins/popularity/lang/sl/lang.php
@@ -4,5 +4,6 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
$lang['submit'] = 'Pošlji';
diff --git a/lib/plugins/popularity/lang/tr/lang.php b/lib/plugins/popularity/lang/tr/lang.php
index 682b51218..fe87d1548 100644
--- a/lib/plugins/popularity/lang/tr/lang.php
+++ b/lib/plugins/popularity/lang/tr/lang.php
@@ -2,11 +2,10 @@
/**
* Turkish language file
*
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['name'] = 'Popülerlik Geribeslemesi (yüklemesi uzun sürebilir)';
$lang['submit'] = 'Verileri Gönder';
diff --git a/lib/plugins/popularity/plugin.info.txt b/lib/plugins/popularity/plugin.info.txt
new file mode 100644
index 000000000..2652bd669
--- /dev/null
+++ b/lib/plugins/popularity/plugin.info.txt
@@ -0,0 +1,7 @@
+base popularity
+author Andreas Gohr
+email andi@splitbrain.org
+date 2010-12-09
+name Popularity Feedback Plugin
+desc Send anonymous data about your wiki to the developers.
+url http://www.dokuwiki.org/plugin:popularity
diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php
index 8a2cd5553..e188e2488 100644
--- a/lib/plugins/revert/admin.php
+++ b/lib/plugins/revert/admin.php
@@ -196,4 +196,4 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/revert/lang/cs/intro.txt b/lib/plugins/revert/lang/cs/intro.txt
index bbc0df25a..1e1cd0fd8 100644
--- a/lib/plugins/revert/lang/cs/intro.txt
+++ b/lib/plugins/revert/lang/cs/intro.txt
@@ -1,3 +1,3 @@
====== Obnova zaspamovaných stránek ======
-Tato stránka pomůže při automatické obnově po spamovém útoku. Pro nalezení seznamu zaspamovaných stránek nedřív zadejte hledaný výraz (např. spamové URL) a pak potvrďte, že nalezené stránky opravdu obsahují spam a mohou být obnoveny.
+Tato stránka pomůže při automatické obnově po spamovém útoku. Pro nalezení seznamu zaspamovaných stránek nejdříve zadejte hledaný výraz (např. spamové URL) a pak potvrďte, že nalezené stránky opravdu obsahují spam a mohou být obnoveny.
diff --git a/lib/plugins/revert/lang/de-informal/lang.php b/lib/plugins/revert/lang/de-informal/lang.php
index ac2f35e85..b6709d2fa 100644
--- a/lib/plugins/revert/lang/de-informal/lang.php
+++ b/lib/plugins/revert/lang/de-informal/lang.php
@@ -6,6 +6,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Zurückstellungsmanager';
$lang['filter'] = 'Durchsuche als Spam markierte Seiten';
diff --git a/lib/plugins/revert/lang/de/lang.php b/lib/plugins/revert/lang/de/lang.php
index 5dee8007b..0bc8e2ce0 100644
--- a/lib/plugins/revert/lang/de/lang.php
+++ b/lib/plugins/revert/lang/de/lang.php
@@ -12,6 +12,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Seiten wieder herstellen';
$lang['filter'] = 'Nach betroffenen Seiten suchen';
diff --git a/lib/plugins/revert/lang/en/lang.php b/lib/plugins/revert/lang/en/lang.php
index a2002f1a7..6bf867ded 100644
--- a/lib/plugins/revert/lang/en/lang.php
+++ b/lib/plugins/revert/lang/en/lang.php
@@ -20,4 +20,4 @@ $lang['revstop'] = 'Reversion process finished successfully.';
$lang['note1'] = 'Note: this search is case sensitive';
$lang['note2'] = 'Note: the page will be reverted to the last version not containing the given spam term <i>%s</i>.';
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/revert/lang/he/lang.php b/lib/plugins/revert/lang/he/lang.php
index 585487816..ac3c3412e 100644
--- a/lib/plugins/revert/lang/he/lang.php
+++ b/lib/plugins/revert/lang/he/lang.php
@@ -5,6 +5,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['menu'] = 'מנהל שחזור';
$lang['filter'] = 'חפש דפים עם ספאם';
diff --git a/lib/plugins/revert/lang/ko/lang.php b/lib/plugins/revert/lang/ko/lang.php
index 5e070de92..0163d2754 100644
--- a/lib/plugins/revert/lang/ko/lang.php
+++ b/lib/plugins/revert/lang/ko/lang.php
@@ -6,6 +6,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['menu'] = '복구 관리자';
$lang['filter'] = '스팸 페이지 검색 ';
diff --git a/lib/plugins/revert/lang/la/intro.txt b/lib/plugins/revert/lang/la/intro.txt
index 35916f683..99a206f63 100644
--- a/lib/plugins/revert/lang/la/intro.txt
+++ b/lib/plugins/revert/lang/la/intro.txt
@@ -1,3 +1,3 @@
====== Restituendi Administrator ======
-Haec pagina contra mala interretialia paginas restituta. Ut paginas aegras quaeras, malum VRL scribe, deinde paginas malas eligas. \ No newline at end of file
+Haec pagina contra mala interretialia paginas restituta. Vt paginas aegras quaeras, malum VRL scribe, deinde paginas malas eligas. \ No newline at end of file
diff --git a/lib/plugins/revert/lang/la/lang.php b/lib/plugins/revert/lang/la/lang.php
index f742e63f2..af4203437 100644
--- a/lib/plugins/revert/lang/la/lang.php
+++ b/lib/plugins/revert/lang/la/lang.php
@@ -2,6 +2,7 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
$lang['menu'] = 'Restituendi administrator';
$lang['filter'] = 'Malas paginas quaerere';
diff --git a/lib/plugins/revert/lang/ru/intro.txt b/lib/plugins/revert/lang/ru/intro.txt
index 66c5af005..52d1f8d3d 100644
--- a/lib/plugins/revert/lang/ru/intro.txt
+++ b/lib/plugins/revert/lang/ru/intro.txt
@@ -1,3 +1,3 @@
====== Менеджер откаток ======
-Эта страница поможет вам в автоматической откатке изменений после спам-атаки. Для того, чтобы найти спам-страницы, введите ключевые слова и произведите поиск (например, по URL спамера). Затем убедитесь, что найденные страницы действительно содержат спам, и сделайте откатку изменений.
+Эта страница поможет вам в автоматической откатке изменений после спам-атаки. Для того, чтобы найти спам-страницы, введите ключевые слова и произведите поиск (например, по URL спамера). Затем убедитесь, что найденные страницы действительно содержат спам и сделайте откатку изменений.
diff --git a/lib/plugins/revert/lang/sl/lang.php b/lib/plugins/revert/lang/sl/lang.php
index 1fcf4ca36..57ae9d092 100644
--- a/lib/plugins/revert/lang/sl/lang.php
+++ b/lib/plugins/revert/lang/sl/lang.php
@@ -4,4 +4,5 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
diff --git a/lib/plugins/revert/lang/tr/lang.php b/lib/plugins/revert/lang/tr/lang.php
index 164a8ec4f..aa1458a95 100644
--- a/lib/plugins/revert/lang/tr/lang.php
+++ b/lib/plugins/revert/lang/tr/lang.php
@@ -2,11 +2,10 @@
/**
* Turkish language file
*
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['menu'] = 'Eskiye Döndürme';
$lang['filter'] = 'Spam bulunan sayfaları ara';
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 127b92ce5..12451f636 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -188,10 +188,13 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
function localFN($id) {
global $conf;
$plugin = $this->getPluginName();
- $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
- if(!@file_exists($file)){
- //fall back to english
- $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ $file = DOKU_CONF.'/plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt';
+ if (!@file_exists($file)){
+ $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt';
+ }
}
return $file;
}
@@ -276,4 +279,4 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
}
}
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 :
diff --git a/lib/plugins/usermanager/lang/cs/lang.php b/lib/plugins/usermanager/lang/cs/lang.php
index 9c5a2abc9..7d8e4599d 100644
--- a/lib/plugins/usermanager/lang/cs/lang.php
+++ b/lib/plugins/usermanager/lang/cs/lang.php
@@ -45,7 +45,7 @@ $lang['edit_usermissing'] = 'Vybraný uživatel nebyl nalezen, zadané uži
$lang['user_notify'] = 'Upozornit uživatele';
$lang['note_notify'] = 'Maily s upozorněním se budou posílat pouze, když uživatel dostává nové heslo.';
$lang['note_group'] = 'Noví uživatelé budou přidáváni do této výchozí skupiny (%s), pokud pro ně není uvedena žádná skupina.';
-$lang['note_pass'] = 'Heslo bude automaticky vygenerováno pokud je pole ponacháno prázdné a je zapnutá notifikace uživatele.';
+$lang['note_pass'] = 'Heslo bude automaticky vygenerováno pokud je pole ponecháno prázdné a je zapnutá notifikace uživatele.';
$lang['add_ok'] = 'Uživatel úspěšně vytvořen';
$lang['add_fail'] = 'Vytvoření uživatele selhalo';
$lang['notify_ok'] = 'Odeslán mail s upozorněním';
diff --git a/lib/plugins/usermanager/lang/de-informal/lang.php b/lib/plugins/usermanager/lang/de-informal/lang.php
index e906c0cf8..95b36c60f 100644
--- a/lib/plugins/usermanager/lang/de-informal/lang.php
+++ b/lib/plugins/usermanager/lang/de-informal/lang.php
@@ -6,6 +6,7 @@
* @author Juergen Schwarzer <jschwarzer@freenet.de>
* @author Marcel Metz <marcel_metz@gmx.de>
* @author Matthias Schulte <post@lupo49.de>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Benutzerverwalter';
$lang['noauth'] = '(Benutzeranmeldung ist nicht verfügbar)';
diff --git a/lib/plugins/usermanager/lang/de/lang.php b/lib/plugins/usermanager/lang/de/lang.php
index 816aaebd7..090d1d1d9 100644
--- a/lib/plugins/usermanager/lang/de/lang.php
+++ b/lib/plugins/usermanager/lang/de/lang.php
@@ -13,6 +13,8 @@
* @author Blitzi94@gmx.de
* @author Robert Bogenschneider <robog@GMX.de>
* @author Robert Bogenschneider <robog@gmx.de>
+ * @author Niels Lange <niels@boldencursief.nl>
+ * @author Christian Wichmann <nospam@zone0.de>
*/
$lang['menu'] = 'Benutzerverwaltung';
$lang['noauth'] = '(Authentifizierungssystem nicht verfügbar)';
diff --git a/lib/plugins/usermanager/lang/he/lang.php b/lib/plugins/usermanager/lang/he/lang.php
index b2b55c3b4..601163013 100644
--- a/lib/plugins/usermanager/lang/he/lang.php
+++ b/lib/plugins/usermanager/lang/he/lang.php
@@ -6,6 +6,7 @@
* @author Dotan Kamber <kamberd@yahoo.com>
* @author Moshe Kaplan <mokplan@gmail.com>
* @author Yaron Yogev <yaronyogev@gmail.com>
+ * @author Yaron Shahrabani <sh.yaron@gmail.com>
*/
$lang['menu'] = 'מנהל משתמשים';
$lang['noauth'] = '(אימות משתמשים אינו זמין)';
diff --git a/lib/plugins/usermanager/lang/ko/lang.php b/lib/plugins/usermanager/lang/ko/lang.php
index eeb8eb791..f2322414a 100644
--- a/lib/plugins/usermanager/lang/ko/lang.php
+++ b/lib/plugins/usermanager/lang/ko/lang.php
@@ -6,6 +6,7 @@
* @author dongnak@gmail.com
* @author Song Younghwan <purluno@gmail.com>
* @author SONG Younghwan <purluno@gmail.com>
+ * @author Seung-Chul Yoo <dryoo@live.com>
*/
$lang['menu'] = '사용자 관리자';
$lang['noauth'] = '(사용자 인증이 불가능합니다.)';
diff --git a/lib/plugins/usermanager/lang/la/lang.php b/lib/plugins/usermanager/lang/la/lang.php
index 2646979bd..52c848754 100644
--- a/lib/plugins/usermanager/lang/la/lang.php
+++ b/lib/plugins/usermanager/lang/la/lang.php
@@ -2,6 +2,7 @@
/**
* Latin language file
*
+ * @author Massimiliano Vassalli <vassalli.max@gmail.com>
*/
$lang['menu'] = 'Sodalis Tabella';
$lang['noauth'] = '(Sodalis confirmatio deest)';
diff --git a/lib/plugins/usermanager/lang/ru/lang.php b/lib/plugins/usermanager/lang/ru/lang.php
index 81d9a72a6..d7a0591ab 100644
--- a/lib/plugins/usermanager/lang/ru/lang.php
+++ b/lib/plugins/usermanager/lang/ru/lang.php
@@ -47,12 +47,12 @@ $lang['start'] = 'в начало';
$lang['prev'] = 'назад';
$lang['next'] = 'вперёд';
$lang['last'] = 'в конец';
-$lang['edit_usermissing'] = 'Выбранный пользователь не найден. Возможно, указанный логин был удалён или изменен извне.';
+$lang['edit_usermissing'] = 'Выбранный пользователь не найден. Возможно, указанный логин был удалён или изменён извне.';
$lang['user_notify'] = 'Сообщить пользователю';
$lang['note_notify'] = 'Письма с уведомлением высылаются только в случае получения нового пароля.';
$lang['note_group'] = 'Если группа не указана, новые пользователи будут добавлены в группу по умолчанию (%s).';
$lang['note_pass'] = 'Пароль будет сгенерирован автоматически, если поле оставлено пустым и включено уведомление пользователя.';
$lang['add_ok'] = 'Пользователь успешно добавлен';
$lang['add_fail'] = 'Не удалось добавить пользователя';
-$lang['notify_ok'] = 'Пиьмо с уведомлением отправлено';
+$lang['notify_ok'] = 'Письмо с уведомлением отправлено';
$lang['notify_fail'] = 'Не удалось отправить письмо с уведомлением';
diff --git a/lib/plugins/usermanager/lang/sl/lang.php b/lib/plugins/usermanager/lang/sl/lang.php
index e31f8ff1a..b671d65dc 100644
--- a/lib/plugins/usermanager/lang/sl/lang.php
+++ b/lib/plugins/usermanager/lang/sl/lang.php
@@ -4,17 +4,35 @@
*
* @author Dejan Levec <webphp@gmail.com>
* @author Boštjan Seničar <senicar@gmail.com>
+ * @author Gregor Skumavc (grega.skumavc@gmail.com)
*/
+$lang['menu'] = 'Urejanje uporabnikov';
+$lang['noauth'] = '(preverjanje uporabnikov ni na voljo)';
+$lang['nosupport'] = '(urejanje uporabnikov ni podprto)';
+$lang['badauth'] = 'neeljaven mehanizem za preverjanje';
$lang['user_id'] = 'Uporabnik';
$lang['user_pass'] = 'Geslo';
+$lang['user_name'] = 'Pravo ime';
$lang['user_mail'] = 'Email';
$lang['user_groups'] = 'Skupine';
+$lang['field'] = 'Polje';
+$lang['value'] = 'Vrednost';
$lang['add'] = 'Dodaj';
$lang['delete'] = 'Izbriši';
$lang['delete_selected'] = 'Izbriši izbrano';
$lang['edit'] = 'Uredi';
+$lang['edit_prompt'] = 'Uredi tega uporabnika';
$lang['modify'] = 'Shrani spremembe';
$lang['search'] = 'Iskanje';
+$lang['search_prompt'] = 'Išči';
+$lang['clear'] = 'Ponastavi filter iskanja';
+$lang['filter'] = 'Filter';
+$lang['summary'] = 'Prikazujem uporabnike %1$d-%2$d od najdenih %3$d. Vseh je %4$d.';
+$lang['nonefound'] = 'Ni najdenih uporabnikov. Vseh uporabnikov je %d.';
+$lang['delete_ok'] = '%d uporabnikov izbrisanih';
+$lang['delete_fail'] = '%d ni bilo možno izbrisati';
+$lang['update_ok'] = 'Uporabnik uspešno posodobljen';
+$lang['update_fail'] = 'Posodobitev uporabnika ni uspela';
$lang['prev'] = 'Prejšnji';
$lang['next'] = 'Naslednji';
$lang['last'] = 'Zadnji';
diff --git a/lib/plugins/usermanager/lang/tr/lang.php b/lib/plugins/usermanager/lang/tr/lang.php
index 28127d9d0..b9c9cfc52 100644
--- a/lib/plugins/usermanager/lang/tr/lang.php
+++ b/lib/plugins/usermanager/lang/tr/lang.php
@@ -2,11 +2,10 @@
/**
* Turkish language file
*
- * @author Aydın Coşkuner aydinweb@gmail.com
* @author Aydın Coşkuner <aydinweb@gmail.com>
- * @author yavuzselim@gmail.com
- * @author Cihan Kahveci kahvecicihan@gmail.com
+ * @author Cihan Kahveci <kahvecicihan@gmail.com>
* @author Yavuz Selim <yavuzselim@gmail.com>
+ * @author Caleb Maclennan <caleb@alerque.com>
*/
$lang['menu'] = 'Kullanıcı Yönetimi';
$lang['noauth'] = '(kullanıcı onaylaması yoktur)';
diff --git a/lib/scripts/ajax.js b/lib/scripts/ajax.js
index de009d448..44dcee999 100644
--- a/lib/scripts/ajax.js
+++ b/lib/scripts/ajax.js
@@ -5,44 +5,114 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Adrian Lang <lang@cosmocode.de>
*/
-addInitEvent(function () {
+var ajax_quicksearch = {
- var inID = 'qsearch__in';
- var outID = 'qsearch__out';
+ inObj: null,
+ outObj: null,
+ sackObj: null,
+ delay: null,
- var inObj = document.getElementById(inID);
- var outObj = document.getElementById(outID);
+ init: function(inID, outID) {
- // objects found?
- if (inObj === null){ return; }
- if (outObj === null){ return; }
+ this.inObj = $(inID);
+ this.outObj = $(outID);
- function clear_results(){
- outObj.style.display = 'none';
- outObj.innerHTML = '';
- }
+ // objects found?
+ if (this.inObj === null) return;
+ if (this.outObj === null) return;
+
+ // prepare AJAX
+ this.sackObj = new sack(DOKU_BASE + 'lib/exe/ajax.php');
+ this.sackObj.AjaxFailedAlert = '';
+ this.sackObj.encodeURIString = false;
+ this.sackObj.onCompletion = ajax_quicksearch.onCompletion;
+
+ // attach eventhandler to search field
+ this.delay = new Delay(function () {
+ ajax_quicksearch.clear_results();
+ var value = ajax_quicksearch.inObj.value;
+ if(value === ''){ return; }
+ ajax_quicksearch.sackObj.runAJAX('call=qsearch&q=' + encodeURI(value));
+ });
+
+ addEvent(this.inObj, 'keyup', function () {
+ ajax_quicksearch.clear_results();
+ ajax_quicksearch.delay.start();
+ });
- var sack_obj = new sack(DOKU_BASE + 'lib/exe/ajax.php');
- sack_obj.AjaxFailedAlert = '';
- sack_obj.encodeURIString = false;
- sack_obj.onCompletion = function () {
- var data = sack_obj.response;
+ // attach eventhandler to output field
+ addEvent(this.outObj, 'click', function () {
+ ajax_quicksearch.outObj.style.display = 'none';
+ });
+ },
+
+ clear_results: function(){
+ ajax_quicksearch.outObj.style.display = 'none';
+ ajax_quicksearch.outObj.innerHTML = '';
+ },
+
+ onCompletion: function() {
+ var data = this.response; // 'this' is sack context
if (data === '') { return; }
+ var outObj = ajax_quicksearch.outObj;
+
outObj.innerHTML = data;
outObj.style.display = 'block';
- };
+ outObj.style['white-space'] = 'nowrap';
- // attach eventhandler to search field
- var delay = new Delay(function () {
- clear_results();
- var value = inObj.value;
- if(value === ''){ return; }
- sack_obj.runAJAX('call=qsearch&q=' + encodeURI(value));
- });
+ // shorten namespaces if too long
+ var width = outObj.clientWidth;
+ var links = outObj.getElementsByTagName('a');
+ for(var i=0; i<links.length; i++){
+ // maximum allowed width:
+ var max = width - links[i].offsetLeft;
+ var isRTL = (document.documentElement.dir == 'rtl');
- addEvent(inObj, 'keyup', function () {clear_results(); delay.start(); });
+ if(!isRTL && links[i].offsetWidth < max) continue;
+ if(isRTL && links[i].offsetLeft > 0) continue;
- // attach eventhandler to output field
- addEvent(outObj, 'click', function () {outObj.style.display = 'none'; });
+ var nsL = links[i].innerText.indexOf('(');
+ var nsR = links[i].innerText.indexOf(')');
+ var eli = 0;
+ var runaway = 0;
+
+ while( (nsR - nsL > 3) &&
+ (
+ (!isRTL && links[i].offsetWidth > max) ||
+ (isRTL && links[i].offsetLeft < 0)
+ )
+ ){
+ if(runaway++ > 500) return; // just in case something went wrong
+
+ if(eli){
+ // elipsis already inserted
+ if( (eli - nsL) > (nsR - eli) ){
+ // cut left
+ links[i].innerText = links[i].innerText.substring(0,eli-2)+
+ links[i].innerText.substring(eli);
+ }else{
+ // cut right
+ links[i].innerText = links[i].innerText.substring(0,eli+1)+
+ links[i].innerText.substring(eli+2);
+ }
+ }else{
+ // replace middle with ellipsis
+ var mid = Math.floor( nsL + ((nsR-nsL)/2) );
+ links[i].innerText = links[i].innerText.substring(0,mid)+'…'+
+ links[i].innerText.substring(mid+1);
+ }
+ eli = links[i].innerText.indexOf('…');
+ nsL = links[i].innerText.indexOf('(');
+ nsR = links[i].innerText.indexOf(')');
+ }
+ }
+ }
+
+};
+
+
+addInitEvent(function(){
+ ajax_quicksearch.init('qsearch__in','qsearch__out');
});
+
diff --git a/lib/tpl/default/rtl.css b/lib/tpl/default/rtl.css
index e40dd966d..82c85839b 100644
--- a/lib/tpl/default/rtl.css
+++ b/lib/tpl/default/rtl.css
@@ -55,8 +55,7 @@ div.dokuwiki li ol {
div.dokuwiki a.urlextern,
div.dokuwiki a.interwiki,
div.dokuwiki a.windows,
-div.dokuwiki a.mail,
-div.dokuwiki a.mail.JSnocheck {
+div.dokuwiki a.mail {
/* should work but doesn't - so we just disable icons here*/
/*
background-position: right 1px;