Upgrade to latest and greatest stable

This commit is contained in:
Hannes Magnusson
2013-12-12 09:56:02 -08:00
parent be5f47cf41
commit 1d56890359
34 changed files with 4490 additions and 4409 deletions

View File

@ -1 +1 @@
rc2013-11-18 "Binky RC2"
2013-12-08 "Binky"

View File

@ -2,6 +2,17 @@
# but were removed later. An up to date DokuWiki should not have any of
# the files installed
# removed in 2013-11-18
lib/images/arrow_down.gif
lib/images/arrow_up.gif
lib/images/at.gif
lib/images/close.png
lib/images/del.png
lib/images/edit.gif
lib/images/list-minus.gif
lib/images/list-plus.gif
lib/images/pencil.png
# removed in 2013-10-28
lib/images/interwiki/meatball.gif
lib/images/interwiki/wiki.gif

View File

@ -9,7 +9,7 @@
*/
// update message version
$updateVersion = 42;
$updateVersion = 43;
// xdebug_start_profiling();

View File

@ -430,8 +430,6 @@ function rss_buildItems(&$rss, &$data, $opt) {
if($cat) $item->category = $cat;
}
// Add only visible items
if(isVisiblePage($id)) {
// finally add the item to the feed object, after handing it to registered plugins
$evdata = array(
'item' => &$item,
@ -446,7 +444,6 @@ function rss_buildItems(&$rss, &$data, $opt) {
$evt->advise_after(); // for completeness
}
}
}
$event->advise_after();
}
@ -479,8 +476,12 @@ function rssListNamespace($opt) {
$ns = str_replace(':', '/', $ns);
$data = array();
sort($data);
search($data, $conf['datadir'], 'search_list', '', $ns);
$search_opts = array(
'depth' => 1,
'pagesonly' => true,
'listfiles' => true
);
search($data, $conf['datadir'], 'search_universal', $search_opts, $ns);
return $data;
}

View File

