line lengths shortened

This makes sure all files use line lenghts shorter than 120 characters.

This is a quick fix. It might not always be the nicest change.
This commit is contained in:
Andreas Gohr 2018-04-27 19:07:43 +02:00
parent 09d57d5a23
commit 64159a61e9
60 changed files with 1113 additions and 295 deletions

View File

@ -104,7 +104,9 @@ class DropdownElement extends InputElement {
*/
public function attr($name, $value = null) {
if(strtolower($name) == 'multiple') {
throw new \InvalidArgumentException('Sorry, the dropdown element does not support the "multiple" attribute');
throw new \InvalidArgumentException(
'Sorry, the dropdown element does not support the "multiple" attribute'
);
}
return parent::attr($name, $value);
}
@ -181,7 +183,13 @@ class DropdownElement extends InputElement {
if($this->useInput) $this->prefillInput();
$html = '<select ' . buildAttributes($this->attrs()) . '>';
$html = array_reduce($this->optGroups, function($html, OptGroup $optGroup) {return $html . $optGroup->toHTML();}, $html);
$html = array_reduce(
$this->optGroups,
function ($html, OptGroup $optGroup) {
return $html . $optGroup->toHTML();
},
$html
);
$html .= '</select>';
return $html;

View File

@ -84,7 +84,9 @@ class Form extends Element {
/**
* Get the position of the element in the form or false if it is not in the form
*
* Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.
* Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates
* to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the
* return value of this function.
*
* @param Element $element
*
@ -157,7 +159,9 @@ class Form extends Element {
* @return Element
*/
public function addElement(Element $element, $pos = -1) {
if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException(
'You can\'t add a form to a form'
);
if($pos < 0) {
$this->elements[] = $element;
} else {
@ -173,7 +177,9 @@ class Form extends Element {
* @param int $pos 0-based position of the element to replace
*/
public function replaceElement(Element $element, $pos) {
if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException(
'You can\'t add a form to a form'
);
array_splice($this->elements, $pos, 1, array($element));
}

View File

@ -51,9 +51,13 @@ class OptGroup extends Element {
$this->options = array();
foreach($options as $key => $val) {
if (is_array($val)) {
if (!key_exists('label', $val)) throw new \InvalidArgumentException('If option is given as array, it has to have a "label"-key!');
if (!key_exists('label', $val)) throw new \InvalidArgumentException(
'If option is given as array, it has to have a "label"-key!'
);
if (key_exists('attrs', $val) && is_array($val['attrs']) && key_exists('selected', $val['attrs'])) {
throw new \InvalidArgumentException('Please use function "DropdownElement::val()" to set the selected option');
throw new \InvalidArgumentException(
'Please use function "DropdownElement::val()" to set the selected option'
);
}
$this->options[$key] = $val;
} elseif(is_int($key)) {
@ -93,7 +97,9 @@ class OptGroup extends Element {
if (!empty($val['attrs']) && is_array($val['attrs'])) {
$attrs = buildAttributes($val['attrs']);
}
$html .= '<option' . $selected . ' value="' . hsc($key) . '" '.$attrs.'>' . hsc($val['label']) . '</option>';
$html .= '<option' . $selected . ' value="' . hsc($key) . '" '.$attrs.'>';
$html .= hsc($val['label']);
$html .= '</option>';
}
return $html;
}

View File

@ -398,8 +398,15 @@ class HTTPClient {
//read body (with chunked encoding if needed)
$r_body = '';
if((isset($this->resp_headers['transfer-encoding']) && $this->resp_headers['transfer-encoding'] == 'chunked')
|| (isset($this->resp_headers['transfer-coding']) && $this->resp_headers['transfer-coding'] == 'chunked')){
if(
(
isset($this->resp_headers['transfer-encoding']) &&
$this->resp_headers['transfer-encoding'] == 'chunked'
) || (
isset($this->resp_headers['transfer-coding']) &&
$this->resp_headers['transfer-coding'] == 'chunked'
)
) {
$abort = false;
do {
$chunk_size = '';
@ -433,7 +440,11 @@ class HTTPClient {
// read up to the content-length or max_bodysize
// for keep alive we need to read the whole message to clean up the socket for the next read
if(!$this->keep_alive && $this->max_bodysize && $this->max_bodysize < $this->resp_headers['content-length']){
if(
!$this->keep_alive &&
$this->max_bodysize &&
$this->max_bodysize < $this->resp_headers['content-length']
) {
$length = $this->max_bodysize;
}else{
$length = $this->resp_headers['content-length'];
@ -550,7 +561,9 @@ class HTTPClient {
return true;
}
throw new HTTPClientException('Failed to set up crypto for secure connection to '.$requestinfo['host'], -151);
throw new HTTPClientException(
'Failed to set up crypto for secure connection to '.$requestinfo['host'], -151
);
}
throw new HTTPClientException('Failed to establish secure proxy connection', -150);

View File

@ -186,7 +186,7 @@ class Mailer {
*
* @param string $text plain text body
* @param array $textrep replacements to apply on the text part
* @param array $htmlrep replacements to apply on the HTML part, null to use $textrep (with urls wrapped in <a> tags)
* @param array $htmlrep replacements to apply on the HTML part, null to use $textrep (urls wrapped in <a> tags)
* @param string $html the HTML body, leave null to create it from $text
* @param bool $wrap wrap the HTML in the default header/Footer
*/
@ -616,7 +616,11 @@ class Mailer {
'NAME' => $INFO['userinfo']['name'],
'MAIL' => $INFO['userinfo']['mail']
);
$signature = str_replace('@DOKUWIKIURL@', $this->replacements['text']['DOKUWIKIURL'], $lang['email_signature_text']);
$signature = str_replace(
'@DOKUWIKIURL@',
$this->replacements['text']['DOKUWIKIURL'],
$lang['email_signature_text']
);
$this->replacements['text']['EMAILSIGNATURE'] = "\n-- \n" . $signature . "\n";
$this->replacements['html'] = array(

View File

@ -37,7 +37,9 @@ class Manifest
}
if (empty($manifest['theme_color'])) {
$manifest['theme_color'] = !empty($replacements['__theme_color__']) ? $replacements['__theme_color__'] : $replacements['__background_alt__'];
$manifest['theme_color'] = !empty($replacements['__theme_color__'])
? $replacements['__theme_color__']
: $replacements['__background_alt__'];
}
if (empty($manifest['icons'])) {

View File

@ -772,7 +772,10 @@ class RemoteAPICore {
* @author Michael Klier <chi@chimeric.de>
*
* @param string $id page id
* @param int $first skip the first n changelog lines (0 = from current(if exists), 1 = from 1st old rev, 2 = from 2nd old rev, etc)
* @param int $first skip the first n changelog lines
* 0 = from current(if exists)
* 1 = from 1st old rev
* 2 = from 2nd old rev, etc
* @return array
* @throws RemoteAccessDeniedException no read access for page
* @throws RemoteException empty id

View File

@ -174,8 +174,10 @@ class SitemapItem {
*
* @param string $url The url of the item
* @param int $lastmod Timestamp of the last modification
* @param string $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
* @param string $changefreq How frequently the item is likely to change.
* Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param $priority float|string The priority of the item relative to other URLs on your site.
* Valid values range from 0.0 to 1.0.
*/
public function __construct($url, $lastmod, $changefreq = null, $priority = null) {
$this->url = $url;
@ -188,8 +190,10 @@ class SitemapItem {
* Helper function for creating an item for a wikipage id.
*
* @param string $id A wikipage id.
* @param string $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param float|string $priority The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
* @param string $changefreq How frequently the item is likely to change.
* Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param float|string $priority The priority of the item relative to other URLs on your site.
* Valid values range from 0.0 to 1.0.
* @return SitemapItem The sitemap item.
*/
public static function createFromID($id, $changefreq = null, $priority = null) {

View File

@ -48,7 +48,11 @@ class StyleUtils
if (file_exists($incbase . $basename . '.' . $newExtension)) {
$stylesheets[$mode][$incbase . $basename . '.' . $newExtension] = $webbase;
if ($conf['allowdebug']) {
msg("Stylesheet $file not found, using $basename.$newExtension instead. Please contact developer of \"{$conf['template']}\" template.", 2);
msg(
"Stylesheet $file not found, using $basename.$newExtension instead. '.
'Please contact developer of \"{$conf['template']}\" template.",
2
);
}
continue;
}
@ -58,7 +62,10 @@ class StyleUtils
// replacements
if(is_array($data['replacements'])){
$replacements = array_merge($replacements, $this->cssFixreplacementurls($data['replacements'],$webbase));
$replacements = array_merge(
$replacements,
$this->cssFixreplacementurls($data['replacements'], $webbase)
);
}
}
@ -70,13 +77,18 @@ class StyleUtils
$data = parse_ini_file($ini, true);
// stylesheets
if(isset($data['stylesheets']) && is_array($data['stylesheets'])) foreach($data['stylesheets'] as $file => $mode){
$stylesheets[$mode][$incbase.$file] = $webbase;
if(isset($data['stylesheets']) && is_array($data['stylesheets'])) {
foreach($data['stylesheets'] as $file => $mode) {
$stylesheets[$mode][$incbase . $file] = $webbase;
}
}
// replacements
if(isset($data['replacements']) && is_array($data['replacements'])){
$replacements = array_merge($replacements, $this->cssFixreplacementurls($data['replacements'],$webbase));
$replacements = array_merge(
$replacements,
$this->cssFixreplacementurls($data['replacements'], $webbase)
);
}
}
@ -88,7 +100,10 @@ class StyleUtils
$data = parse_ini_file($ini, true);
// replacements
if(is_array($data['replacements'])) {
$replacements = array_merge($replacements, $this->cssFixreplacementurls($data['replacements'], $webbase));
$replacements = array_merge(
$replacements,
$this->cssFixreplacementurls($data['replacements'], $webbase)
);
}
}
}
@ -111,7 +126,11 @@ class StyleUtils
*/
protected function cssFixreplacementurls($replacements, $location) {
foreach($replacements as $key => $value) {
$replacements[$key] = preg_replace('#(url\([ \'"]*)(?!/|data:|http://|https://| |\'|")#','\\1'.$location,$value);
$replacements[$key] = preg_replace(
'#(url\([ \'"]*)(?!/|data:|http://|https://| |\'|")#',
'\\1' . $location,
$value
);
}
return $replacements;
}

View File

@ -102,9 +102,11 @@ class Admin extends Ui {
protected function showSecurityCheck() {
global $conf;
if(substr($conf['savedir'], 0, 2) !== './') return;
$img = DOKU_URL . $conf['savedir'] .
'/dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.png';
echo '<a style="border:none; float:right;"
href="http://www.dokuwiki.org/security#web_access_security">
<img src="' . DOKU_URL . $conf['savedir'] . '/dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.png" alt="Your data directory seems to be protected properly."
<img src="' . $img . '" alt="Your data directory seems to be protected properly."
onerror="this.parentNode.style.display=\'none\'" /></a>';
}

View File

@ -2,7 +2,7 @@
namespace dokuwiki\Ui;
use \dokuwiki\Form\Form;
use dokuwiki\Form\Form;
class Search extends Ui
{
@ -587,7 +587,9 @@ class Search extends Ui
$resultBody = [];
$mtime = filemtime(wikiFN($id));
$lastMod = '<span class="lastmod">' . $lang['lastmod'] . '</span> ';
$lastMod .= '<time datetime="' . date_iso8601($mtime) . '" title="'.dformat($mtime).'">' . dformat($mtime, '%f') . '</time>';
$lastMod .= '<time datetime="' . date_iso8601($mtime) . '" title="' . dformat($mtime) . '">' .
dformat($mtime, '%f') .
'</time>';
$resultBody['meta'] = $lastMod;
if ($cnt !== 0) {
$num++;

View File

@ -214,7 +214,9 @@ class cache_parser extends cache {
);
$files = array_merge($files, getConfigFiles('main')); // ... wiki settings
$this->depends['files'] = !empty($this->depends['files']) ? array_merge($files, $this->depends['files']) : $files;
$this->depends['files'] = !empty($this->depends['files']) ?
array_merge($files, $this->depends['files']) :
$files;
parent::_addDependencies();
}
@ -239,7 +241,8 @@ class cache_renderer extends cache_parser {
return true;
}
if ($this->_time < @filemtime(metaFN($this->page,'.meta'))) return false; // meta cache older than file it depends on?
// meta cache older than file it depends on?
if ($this->_time < @filemtime(metaFN($this->page,'.meta'))) return false;
// check current link existence is consistent with cache version
// first check the purgefile
@ -285,14 +288,18 @@ class cache_renderer extends cache_parser {
// page implies metadata and possibly some other dependencies
if (isset($this->page)) {
$valid = p_get_metadata($this->page, 'date valid'); // for xhtml this will render the metadata if needed
// for xhtml this will render the metadata if needed
$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'];
}
}
$this->depends['files'] = !empty($this->depends['files']) ? array_merge($files, $this->depends['files']) : $files;
$this->depends['files'] = !empty($this->depends['files']) ?
array_merge($files, $this->depends['files']) :
$files;
parent::_addDependencies();
}
}

View File

@ -104,13 +104,15 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
if (!$wasRemoved) {
$oldmeta = p_read_metadata($id);
$meta = array();
if ($wasCreated && empty($oldmeta['persistent']['date']['created'])){ // newly created
if ($wasCreated && empty($oldmeta['persistent']['date']['created'])){
// newly created
$meta['date']['created'] = $created;
if ($user){
$meta['creator'] = $INFO['userinfo']['name'];
$meta['user'] = $user;
}
} elseif (($wasCreated || $wasReverted) && !empty($oldmeta['persistent']['date']['created'])) { // re-created / restored
} elseif (($wasCreated || $wasReverted) && !empty($oldmeta['persistent']['date']['created'])) {
// re-created / restored
$meta['date']['created'] = $oldmeta['persistent']['date']['created'];
$meta['date']['modified'] = $created; // use the files ctime here
$meta['creator'] = $oldmeta['persistent']['creator'];
@ -147,7 +149,15 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
* - (none, so far)
* @param null|int $sizechange Change of filesize
*/
function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null, $sizechange = null){
function addMediaLogEntry(
$date,
$id,
$type=DOKU_CHANGE_TYPE_EDIT,
$summary='',
$extra='',
$flags=null,
$sizechange = null)
{
global $conf;
/** @var Input $INPUT */
global $INPUT;
@ -238,7 +248,12 @@ function getRecents($first,$num,$ns='',$flags=0){
}
}
if (($flags & RECENTS_MEDIA_PAGES_MIXED) && empty($media_rec) && $media_lines_position >= 0) {
$media_rec = _handleRecent(@$media_lines[$media_lines_position], $ns, $flags | RECENTS_MEDIA_CHANGES, $seen);
$media_rec = _handleRecent(
@$media_lines[$media_lines_position],
$ns,
$flags | RECENTS_MEDIA_CHANGES,
$seen
);
if (!$media_rec) {
$media_lines_position --;
continue;

View File

@ -488,7 +488,9 @@ function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&amp
global $conf;
if(is_array($urlParameters)) {
if(isset($urlParameters['rev']) && !$urlParameters['rev']) unset($urlParameters['rev']);
if(isset($urlParameters['at']) && $conf['date_at_format']) $urlParameters['at'] = date($conf['date_at_format'],$urlParameters['at']);
if(isset($urlParameters['at']) && $conf['date_at_format']) {
$urlParameters['at'] = date($conf['date_at_format'], $urlParameters['at']);
}
$urlParameters = buildURLparams($urlParameters, $separator);
} else {
$urlParameters = str_replace(',', $separator, $urlParameters);
@ -712,7 +714,13 @@ function checkwordblock($text = '') {
if(!$text) $text = "$PRE $TEXT $SUF $SUM";
// we prepare the text a tiny bit to prevent spammers circumventing URL checks
$text = preg_replace('!(\b)(www\.[\w.:?\-;,]+?\.[\w.:?\-;,]+?[\w/\#~:.?+=&%@\!\-.:?\-;,]+?)([.:?\-;,]*[^\w/\#~:.?+=&%@\!\-.:?\-;,])!i', '\1http://\2 \2\3', $text);
// phpcs:disable Generic.Files.LineLength.TooLong
$text = preg_replace(
'!(\b)(www\.[\w.:?\-;,]+?\.[\w.:?\-;,]+?[\w/\#~:.?+=&%@\!\-.:?\-;,]+?)([.:?\-;,]*[^\w/\#~:.?+=&%@\!\-.:?\-;,])!i',
'\1http://\2 \2\3',
$text
);
// phpcs:enable
$wordblocks = getWordblocks();
// how many lines to read at once (to work around some PCRE limits)
@ -838,6 +846,7 @@ function clientIP($single = false) {
*
* @link http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code
*
* @deprecated 2018-04-27 you probably want media queries instead anyway
* @return bool if true, client is mobile browser; otherwise false
*/
function clientismobile() {
@ -850,7 +859,18 @@ function clientismobile() {
if(!$INPUT->server->has('HTTP_USER_AGENT')) return false;
$uamatches = 'midp|j2me|avantg|docomo|novarra|palmos|palmsource|240x320|opwv|chtml|pda|windows ce|mmp\/|blackberry|mib\/|symbian|wireless|nokia|hand|mobi|phone|cdm|up\.b|audio|SIE\-|SEC\-|samsung|HTC|mot\-|mitsu|sagem|sony|alcatel|lg|erics|vx|NEC|philips|mmm|xx|panasonic|sharp|wap|sch|rover|pocket|benq|java|pt|pg|vox|amoi|bird|compal|kg|voda|sany|kdd|dbt|sendo|sgh|gradi|jb|\d\d\di|moto';
$uamatches = join(
'|',
[
'midp', 'j2me', 'avantg', 'docomo', 'novarra', 'palmos', 'palmsource', '240x320', 'opwv',
'chtml', 'pda', 'windows ce', 'mmp\/', 'blackberry', 'mib\/', 'symbian', 'wireless', 'nokia',
'hand', 'mobi', 'phone', 'cdm', 'up\.b', 'audio', 'SIE\-', 'SEC\-', 'samsung', 'HTC', 'mot\-',
'mitsu', 'sagem', 'sony', 'alcatel', 'lg', 'erics', 'vx', 'NEC', 'philips', 'mmm', 'xx',
'panasonic', 'sharp', 'wap', 'sch', 'rover', 'pocket', 'benq', 'java', 'pt', 'pg', 'vox',
'amoi', 'bird', 'compal', 'kg', 'voda', 'sany', 'kdd', 'dbt', 'sendo', 'sgh', 'gradi', 'jb',
'\d\d\di', 'moto'
]
);
if(preg_match("/$uamatches/i", $INPUT->server->str('HTTP_USER_AGENT'))) return true;
@ -1266,7 +1286,15 @@ function detectExternalEdit($id) {
$filesize_new = filesize($fileLastMod);
$sizechange = $filesize_new - $filesize_old;
addLogEntry($lastMod, $id, DOKU_CHANGE_TYPE_EDIT, $lang['external_edit'], '', array('ExternalEdit'=> true), $sizechange);
addLogEntry(
$lastMod,
$id,
DOKU_CHANGE_TYPE_EDIT,
$lang['external_edit'],
'',
array('ExternalEdit' => true),
$sizechange
);
// remove soon to be stale instructions
$cache = new cache_instructions($id, $fileLastMod);
$cache->removeCache();
@ -1359,7 +1387,8 @@ function saveWikiText($id, $text, $summary, $minor = false) {
// remove empty file
@unlink($svdta['file']);
$filesize_new = 0;
// don't remove old meta info as it should be saved, plugins can use IO_WIKIPAGE_WRITE for removing their metadata...
// don't remove old meta info as it should be saved, plugins can use
// IO_WIKIPAGE_WRITE for removing their metadata...
// purge non-persistant meta data
p_purge_metadata($id);
// remove empty namespaces
@ -1376,7 +1405,15 @@ function saveWikiText($id, $text, $summary, $minor = false) {
$event->advise_after();
addLogEntry($svdta['newRevision'], $svdta['id'], $svdta['changeType'], $svdta['summary'], $svdta['changeInfo'], null, $svdta['sizechange']);
addLogEntry(
$svdta['newRevision'],
$svdta['id'],
$svdta['changeType'],
$svdta['summary'],
$svdta['changeInfo'],
null,
$svdta['sizechange']
);
// send notify mails
notify($svdta['id'], 'admin', $svdta['oldRevision'], $svdta['summary'], $minor);
@ -1762,7 +1799,8 @@ function userlink($username = null, $textonly = false) {
if($textonly){
$data['name'] = $INFO['userinfo']['name']. ' (' . $INPUT->server->str('REMOTE_USER') . ')';
}else {
$data['name'] = '<bdi>' . hsc($INFO['userinfo']['name']) . '</bdi> (<bdi>' . hsc($INPUT->server->str('REMOTE_USER')) . '</bdi>)';
$data['name'] = '<bdi>' . hsc($INFO['userinfo']['name']) . '</bdi> '.
'(<bdi>' . hsc($INPUT->server->str('REMOTE_USER')) . '</bdi>)';
}
}
@ -2035,7 +2073,8 @@ function set_doku_pref($pref, $val) {
}
$cookieVal = implode('#', $parts);
} else if (!$orig && $val !== false) {
$cookieVal = ($_COOKIE['DOKU_PREFS'] ? $_COOKIE['DOKU_PREFS'].'#' : '').rawurlencode($pref).'#'.rawurlencode($val);
$cookieVal = ($_COOKIE['DOKU_PREFS'] ? $_COOKIE['DOKU_PREFS'].'#' : '').
rawurlencode($pref).'#'.rawurlencode($val);
}
if (!empty($cookieVal)) {

View File

@ -155,9 +155,18 @@ function getCdnUrls() {
$src[] = sprintf('https://code.jquery.com/jquery-migrate-%s.min.js', $versions['JQM_VERSION']);
$src[] = sprintf('https://code.jquery.com/ui/%s/jquery-ui.min.js', $versions['JQUI_VERSION']);
} elseif($conf['jquerycdn'] == 'cdnjs') {
$src[] = sprintf('https://cdnjs.cloudflare.com/ajax/libs/jquery/%s/jquery.min.js', $versions['JQ_VERSION']);
$src[] = sprintf('https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/%s/jquery-migrate.min.js', $versions['JQM_VERSION']);
$src[] = sprintf('https://cdnjs.cloudflare.com/ajax/libs/jqueryui/%s/jquery-ui.min.js', $versions['JQUI_VERSION']);
$src[] = sprintf(
'https://cdnjs.cloudflare.com/ajax/libs/jquery/%s/jquery.min.js',
$versions['JQ_VERSION']
);
$src[] = sprintf(
'https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/%s/jquery-migrate.min.js',
$versions['JQM_VERSION']
);
$src[] = sprintf(
'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/%s/jquery-ui.min.js',
$versions['JQUI_VERSION']
);
}
}
$event->advise_after();

View File

@ -97,7 +97,11 @@ class Doku_Event {
if (!is_callable($action)) {
$enablePrevent = false;
if (!is_null($action)) {
trigger_error('The default action of '.$this.' is not null but also not callable. Maybe the method is not public?', E_USER_WARNING);
trigger_error(
'The default action of ' . $this .
' is not null but also not callable. Maybe the method is not public?',
E_USER_WARNING
);
}
}

View File

@ -22,7 +22,7 @@
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
// DOKU_FARMDIR needs to be set in preload.php, here the fallback is the same as DOKU_INC would be (if it was set already)
// DOKU_FARMDIR needs to be set in preload.php, the fallback is the same as DOKU_INC would be (if it was set already)
if(!defined('DOKU_FARMDIR')) define('DOKU_FARMDIR', fullpath(dirname(__FILE__).'/../').'/');
if(!defined('DOKU_CONF')) define('DOKU_CONF', farm_confpath(DOKU_FARMDIR));
if(!defined('DOKU_FARM')) define('DOKU_FARM', false);

View File

@ -104,7 +104,13 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
* @return string in the format " name*=charset'lang'value" for values WITH special characters
*/
function rfc2231_encode($name, $value, $charset='utf-8', $lang='en') {
$internal = preg_replace_callback('/[\x00-\x20*\'%()<>@,;:\\\\"\/[\]?=\x80-\xFF]/', function($match) { return rawurlencode($match[0]); }, $value);
$internal = preg_replace_callback(
'/[\x00-\x20*\'%()<>@,;:\\\\"\/[\]?=\x80-\xFF]/',
function ($match) {
return rawurlencode($match[0]);
},
$value
);
if ( $value != $internal ) {
return ' '.$name.'*='.$charset."'".$lang."'".$internal;
} else {

View File

@ -21,8 +21,8 @@ if(!defined('FT_SNIPPET_NUMBER')) define('FT_SNIPPET_NUMBER',15);
* @param string $query
* @param array $highlight
* @param string $sort
* @param int|string $after only show results with an modified time after this date, accepts timestap or strtotime arguments
* @param int|string $before only show results with an modified time before this date, accepts timestap or strtotime arguments
* @param int|string $after only show results with mtime after this date, accepts timestap or strtotime arguments
* @param int|string $before only show results with mtime before this date, accepts timestap or strtotime arguments
*
* @return array
*/
@ -230,8 +230,8 @@ function ft_mediause($id, $ignore_perms = false){
* @param string $id page id
* @param bool $in_ns match against namespace as well?
* @param bool $in_title search in title?
* @param int|string $after only show results with an modified time after this date, accepts timestap or strtotime arguments
* @param int|string $before only show results with an modified time before this date, accepts timestap or strtotime arguments
* @param int|string $after only show results with mtime after this date, accepts timestap or strtotime arguments
* @param int|string $before only show results with mtime before this date, accepts timestap or strtotime arguments
*
* @return string[]
*/
@ -313,8 +313,8 @@ function _ft_pageLookup(&$data){
/**
* @param array $results search results in the form pageid => value
* @param int|string $after only returns results with an modified time after this date, accepts timestap or strtotime arguments
* @param int|string $before only returns results with an modified time after this date, accepts timestap or strtotime arguments
* @param int|string $after only returns results with mtime after this date, accepts timestap or strtotime arguments
* @param int|string $before only returns results with mtime after this date, accepts timestap or strtotime arguments
*
* @return array
*/
@ -413,7 +413,18 @@ function ft_snippet($id,$highlight){
$len = utf8_strlen($text);
// build a regexp from the phrases to highlight
$re1 = '('.join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',array_filter((array) $highlight)))).')';
$re1 = '(' .
join(
'|',
array_map(
'ft_snippet_re_preprocess',
array_map(
'preg_quote_cb',
array_filter((array) $highlight)
)
)
) .
')';
$re2 = "$re1.{0,75}(?!\\1)$re1";
$re3 = "$re1.{0,45}(?!\\1)$re1.{0,45}(?!\\1)(?!\\2)$re1";
@ -476,7 +487,11 @@ function ft_snippet($id,$highlight){
$m = "\1";
$snippets = preg_replace('/'.$re1.'/iu',$m.'$1'.$m,$snippets);
$snippet = preg_replace('/'.$m.'([^'.$m.']*?)'.$m.'/iu','<strong class="search_hit">$1</strong>',hsc(join('... ',$snippets)));
$snippet = preg_replace(
'/' . $m . '([^' . $m . ']*?)' . $m . '/iu',
'<strong class="search_hit">$1</strong>',
hsc(join('... ', $snippets))
);
$evdata['snippet'] = $snippet;
}

View File

@ -49,7 +49,13 @@ function html_login($svg = false){
$form->startFieldset($lang['btn_login']);
$form->addHidden('id', $ID);
$form->addHidden('do', 'login');
$form->addElement(form_makeTextField('u', ((!$INPUT->bool('http_credentials')) ? $INPUT->str('u') : ''), $lang['user'], 'focus__this', 'block'));
$form->addElement(form_makeTextField(
'u',
((!$INPUT->bool('http_credentials')) ? $INPUT->str('u') : ''),
$lang['user'],
'focus__this',
'block')
);
$form->addElement(form_makePasswordField('p', $lang['pass'], '', 'block'));
if($conf['rememberme']) {
$form->addElement(form_makeCheckboxField('r', '1', $lang['remember'], 'remember__me', 'simple'));
@ -168,7 +174,10 @@ function html_secedit_get_button($data) {
function html_topbtn(){
global $lang;
$ret = '<a class="nolink" href="#dokuwiki__top"><button class="button" onclick="window.scrollTo(0, 0)" title="'.$lang['btn_top'].'">'.$lang['btn_top'].'</button></a>';
$ret = '<a class="nolink" href="#dokuwiki__top">' .
'<button class="button" onclick="window.scrollTo(0, 0)" title="' . $lang['btn_top'] . '">' .
$lang['btn_top'] .
'</button></a>';
return $ret;
}
@ -687,7 +696,9 @@ function html_recent($first = 0, $show_changes = 'both') {
print p_locale_xhtml('recent');
if(getNS($ID) != '') {
print '<div class="level1"><p>' . sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) . '</p></div>';
print '<div class="level1"><p>' .
sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) .
'</p></div>';
}
$form = new Doku_Form(array('id' => 'dw__recent', 'method' => 'GET', 'class' => 'changes'));
@ -770,7 +781,14 @@ function html_recent($first = 0, $show_changes = 'both') {
}
if(!empty($recent['media'])) {
$href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
$href = media_managerURL(
array(
'tab_details' => 'history',
'image' => $recent['id'],
'ns' => getNS($recent['id'])
),
'&'
);
} else {
$href = wl($recent['id'], "do=revisions", false, '&');
}
@ -787,7 +805,14 @@ function html_recent($first = 0, $show_changes = 'both') {
$form->addElement(form_makeCloseTag('a'));
if(!empty($recent['media'])) {
$href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
$href = media_managerURL(
array(
'tab_details' => 'view',
'image' => $recent['id'],
'ns' => getNS($recent['id'])
),
'&'
);
$class = file_exists(mediaFN($recent['id'])) ? 'wikilink1' : 'wikilink2';
$form->addElement(form_makeOpenTag('a', array(
'class' => $class,
@ -894,14 +919,15 @@ function html_list_index($item){
global $ID, $conf;
// prevent searchbots needlessly following links
$nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : '';
$nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? 'rel="nofollow"' : '';
$ret = '';
$base = ':'.$item['id'];
$base = substr($base,strrpos($base,':')+1);
if($item['type']=='d'){
// FS#2766, no need for search bots to follow namespace links in the index
$ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"' . $nofollow . '><strong>';
$link = wl($ID, 'idx=' . rawurlencode($item['id']));
$ret .= '<a href="' . $link . '" title="' . $item['id'] . '" class="idx_dir" ' . $nofollow . '><strong>';
$ret .= $base;
$ret .= '</strong></a>';
}else{
@ -1559,12 +1585,12 @@ function html_softbreak_callback($match){
// make certain characters into breaking characters by inserting a
// breaking character (zero length space, U+200B / #8203) in front them.
$regex = <<< REGEX
(?(?= # start a conditional expression with a positive look ahead ...
&\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
&\#?\\w{1,6}; # yes pattern - a quicker match for the html entity, since we know we have one
(?(?= # start a conditional expression with a positive look ahead ...
&\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
&\#?\\w{1,6}; # yes pattern - a quicker match for the html entity, since we know we have one
|
[?/,&\#;:] # no pattern - any other group of 'special' characters to insert a breaking character after
)+ # end conditional expression
[?/,&\#;:] # no pattern - any other group of 'special' characters to insert a breaking character after
)+ # end conditional expression
REGEX;
return preg_replace('<'.$regex.'>xu','\0&#8203;',$match[0]);
@ -1640,13 +1666,41 @@ function html_register(){
$form->startFieldset($lang['btn_register']);
$form->addHidden('do', 'register');
$form->addHidden('save', '1');
$form->addElement(form_makeTextField('login', $INPUT->post->str('login'), $lang['user'], '', 'block', $base_attrs));
$form->addElement(
form_makeTextField(
'login',
$INPUT->post->str('login'),
$lang['user'],
'',
'block',
$base_attrs
)
);
if (!$conf['autopasswd']) {
$form->addElement(form_makePasswordField('pass', $lang['pass'], '', 'block', $base_attrs));
$form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', $base_attrs));
}
$form->addElement(form_makeTextField('fullname', $INPUT->post->str('fullname'), $lang['fullname'], '', 'block', $base_attrs));
$form->addElement(form_makeField('email','email', $INPUT->post->str('email'), $lang['email'], '', 'block', $email_attrs));
$form->addElement(
form_makeTextField(
'fullname',
$INPUT->post->str('fullname'),
$lang['fullname'],
'',
'block',
$base_attrs
)
);
$form->addElement(
form_makeField(
'email',
'email',
$INPUT->post->str('email'),
$lang['email'],
'',
'block',
$email_attrs
)
);
$form->addElement(form_makeButton('submit', '', $lang['btn_register']));
$form->endFieldset();
html_form('register', $form);
@ -1677,7 +1731,16 @@ function html_updateprofile(){
$form->startFieldset($lang['profile']);
$form->addHidden('do', 'profile');
$form->addHidden('save', '1');
$form->addElement(form_makeTextField('login', $_SERVER['REMOTE_USER'], $lang['user'], '', 'block', array('size'=>'50', 'disabled'=>'disabled')));
$form->addElement(
form_makeTextField(
'login',
$_SERVER['REMOTE_USER'],
$lang['user'],
'',
'block',
array('size' => '50', 'disabled' => 'disabled')
)
);
$attr = array('size'=>'50');
if (!$auth->canDo('modName')) $attr['disabled'] = 'disabled';
$form->addElement(form_makeTextField('fullname', $fullname, $lang['fullname'], '', 'block', $attr));
@ -1691,7 +1754,15 @@ function html_updateprofile(){
}
if ($conf['profileconfirm']) {
$form->addElement(form_makeTag('br'));
$form->addElement(form_makePasswordField('oldpass', $lang['oldpass'], '', 'block', array('size'=>'50', 'required' => 'required')));
$form->addElement(
form_makePasswordField(
'oldpass',
$lang['oldpass'],
'',
'block',
array('size' => '50', 'required' => 'required')
)
);
}
$form->addElement(form_makeButton('submit', '', $lang['btn_save']));
$form->addElement(form_makeButton('reset', '', $lang['btn_reset']));
@ -1704,10 +1775,27 @@ function html_updateprofile(){
$form_profiledelete->startFieldset($lang['profdeleteuser']);
$form_profiledelete->addHidden('do', 'profile_delete');
$form_profiledelete->addHidden('delete', '1');
$form_profiledelete->addElement(form_makeCheckboxField('confirm_delete', '1', $lang['profconfdelete'],'dw__confirmdelete','', array('required' => 'required')));
$form_profiledelete->addElement(
form_makeCheckboxField(
'confirm_delete',
'1',
$lang['profconfdelete'],
'dw__confirmdelete',
'',
array('required' => 'required')
)
);
if ($conf['profileconfirm']) {
$form_profiledelete->addElement(form_makeTag('br'));
$form_profiledelete->addElement(form_makePasswordField('oldpass', $lang['oldpass'], '', 'block', array('size'=>'50', 'required' => 'required')));
$form_profiledelete->addElement(
form_makePasswordField(
'oldpass',
$lang['oldpass'],
'',
'block',
array('size' => '50', 'required' => 'required')
)
);
}
$form_profiledelete->addElement(form_makeButton('submit', '', $lang['btn_deleteuser']));
$form_profiledelete->endFieldset();
@ -1800,12 +1888,35 @@ function html_edit(){
$form->addElement(form_makeCloseTag('div'));
if ($wr) {
$form->addElement(form_makeOpenTag('div', array('class'=>'editButtons')));
$form->addElement(form_makeButton('submit', 'save', $lang['btn_save'], array('id'=>'edbtn__save', 'accesskey'=>'s', 'tabindex'=>'4')));
$form->addElement(form_makeButton('submit', 'preview', $lang['btn_preview'], array('id'=>'edbtn__preview', 'accesskey'=>'p', 'tabindex'=>'5')));
$form->addElement(
form_makeButton(
'submit',
'save',
$lang['btn_save'],
array('id' => 'edbtn__save', 'accesskey' => 's', 'tabindex' => '4')
)
);
$form->addElement(
form_makeButton(
'submit',
'preview',
$lang['btn_preview'],
array('id' => 'edbtn__preview', 'accesskey' => 'p', 'tabindex' => '5')
)
);
$form->addElement(form_makeButton('submit', 'draftdel', $lang['btn_cancel'], array('tabindex'=>'6')));
$form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeOpenTag('div', array('class'=>'summary')));
$form->addElement(form_makeTextField('summary', $SUM, $lang['summary'], 'edit__summary', 'nowrap', array('size'=>'50', 'tabindex'=>'2')));
$form->addElement(
form_makeTextField(
'summary',
$SUM,
$lang['summary'],
'edit__summary',
'nowrap',
array('size' => '50', 'tabindex' => '2')
)
);
$elem = html_minoredit();
if ($elem) $form->addElement($elem);
$form->addElement(form_makeCloseTag('div'));
@ -1830,9 +1941,14 @@ function html_edit(){
<div class="editBox" role="application">
<div class="toolbar group">
<div id="draft__status" class="draft__status"><?php if(!empty($INFO['draft'])) echo $lang['draftdate'].' '.dformat();?></div>
<div id="tool__bar" class="tool__bar"><?php if ($wr && $data['media_manager']){?><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
target="_blank"><?php echo $lang['mediaselect'] ?></a><?php }?></div>
<div id="draft__status" class="draft__status"><?php
if(!empty($INFO['draft'])) echo $lang['draftdate'].' '.dformat();
?></div>
<div id="tool__bar" class="tool__bar"><?php
if ($wr && $data['media_manager']){
?><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
target="_blank"><?php echo $lang['mediaselect'] ?></a><?php
}?></div>
</div>
<?php

View File

@ -401,7 +401,7 @@ class Doku_Indexer {
*
* @param string $key The metadata key of which a value shall be changed
* @param string $oldvalue The old value that shall be renamed
* @param string $newvalue The new value to which the old value shall be renamed, can exist (then values will be merged)
* @param string $newvalue The new value to which the old value shall be renamed, if exists values will be merged
* @return bool|string If renaming the value has been successful, false or error message on error.
*/
public function renameMetaValue($key, $oldvalue, $newvalue) {
@ -1519,7 +1519,10 @@ function idx_listIndexLengths() {
clearstatcache();
if (file_exists($conf['indexdir'].'/lengths.idx')
&& (time() < @filemtime($conf['indexdir'].'/lengths.idx') + $conf['readdircache'])) {
if (($lengths = @file($conf['indexdir'].'/lengths.idx', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) !== false) {
if (
($lengths = @file($conf['indexdir'].'/lengths.idx', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES))
!== false
) {
$idx = array();
foreach ($lengths as $length) {
$idx[] = (int)$length;

View File

@ -136,9 +136,11 @@ function check(){
if($mem < 16777216){
msg('PHP is limited to less than 16MB RAM ('.$mem.' bytes). Increase memory_limit in php.ini',-1);
}elseif($mem < 20971520){
msg('PHP is limited to less than 20MB RAM ('.$mem.' bytes), you might encounter problems with bigger pages. Increase memory_limit in php.ini',-1);
msg('PHP is limited to less than 20MB RAM ('.$mem.' bytes),
you might encounter problems with bigger pages. Increase memory_limit in php.ini',-1);
}elseif($mem < 33554432){
msg('PHP is limited to less than 32MB RAM ('.$mem.' bytes), but that should be enough in most cases. If not, increase memory_limit in php.ini',0);
msg('PHP is limited to less than 32MB RAM ('.$mem.' bytes),
but that should be enough in most cases. If not, increase memory_limit in php.ini',0);
}else{
msg('More than 32MB RAM ('.$mem.' bytes) available.',1);
}
@ -206,7 +208,8 @@ function check(){
if(!$loc){
msg('No valid locale is set for your PHP setup. You should fix this',-1);
}elseif(stripos($loc,'utf') === false){
msg('Your locale <code>'.hsc($loc).'</code> seems not to be a UTF-8 locale, you should fix this if you encounter problems.',0);
msg('Your locale <code>'.hsc($loc).'</code> seems not to be a UTF-8 locale,
you should fix this if you encounter problems.',0);
}else{
msg('Valid locale '.hsc($loc).' found.', 1);
}
@ -286,7 +289,8 @@ function check(){
if(abs($diff) < 4) {
msg("Server time seems to be okay. Diff: {$diff}s", 1);
} else {
msg("Your server's clock seems to be out of sync! Consider configuring a sync with a NTP server. Diff: {$diff}s");
msg("Your server's clock seems to be out of sync!
Consider configuring a sync with a NTP server. Diff: {$diff}s");
}
}
@ -376,7 +380,8 @@ function info_msg_allowed($msg){
return $INFO['isadmin'];
default:
trigger_error('invalid msg allow restriction. msg="'.$msg['msg'].'" allow='.$msg['allow'].'"', E_USER_WARNING);
trigger_error('invalid msg allow restriction. msg="'.$msg['msg'].'" allow='.$msg['allow'].'"',
E_USER_WARNING);
return $INFO['isadmin'];
}

View File

@ -109,7 +109,10 @@ if(!defined('DOKU_LF')) define ('DOKU_LF',"\n");
if(!defined('DOKU_TAB')) define ('DOKU_TAB',"\t");
// define cookie and session id, append server port when securecookie is configured FS#1664
if (!defined('DOKU_COOKIE')) define('DOKU_COOKIE', 'DW'.md5(DOKU_REL.(($conf['securecookie'])?$_SERVER['SERVER_PORT']:'')));
if(!defined('DOKU_COOKIE')) define(
'DOKU_COOKIE',
'DW' . md5(DOKU_REL . (($conf['securecookie']) ? $_SERVER['SERVER_PORT'] : ''))
);
// define main script
@ -230,7 +233,13 @@ mail_setup();
function init_session() {
global $conf;
session_name(DOKU_SESSION_NAME);
session_set_cookie_params(DOKU_SESSION_LIFETIME, DOKU_SESSION_PATH, DOKU_SESSION_DOMAIN, ($conf['securecookie'] && is_ssl()), true);
session_set_cookie_params(
DOKU_SESSION_LIFETIME,
DOKU_SESSION_PATH,
DOKU_SESSION_DOMAIN,
($conf['securecookie'] && is_ssl()),
true
);
// make sure the session cookie contains a valid session ID
if(isset($_COOKIE[DOKU_SESSION_NAME]) && !preg_match('/^[-,a-zA-Z0-9]{22,256}$/', $_COOKIE[DOKU_SESSION_NAME])) {
@ -269,7 +278,9 @@ function init_paths(){
}
// path to old changelog only needed for upgrading
$conf['changelog_old'] = init_path((isset($conf['changelog']))?($conf['changelog']):($conf['savedir'].'/changes.log'));
$conf['changelog_old'] = init_path(
(isset($conf['changelog'])) ? ($conf['changelog']) : ($conf['savedir'] . '/changes.log')
);
if ($conf['changelog_old']=='') { unset($conf['changelog_old']); }
// hardcoded changelog because it is now a cache that lives in meta
$conf['changelog'] = $conf['metadir'].'/_dokuwiki.changes';
@ -438,7 +449,7 @@ function getBaseURL($abs=null){
//finish here for relative URLs
if(!$abs) return $dir;
//use config option if available, trim any slash from end of baseurl to avoid multiple consecutive slashes in the path
//use config if available, trim any slash from end of baseurl to avoid multiple consecutive slashes in the path
if(!empty($conf['baseurl'])) return rtrim($conf['baseurl'],'/').$dir;
//split hostheader into host and port

View File

@ -644,7 +644,8 @@ function io_mktmpdir() {
*
* @param string $url url to download
* @param string $file path to file or directory where to save
* @param bool $useAttachment if true: try to use name of download, uses otherwise $defaultName, false: uses $file as path to file
* @param bool $useAttachment true: try to use name of download, uses otherwise $defaultName
* false: uses $file as path to file
* @param string $defaultName fallback for if using $useAttachment
* @param int $maxSize maximum file size
* @return bool|string if failed false, otherwise true or the name of the file in the given dir

View File

@ -144,8 +144,13 @@ function load_autoload($name){
}
// Plugin loading
if(preg_match('/^(auth|helper|syntax|action|admin|renderer|remote|cli)_plugin_('.DOKU_PLUGIN_NAME_REGEX.')(?:_([^_]+))?$/',
$name, $m)) {
if(preg_match(
'/^(auth|helper|syntax|action|admin|renderer|remote|cli)_plugin_(' .
DOKU_PLUGIN_NAME_REGEX .
')(?:_([^_]+))?$/',
$name,
$m
)) {
// try to load the wanted plugin file
$c = ((count($m) === 4) ? "/{$m[3]}" : '');
$plg = DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";

View File

@ -25,7 +25,10 @@ if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n");
* Check if a given mail address is valid
*/
if (!defined('RFC2822_ATEXT')) define('RFC2822_ATEXT',"0-9a-zA-Z!#$%&'*+/=?^_`{|}~-");
if (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', '['.RFC2822_ATEXT.']+(?:\.['.RFC2822_ATEXT.']+)*@(?i:[0-9a-z][0-9a-z-]*\.)+(?i:[a-z]{2,63})');
if (!defined('PREG_PATTERN_VALID_EMAIL')) define(
'PREG_PATTERN_VALID_EMAIL',
'['.RFC2822_ATEXT.']+(?:\.['.RFC2822_ATEXT.']+)*@(?i:[0-9a-z][0-9a-z-]*\.)+(?i:[a-z]{2,63})'
);
/**
* Prepare mailfrom replacement patterns

View File

@ -169,7 +169,17 @@ function media_metaform($id,$auth){
$form->addElement('<div class="row">');
if($field[2] == 'text'){
$form->addElement(form_makeField('text', $p['name'], $value, ($lang[$field[1]]) ? $lang[$field[1]] : $field[1] . ':', $p['id'], $p['class'], $p_attrs));
$form->addElement(
form_makeField(
'text',
$p['name'],
$value,
($lang[$field[1]]) ? $lang[$field[1]] : $field[1] . ':',
$p['id'],
$p['class'],
$p_attrs
)
);
}else{
$att = buildAttributes($p);
$form->addElement('<label for="meta__'.$key.'">'.$lang[$field[1]].'</label>');
@ -178,7 +188,14 @@ function media_metaform($id,$auth){
$form->addElement('</div>'.NL);
}
$form->addElement('<div class="buttons">');
$form->addElement(form_makeButton('submit', '', $lang['btn_save'], array('accesskey' => 's', 'name' => 'mediado[save]')));
$form->addElement(
form_makeButton(
'submit',
'',
$lang['btn_save'],
array('accesskey' => 's', 'name' => 'mediado[save]')
)
);
$form->addElement('</div>'.NL);
$form->printForm();
@ -527,7 +544,15 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov
$filesize_new = filesize($fn);
$sizechange = $filesize_new - $filesize_old;
if($REV) {
addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_REVERT, sprintf($lang['restored'], dformat($REV)), $REV, null, $sizechange);
addMediaLogEntry(
$new,
$id,
DOKU_CHANGE_TYPE_REVERT,
sprintf($lang['restored'], dformat($REV)),
$REV,
null,
$sizechange
);
} elseif($overwrite) {
addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_EDIT, '', '', null, $sizechange);
} else {
@ -1713,7 +1738,7 @@ function media_printimgdetail($item, $fullscreen=false){
// output
if ($fullscreen) {
echo '<a id="l_:'.$item['id'].'" class="image thumb" href="'.
media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')).'">';
media_managerURL(['image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view']).'">';
echo '<img src="'.$src.'" '.$att.' />';
echo '</a>';
}
@ -1897,7 +1922,16 @@ function media_searchform($ns,$query='',$fullscreen=false){
$form->addHidden($fullscreen ? 'mediado' : 'do', 'searchlist');
$form->addElement(form_makeOpenTag('p'));
$form->addElement(form_makeTextField('q', $query,$lang['searchmedia'],'','',array('title'=>sprintf($lang['searchmedia_in'],hsc($ns).':*'))));
$form->addElement(
form_makeTextField(
'q',
$query,
$lang['searchmedia'],
'',
'',
array('title' => sprintf($lang['searchmedia_in'], hsc($ns) . ':*'))
)
);
$form->addElement(form_makeButton('submit', '', $lang['btn_search']));
$form->addElement(form_makeCloseTag('p'));
html_form('searchmedia', $form);
@ -1940,7 +1974,13 @@ function media_nstree($ns){
// find the namespace parts or insert them
while ($data[$pos]['id'] != $tmp_ns) {
if ($pos >= count($data) || ($data[$pos]['level'] <= $level+1 && strnatcmp(utf8_encodeFN($data[$pos]['id']), utf8_encodeFN($tmp_ns)) > 0)) {
if (
$pos >= count($data) ||
(
$data[$pos]['level'] <= $level+1 &&
strnatcmp(utf8_encodeFN($data[$pos]['id']), utf8_encodeFN($tmp_ns)) > 0
)
) {
array_splice($data, $pos, 0, array(array('level' => $level+1, 'id' => $tmp_ns, 'open' => 'true')));
break;
}
@ -2350,7 +2390,12 @@ function media_resize_imageGD($ext,$from,$from_w,$from_h,$to,$to_w,$to_h,$ofs_x=
$transcolorindex = @imagecolortransparent($image);
if($transcolorindex >= 0 ) { //transparent color exists
$transcolor = @imagecolorsforindex($image, $transcolorindex);
$transcolorindex = @imagecolorallocate($newimg, $transcolor['red'], $transcolor['green'], $transcolor['blue']);
$transcolorindex = @imagecolorallocate(
$newimg,
$transcolor['red'],
$transcolor['green'],
$transcolor['blue']
);
@imagefill($newimg, 0, 0, $transcolorindex);
@imagecolortransparent($newimg, $transcolorindex);
}else{ //filling with white

View File

@ -1504,7 +1504,10 @@ class Doku_Handler_Table implements Doku_Handler_CallWriter_Interface {
for($i = $key-2; $i >= $cellKey[$lastRow][1]; $i--) {
if ( $this->tableCalls[$i][0] == 'tablecell_open' || $this->tableCalls[$i][0] == 'tableheader_open' ) {
if (
$this->tableCalls[$i][0] == 'tablecell_open' ||
$this->tableCalls[$i][0] == 'tableheader_open'
) {
if ( false !== $this->tableCalls[$i][1][0] ) {
$this->tableCalls[$i][1][0]++;
@ -1522,7 +1525,8 @@ class Doku_Handler_Table implements Doku_Handler_CallWriter_Interface {
case 'rowspan':
if ( $this->tableCalls[$key-1][0] == 'cdata' ) {
// ignore rowspan if previous call was cdata (text mixed with :::) we don't have to check next call as that wont match regex
// ignore rowspan if previous call was cdata (text mixed with :::)
// we don't have to check next call as that wont match regex
$this->tableCalls[$key][0] = 'cdata';
} else {
@ -1533,7 +1537,10 @@ class Doku_Handler_Table implements Doku_Handler_CallWriter_Interface {
if (!$this->countTableHeadRows || ($lastRow-1 != $this->countTableHeadRows)) {
for($i = $lastRow-1; $i > 0; $i--) {
if ( $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' || $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open' ) {
if (
$this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' ||
$this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open'
) {
if ($this->tableCalls[$cellKey[$i][$lastCell]][1][2] >= $lastRow - $i) {
$spanning_cell = $i;

View File

@ -338,7 +338,8 @@ class Doku_Parser_Mode_eol extends Doku_Parser_Mode {
if ( in_array($mode, $badModes) ) {
return;
}
// see FS#1652, pattern extended to swallow preceding whitespace to avoid issues with lines that only contain whitespace
// see FS#1652, pattern extended to swallow preceding whitespace to avoid
// issues with lines that only contain whitespace
$this->Lexer->addSpecialPattern('(?:^[ \t]*)?\n',$mode,'eol');
}

View File

@ -169,7 +169,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// Prepare the TOC
global $conf;
if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']) {
if(
$this->info['toc'] &&
is_array($this->toc) &&
$conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']
) {
global $TOC;
$TOC = $this->toc;
}
@ -665,7 +669,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$offset = $INPUT->str('codeblockOffset');
}
$this->doc .= '<dl class="'.$type.'">'.DOKU_LF;
$this->doc .= '<dt><a href="'.exportlink($ID, 'code', array('codeblock' => $offset+$this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">';
$this->doc .= '<dt><a href="' .
exportlink(
$ID,
'code',
array('codeblock' => $offset + $this->_codeblock)
) . '" title="' . $lang['download'] . '" class="' . $class . '">';
$this->doc .= hsc($filename);
$this->doc .= '</a></dt>'.DOKU_LF.'<dd>';
}
@ -683,7 +692,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$class = 'code'; //we always need the code class to make the syntax highlighting apply
if($type != 'code') $class .= ' '.$type;
$this->doc .= "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '', $options).'</pre>'.DOKU_LF;
$this->doc .= "<pre class=\"$class $language\">" .
p_xhtml_cached_geshi($text, $language, '', $options) .
'</pre>' . DOKU_LF;
}
if($filename) {
@ -1172,7 +1183,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
list($ext, $mime) = mimetype($src, false);
if(substr($mime, 0, 5) == 'image' && $render) {
$link['url'] = ml($src, array('id' => $ID, 'cache' => $cache, 'rev'=>$this->_getLastMediaRevisionAt($src)), ($linking == 'direct'));
$link['url'] = ml(
$src,
array(
'id' => $ID,
'cache' => $cache,
'rev' => $this->_getLastMediaRevisionAt($src)
),
($linking == 'direct')
);
} elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render) {
// don't link movies
$noLink = true;
@ -1180,7 +1199,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// add file icons
$class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
$link['class'] .= ' mediafile mf_'.$class;
$link['url'] = ml($src, array('id' => $ID, 'cache' => $cache , 'rev'=>$this->_getLastMediaRevisionAt($src)), true);
$link['url'] = ml(
$src,
array(
'id' => $ID,
'cache' => $cache,
'rev' => $this->_getLastMediaRevisionAt($src)
),
true
);
if($exists) $link['title'] .= ' ('.filesize_h(filesize(mediaFN($src))).')';
}
@ -1616,7 +1643,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $title;
}
//add image tag
$ret .= '<img src="'.ml($src, array('w' => $width, 'h' => $height, 'cache' => $cache, 'rev'=>$this->_getLastMediaRevisionAt($src))).'"';
$ret .= '<img src="' . ml(
$src,
array(
'w' => $width, 'h' => $height,
'cache' => $cache,
'rev' => $this->_getLastMediaRevisionAt($src)
)
) . '"';
$ret .= ' class="media'.$align.'"';
if($title) {
@ -1866,7 +1900,16 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
// alternative content (just a link to the file)
$fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
$fallback .= $this->$linkType(
$file,
$title,
null,
null,
null,
$cache = null,
$linking = 'linkonly',
$return = true
);
}
// output each track if any
@ -1924,7 +1967,16 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
// alternative content (just a link to the file)
$fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
$fallback .= $this->$linkType(
$file,
$title,
null,
null,
null,
$cache = null,
$linking = 'linkonly',
$return = true
);
}
// finish

View File

@ -72,7 +72,8 @@ function p_wiki_xhtml($id, $rev='', $excuse=true,$date_at=''){
if($rev || $date_at){
if(file_exists($file)){
$ret = p_render('xhtml',p_get_instructions(io_readWikiPage($file,$id,$rev)),$info,$date_at); //no caching on old revisions
//no caching on old revisions
$ret = p_render('xhtml',p_get_instructions(io_readWikiPage($file,$id,$rev)),$info,$date_at);
}elseif($excuse){
$ret = p_locale_xhtml('norev');
}
@ -211,7 +212,8 @@ 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 string $key The key of the metdata value that shall be read (by default everything)
* separate hierarchies by " " like "date created"
* @param int $render If the page should be rendererd - possible values:
* METADATA_DONT_RENDER, METADATA_RENDER_USING_SIMPLE_CACHE, METADATA_RENDER_USING_CACHE
* METADATA_RENDER_UNLIMITED (also combined with the previous two options),
@ -341,7 +343,10 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
}
if($persistent) {
if(isset($meta['persistent'][$key][$subkey]) && is_array($meta['persistent'][$key][$subkey])) {
$meta['persistent'][$key][$subkey] = array_replace($meta['persistent'][$key][$subkey], (array)$subvalue);
$meta['persistent'][$key][$subkey] = array_replace(
$meta['persistent'][$key][$subkey],
(array) $subvalue
);
} else {
$meta['persistent'][$key][$subkey] = $subvalue;
}
@ -353,10 +358,14 @@ function p_set_metadata($id, $data, $render=false, $persistent=true){
// these keys, must have subkeys - a legitimate value must be an array
if (is_array($value)) {
$meta['current'][$key] = !empty($meta['current'][$key]) ? array_replace((array)$meta['current'][$key],$value) : $value;
$meta['current'][$key] = !empty($meta['current'][$key]) ?
array_replace((array)$meta['current'][$key],$value) :
$value;
if ($persistent) {
$meta['persistent'][$key] = !empty($meta['persistent'][$key]) ? array_replace((array)$meta['persistent'][$key],$value) : $value;
$meta['persistent'][$key] = !empty($meta['persistent'][$key]) ?
array_replace((array)$meta['persistent'][$key],$value) :
$value;
}
}
@ -420,7 +429,9 @@ function p_read_metadata($id,$cache=false) {
if (isset($cache_metadata[(string)$id])) return $cache_metadata[(string)$id];
$file = metaFN($id, '.meta');
$meta = file_exists($file) ? unserialize(io_readFile($file, false)) : array('current'=>array(),'persistent'=>array());
$meta = file_exists($file) ?
unserialize(io_readFile($file, false)) :
array('current'=>array(),'persistent'=>array());
if ($cache) {
$cache_metadata[(string)$id] = $meta;

View File

@ -54,7 +54,9 @@ class Doku_Plugin_Controller {
$this->list_bytype[$type]['disabled'] = $this->_getListByType($type,false);
}
return $all ? array_merge($this->list_bytype[$type]['enabled'],$this->list_bytype[$type]['disabled']) : $this->list_bytype[$type]['enabled'];
return $all
? array_merge($this->list_bytype[$type]['enabled'], $this->list_bytype[$type]['disabled'])
: $this->list_bytype[$type]['enabled'];
}
/**
@ -98,10 +100,22 @@ class Doku_Plugin_Controller {
$dir = $this->get_directory($plugin);
$inf = confToHash(DOKU_PLUGIN."$dir/plugin.info.txt");
if($inf['base'] && $inf['base'] != $plugin){
msg(sprintf("Plugin installed incorrectly. Rename plugin directory '%s' to '%s'.", hsc($plugin), hsc($inf['base'])), -1);
msg(
sprintf(
"Plugin installed incorrectly. Rename plugin directory '%s' to '%s'.",
hsc($plugin),
hsc(
$inf['base']
)
), -1
);
} elseif (preg_match('/^'.DOKU_PLUGIN_NAME_REGEX.'$/', $plugin) !== 1) {
msg(sprintf("Plugin name '%s' is not a valid plugin name, only the characters a-z and 0-9 are allowed. ".
'Maybe the plugin has been installed in the wrong directory?', hsc($plugin)), -1);
msg(
sprintf(
"Plugin name '%s' is not a valid plugin name, only the characters a-z and 0-9 are allowed. " .
'Maybe the plugin has been installed in the wrong directory?', hsc($plugin)
), -1
);
}
return null;
}
@ -222,8 +236,10 @@ class Doku_Plugin_Controller {
$local_plugins = $this->rebuildLocal();
if($local_plugins != $this->plugin_cascade['local'] || $forceSave) {
$file = $this->last_local_config_file;
$out = "<?php\n/*\n * Local plugin enable/disable settings\n * Auto-generated through plugin/extension manager\n *\n".
" * NOTE: Plugins will not be added to this file unless there is a need to override a default setting. Plugins are\n".
$out = "<?php\n/*\n * Local plugin enable/disable settings\n".
" * Auto-generated through plugin/extension manager\n *\n".
" * NOTE: Plugins will not be added to this file unless there ".
"is a need to override a default setting. Plugins are\n".
" * enabled by default.\n */\n";
foreach ($local_plugins as $plugin => $value) {
$out .= "\$plugins['$plugin'] = $value;\n";
@ -276,9 +292,16 @@ class Doku_Plugin_Controller {
$this->last_local_config_file = array_pop($local);
$this->plugin_cascade['local'] = $this->checkRequire(array($this->last_local_config_file));
if(is_array($local)) {
$this->plugin_cascade['default'] = array_merge($this->plugin_cascade['default'],$this->checkRequire($local));
$this->plugin_cascade['default'] = array_merge(
$this->plugin_cascade['default'],
$this->checkRequire($local)
);
}
$this->tmp_plugins = array_merge($this->plugin_cascade['default'],$this->plugin_cascade['local'],$this->plugin_cascade['protected']);
$this->tmp_plugins = array_merge(
$this->plugin_cascade['default'],
$this->plugin_cascade['local'],
$this->plugin_cascade['protected']
);
}
/**
@ -290,7 +313,9 @@ class Doku_Plugin_Controller {
* @return array of plugin components of requested type
*/
protected function _getListByType($type, $enabled) {
$master_list = $enabled ? array_keys(array_filter($this->tmp_plugins)) : array_keys(array_filter($this->tmp_plugins,array($this,'negate')));
$master_list = $enabled
? array_keys(array_filter($this->tmp_plugins))
: array_keys(array_filter($this->tmp_plugins,array($this,'negate')));
$plugins = array();
foreach ($master_list as $plugin) {

View File

@ -8,7 +8,8 @@
// plugin related constants
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
// note that only [a-z0-9]+ is officially supported, this is only to support plugins that don't follow these conventions, too
// note that only [a-z0-9]+ is officially supported,
// this is only to support plugins that don't follow these conventions, too
if(!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z0-9\x7f-\xff]+');
/**

View File

@ -235,7 +235,7 @@ class RemoteAPI {
global $INPUT;
if (!$conf['remote']) {
throw new RemoteAccessDeniedException('server error. RPC server not enabled.',-32604); //should not be here,just throw
throw new RemoteAccessDeniedException('server error. RPC server not enabled.',-32604);
}
if(trim($conf['remoteuser']) == '!!not set!!') {
return false;

View File

@ -18,7 +18,8 @@
* @param array $opts option array will be given to the Callback
* @param string $dir Current directory beyond $base
* @param int $lvl Recursion Level
* @param mixed $sort 'natural' to use natural order sorting (default); 'date' to sort by filemtime; leave empty to skip sorting.
* @param mixed $sort 'natural' to use natural order sorting (default);
* 'date' to sort by filemtime; leave empty to skip sorting.
* @author Andreas Gohr <andi@splitbrain.org>
*/
function search(&$data,$base,$func,$opts,$dir='',$lvl=1,$sort='natural'){
@ -477,7 +478,8 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
// are we done here maybe?
if($type == 'd'){
if(empty($opts['listdirs'])) return $return;
if(empty($opts['skipacl']) && !empty($opts['sneakyacl']) && $item['perm'] < AUTH_READ) return false; //neither list nor recurse
//neither list nor recurse forbidden items:
if(empty($opts['skipacl']) && !empty($opts['sneakyacl']) && $item['perm'] < AUTH_READ) return false;
if(!empty($opts['dirmatch']) && !preg_match('/'.$opts['dirmatch'].'/',$file)) return $return;
if(!empty($opts['nsmatch']) && !preg_match('/'.$opts['nsmatch'].'/',$item['ns'])) return $return;
}else{

View File

@ -1420,7 +1420,11 @@ function tpl_mediaFileDetails($image, $rev) {
/** @var Input $INPUT */
global $INPUT;
$removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')) && $conf['mediarevisions']);
$removed = (
!file_exists(mediaFN($image)) &&
file_exists(mediaMetaFN($image, '.changes')) &&
$conf['mediarevisions']
);
if(!$image || (!file_exists(mediaFN($image)) && !$removed) || $DEL) return;
if($rev && !file_exists(mediaFN($image, $rev))) $rev = false;
$ns = getNS($image);
@ -1448,7 +1452,8 @@ function tpl_mediaFileDetails($image, $rev) {
$class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
$class = 'select mediafile mf_'.$class;
$attributes = $rev ? ['rev' => $rev] : [];
$tabTitle = '<strong><a href="'.ml($image, $attributes).'" class="'.$class.'" title="'.$lang['mediaview'].'">'.$image.'</a>'.'</strong>';
$tabTitle = '<strong><a href="'.ml($image, $attributes).'" class="'.$class.'" title="'.$lang['mediaview'].'">'.
$image.'</a>'.'</strong>';
if($opened_tab === 'view' && $rev) {
printf($lang['media_viewold'], $tabTitle, dformat($rev));
} else {

View File

@ -211,7 +211,30 @@ function toolbar_JSdefines($varname){
'type' => 'picker',
'title' => $lang['qb_chars'],
'icon' => 'chars.png',
'list' => explode(' ','À à Á á  â à ã Ä ä Ǎ ǎ Ă ă Å å Ā ā Ą ą Æ æ Ć ć Ç ç Č č Ĉ ĉ Ċ ċ Ð đ ð Ď ď È è É é Ê ê Ë ë Ě ě Ē ē Ė ė Ę ę Ģ ģ Ĝ ĝ Ğ ğ Ġ ġ Ĥ ĥ Ì ì Í í Î î Ï ï Ǐ ǐ Ī ī İ ı Į į Ĵ ĵ Ķ ķ Ĺ ĺ Ļ ļ Ľ ľ Ł ł Ŀ ŀ Ń ń Ñ ñ Ņ ņ Ň ň Ò ò Ó ó Ô ô Õ õ Ö ö Ǒ ǒ Ō ō Ő ő Œ œ Ø ø Ŕ ŕ Ŗ ŗ Ř ř Ś ś Ş ş Š š Ŝ ŝ Ţ ţ Ť ť Ù ù Ú ú Û û Ü ü Ǔ ǔ Ŭ ŭ Ū ū Ů ů ǖ ǘ ǚ ǜ Ų ų Ű ű Ŵ ŵ Ý ý Ÿ ÿ Ŷ ŷ Ź ź Ž ž Ż ż Þ þ ß Ħ ħ ¿ ¡ ¢ £ ¤ ¥ € ¦ § ª ¬ ¯ ° ± ÷ ‰ ¼ ½ ¾ ¹ ² ³ µ ¶ † ‡ · • º ∀ ∂ ∃ Ə ə ∅ ∇ ∈ ∉ ∋ ∏ ∑ ‾ × √ ∝ ∞ ∠ ∧ ∫ ∴ ≅ ≈ ≠ ≡ ≤ ≥ ⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ◊ ℘ ℵ ♠ ♣ ♥ ♦ α β Γ γ Δ δ ε ζ η Θ θ ι κ Λ λ μ Ξ ξ Π π ρ Σ σ Τ τ υ Φ φ χ Ψ ψ Ω ω ★ ☆ ☎ ☚ ☛ ☜ ☝ ☞ ☟ ☹ ☺ ✔ ✘ „ “ ” « » … ← ↑ → ↓ ↔ ⇐ ⇑ ⇒ ⇓ ⇔ © ™ ® ″ [ ] { } ~ ( ) % § $ # | @'),
'list' => [
'À', 'à', 'Á', 'á', 'Â', 'â', 'Ã', 'ã', 'Ä', 'ä', 'Ǎ', 'ǎ', 'Ă', 'ă', 'Å', 'å',
'Ā', 'ā', 'Ą', 'ą', 'Æ', 'æ', 'Ć', 'ć', 'Ç', 'ç', 'Č', 'č', 'Ĉ', 'ĉ', 'Ċ', 'ċ',
'Ð', 'đ', 'ð', 'Ď', 'ď', 'È', 'è', 'É', 'é', 'Ê', 'ê', 'Ë', 'ë', 'Ě', 'ě', 'Ē',
'ē', 'Ė', 'ė', 'Ę', 'ę', 'Ģ', 'ģ', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ĥ', 'ĥ', 'Ì',
'ì', 'Í', 'í', 'Î', 'î', 'Ï', 'ï', 'Ǐ', 'ǐ', 'Ī', 'ī', 'İ', 'ı', 'Į', 'į', 'Ĵ',
'ĵ', 'Ķ', 'ķ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ł', 'ł', 'Ŀ', 'ŀ', 'Ń', 'ń', 'Ñ',
'ñ', 'Ņ', 'ņ', 'Ň', 'ň', 'Ò', 'ò', 'Ó', 'ó', 'Ô', 'ô', 'Õ', 'õ', 'Ö', 'ö', 'Ǒ',
'ǒ', 'Ō', 'ō', 'Ő', 'ő', 'Œ', 'œ', 'Ø', 'ø', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś',
'ś', 'Ş', 'ş', 'Š', 'š', 'Ŝ', 'ŝ', 'Ţ', 'ţ', 'Ť', 'ť', 'Ù', 'ù', 'Ú', 'ú', 'Û',
'û', 'Ü', 'ü', 'Ǔ', 'ǔ', 'Ŭ', 'ŭ', 'Ū', 'ū', 'Ů', 'ů', 'ǖ', 'ǘ', 'ǚ', 'ǜ', 'Ų',
'ų', 'Ű', 'ű', 'Ŵ', 'ŵ', 'Ý', 'ý', 'Ÿ', 'ÿ', 'Ŷ', 'ŷ', 'Ź', 'ź', 'Ž', 'ž', 'Ż',
'ż', 'Þ', 'þ', 'ß', 'Ħ', 'ħ', '¿', '¡', '¢', '£', '¤', '¥', '€', '¦', '§', 'ª',
'¬', '¯', '°', '±', '÷', '‰', '¼', '½', '¾', '¹', '²', '³', 'µ', '¶', '†', '‡',
'·', '•', 'º', '∀', '∂', '∃', 'Ə', 'ə', '∅', '∇', '∈', '∉', '∋', '∏', '∑', '‾',
'', '', '×', '', '√', '∝', '∞', '∠', '∧', '', '∩', '', '∫', '∴', '', '≅',
'≈', '≠', '≡', '≤', '≥', '⊂', '⊃', '⊄', '⊆', '⊇', '⊕', '⊗', '⊥', '⋅', '◊', '℘',
'', '', 'ℵ', '♠', '♣', '♥', '♦', 'α', 'β', 'Γ', 'γ', 'Δ', 'δ', 'ε', 'ζ', 'η',
'Θ', 'θ', 'ι', 'κ', 'Λ', 'λ', 'μ', 'Ξ', 'ξ', 'Π', 'π', 'ρ', 'Σ', 'σ', 'Τ', 'τ',
'υ', 'Φ', 'φ', 'χ', 'Ψ', 'ψ', 'Ω', 'ω', '★', '☆', '☎', '☚', '☛', '☜', '☝', '☞',
'☟', '☹', '☺', '✔', '✘', '„', '“', '”', '', '', '', '«', '»', '', '', '—',
'', '…', '←', '↑', '→', '↓', '↔', '⇐', '⇑', '⇒', '⇓', '⇔', '©', '™', '®', '',
'″', '[', ']', '{', '}', '~', '(', ')', '%', '§', '$', '#', '|', '@'
],
'block' => false
),
array(

View File

@ -238,7 +238,7 @@ if(!function_exists('utf8_substr')){
if ($length > 0) {
$length = min($strlen-$offset, $length); // reduce any length that would go passed the end of the string
$length = min($strlen-$offset, $length); // reduce any length that would go past the end of the string
$Lx = (int)($length/65535);
$Ly = $length%65535;
@ -1474,7 +1474,8 @@ if(empty($UTF8_ROMANIZATION)) $UTF8_ROMANIZATION = array(
'っりゃ'=>'rrya','っりぇ'=>'rrye','っりぃ'=>'rryi','っりょ'=>'rryo','っりゅ'=>'rryu',
'っしゃ'=>'ssha','っしぇ'=>'sshe','っし'=>'sshi','っしょ'=>'ssho','っしゅ'=>'sshu',
// seperate hiragana 'n' ('n' + 'i' != 'ni', normally we would write "kon'nichi wa" but the apostrophe would be converted to _ anyway)
// seperate hiragana 'n' ('n' + 'i' != 'ni', normally we would write "kon'nichi wa" but the
// apostrophe would be converted to _ anyway)
'んあ'=>'n_a','んえ'=>'n_e','んい'=>'n_i','んお'=>'n_o','んう'=>'n_u',
'んや'=>'n_ya','んよ'=>'n_yo','んゆ'=>'n_yu',
@ -1561,7 +1562,8 @@ if(empty($UTF8_ROMANIZATION)) $UTF8_ROMANIZATION = array(
// Japanese katakana
// 4 character syllables: ッ doubles the consonant after, ー doubles the vowel before (usualy written with macron, but we don't want that in our URLs)
// 4 character syllables: ッ doubles the consonant after, ー doubles the vowel before
// (usualy written with macron, but we don't want that in our URLs)
'ッビャー'=>'bbyaa','ッビェー'=>'bbyee','ッビィー'=>'bbyii','ッビョー'=>'bbyoo','ッビュー'=>'bbyuu',
'ッピャー'=>'ppyaa','ッピェー'=>'ppyee','ッピィー'=>'ppyii','ッピョー'=>'ppyoo','ッピュー'=>'ppyuu',
'ッキャー'=>'kkyaa','ッキェー'=>'kkyee','ッキィー'=>'kkyii','ッキョー'=>'kkyoo','ッキュー'=>'kkyuu',

View File

@ -95,8 +95,11 @@ header('Content-Type: text/html; charset=utf-8');
print "</div>\n";
}
?>
<a style="background: transparent url(data/dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.png) left top no-repeat;
display: block; width:380px; height:73px; border:none; clear:both;"
<a style="
background: transparent
url(data/dont-panic-if-you-see-this-in-your-logs-it-means-your-directory-permissions-are-correct.png)
left top no-repeat;
display: block; width:380px; height:73px; border:none; clear:both;"
target="_blank"
href="http://www.dokuwiki.org/security#web_access_security"></a>
</div>
@ -166,10 +169,12 @@ function print_form($d){
<fieldset id="acldep">
<label for="superuser"><?php echo $lang['i_superuser']?></label>
<input class="text" type="text" name="d[superuser]" id="superuser" value="<?php echo $d['superuser'] ?>" />
<input class="text" type="text" name="d[superuser]" id="superuser"
value="<?php echo $d['superuser'] ?>" />
<label for="fullname"><?php echo $lang['fullname']?></label>
<input class="text" type="text" name="d[fullname]" id="fullname" value="<?php echo $d['fullname'] ?>" />
<input class="text" type="text" name="d[fullname]" id="fullname"
value="<?php echo $d['fullname'] ?>" />
<label for="email"><?php echo $lang['email']?></label>
<input class="text" type="text" name="d[email]" id="email" value="<?php echo $d['email'] ?>" />
@ -182,13 +187,17 @@ function print_form($d){
<label for="policy"><?php echo $lang['i_policy']?></label>
<select class="text" name="d[policy]" id="policy">
<option value="0" <?php echo ($d['policy'] == 0)?'selected="selected"':'' ?>><?php echo $lang['i_pol0']?></option>
<option value="1" <?php echo ($d['policy'] == 1)?'selected="selected"':'' ?>><?php echo $lang['i_pol1']?></option>
<option value="2" <?php echo ($d['policy'] == 2)?'selected="selected"':'' ?>><?php echo $lang['i_pol2']?></option>
<option value="0" <?php echo ($d['policy'] == 0)?'selected="selected"':'' ?>><?php
echo $lang['i_pol0']?></option>
<option value="1" <?php echo ($d['policy'] == 1)?'selected="selected"':'' ?>><?php
echo $lang['i_pol1']?></option>
<option value="2" <?php echo ($d['policy'] == 2)?'selected="selected"':'' ?>><?php
echo $lang['i_pol2']?></option>
</select>
<label for="allowreg">
<input type="checkbox" name="d[allowreg]" id="allowreg" <?php echo(($d['allowreg'] ? ' checked="checked"' : ''));?> />
<input type="checkbox" name="d[allowreg]" id="allowreg" <?php
echo(($d['allowreg'] ? ' checked="checked"' : ''));?> />
<?php echo $lang['i_allowreg']?>
</label>
</fieldset>
@ -213,8 +222,10 @@ function print_form($d){
<fieldset>
<p><?php echo $lang['i_pop_field']?></p>
<label for="pop">
<input type="checkbox" name="d[pop]" id="pop" <?php echo(($d['pop'] ? ' checked="checked"' : ''));?> />
<?php echo $lang['i_pop_label']?> <a href="http://www.dokuwiki.org/popularity" target="_blank"><sup>[?]</sup></a>
<input type="checkbox" name="d[pop]" id="pop" <?php
echo(($d['pop'] ? ' checked="checked"' : ''));?> />
<?php echo $lang['i_pop_label']?>
<a href="http://www.dokuwiki.org/popularity" target="_blank"><sup>[?]</sup></a>
</label>
</fieldset>

View File

@ -67,7 +67,8 @@ function css_out(){
// load jQuery-UI theme
if ($mediatype == 'screen') {
$files[DOKU_INC.'lib/scripts/jquery/jquery-ui-theme/smoothness.css'] = DOKU_BASE.'lib/scripts/jquery/jquery-ui-theme/';
$files[DOKU_INC.'lib/scripts/jquery/jquery-ui-theme/smoothness.css'] =
DOKU_BASE.'lib/scripts/jquery/jquery-ui-theme/';
}
// load plugin styles
$files = array_merge($files, css_pluginstyles($mediatype));
@ -99,7 +100,16 @@ function css_out(){
}
// The generated script depends on some dynamic options
$cache = new cache('styles'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].$INPUT->bool('preview').DOKU_BASE.$tpl.$type,'.css');
$cache = new cache(
'styles' .
$_SERVER['HTTP_HOST'] .
$_SERVER['SERVER_PORT'] .
$INPUT->bool('preview') .
DOKU_BASE .
$tpl .
$type,
'.css'
);
$cache->_event = 'CSS_CACHE_USE';
// check cache age & handle conditional request
@ -547,18 +557,50 @@ function css_compress($css){
$css = preg_replace('/ ?: /',':',$css);
// number compression
$css = preg_replace('/([: ])0+(\.\d+?)0*((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/', '$1$2$3', $css); // "0.1em" to ".1em", "1.10em" to "1.1em"
$css = preg_replace('/([: ])\.(0)+((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/', '$1$2', $css); // ".0em" to "0"
$css = preg_replace('/([: ]0)0*(\.0*)?((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/', '$1', $css); // "0.0em" to "0"
$css = preg_replace('/([: ]\d+)(\.0*)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/', '$1$3', $css); // "1.0em" to "1em"
$css = preg_replace('/([: ])0+(\d+|\d*\.\d+)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/', '$1$2$3', $css); // "001em" to "1em"
$css = preg_replace(
'/([: ])0+(\.\d+?)0*((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/',
'$1$2$3',
$css
); // "0.1em" to ".1em", "1.10em" to "1.1em"
$css = preg_replace(
'/([: ])\.(0)+((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/',
'$1$2',
$css
); // ".0em" to "0"
$css = preg_replace(
'/([: ]0)0*(\.0*)?((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
'$1',
$css
); // "0.0em" to "0"
$css = preg_replace(
'/([: ]\d+)(\.0*)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
'$1$3',
$css
); // "1.0em" to "1em"
$css = preg_replace(
'/([: ])0+(\d+|\d*\.\d+)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
'$1$2$3',
$css
); // "001em" to "1em"
// shorten attributes (1em 1em 1em 1em -> 1em)
$css = preg_replace('/(?<![\w\-])((?:margin|padding|border|border-(?:width|radius)):)([\w\.]+)( \2)+(?=[;\}]| !)/', '$1$2', $css); // "1em 1em 1em 1em" to "1em"
$css = preg_replace('/(?<![\w\-])((?:margin|padding|border|border-(?:width)):)([\w\.]+) ([\w\.]+) \2 \3(?=[;\}]| !)/', '$1$2 $3', $css); // "1em 2em 1em 2em" to "1em 2em"
$css = preg_replace(
'/(?<![\w\-])((?:margin|padding|border|border-(?:width|radius)):)([\w\.]+)( \2)+(?=[;\}]| !)/',
'$1$2',
$css
); // "1em 1em 1em 1em" to "1em"
$css = preg_replace(
'/(?<![\w\-])((?:margin|padding|border|border-(?:width)):)([\w\.]+) ([\w\.]+) \2 \3(?=[;\}]| !)/',
'$1$2 $3',
$css
); // "1em 2em 1em 2em" to "1em 2em"
// shorten colors
$css = preg_replace("/#([0-9a-fA-F]{1})\\1([0-9a-fA-F]{1})\\2([0-9a-fA-F]{1})\\3(?=[^\{]*[;\}])/", "#\\1\\2\\3", $css);
$css = preg_replace(
"/#([0-9a-fA-F]{1})\\1([0-9a-fA-F]{1})\\2([0-9a-fA-F]{1})\\3(?=[^\{]*[;\}])/",
"#\\1\\2\\3",
$css
);
return $css;
}

View File

@ -89,9 +89,11 @@ function runTrimRecentChanges($media_changes = false) {
$log = parseChangelogLine($lines[$i]);
if ($log === false) continue; // discard junk
if ($log['date'] < $trim_time) {
$old_lines[$log['date'].".$i"] = $lines[$i]; // keep old lines for now (append .$i to prevent key collisions)
// keep old lines for now (append .$i to prevent key collisions)
$old_lines[$log['date'].".$i"] = $lines[$i];
} else {
$out_lines[$log['date'].".$i"] = $lines[$i]; // definitely keep these lines
// definitely keep these lines
$out_lines[$log['date'].".$i"] = $lines[$i];
}
}

View File

@ -100,8 +100,12 @@ function js_out(){
'secure' => $conf['securecookie'] && is_ssl()
)).";";
// FIXME: Move those to JSINFO
print "Object.defineProperty(window, 'DOKU_UHN', { get: function() { console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead'); return JSINFO.useHeadingNavigation; } });";
print "Object.defineProperty(window, 'DOKU_UHC', { get: function() { console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead'); return JSINFO.useHeadingContent; } });";
print "Object.defineProperty(window, 'DOKU_UHN', { get: function() {".
"console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');".
"return JSINFO.useHeadingNavigation; } });";
print "Object.defineProperty(window, 'DOKU_UHC', { get: function() {".
"console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');".
"return JSINFO.useHeadingContent; } });";
// load JS specific translations
$lang['js']['plugins'] = js_pluginstrings();

View File

@ -513,11 +513,15 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
$alt = '+';
}
$ret .= '<img src="'.$img.'" alt="'.$alt.'" />';
$ret .= '<a href="'.wl('',$this->_get_opts(array('ns'=>$item['id'],'sectok'=>getSecurityToken()))).'" class="idx_dir'.$cl.'">';
$ret .= '<a href="'.
wl('',$this->_get_opts(array('ns'=>$item['id'],'sectok'=>getSecurityToken()))).
'" class="idx_dir'.$cl.'">';
$ret .= $base;
$ret .= '</a>';
}else{
$ret .= '<a href="'.wl('',$this->_get_opts(array('id'=>$item['id'],'ns'=>'','sectok'=>getSecurityToken()))).'" class="wikilink1'.$cl.'">';
$ret .= '<a href="'.
wl('',$this->_get_opts(array('id'=>$item['id'],'ns'=>'','sectok'=>getSecurityToken()))).
'" class="wikilink1'.$cl.'">';
$ret .= noNS($item['id']);
$ret .= '</a>';
}

View File

@ -39,7 +39,10 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin {
*/
public function listAcls(){
if(!auth_isadmin()) {
throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114);
throw new RemoteAccessDeniedException(
'You are not allowed to access ACLs, superuser permission is required',
114
);
}
/** @var admin_plugin_acl $apa */
$apa = plugin_load('admin', 'acl');
@ -58,7 +61,10 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin {
*/
public function addAcl($scope, $user, $level){
if(!auth_isadmin()) {
throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114);
throw new RemoteAccessDeniedException(
'You are not allowed to access ACLs, superuser permission is required',
114
);
}
/** @var admin_plugin_acl $apa */
@ -76,7 +82,10 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin {
*/
public function delAcl($scope, $user){
if(!auth_isadmin()) {
throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114);
throw new RemoteAccessDeniedException(
'You are not allowed to access ACLs, superuser permission is required',
114
);
}
/** @var admin_plugin_acl $apa */

View File

@ -115,7 +115,8 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
*
* @author Gabriel Birke <birke@d-scribe.de>
* @param string $type Modification type ('create', 'modify', 'delete')
* @param array $params Parameters for the createUser, modifyUser or deleteUsers method. The content of this array depends on the modification type
* @param array $params Parameters for the createUser, modifyUser or deleteUsers method.
* The content of this array depends on the modification type
* @return bool|null|int Result from the modification function or false if an event handler has canceled the action
*/
public function triggerUserMod($type, $params) {
@ -132,7 +133,7 @@ class DokuWiki_Auth_Plugin extends DokuWiki_Plugin {
$eventdata = array('type' => $type, 'params' => $params, 'modification_result' => null);
$evt = new Doku_Event('AUTH_USER_CHANGE', $eventdata);
if($evt->advise_before(true)) {
$result = call_user_func_array(array($this, $validTypes[$type]), $evt->data['params']);
$result = call_user_func_array(array($this, $validTypes[$type]), $evt->data['params']);
$evt->data['modification_result'] = $result;
}
$evt->advise_after();

View File

@ -381,8 +381,16 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
$usermanager->setLastdisabled(true);
if (!isset($this->_grpsusers[$this->_filterToString($filter)])){
$this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize());
} elseif (count($this->_grpsusers[$this->_filterToString($filter)]) < $usermanager->getStart() + 3*$usermanager->getPagesize()) {
$this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize() - count($this->_grpsusers[$this->_filterToString($filter)]));
} elseif (
count($this->_grpsusers[$this->_filterToString($filter)]) <
$usermanager->getStart() + 3*$usermanager->getPagesize()
) {
$this->_fillGroupUserArray(
$filter,
$usermanager->getStart() +
3*$usermanager->getPagesize() -
count($this->_grpsusers[$this->_filterToString($filter)])
);
}
$result = $this->_grpsusers[$this->_filterToString($filter)];
} else {
@ -494,8 +502,14 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
} else {
$usermanager = plugin_load("admin", "usermanager", false);
$usermanager->setLastdisabled(true);
if (!isset($this->_grpsusers[$this->_filterToString($filter)]) || count($this->_grpsusers[$this->_filterToString($filter)]) < ($start+$limit)) {
$this->_fillGroupUserArray($filter,$start+$limit - count($this->_grpsusers[$this->_filterToString($filter)]) +1);
if (
!isset($this->_grpsusers[$this->_filterToString($filter)]) ||
count($this->_grpsusers[$this->_filterToString($filter)]) < ($start+$limit)
) {
$this->_fillGroupUserArray(
$filter,
$start+$limit - count($this->_grpsusers[$this->_filterToString($filter)]) +1
);
}
if (!$this->_grpsusers[$this->_filterToString($filter)]) return false;
foreach($this->_grpsusers[$this->_filterToString($filter)] as $user => &$info) {
@ -638,8 +652,12 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
$opts['domain_controllers'] = array_filter($opts['domain_controllers']);
// compatibility with old option name
if(empty($opts['admin_username']) && !empty($opts['ad_username'])) $opts['admin_username'] = $opts['ad_username'];
if(empty($opts['admin_password']) && !empty($opts['ad_password'])) $opts['admin_password'] = $opts['ad_password'];
if(empty($opts['admin_username']) && !empty($opts['ad_username'])) {
$opts['admin_username'] = $opts['ad_username'];
}
if(empty($opts['admin_password']) && !empty($opts['ad_password'])) {
$opts['admin_password'] = $opts['ad_password'];
}
$opts['admin_password'] = conf_decodeString($opts['admin_password']); // deobfuscate
// we can change the password if SSL is set

View File

@ -58,7 +58,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if($this->getConf('binddn') && $this->getConf('bindpw')) {
// use superuser credentials
if(!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))) {
$this->_debug('LDAP bind as superuser: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP bind as superuser: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
$this->bound = 2;
@ -83,7 +83,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// Anonymous bind
if(!@ldap_bind($this->con)) {
msg("LDAP: can not bind anonymously", -1);
$this->_debug('LDAP anonymous bind: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP anonymous bind: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
}
@ -93,7 +93,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// User/Password bind
if(!@ldap_bind($this->con, $dn, $pass)) {
$this->_debug("LDAP: bind with $dn failed", -1, __LINE__, __FILE__);
$this->_debug('LDAP user dn bind: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP user dn bind: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
$this->bound = 1;
@ -110,7 +110,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// Try to bind with the dn provided
if(!@ldap_bind($this->con, $dn, $pass)) {
$this->_debug("LDAP: bind with $dn failed", -1, __LINE__, __FILE__);
$this->_debug('LDAP user bind: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP user bind: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
$this->bound = 1;
@ -163,7 +163,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if($this->getConf('binddn') && $this->getConf('bindpw') && $this->bound < 2) {
// use superuser credentials
if(!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))) {
$this->_debug('LDAP bind as superuser: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP bind as superuser: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
$this->bound = 2;
@ -180,10 +180,10 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
$info = array();
$info['user'] = $user;
$this->_debug('LDAP user to find: '.htmlspecialchars($info['user']), 0, __LINE__, __FILE__);
$this->_debug('LDAP user to find: '.hsc($info['user']), 0, __LINE__, __FILE__);
$info['server'] = $this->getConf('server');
$this->_debug('LDAP Server: '.htmlspecialchars($info['server']), 0, __LINE__, __FILE__);
$this->_debug('LDAP Server: '.hsc($info['server']), 0, __LINE__, __FILE__);
//get info for given user
@ -194,10 +194,10 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
$filter = "(ObjectClass=*)";
}
$this->_debug('LDAP Filter: '.htmlspecialchars($filter), 0, __LINE__, __FILE__);
$this->_debug('LDAP Filter: '.hsc($filter), 0, __LINE__, __FILE__);
$this->_debug('LDAP user search: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP search at: '.htmlspecialchars($base.' '.$filter), 0, __LINE__, __FILE__);
$this->_debug('LDAP user search: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP search at: '.hsc($base.' '.$filter), 0, __LINE__, __FILE__);
$sr = $this->_ldapsearch($this->con, $base, $filter, $this->getConf('userscope'));
$result = @ldap_get_entries($this->con, $sr);
@ -205,15 +205,18 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// if result is not an array
if(!is_array($result)) {
// no objects found
$this->_debug('LDAP search returned non-array result: '.htmlspecialchars(print($result)), -1, __LINE__, __FILE__);
$this->_debug('LDAP search returned non-array result: '.hsc(print($result)), -1, __LINE__, __FILE__);
return false;
}
// Don't accept more or less than one response
if ($result['count'] != 1) {
$this->_debug('LDAP search returned '.htmlspecialchars($result['count']).' results while it should return 1!', -1, __LINE__, __FILE__);
$this->_debug(
'LDAP search returned '.hsc($result['count']).' results while it should return 1!',
-1, __LINE__, __FILE__
);
//for($i = 0; $i < $result["count"]; $i++) {
//$this->_debug('result: '.htmlspecialchars(print_r($result[$i])), 0, __LINE__, __FILE__);
//$this->_debug('result: '.hsc(print_r($result[$i])), 0, __LINE__, __FILE__);
//}
return false;
}
@ -259,9 +262,15 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if($this->getConf('grouptree') || $this->getConf('groupfilter')) {
$base = $this->_makeFilter($this->getConf('grouptree'), $user_result);
$filter = $this->_makeFilter($this->getConf('groupfilter'), $user_result);
$sr = $this->_ldapsearch($this->con, $base, $filter, $this->getConf('groupscope'), array($this->getConf('groupkey')));
$this->_debug('LDAP group search: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP search at: '.htmlspecialchars($base.' '.$filter), 0, __LINE__, __FILE__);
$sr = $this->_ldapsearch(
$this->con,
$base,
$filter,
$this->getConf('groupscope'),
array($this->getConf('groupkey')))
;
$this->_debug('LDAP group search: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP search at: '.hsc($base.' '.$filter), 0, __LINE__, __FILE__);
if(!$sr) {
msg("LDAP: Reading group memberships failed", -1);
@ -280,7 +289,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
}
if($group === '') continue;
$this->_debug('LDAP usergroup: '.htmlspecialchars($group), 0, __LINE__, __FILE__);
$this->_debug('LDAP usergroup: '.hsc($group), 0, __LINE__, __FILE__);
$info['grps'][] = $group;
}
}
@ -305,7 +314,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// open the connection to the ldap
if(!$this->_openLDAP()){
$this->_debug('LDAP cannot connect: '. htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP cannot connect: '. hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
@ -325,14 +334,16 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// bind with the ldap
if(!@ldap_bind($this->con, $dn, $pass)){
$this->_debug('LDAP user bind failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug(
'LDAP user bind failed: '. hsc($dn) .': '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__
);
return false;
}
} elseif ($this->getConf('binddn') && $this->getConf('bindpw')) {
// we are changing the password on behalf of the user (eg: forgotten password)
// bind with the superuser ldap
if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))){
$this->_debug('LDAP bind as superuser: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP bind as superuser: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
return false;
}
}
@ -346,7 +357,9 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
// change the password
if(!@ldap_mod_replace($this->con, $dn,array('userpassword' => $hash))){
$this->_debug('LDAP mod replace failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug(
'LDAP mod replace failed: '. hsc($dn) .': '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__
);
return false;
}
@ -538,13 +551,13 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
)
) {
msg('Setting LDAP Protocol version '.$this->getConf('version').' failed', -1);
$this->_debug('LDAP version set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP version set: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
} else {
//use TLS (needs version 3)
if($this->getConf('starttls')) {
if(!@ldap_start_tls($this->con)) {
msg('Starting TLS failed', -1);
$this->_debug('LDAP TLS set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP TLS set: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
}
}
// needs version 3
@ -555,7 +568,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
)
) {
msg('Setting LDAP referrals failed', -1);
$this->_debug('LDAP referal set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP referal set: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
}
}
}
@ -565,7 +578,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if($this->getConf('deref')) {
if(!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {
msg('Setting LDAP Deref mode '.$this->getConf('deref').' failed', -1);
$this->_debug('LDAP deref set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);
$this->_debug('LDAP deref set: '.hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
}
}
/* As of PHP 5.3.0 we can set timeout to speedup skipping of invalid servers */

View File

@ -191,7 +191,13 @@ class auth_plugin_authplain extends DokuWiki_Auth_Plugin {
$userinfo[$field] = $value;
}
$userline = $this->_createUserLine($newuser, $userinfo['pass'], $userinfo['name'], $userinfo['mail'], $userinfo['grps']);
$userline = $this->_createUserLine(
$newuser,
$userinfo['pass'],
$userinfo['name'],
$userinfo['mail'],
$userinfo['grps']
);
if(!io_replaceInFile($config_cascade['plainauth.users']['default'], '/^'.$user.':/', $userline, true)) {
msg('There was an error modifying your user data. You may need to register again.', -1);

View File

@ -148,9 +148,16 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
// config settings
list($label,$input) = $setting->html($this, $this->_error);
$class = $setting->is_default() ? ' class="default"' : ($setting->is_protected() ? ' class="protected"' : '');
$error = $setting->error() ? ' class="value error"' : ' class="value"';
$icon = $setting->caution() ? '<img src="'.DOKU_PLUGIN_IMAGES.$setting->caution().'.png" alt="'.$setting->caution().'" title="'.$this->getLang($setting->caution()).'" />' : '';
$class = $setting->is_default()
? ' class="default"'
: ($setting->is_protected() ? ' class="protected"' : '');
$error = $setting->error()
? ' class="value error"'
: ' class="value"';
$icon = $setting->caution()
? '<img src="'.DOKU_PLUGIN_IMAGES.$setting->caution().'.png" '.
'alt="'.$setting->caution().'" title="'.$this->getLang($setting->caution()).'" />'
: '';
ptln(' <tr'.$class.'>');
ptln(' <td class="label">');
@ -188,13 +195,20 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
ptln('<table class="inline">');
$undefined_setting_match = array();
foreach($undefined_settings as $setting) {
if (preg_match('/^(?:plugin|tpl)'.CM_KEYMARKER.'.*?'.CM_KEYMARKER.'(.*)$/', $setting->_key, $undefined_setting_match)) {
if (
preg_match(
'/^(?:plugin|tpl)'.CM_KEYMARKER.'.*?'.CM_KEYMARKER.'(.*)$/',
$setting->_key,
$undefined_setting_match
)
) {
$undefined_setting_key = $undefined_setting_match[1];
} else {
$undefined_setting_key = $setting->_key;
}
ptln(' <tr>');
ptln(' <td class="label"><span title="$meta[\''.$undefined_setting_key.'\']">$'.$this->_config->_name.'[\''.$setting->_out_key().'\']</span></td>');
ptln(' <td class="label"><span title="$meta[\''.$undefined_setting_key.'\']">$'.
$this->_config->_name.'[\''.$setting->_out_key().'\']</span></td>');
ptln(' <td>'.$this->getLang('_msg_'.get_class($setting)).'</td>');
ptln(' </tr>');
}

View File

@ -15,14 +15,14 @@ if (!class_exists('configuration')) {
*/
class configuration {
var $_name = 'conf'; // name of the config variable found in the files (overridden by $config['varname'])
var $_format = 'php'; // format of the config file, supported formats - php (overridden by $config['format'])
var $_heading = ''; // heading string written at top of config file - don't include comment indicators
var $_loaded = false; // set to true after configuration files are loaded
var $_metadata = array(); // holds metadata describing the settings
var $_name = 'conf'; // name of the config variable found in the files (overridden by $config['varname'])
var $_format = 'php'; // format of the config file, supported formats - php (overridden by $config['format'])
var $_heading = ''; // heading string written at top of config file - don't include comment indicators
var $_loaded = false; // set to true after configuration files are loaded
var $_metadata = array();// holds metadata describing the settings
/** @var setting[] */
var $setting = array(); // array of setting objects
var $locked = false; // configuration is considered locked if it can't be updated
var $setting = array(); // array of setting objects
var $locked = false; // configuration is considered locked if it can't be updated
var $show_disabled_plugins = false;
// configuration filenames
@ -68,11 +68,19 @@ if (!class_exists('configuration')) {
$no_default_check = array('setting_fieldset', 'setting_undefined', 'setting_no_class');
if (!$this->_loaded) {
$default = array_merge($this->get_plugintpl_default($conf['template']), $this->_read_config_group($this->_default_files));
$default = array_merge(
$this->get_plugintpl_default($conf['template']),
$this->_read_config_group($this->_default_files)
);
$local = $this->_read_config_group($this->_local_files);
$protected = $this->_read_config_group($this->_protected_files);
$keys = array_merge(array_keys($this->_metadata),array_keys($default), array_keys($local), array_keys($protected));
$keys = array_merge(
array_keys($this->_metadata),
array_keys($default),
array_keys($local),
array_keys($protected)
);
$keys = array_unique($keys);
$param = null;
@ -378,7 +386,7 @@ if (!class_exists('configuration')) {
@include(DOKU_PLUGIN.$plugin_dir.$file);
@include(DOKU_PLUGIN.$plugin_dir.$class);
if (!empty($meta)) {
$metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] = array('fieldset');
$metadata['plugin'.CM_KEYMARKER.$plugin.CM_KEYMARKER.'plugin_settings_name'] = ['fieldset'];
}
foreach ($meta as $key => $value){
if ($value[0]=='fieldset') { continue; } //plugins only get one fieldset
@ -535,7 +543,8 @@ if (!class_exists('setting')) {
$value = formText($value);
$label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
$input = '<textarea rows="3" cols="40" id="config___'.$key.'" name="config['.$key.']" class="edit" '.$disable.'>'.$value.'</textarea>';
$input = '<textarea rows="3" cols="40" id="config___'.$key.
'" name="config['.$key.']" class="edit" '.$disable.'>'.$value.'</textarea>';
return array($label,$input);
}
@ -603,7 +612,10 @@ if (!class_exists('setting')) {
public function caution() {
if (!empty($this->_caution)) {
if (!in_array($this->_caution, setting::$_validCautions)) {
trigger_error('Invalid caution string ('.$this->_caution.') in metadata for setting "'.$this->_key.'"', E_USER_WARNING);
trigger_error(
'Invalid caution string ('.$this->_caution.') in metadata for setting "'.$this->_key.'"',
E_USER_WARNING
);
return false;
}
return $this->_caution;
@ -760,7 +772,8 @@ if (!class_exists('setting_array')) {
$value = htmlspecialchars($this->_from_array($value));
$label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
$input = '<input id="config___'.$key.'" name="config['.$key.']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
$input = '<input id="config___'.$key.'" name="config['.$key.
']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
return array($label,$input);
}
}
@ -796,7 +809,8 @@ if (!class_exists('setting_string')) {
$value = htmlspecialchars($value);
$label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
$input = '<input id="config___'.$key.'" name="config['.$key.']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
$input = '<input id="config___'.$key.'" name="config['.$key.
']" type="text" class="edit" value="'.$value.'" '.$disable.'/>';
return array($label,$input);
}
}
@ -846,7 +860,8 @@ if (!class_exists('setting_password')) {
$key = htmlspecialchars($this->_key);
$label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
$input = '<input id="config___'.$key.'" name="config['.$key.']" autocomplete="off" type="password" class="edit" value="" '.$disable.' />';
$input = '<input id="config___'.$key.'" name="config['.$key.
']" autocomplete="off" type="password" class="edit" value="" '.$disable.' />';
return array($label,$input);
}
}
@ -1027,7 +1042,8 @@ if (!class_exists('setting_onoff')) {
$checked = ($value) ? ' checked="checked"' : '';
$label = '<label for="config___'.$key.'">'.$this->prompt($plugin).'</label>';
$input = '<div class="input"><input id="config___'.$key.'" name="config['.$key.']" type="checkbox" class="checkbox" value="1"'.$checked.$disable.'/></div>';
$input = '<div class="input"><input id="config___'.$key.'" name="config['.$key.
']" type="checkbox" class="checkbox" value="1"'.$checked.$disable.'/></div>';
return array($label,$input);
}
@ -1097,7 +1113,9 @@ if (!class_exists('setting_multichoice')) {
foreach ($this->_choices as $choice) {
$selected = ($value == $choice) ? ' selected="selected"' : '';
$option = $plugin->getLang($this->_key.'_o_'.$choice);
if (!$option && isset($this->lang[$this->_key.'_o_'.$choice])) $option = $this->lang[$this->_key.'_o_'.$choice];
if (!$option && isset($this->lang[$this->_key.'_o_'.$choice])) {
$option = $this->lang[$this->_key . '_o_' . $choice];
}
if (!$option) $option = $choice;
$choice = htmlspecialchars($choice);
@ -1303,7 +1321,8 @@ if (!class_exists('setting_multicheckbox')) {
$input .= '<div class="selection'.$class.'">'."\n";
$input .= '<label for="config___'.$key.'_'.$choice.'">'.$prompt."</label>\n";
$input .= '<input id="config___'.$key.'_'.$choice.'" name="config['.$key.'][]" type="checkbox" class="checkbox" value="'.$choice.'" '.$disable.' '.$checked."/>\n";
$input .= '<input id="config___'.$key.'_'.$choice.'" name="config['.$key.
'][]" type="checkbox" class="checkbox" value="'.$choice.'" '.$disable.' '.$checked."/>\n";
$input .= "</div>\n";
// remove this action from the disabledactions array
@ -1318,12 +1337,16 @@ if (!class_exists('setting_multicheckbox')) {
// use != 'exists' rather than == 'always' to ensure invalid values default to 'always'
if ($this->_other != 'exists' || $other) {
$class = ((count($default) == count($value)) && (count($value) == count(array_intersect($value,$default)))) ?
$class = (
(count($default) == count($value)) &&
(count($value) == count(array_intersect($value,$default)))
) ?
" selectiondefault" : "";
$input .= '<div class="other'.$class.'">'."\n";
$input .= '<label for="config___'.$key.'_other">'.$plugin->getLang($key.'_other')."</label>\n";
$input .= '<input id="config___'.$key.'_other" name="config['.$key.'][other]" type="text" class="edit" value="'.htmlspecialchars($other).'" '.$disable." />\n";
$input .= '<input id="config___'.$key.'_other" name="config['.$key.
'][other]" type="text" class="edit" value="'.htmlspecialchars($other).'" '.$disable." />\n";
$input .= "</div>\n";
}
}

View File

@ -122,7 +122,10 @@ $meta['fullpath'] = array('onoff','_caution' => 'security');
$meta['typography'] = array('multichoice','_choices' => array(0,1,2));
$meta['dformat'] = array('string');
$meta['signature'] = array('string');
$meta['showuseras'] = array('multichoice','_choices' => array('loginname','username','username_link','email','email_link'));
$meta['showuseras'] = array(
'multichoice',
'_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
);
$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5)); // 5 toc levels
$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
@ -146,9 +149,29 @@ $meta['superuser'] = array('string','_caution' => 'danger');
$meta['manager'] = array('string');
$meta['profileconfirm'] = array('onoff');
$meta['rememberme'] = array('onoff');
$meta['disableactions'] = array('disableactions',
'_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','profile_delete','edit','wikicode','check', 'rss'),
'_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
$meta['disableactions'] = array(
'disableactions',
'_choices' => array(
'backlink',
'index',
'recent',
'revisions',
'search',
'subscription',
'register',
'resendpwd',
'profile',
'profile_delete',
'edit',
'wikicode',
'check',
'rss'
),
'_combine' => array(
'subscription' => array('subscribe', 'unsubscribe'),
'wikicode' => array('source', 'export_raw')
)
);
$meta['auth_security_timeout'] = array('numeric');
$meta['securecookie'] = array('onoff');
$meta['remote'] = array('onoff','_caution' => 'security');

View File

@ -70,16 +70,34 @@ class admin_plugin_extension extends DokuWiki_Admin_Plugin {
$extension->setExtension($extname);
$installed = $extension->installOrUpdate();
foreach($installed as $ext => $info) {
msg(sprintf($this->getLang('msg_'.$info['type'].'_'.$info['action'].'_success'), $info['base']), 1);
msg(
sprintf(
$this->getLang('msg_' . $info['type'] . '_' . $info['action'] . '_success'),
$info['base']
),
1
);
}
break;
case 'uninstall':
$extension->setExtension($extname);
$status = $extension->uninstall();
if($status) {
msg(sprintf($this->getLang('msg_delete_success'), hsc($extension->getDisplayName())), 1);
msg(
sprintf(
$this->getLang('msg_delete_success'),
hsc($extension->getDisplayName())
),
1
);
} else {
msg(sprintf($this->getLang('msg_delete_failed'), hsc($extension->getDisplayName())), -1);
msg(
sprintf(
$this->getLang('msg_delete_failed'),
hsc($extension->getDisplayName())
),
-1
);
}
break;
case 'enable';

View File

@ -106,8 +106,10 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
if (!empty($this->remoteInfo['bundled'])) return $this->remoteInfo['bundled'];
return in_array($this->id,
array(
'authad', 'authldap', 'authmysql', 'authpdo', 'authpgsql', 'authplain', 'acl', 'info', 'extension',
'revert', 'popularity', 'config', 'safefnrecode', 'styling', 'testing', 'template:dokuwiki'
'authad', 'authldap', 'authmysql', 'authpdo',
'authpgsql', 'authplain', 'acl', 'info', 'extension',
'revert', 'popularity', 'config', 'safefnrecode', 'styling',
'testing', 'template:dokuwiki'
)
);
}

View File

@ -124,7 +124,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin {
echo $this->locale_xhtml('intro_install');
echo '</div>';
$form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data', 'class' => 'install'));
$form = new Doku_Form(
array(
'action' => $this->tabURL('', array(), '&'),
'enctype' => 'multipart/form-data',
'class' => 'install'
)
);
$form->addElement(form_makeTextField('installurl', '', $this->getLang('install_url'), '', 'block'));
$form->addElement(form_makeFileField('installfile', $this->getLang('install_upload'), '', 'block'));
$form->addElement(form_makeButton('submit', '', $this->getLang('btn_install')));

View File

@ -106,7 +106,8 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
* @param helper_plugin_extension_extension $extension The extension
*/
private function start_row(helper_plugin_extension_extension $extension) {
$this->form .= '<li id="extensionplugin__'.hsc($extension->getID()).'" class="'.$this->make_class($extension).'">';
$this->form .= '<li id="extensionplugin__'.hsc($extension->getID()).
'" class="'.$this->make_class($extension).'">';
}
/**
@ -170,7 +171,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$mailid = $extension->getEmailID();
if($mailid){
$url = $this->gui->tabURL('search', array('q' => 'authorid:'.$mailid));
return '<bdi><a href="'.$url.'" class="author" title="'.$this->getLang('author_hint').'" ><img src="//www.gravatar.com/avatar/'.$mailid.'?s=20&amp;d=mm" width="20" height="20" alt="" /> '.hsc($extension->getAuthor()).'</a></bdi>';
return '<bdi><a href="'.$url.'" class="author" title="'.$this->getLang('author_hint').'" >'.
'<img src="//www.gravatar.com/avatar/'.$mailid.'?s=20&amp;d=mm" width="20" height="20" alt="" /> '.
hsc($extension->getAuthor()).'</a></bdi>';
}else{
return '<bdi><span class="author">'.hsc($extension->getAuthor()).'</span></bdi>';
@ -199,10 +202,12 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
'<img alt="'.$title.'" width="120" height="70" src="'.hsc($thumb).'" />'.
'</a>';
} elseif($extension->isTemplate()) {
$img = '<img alt="" width="120" height="70" src="'.DOKU_BASE.'lib/plugins/extension/images/template.png" />';
$img = '<img alt="" width="120" height="70" src="'.DOKU_BASE.
'lib/plugins/extension/images/template.png" />';
} else {
$img = '<img alt="" width="120" height="70" src="'.DOKU_BASE.'lib/plugins/extension/images/plugin.png" />';
$img = '<img alt="" width="120" height="70" src="'.DOKU_BASE.
'lib/plugins/extension/images/plugin.png" />';
}
return '<div class="screenshot" >'.$img.'<span></span></div>'.DOKU_LF;
}
@ -217,7 +222,11 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
function make_legend(helper_plugin_extension_extension $extension, $showinfo = false) {
$return = '<div>';
$return .= '<h2>';
$return .= sprintf($this->getLang('extensionby'), '<bdi>'.hsc($extension->getDisplayName()).'</bdi>', $this->make_author($extension));
$return .= sprintf(
$this->getLang('extensionby'),
'<bdi>'.hsc($extension->getDisplayName()).'</bdi>',
$this->make_author($extension)
);
$return .= '</h2>'.DOKU_LF;
$return .= $this->make_screenshot($extension);
@ -225,7 +234,10 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$popularity = $extension->getPopularity();
if ($popularity !== false && !$extension->isBundled()) {
$popularityText = sprintf($this->getLang('popularity'), round($popularity*100, 2));
$return .= '<div class="popularity" title="'.$popularityText.'"><div style="width: '.($popularity * 100).'%;"><span class="a11y">'.$popularityText.'</span></div></div>'.DOKU_LF;
$return .= '<div class="popularity" title="'.$popularityText.'">'.
'<div style="width: '.($popularity * 100).'%;">'.
'<span class="a11y">'.$popularityText.'</span>'.
'</div></div>'.DOKU_LF;
}
if($extension->getDescription()) {
@ -243,7 +255,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$url = $this->gui->tabURL('', array('info' => $extension->getID()));
$class = '';
}
$return .= ' <a href="'.$url.'#extensionplugin__'.$extension->getID().'" class="info '.$class.'" title="'.$this->getLang('btn_info').'" data-extid="'.$extension->getID().'">'.$this->getLang('btn_info').'</a>';
$return .= ' <a href="'.$url.'#extensionplugin__'.$extension->getID().
'" class="info '.$class.'" title="'.$this->getLang('btn_info').
'" data-extid="'.$extension->getID().'">'.$this->getLang('btn_info').'</a>';
if ($showinfo) {
$return .= $this->make_info($extension);
@ -263,7 +277,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$return = '<div class="linkbar">';
$return .= $this->make_homepagelink($extension);
if ($extension->getBugtrackerURL()) {
$return .= ' <a href="'.hsc($extension->getBugtrackerURL()).'" title="'.hsc($extension->getBugtrackerURL()).'" class ="bugs">'.$this->getLang('bugs_features').'</a> ';
$return .= ' <a href="'.hsc($extension->getBugtrackerURL()).
'" title="'.hsc($extension->getBugtrackerURL()).'" class ="bugs">'.
$this->getLang('bugs_features').'</a> ';
}
if ($extension->getTags()){
$first = true;
@ -293,13 +309,20 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$return = '';
$missing_dependencies = $extension->getMissingDependencies();
if(!empty($missing_dependencies)) {
$return .= '<div class="msg error">'.
sprintf($this->getLang('missing_dependency'), '<bdi>'.implode(', ', /*array_map(array($this->helper, 'make_extensionsearchlink'),*/ $missing_dependencies).'</bdi>').
$return .= '<div class="msg error">' .
sprintf(
$this->getLang('missing_dependency'),
'<bdi>' . implode(', ', $missing_dependencies) . '</bdi>'
) .
'</div>';
}
if($extension->isInWrongFolder()) {
$return .= '<div class="msg error">'.
sprintf($this->getLang('wrong_folder'), '<bdi>'.hsc($extension->getInstallName()).'</bdi>', '<bdi>'.hsc($extension->getBase()).'</bdi>').
$return .= '<div class="msg error">' .
sprintf(
$this->getLang('wrong_folder'),
'<bdi>' . hsc($extension->getInstallName()) . '</bdi>',
'<bdi>' . hsc($extension->getBase()) . '</bdi>'
) .
'</div>';
}
if(($securityissue = $extension->getSecurityIssue()) !== false) {
@ -318,8 +341,12 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
'</div>';
}
if($extension->hasDownloadURLChanged()) {
$return .= '<div class="msg notify">'.
sprintf($this->getLang('url_change'), '<bdi>'.hsc($extension->getDownloadURL()).'</bdi>', '<bdi>'.hsc($extension->getLastDownloadURL()).'</bdi>').
$return .= '<div class="msg notify">' .
sprintf(
$this->getLang('url_change'),
'<bdi>' . hsc($extension->getDownloadURL()) . '</bdi>',
'<bdi>' . hsc($extension->getLastDownloadURL()) . '</bdi>'
) .
'</div>';
}
return $return.DOKU_LF;
@ -362,7 +389,8 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
if ($extension->getDonationURL()) {
$return .= '<dt>'.$this->getLang('donate').'</dt>';
$return .= '<dd>';
$return .= '<a href="'.$extension->getDonationURL().'" class="donate">'.$this->getLang('donate_action').'</a>';
$return .= '<a href="'.$extension->getDonationURL().'" class="donate">'.
$this->getLang('donate_action').'</a>';
$return .= '</dd>';
}
@ -446,7 +474,8 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
function make_linklist($ext) {
$return = '';
foreach ($ext as $link) {
$return .= '<bdi><a href="'.$this->gui->tabURL('search', array('q'=>'ext:'.$link)).'">'.hsc($link).'</a></bdi>, ';
$return .= '<bdi><a href="'.
$this->gui->tabURL('search', array('q'=>'ext:'.$link)).'">'.hsc($link).'</a></bdi>, ';
}
return rtrim($return, ', ');
}
@ -490,7 +519,11 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$errors .= '<p class="permerror">'.$this->getLang('git').'</p>';
}
if ($extension->isEnabled() && in_array('Auth', $extension->getTypes()) && $conf['authtype'] != $extension->getID()) {
if (
$extension->isEnabled() &&
in_array('Auth', $extension->getTypes()) &&
$conf['authtype'] != $extension->getID()
) {
$errors .= '<p class="permerror">'.$this->getLang('auth').'</p>';
}
@ -506,7 +539,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
if (!$extension->isInstalled() && $extension->getDownloadURL()) {
$return .= ' <span class="version">'.$this->getLang('available_version').' ';
$return .= ($extension->getLastUpdate() ? hsc($extension->getLastUpdate()) : $this->getLang('unknown')).'</span>';
$return .= ($extension->getLastUpdate()
? hsc($extension->getLastUpdate())
: $this->getLang('unknown')).'</span>';
}
return $return.' '.$errors.DOKU_LF;
@ -532,7 +567,8 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$classes = 'button '.$action;
$name = 'fn['.$action.']['.hsc($extension->getID()).']';
return '<button class="'.$classes.'" name="'.$name.'" type="submit" '.$title.'>'.$this->getLang('btn_'.$action).'</button> ';
return '<button class="'.$classes.'" name="'.$name.'" type="submit" '.$title.'>'.
$this->getLang('btn_'.$action).'</button> ';
}
/**
@ -550,7 +586,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
if ($extension->isProtected()) {
$status[] = $this->getLang('status_protected');
} else {
$status[] = $extension->isEnabled() ? $this->getLang('status_enabled') : $this->getLang('status_disabled');
$status[] = $extension->isEnabled()
? $this->getLang('status_enabled')
: $this->getLang('status_disabled');
}
} else {
$status[] = $this->getLang('status_not_installed');

View File

@ -30,7 +30,11 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin {
foreach ($list as $name) {
$cache = new cache('##extension_manager##'.$name, '.repo');
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
if(
!isset($this->loaded_extensions[$name]) &&
$this->hasAccess() &&
!$cache->useCache(array('age' => 3600 * 24))
) {
$this->loaded_extensions[$name] = true;
$request_data['ext'][] = $name;
$request_needed = true;
@ -89,7 +93,11 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin {
public function getData($name) {
$cache = new cache('##extension_manager##'.$name, '.repo');
if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) {
if(
!isset($this->loaded_extensions[$name]) &&
$this->hasAccess() &&
!$cache->useCache(array('age' => 3600 * 24))
) {
$this->loaded_extensions[$name] = true;
$httpclient = new DokuHTTPClient();
$data = $httpclient->get(EXTENSION_REPOSITORY_API.'?fmt=php&ext[]='.urlencode($name));

View File

@ -129,7 +129,8 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin {
echo ($recent['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) ? '<li class="minor">' : '<li>';
echo '<div class="li">';
echo '<input type="checkbox" name="revert[]" value="'.hsc($recent['id']).'" checked="checked" id="revert__'.$cnt.'" />';
echo '<input type="checkbox" name="revert[]" value="'.hsc($recent['id']).
'" checked="checked" id="revert__'.$cnt.'" />';
echo ' <label for="revert__'.$cnt.'">'.$date.'</label> ';
echo '<a href="'.wl($recent['id'],"do=diff").'">';

View File

@ -79,14 +79,17 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin {
echo '<tr>';
echo '<td><label for="tpl__'.hsc($key).'">'.$name.'</label></td>';
echo '<td><input type="text" name="tpl['.hsc($key).']" id="tpl__'.hsc($key).'" value="'.hsc($value).'" '.$this->colorClass($key).' dir="ltr" /></td>';
echo '<td><input type="text" name="tpl['.hsc($key).']" id="tpl__'.hsc($key).'"
value="'.hsc($value).'" '.$this->colorClass($key).' dir="ltr" /></td>';
echo '</tr>';
}
echo '</tbody></table>';
echo '<p>';
echo '<button type="submit" name="run[preview]" class="btn_preview primary">'.$this->getLang('btn_preview').'</button> ';
echo '<button type="submit" name="run[reset]">'.$this->getLang('btn_reset').'</button>'; #FIXME only if preview.ini exists
echo '<button type="submit" name="run[preview]" class="btn_preview primary">'.
$this->getLang('btn_preview').'</button> ';
#FIXME only if preview.ini exists:
echo '<button type="submit" name="run[reset]">'.$this->getLang('btn_reset').'</button>';
echo '</p>';
echo '<p>';
@ -94,7 +97,8 @@ class admin_plugin_styling extends DokuWiki_Admin_Plugin {
echo '</p>';
echo '<p>';
echo '<button type="submit" name="run[revert]">'.$this->getLang('btn_revert').'</button>'; #FIXME only if local.ini exists
#FIXME only if local.ini exists:
echo '<button type="submit" name="run[revert]">'.$this->getLang('btn_revert').'</button>';
echo '</p>';
echo '</form>';

View File

@ -180,7 +180,15 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln("<div class=\"level2\">");
if ($this->_user_total > 0) {
ptln("<p>".sprintf($this->lang['summary'],$this->_start+1,$this->_last,$this->_user_total,$this->_auth->getUserCount())."</p>");
ptln(
"<p>" . sprintf(
$this->lang['summary'],
$this->_start + 1,
$this->_last,
$this->_user_total,
$this->_auth->getUserCount()
) . "</p>"
);
} else {
if($this->_user_total < 0) {
$allUserTotal = 0;
@ -195,15 +203,25 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln(" <table class=\"inline\">");
ptln(" <thead>");
ptln(" <tr>");
ptln(" <th>&#160;</th><th>".$this->lang["user_id"]."</th><th>".$this->lang["user_name"]."</th><th>".$this->lang["user_mail"]."</th><th>".$this->lang["user_groups"]."</th>");
ptln(" <th>&#160;</th>
<th>".$this->lang["user_id"]."</th>
<th>".$this->lang["user_name"]."</th>
<th>".$this->lang["user_mail"]."</th>
<th>".$this->lang["user_groups"]."</th>");
ptln(" </tr>");
ptln(" <tr>");
ptln(" <td class=\"rightalign\"><input type=\"image\" src=\"".DOKU_PLUGIN_IMAGES."search.png\" name=\"fn[search][new]\" title=\"".$this->lang['search_prompt']."\" alt=\"".$this->lang['search']."\" class=\"button\" /></td>");
ptln(" <td><input type=\"text\" name=\"userid\" class=\"edit\" value=\"".$this->_htmlFilter('user')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"username\" class=\"edit\" value=\"".$this->_htmlFilter('name')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"usermail\" class=\"edit\" value=\"".$this->_htmlFilter('mail')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"usergroups\" class=\"edit\" value=\"".$this->_htmlFilter('grps')."\" /></td>");
ptln(" <td class=\"rightalign\"><input type=\"image\" src=\"".
DOKU_PLUGIN_IMAGES."search.png\" name=\"fn[search][new]\" title=\"".
$this->lang['search_prompt']."\" alt=\"".$this->lang['search']."\" class=\"button\" /></td>");
ptln(" <td><input type=\"text\" name=\"userid\" class=\"edit\" value=\"".
$this->_htmlFilter('user')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"username\" class=\"edit\" value=\"".
$this->_htmlFilter('name')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"usermail\" class=\"edit\" value=\"".
$this->_htmlFilter('mail')."\" /></td>");
ptln(" <td><input type=\"text\" name=\"usergroups\" class=\"edit\" value=\"".
$this->_htmlFilter('grps')."\" /></td>");
ptln(" </tr>");
ptln(" </thead>");
@ -219,7 +237,8 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
*/
$groups = join(', ',$grps);
ptln(" <tr class=\"user_info\">");
ptln(" <td class=\"centeralign\"><input type=\"checkbox\" name=\"delete[".hsc($user)."]\" ".$delete_disable." /></td>");
ptln(" <td class=\"centeralign\"><input type=\"checkbox\" name=\"delete[".hsc($user).
"]\" ".$delete_disable." /></td>");
if ($editable) {
ptln(" <td><a href=\"".wl($ID,array('fn[edit]['.$user.']' => 1,
'do' => 'admin',
@ -238,13 +257,18 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln(" <tbody>");
ptln(" <tr><td colspan=\"5\" class=\"centeralign\">");
ptln(" <span class=\"medialeft\">");
ptln(" <button type=\"submit\" name=\"fn[delete]\" id=\"usrmgr__del\" ".$delete_disable.">".$this->lang['delete_selected']."</button>");
ptln(" <button type=\"submit\" name=\"fn[delete]\" id=\"usrmgr__del\" ".$delete_disable.">".
$this->lang['delete_selected']."</button>");
ptln(" </span>");
ptln(" <span class=\"mediaright\">");
ptln(" <button type=\"submit\" name=\"fn[start]\" ".$page_buttons['start'].">".$this->lang['start']."</button>");
ptln(" <button type=\"submit\" name=\"fn[prev]\" ".$page_buttons['prev'].">".$this->lang['prev']."</button>");
ptln(" <button type=\"submit\" name=\"fn[next]\" ".$page_buttons['next'].">".$this->lang['next']."</button>");
ptln(" <button type=\"submit\" name=\"fn[last]\" ".$page_buttons['last'].">".$this->lang['last']."</button>");
ptln(" <button type=\"submit\" name=\"fn[start]\" ".$page_buttons['start'].">".
$this->lang['start']."</button>");
ptln(" <button type=\"submit\" name=\"fn[prev]\" ".$page_buttons['prev'].">".
$this->lang['prev']."</button>");
ptln(" <button type=\"submit\" name=\"fn[next]\" ".$page_buttons['next'].">".
$this->lang['next']."</button>");
ptln(" <button type=\"submit\" name=\"fn[last]\" ".$page_buttons['last'].">".
$this->lang['last']."</button>");
ptln(" </span>");
if (!empty($this->_filter)) {
ptln(" <button type=\"submit\" name=\"fn[search][clear]\">".$this->lang['clear']."</button>");
@ -326,12 +350,60 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln(" </thead>",$indent);
ptln(" <tbody>",$indent);
$this->_htmlInputField($cmd."_userid", "userid", $this->lang["user_id"], $user, $this->_auth->canDo("modLogin"), true, $indent+6);
$this->_htmlInputField($cmd."_userpass", "userpass", $this->lang["user_pass"], "", $this->_auth->canDo("modPass"), false, $indent+6);
$this->_htmlInputField($cmd."_userpass2", "userpass2", $lang["passchk"], "", $this->_auth->canDo("modPass"), false, $indent+6);
$this->_htmlInputField($cmd."_username", "username", $this->lang["user_name"], $name, $this->_auth->canDo("modName"), true, $indent+6);
$this->_htmlInputField($cmd."_usermail", "usermail", $this->lang["user_mail"], $mail, $this->_auth->canDo("modMail"), true, $indent+6);
$this->_htmlInputField($cmd."_usergroups","usergroups",$this->lang["user_groups"],$groups,$this->_auth->canDo("modGroups"), false, $indent+6);
$this->_htmlInputField(
$cmd . "_userid",
"userid",
$this->lang["user_id"],
$user,
$this->_auth->canDo("modLogin"),
true,
$indent + 6
);
$this->_htmlInputField(
$cmd . "_userpass",
"userpass",
$this->lang["user_pass"],
"",
$this->_auth->canDo("modPass"),
false,
$indent + 6
);
$this->_htmlInputField(
$cmd . "_userpass2",
"userpass2",
$lang["passchk"],
"",
$this->_auth->canDo("modPass"),
false,
$indent + 6
);
$this->_htmlInputField(
$cmd . "_username",
"username",
$this->lang["user_name"],
$name,
$this->_auth->canDo("modName"),
true,
$indent + 6
);
$this->_htmlInputField(
$cmd . "_usermail",
"usermail",
$this->lang["user_mail"],
$mail,
$this->_auth->canDo("modMail"),
true,
$indent + 6
);
$this->_htmlInputField(
$cmd . "_usergroups",
"usergroups",
$this->lang["user_groups"],
$groups,
$this->_auth->canDo("modGroups"),
false,
$indent + 6
);
if ($this->_auth->canDo("modPass")) {
if ($cmd == 'add') {
@ -341,7 +413,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$notes[] = $this->lang['note_notify'];
}
ptln("<tr><td><label for=\"".$cmd."_usernotify\" >".$this->lang["user_notify"].": </label></td><td><input type=\"checkbox\" id=\"".$cmd."_usernotify\" name=\"usernotify\" value=\"1\" /></td></tr>", $indent);
ptln("<tr><td><label for=\"".$cmd."_usernotify\" >".
$this->lang["user_notify"].": </label></td>
<td><input type=\"checkbox\" id=\"".$cmd."_usernotify\" name=\"usernotify\" value=\"1\" />
</td></tr>", $indent);
}
ptln(" </tbody>",$indent);
@ -407,10 +482,12 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if($cando){
$req = '';
if($required) $req = 'required="required"';
echo "<input type=\"$fieldtype\" id=\"$id\" name=\"$name\" value=\"$value\" class=\"edit\" $autocomp $req />";
echo "<input type=\"$fieldtype\" id=\"$id\" name=\"$name\"
value=\"$value\" class=\"edit\" $autocomp $req />";
}else{
echo "<input type=\"hidden\" name=\"$name\" value=\"$value\" />";
echo "<input type=\"$fieldtype\" id=\"$id\" name=\"$name\" value=\"$value\" class=\"edit disabled\" disabled=\"disabled\" />";
echo "<input type=\"$fieldtype\" id=\"$id\" name=\"$name\"
value=\"$value\" class=\"edit disabled\" disabled=\"disabled\" />";
}
echo "</td>";
echo "</tr>";
@ -867,7 +944,8 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$buttons['last'] = $disabled;
$buttons['next'] = '';
} else {
$buttons['last'] = $buttons['next'] = (($this->_start + $this->_pagesize) >= $this->_user_total) ? $disabled : '';
$buttons['last'] = $buttons['next'] =
(($this->_start + $this->_pagesize) >= $this->_user_total) ? $disabled : '';
}
if ($this->_lastdisabled) {
@ -924,7 +1002,10 @@ 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']) && $this->_isUploadedFile($_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;
}
@ -965,7 +1046,14 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$this->_import_failures[$line] = array('error' => $error, 'user' => $raw, 'orig' => $csv);
}
}
msg(sprintf($this->lang['import_success_count'], ($import_success_count+$import_fail_count), $import_success_count),($import_success_count ? 1 : -1));
msg(
sprintf(
$this->lang['import_success_count'],
($import_success_count + $import_fail_count),
$import_success_count
),
($import_success_count ? 1 : -1)
);
if ($import_fail_count) {
msg(sprintf($this->lang['import_failure_count'], $import_fail_count),-1);
}

View File

@ -25,7 +25,8 @@ if (!defined('DOKU_INC')) die();
<a href="//jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" <?php echo $target?>><img
src="<?php echo tpl_basedir(); ?>images/button-css.png" width="80" height="15" alt="Valid CSS" /></a>
<a href="https://dokuwiki.org/" title="Driven by DokuWiki" <?php echo $target?>><img
src="<?php echo tpl_basedir(); ?>images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a>
src="<?php echo tpl_basedir(); ?>images/button-dw.png" width="80" height="15"
alt="Driven by DokuWiki" /></a>
</div>
</div></div><!-- /footer -->