Turned out a test wasn't really testing what it should have been testing
and thus did hide a bug. Still puzzles me why it still worked some
times.
This patch also sets the default iteration count for bmd5 and pmd5 to 8.
This patch applies the correct pagename cleaning to namespaces as well.
Namespaces should follow the same rules as pagenames but due to a bug it
was possible to have namespaces ending in a underscore.
If you used such a namespace it will be inaccessible after applying this
patch. You should rename the namespace directory on the filesystem
(removing the trailing underscore). You old links will then work
automatically again. Rebuilding the search index is recommended.
Note, any filenames encoded with the previous SafeFN scheme will need to
be converted to the new scheme. Users of the old SafeFN scheme should
not use this new scheme until after converting their filenames.
this splits the long auth_cryptPassword() function into many member
functions of a new class PassHash which should make it more
maintainable and reusable for other projects.
This also adds two new methods djangomd5 and djangosha1 as used by the
popular python framework Django.
Maybe the auth_cryptPassword() and auth_verifyPassword() functions
should be deprecated in favor of using the class directly?
This function abstracts checking a given user and her groups against a
given member list (as used in the superuser and manager options).
It is also used in auth_isManager() and auth_isAdmin(), unlike the
previous function, this one skips the nameencode step as it should be
unnessary here (all input is given decoded).
The test cases where extended by some non-ID user and group names.
People with non-plain auth backends should check that their
administrator and manager setups still work as expected
As of VIM 7.3 it is no longer possible to specify the encoding in the
modeline. This gives an error message whenever such a file is opened,
thus this commit removes the enc setting from the modeline.
SafeFN encoding now always end the encoding block by appending a dot at the end of the file name. This is necessary since the file name may get an extension which is not encoded.
Since the specs aren't 100% clear, dates might be passed in different
formats by various XMLRPC clients. This patch makes date parsing a bit
more flexible.
Unit tests included.
This patch adds support to include plugin tests in the
DokuWiki testsuite. Plugin tests are located in a dedicated
directory _test/within a plugin directory. The naming
convention of the test files follows the one used in
DokuWikis testsuite.
<plugin>/_test/*.test.php -> single test
<plugin>/_test/*.group.php -> group test
The plugin tests are accessible via the web interface
of the test suite and via the cli interface. It is recommend
to bundle plugin test in a plugin group test. The webinterface
also allows to run all plugin tests at once.
Test files must include:
<dokuwiki>/_test/lib/unittest.php
Example Test:
require_once(DOKU_INC.'_test/lib/unittest.php');
class plugin_test extends Doku_UnitTestCase {
function test() {
$this->assertEqual(1,1);
}
}
Example Group Test:
require_once(DOKU_INC.'_test/lib/unittest.php');
class plugin_group_test extends Doku_GroupTest {
function group_test() {
$dir = dirname(__FILE__).'/';
$this->GroupTest('plugin_grouptest');
$this->addTestFile($dir . 'plugin.test1.php');
$this->addTestFile($dir . 'plugin.test2.php');
$this->addTestFile($dir . 'plugin.test3.php');
}
}
At the moment unittest.php contains only two
meta classes so plugins tests don't have to inherit
from the simpletest classes.
This patch should be treated as intermediate step to
allow for plugin tests. The testsuite wasn't designed
to include plugin tests. It should probably be refactored
at a later point.
Each searches on the wiki use this function. Scanning the index directory eachtime is time consuming with a constant series of disk access.
Switching a normal search to use file_exists 1 or more times, and not readdir all the directory.
Switching a wildcard search to use a lengths.idx file containing all the word lengths used in the wiki, file generated if a new configuration parameter $conf[readdircache] is not 0 and fixed to a time in second. Creation of a new function idx_listIndexLengths to do this part.
$_SERVER['PATH_INFO'] is used now to determine the page id when using
internal rewriting, in all testcases I've seen so far this variable
was set correctly. There are also a couple of fallbacks if the variable
doesn't exist, $_SERVER['SCRIPT_NAME'] is now preferred instead of
custom path extraction which fails when doku.php is outside the document
root.