@ -576,7 +576,7 @@ class Mailer {
protected function prepareHeaders() {
$headers = '';
foreach($this->headers as $key => $val) {
if ($val === '') continue;
if ($val === '' || is_null($val)) continue;
$headers .= $this->wrappedHeaderLine($key, $val);
}
return $headers;
@ -640,16 +640,16 @@ class Mailer {
) return false;
// The To: header is special
if(isset($this->headers['To'])) {
$to = $this->headers['To'];
if(array_key_exists('To', $this->headers)) {
$to = (string)$this->headers['To'];
unset($this->headers['To']);
} else {
$to = '';
}
// so is the subject
if(isset($this->headers['Subject'])) {
$subject = $this->headers['Subject'];
if(array_key_exists('Subject', $this->headers)) {
$subject = (string)$this->headers['Subject'];
unset($this->headers['Subject']);
} else {
$subject = '';

View File

@ -680,7 +680,7 @@ function form_wikitext($attrs) {
// mandatory attributes
unset($attrs['name']);
unset($attrs['id']);
return '<textarea name="wikitext" id="wiki__text" '
return '<textarea name="wikitext" id="wiki__text" dir="auto" '
.buildAttributes($attrs,true).'>'.DOKU_LF
.formText($attrs['_text'])
.'</textarea>';

View File

@ -454,8 +454,8 @@ class Doku_Parser_Mode_table extends Doku_Parser_Mode {
}
function connectTo($mode) {
$this->Lexer->addEntryPattern('\s*\n\^',$mode,'table');
$this->Lexer->addEntryPattern('\s*\n\|',$mode,'table');
$this->Lexer->addEntryPattern('[\t ]*\n\^',$mode,'table');
$this->Lexer->addEntryPattern('[\t ]*\n\|',$mode,'table');
}
function postConnect() {

View File

@ -312,6 +312,11 @@ function css_styleini($tpl) {
);
}
/**
* Amend paths used in replacement relative urls, refer FS#2879
*
* @author Chris Smith <chris@jalakai.co.uk>
*/
function css_fixreplacementurls($replacements, $location) {
foreach($replacements as $key => $value) {
$replacements[$key] = preg_replace('#(url\([ \'"]*)(?!/|data:|http://|https://| |\'|")#','\\1'.$location,$value);
@ -400,16 +405,29 @@ function css_loadfile($file,$location=''){
return $css_file->load($location);
}
/**
* Helper class to abstract loading of css/less files
*
* @author Chris Smith <chris@jalakai.co.uk>
*/
class DokuCssFile {
protected $filepath;
protected $location;
protected $filepath; // file system path to the CSS/Less file
protected $location; // base url location of the CSS/Less file
private $relative_path = null;
public function __construct($file) {
$this->filepath = $file;
}
/**
* Load the contents of the css/less file and adjust any relative paths/urls (relative to this file) to be
* relative to the dokuwiki root: the web root (DOKU_BASE) for most files; the file system root (DOKU_INC)
* for less files.
*
* @param string $location base url for this file
* @return string the CSS/Less contents of the file
*/
public function load($location='') {
if (!@file_exists($this->filepath)) return '';
@ -424,10 +442,17 @@ class DokuCssFile {
return $css;
}
/**
* Get the relative file system path of this file, relative to dokuwiki's root folder, DOKU_INC
*
* @return string relative file system path
*/
private function getRelativePath(){
if (is_null($this->relative_path)) {
$basedir = array(DOKU_INC);
// during testing, files may be found relative to a second base dir, TMP_DIR
if (defined('DOKU_UNITTEST')) {
$basedir[] = realpath(TMP_DIR);
}
@ -439,16 +464,26 @@ class DokuCssFile {
return $this->relative_path;
}
/**
* preg_replace callback to adjust relative urls from relative to this file to relative
* to the appropriate dokuwiki root location as described in the code
*
* @param array see http://php.net/preg_replace_callback
* @return string see http://php.net/preg_replace_callback
*/
public function replacements($match) {
// not a relative url? - no adjustment required
if (preg_match('#^(/|data:|https?://)#',$match[3])) {
return $match[0];
}
// a less file import? - requires a file system location
else if (substr($match[3],-5) == '.less') {
if ($match[3]{0} != '/') {
$match[3] = $this->getRelativePath() . '/' . $match[3];
}
}
// everything else requires a url adjustment
else {
$match[3] = $this->location . $match[3];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

View File

@ -330,8 +330,7 @@ if (!class_exists('configuration')) {
foreach ($this->get_plugin_list() as $plugin) {
$plugin_dir = plugin_directory($plugin);
if (@file_exists(DOKU_PLUGIN.$plugin_dir.$file)){
$conf = array();
@include(DOKU_PLUGIN.$plugin_dir.$file);
$conf = $this->_read_config(DOKU_PLUGIN.$plugin_dir.$file);
foreach ($conf as $key => $value){
$default['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.$key] = $value;
}
@ -340,8 +339,7 @@ if (!class_exists('configuration')) {
// the same for the active template
if (@file_exists(tpl_incdir().$file)){
$conf = array();
@include(tpl_incdir().$file);
$conf = $this->_read_config(tpl_incdir().$file);
foreach ($conf as $key => $value){
$default['tpl'.CM_KEYMARKER.$tpl.CM_KEYMARKER.$key] = $value;
}

View File

@ -814,6 +814,8 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
fputcsv($fd, $line);
}
fclose($fd);
if (defined('DOKU_UNITTEST')){ return; }
die;
}
@ -822,7 +824,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
*
* csv file should have 4 columns, user_id, full name, email, groups (comma separated)
*
* @return bool whether succesful
* @return bool whether successful
*/
protected function _import() {
// check we are allowed to add users
@ -830,7 +832,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if (!$this->_auth->canDo('addUser')) return false;
// check file uploaded ok.
if (empty($_FILES['import']['size']) || !empty($FILES['import']['error']) && is_uploaded_file($FILES['import']['tmp_name'])) {
if (empty($_FILES['import']['size']) || !empty($_FILES['import']['error']) && $this->_isUploadedFile($_FILES['import']['tmp_name'])) {
msg($this->lang['import_error_upload'],-1);
return false;
}
@ -845,7 +847,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if (!utf8_check($csv)) {
$csv = utf8_encode($csv);
}
$raw = str_getcsv($csv);
$raw = $this->_getcsv($csv);
$error = ''; // clean out any errors from the previous line
// data checks...
if (1 == ++$line) {
@ -867,6 +869,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$import_success_count++;
} else {
$import_fail_count++;
array_splice($raw, 1, 1); // remove the spliced in password
$this->_import_failures[$line] = array('error' => $error, 'user' => $raw, 'orig' => $csv);
}
}
@ -940,7 +943,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
*
* @param array $user data of user
* @param string &$error reference catched error message
* @return bool whether succesful
* @return bool whether successful
*/
protected function _addImportUser($user, & $error){
if (!$this->_auth->triggerUserMod('create', $user)) {
@ -973,4 +976,37 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
die;
}
/**
* wrapper for is_uploaded_file to facilitate overriding by test suite
*/
protected function _isUploadedFile($file) {
return is_uploaded_file($file);
}
/**
* wrapper for str_getcsv() to simplify maintaining compatibility with php 5.2
*
* @deprecated remove when dokuwiki php requirement increases to 5.3+
* also associated unit test & mock access method
*/
protected function _getcsv($csv) {
return function_exists('str_getcsv') ? str_getcsv($csv) : $this->str_getcsv($csv);
}
/**
* replacement str_getcsv() function for php < 5.3
* loosely based on www.php.net/str_getcsv#88311
*
* @deprecated remove when dokuwiki php requirement increases to 5.3+
*/
protected function str_getcsv($str) {
$fp = fopen("php://temp/maxmemory:1048576", 'r+'); // 1MiB
fputs($fp, $str);
rewind($fp);
$data = fgetcsv($fp);
fclose($fp);
return $data;
}
}