Skip to content

Commit

Permalink
Merge remote branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lupo49 committed Nov 12, 2011
2 parents 1614eb9 + 2c961e6 commit fe9851b
Show file tree
Hide file tree
Showing 225 changed files with 4,333 additions and 3,413 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -20,6 +20,8 @@
/data/index/*
/data/locks/*
/data/media/*
/data/media_meta/*
/data/media_attic/*
/data/meta/*
/data/pages/*
/data/tmp/*
Expand Down
3 changes: 1 addition & 2 deletions _test/cases/inc/auth_password.test.php
Expand Up @@ -43,8 +43,7 @@ function test_verifySelf(){
foreach($this->passes as $method => $hash){
$info = "testing method $method";
$this->signal('failinfo',$info);

$hash = auth_cryptPassword('foo'.$method);
$hash = auth_cryptPassword('foo'.$method,$method);
$this->assertTrue(auth_verifyPassword('foo'.$method,$hash));
}
}
Expand Down
10 changes: 10 additions & 0 deletions _test/cases/inc/pageutils_clean_id.test.php
Expand Up @@ -35,6 +35,16 @@ function test_default(){
$tests[] = array('ښ侧化并곦 β',false,'ښ侧化并곦_β');
$tests[] = array('page:page',false,'page:page');
$tests[] = array('page;page',false,'page:page');
$tests[] = array('page:page 1.2',false,'page:page_1.2');

$tests[] = array('page._#!','false','page');
$tests[] = array('._#!page','false','page');
$tests[] = array('page._#!page','false','page._page');
$tests[] = array('ns._#!:page','false','ns:page');
$tests[] = array('ns:._#!page','false','ns:page');
$tests[] = array('ns._#!ns:page','false','ns._ns:page');
$tests[] = array('ns_:page',false,'ns:page');
$tests[] = array('page...page','false','page...page');

$conf['useslash'] = 0;
$tests[] = array('page/page',false,'page_page');
Expand Down
1 change: 1 addition & 0 deletions _test/cases/inc/utf8_stripspecials.test.php
Expand Up @@ -17,6 +17,7 @@ function test1(){
$tests[] = array('ascii.string','','\._\-:\*','asciistring');
$tests[] = array('ascii.string',' ','\._\-:\*','ascii string');
$tests[] = array('2.1.14',' ','\._\-:\*','2 1 14');
$tests[] = array('string with nbsps','_','\*','string_with_nbsps');

foreach($tests as $test){
$this->assertEqual(utf8_stripspecials($test[0],$test[1],$test[2]),$test[3]);
Expand Down
89 changes: 89 additions & 0 deletions _test/jslint.js
@@ -0,0 +1,89 @@
/**
* Copy to a JavaScript console on your DokuWiki instance and execute
* Runs JSLint on all our JavaScript files with our settings
*/

(function () {
var globals = ['jQuery', 'SIG', 'NS', 'JSINFO', 'LANG', 'DOKU_BASE',
'DOKU_UHC' // FIXME: Should be moved to JSINFO
], files = {
'scripts/behaviour.js': null,
//"scripts/compatibility.js": null,
"scripts/cookie.js": null,
//"scripts/delay.js": null,
//"scripts/drag.js": null,
"scripts/edit.js": null,
"scripts/editor.js": null,
"scripts/helpers.js": null,
"scripts/hotkeys.js": null,
"scripts/index.js": null,
"scripts/linkwiz.js": null,
"scripts/locktimer.js": null,
"scripts/media.js": null,
"scripts/page.js": null,
"scripts/qsearch.js": null,
"scripts/script.js": null,
"scripts/textselection.js": null,
"scripts/toolbar.js": null,
"scripts/tree.js": null //,
//"scripts/tw-sack.js": null
}, overwrites = {
"scripts/script.js": {evil: true},
"scripts/media.js": {devel: true, windows: true},
"scripts/locktimer.js": {devel: true},
"scripts/behaviour.js": {devel: true},
"scripts/helpers.js": {windows: true}
};

jQuery.ajax({
dataType: 'script',
type: "GET",
// url: 'http://jshint.com/jshint.js'
url: 'https://raw.github.com/douglascrockford/JSLint/master/jslint.js',
success: function () {
for (var file in files) {
jQuery.ajax({
cache: false,
async: false,
type: "GET",
url: DOKU_BASE + 'lib/' + file,
dataType: 'text',
success: function (res) {
files[file] = res;
var data = lint(files[file]);
jQuery.merge(globals, data.globals);
}});
}

for (var file in files) {
if (!files[file]) {
continue;
}
// FIXME more fine-grained write access
var data = lint('/*global ' + globals.join(':true, ') +
':true*/\n' + files[file], overwrites[file]);
console.log(file);
jQuery.each(data.errors || [], function (_, val) {
if (val === null) {
return;
}
console.error(val.reason + ' (Line ' + (val.line - 1) +
', character ' + val.character + '):\n' +
val.evidence);
});
};
}
});

function lint(txt, overwrite) {
JSLINT(txt, jQuery.extend({
// These settings are necessary
browser: true,

// Things we probably should learn someday
sloppy: true, white: true, eqeq: true, nomen: true,
plusplus: true, regexp: true
}, overwrite));
return JSLINT.data();
}
})();
File renamed without changes.
12 changes: 12 additions & 0 deletions data/deleted.files
Expand Up @@ -4,6 +4,18 @@
# A copy of this list is maintained at
# http://www.dokuwiki.org/install:upgrade#files_to_remove

# removed in 2011-11-10
lib/_fla/.htaccess
lib/_fla/MultipleUpload.as
lib/_fla/README
lib/_fla/index.html
lib/_fla/multipleUpload.fla
lib/exe/multipleUpload.swf
lib/images/multiupload.png
lib/scripts/ajax.js
lib/scripts/events.js
lib/scripts/subscriptions.js

# removed in 2011-05-25
conf/words.aspell.dist
lib/styles/style.css
Expand Down
2 changes: 1 addition & 1 deletion doku.php
Expand Up @@ -7,7 +7,7 @@
*/

// update message version
$updateVersion = 34;
$updateVersion = 35;

// xdebug_start_profiling();

Expand Down
4 changes: 3 additions & 1 deletion inc/FeedParser.php
Expand Up @@ -49,13 +49,15 @@ 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);

$this->headers = $this->http->resp_headers;
$this->body = $this->http->resp_body;
$this->error = $this->http->error;

$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;

return $this->success;
}

Expand Down
2 changes: 1 addition & 1 deletion inc/JpegMeta.php
Expand Up @@ -1207,7 +1207,7 @@ function _writeJPEGMarker($marker, $length, &$data, $origLength) {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function _parseFileInfo() {
if (file_exists($this->_fileName)) {
if (file_exists($this->_fileName) && is_file($this->_fileName)) {
$this->_info['file'] = array();
$this->_info['file']['Name'] = basename($this->_fileName);
$this->_info['file']['Path'] = fullpath($this->_fileName);
Expand Down
17 changes: 10 additions & 7 deletions inc/PassHash.class.php
Expand Up @@ -82,7 +82,7 @@ function verify_hash($clear,$hash){
public function gen_salt($len=32){
$salt = '';
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
for($i=0;$i<$len,$i++;) $salt .= $chars[mt_rand(0,61)];
for($i=0;$i<$len;$i++) $salt .= $chars[mt_rand(0,61)];
return $salt;
}

Expand Down Expand Up @@ -292,17 +292,20 @@ public function hash_kmd5($clear, $salt=null){
* Password hashing method 'pmd5'
*
* Uses salted MD5 hashs. Salt is 1+8 bytes long, 1st byte is the
* iteration count.
* iteration count when given, for null salts $compute is used.
*
* @param string $clear - the clear text to hash
* @param string $salt - the salt to use, null for random
* @param string $magic - the hash identifier (P or H)
* @param int $compute - the iteration count for new passwords
* @returns string - hashed password
*/
public function hash_pmd5($clear, $salt=null, $magic='P'){
$this->init_salt($salt);

public function hash_pmd5($clear, $salt=null, $magic='P',$compute=8){
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
if(is_null($salt)){
$this->init_salt($salt);
$salt = $itoa64[$compute].$salt; // prefix iteration count
}
$iterc = $salt[0]; // pos 0 of salt is iteration count
$iter = strpos($itoa64,$iterc);
$iter = 1 << $iter;
Expand Down Expand Up @@ -340,8 +343,8 @@ public function hash_pmd5($clear, $salt=null, $magic='P'){
/**
* Alias for hash_pmd5
*/
public function hash_hmd5($clear, $salt=null, $magic='H'){
return $this->hash_pmd5($clear, $salt, $magic);
public function hash_hmd5($clear, $salt=null, $magic='H', $compute=8){
return $this->hash_pmd5($clear, $salt, $magic, $compute);
}

/**
Expand Down

0 comments on commit fe9851b

Please sign in to comment.