From 80fb93f63fa35a09c7a9a0c7ea7a64db609a9fd6 Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Tue, 22 Mar 2011 13:16:27 -0400 Subject: Change Doku_Indexer visibility from private to protected, and get rid of ugly underscores --- inc/indexer.php | 180 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) (limited to 'inc') diff --git a/inc/indexer.php b/inc/indexer.php index 0fbd939be..335b6e25f 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -117,41 +117,41 @@ class Doku_Indexer { * @author Andreas Gohr */ public function addPageWords($page, $text) { - if (!$this->_lock()) + if (!$this->lock()) return "locked"; // load known documents - $pid = $this->_addIndexKey('page', '', $page); + $pid = $this->addIndexKey('page', '', $page); if ($pid === false) { - $this->_unlock(); + $this->unlock(); return false; } $pagewords = array(); // get word usage in page - $words = $this->_getPageWords($text); + $words = $this->getPageWords($text); if ($words === false) { - $this->_unlock(); + $this->unlock(); return false; } if (!empty($words)) { foreach (array_keys($words) as $wlen) { - $index = $this->_getIndex('i', $wlen); + $index = $this->getIndex('i', $wlen); foreach ($words[$wlen] as $wid => $freq) { $idx = ($wid_updateTuple($idx, $pid, $freq); + $index[$wid] = $this->updateTuple($idx, $pid, $freq); $pagewords[] = "$wlen*$wid"; } - if (!$this->_saveIndex('i', $wlen, $index)) { - $this->_unlock(); + if (!$this->saveIndex('i', $wlen, $index)) { + $this->unlock(); return false; } } } // Remove obsolete index entries - $pageword_idx = $this->_getIndexKey('pageword', '', $pid); + $pageword_idx = $this->getIndexKey('pageword', '', $pid); if ($pageword_idx !== '') { $oldwords = explode(':',$pageword_idx); $delwords = array_diff($oldwords, $pagewords); @@ -164,21 +164,21 @@ class Doku_Indexer { } } foreach ($upwords as $wlen => $widx) { - $index = $this->_getIndex('i', $wlen); + $index = $this->getIndex('i', $wlen); foreach ($widx as $wid) { - $index[$wid] = $this->_updateTuple($index[$wid], $pid, 0); + $index[$wid] = $this->updateTuple($index[$wid], $pid, 0); } - $this->_saveIndex('i', $wlen, $index); + $this->saveIndex('i', $wlen, $index); } } // Save the reverse index $pageword_idx = join(':', $pagewords); - if (!$this->_saveIndexKey('pageword', '', $pid, $pageword_idx)) { - $this->_unlock(); + if (!$this->saveIndexKey('pageword', '', $pid, $pageword_idx)) { + $this->unlock(); return false; } - $this->_unlock(); + $this->unlock(); return true; } @@ -189,7 +189,7 @@ class Doku_Indexer { * @author Christopher Smith * @author Tom N Harris */ - private function _getPageWords($text) { + protected function getPageWords($text) { global $conf; $tokens = $this->tokenizer($text); @@ -209,7 +209,7 @@ class Doku_Indexer { $word_idx_modified = false; $index = array(); //resulting index foreach (array_keys($words) as $wlen) { - $word_idx = $this->_getIndex('w', $wlen); + $word_idx = $this->getIndex('w', $wlen); foreach ($words[$wlen] as $word => $freq) { $wid = array_search($word, $word_idx); if ($wid === false) { @@ -222,7 +222,7 @@ class Doku_Indexer { $index[$wlen][$wid] = $freq; } // save back the word index - if ($word_idx_modified && !$this->_saveIndex('w', $wlen, $word_idx)) + if ($word_idx_modified && !$this->saveIndex('w', $wlen, $word_idx)) return false; } @@ -252,13 +252,13 @@ class Doku_Indexer { trigger_error("array passed to addMetaKeys but value is not null", E_USER_WARNING); } - if (!$this->_lock()) + if (!$this->lock()) return "locked"; // load known documents - $pid = $this->_addIndexKey('page', '', $page); + $pid = $this->addIndexKey('page', '', $page); if ($pid === false) { - $this->_unlock(); + $this->unlock(); return false; } @@ -267,20 +267,20 @@ class Doku_Indexer { $value = $key['title']; if (is_array($value)) $value = $value[0]; - $this->_saveIndexKey('title', '', $pid, $value); + $this->saveIndexKey('title', '', $pid, $value); unset($key['title']); } foreach ($key as $name => $values) { $metaname = idx_cleanName($name); - $this->_addIndexKey('metadata', '', $metaname); - $metaidx = $this->_getIndex($metaname, '_i'); - $metawords = $this->_getIndex($metaname, '_w'); + $this->addIndexKey('metadata', '', $metaname); + $metaidx = $this->getIndex($metaname, '_i'); + $metawords = $this->getIndex($metaname, '_w'); $addwords = false; if (!is_array($values)) $values = array($values); - $val_idx = $this->_getIndexKey($metaname, '_p', $pid); + $val_idx = $this->getIndexKey($metaname, '_p', $pid); if ($val_idx != '') { $val_idx = explode(':', $val_idx); // -1 means remove, 0 keep, 1 add @@ -308,30 +308,30 @@ class Doku_Indexer { } if ($addwords) - $this->_saveIndex($metaname.'_w', '', $metawords); + $this->saveIndex($metaname.'_w', '', $metawords); $vals_changed = false; foreach ($val_idx as $id => $action) { if ($action == -1) { - $metaidx[$id] = $this->_updateTuple($metaidx[$id], $pid, 0); + $metaidx[$id] = $this->updateTuple($metaidx[$id], $pid, 0); $vals_changed = true; unset($val_idx[$id]); } elseif ($action == 1) { - $metaidx[$id] = $this->_updateTuple($metaidx[$id], $pid, 1); + $metaidx[$id] = $this->updateTuple($metaidx[$id], $pid, 1); $vals_changed = true; } } if ($vals_changed) { - $this->_saveIndex($metaname.'_i', '', $metaidx); + $this->saveIndex($metaname.'_i', '', $metaidx); $val_idx = implode(':', array_keys($val_idx)); - $this->_saveIndexKey($metaname.'_p', '', $pid, $val_idx); + $this->saveIndexKey($metaname.'_p', '', $pid, $val_idx); } unset($metaidx); unset($metawords); } - $this->_unlock(); + $this->unlock(); return true; } @@ -345,18 +345,18 @@ class Doku_Indexer { * @author Tom N Harris */ public function deletePage($page) { - if (!$this->_lock()) + if (!$this->lock()) return "locked"; // load known documents - $pid = $this->_getIndexKey('page', '', $page); + $pid = $this->getIndexKey('page', '', $page); if ($pid === false) { - $this->_unlock(); + $this->unlock(); return false; } // Remove obsolete index entries - $pageword_idx = $this->_getIndexKey('pageword', '', $pid); + $pageword_idx = $this->getIndexKey('pageword', '', $pid); if ($pageword_idx !== '') { $delwords = explode(':',$pageword_idx); $upwords = array(); @@ -368,32 +368,32 @@ class Doku_Indexer { } } foreach ($upwords as $wlen => $widx) { - $index = $this->_getIndex('i', $wlen); + $index = $this->getIndex('i', $wlen); foreach ($widx as $wid) { - $index[$wid] = $this->_updateTuple($index[$wid], $pid, 0); + $index[$wid] = $this->updateTuple($index[$wid], $pid, 0); } - $this->_saveIndex('i', $wlen, $index); + $this->saveIndex('i', $wlen, $index); } } // Save the reverse index - if (!$this->_saveIndexKey('pageword', '', $pid, "")) { - $this->_unlock(); + if (!$this->saveIndexKey('pageword', '', $pid, "")) { + $this->unlock(); return false; } - $this->_saveIndexKey('title', '', $pid, ""); - $keyidx = $this->_getIndex('metadata', ''); + $this->saveIndexKey('title', '', $pid, ""); + $keyidx = $this->getIndex('metadata', ''); foreach ($keyidx as $metaname) { - $val_idx = explode(':', $this->_getIndexKey($metaname.'_p', '', $pid)); - $meta_idx = $this->_getIndex($metaname.'_i', ''); + $val_idx = explode(':', $this->getIndexKey($metaname.'_p', '', $pid)); + $meta_idx = $this->getIndex($metaname.'_i', ''); foreach ($val_idx as $id) { - $meta_idx[$id] = $this->_updateTuple($meta_idx[$id], $pid, 0); + $meta_idx[$id] = $this->updateTuple($meta_idx[$id], $pid, 0); } - $this->_saveIndex($metaname.'_i', '', $meta_idx); - $this->_saveIndexKey($metaname.'_p', '', $pid, ''); + $this->saveIndex($metaname.'_i', '', $meta_idx); + $this->saveIndexKey($metaname.'_p', '', $pid, ''); } - $this->_unlock(); + $this->unlock(); return true; } @@ -469,17 +469,17 @@ class Doku_Indexer { */ public function lookup(&$tokens) { $result = array(); - $wids = $this->_getIndexWords($tokens, $result); + $wids = $this->getIndexWords($tokens, $result); if (empty($wids)) return array(); // load known words and documents - $page_idx = $this->_getIndex('page', ''); + $page_idx = $this->getIndex('page', ''); $docs = array(); foreach (array_keys($wids) as $wlen) { $wids[$wlen] = array_unique($wids[$wlen]); - $index = $this->_getIndex('i', $wlen); + $index = $this->getIndex('i', $wlen); foreach($wids[$wlen] as $ixid) { if ($ixid < count($index)) - $docs["$wlen*$ixid"] = $this->_parseTuples($page_idx, $index[$ixid]); + $docs["$wlen*$ixid"] = $this->parseTuples($page_idx, $index[$ixid]); } } // merge found pages into final result array @@ -531,9 +531,9 @@ class Doku_Indexer { // get all words in order to search the matching ids if ($key == 'title') { - $words = $this->_getIndex('title', ''); + $words = $this->getIndex('title', ''); } else { - $words = $this->_getIndex($metaname, '_w'); + $words = $this->getIndex($metaname, '_w'); } if (!is_null($func)) { @@ -576,7 +576,7 @@ class Doku_Indexer { $result[$val] = array(); } - $page_idx = $this->_getIndex('page', ''); + $page_idx = $this->getIndex('page', ''); // Special handling for titles if ($key == 'title') { @@ -588,12 +588,12 @@ class Doku_Indexer { } } else { // load all lines and pages so the used lines can be taken and matched with the pages - $lines = $this->_getIndex($metaname, '_i'); + $lines = $this->getIndex($metaname, '_i'); foreach ($value_ids as $value_id => $val_list) { // parse the tuples of the form page_id*1:page2_id*1 and so on, return value // is an array with page_id => 1, page2_id => 1 etc. so take the keys only - $pages = array_keys($this->_parseTuples($page_idx, $lines[$value_id])); + $pages = array_keys($this->parseTuples($page_idx, $lines[$value_id])); foreach ($val_list as $val) { $result[$val] = array_merge($result[$val], $pages); } @@ -616,7 +616,7 @@ class Doku_Indexer { * @return array Set to length => array(id ...) * @author Tom N Harris */ - private function _getIndexWords(&$words, &$result) { + protected function getIndexWords(&$words, &$result) { $tokens = array(); $tokenlength = array(); $tokenwild = array(); @@ -656,12 +656,12 @@ class Doku_Indexer { // $tokenlength = array( base word length => base word ... ) // $tokenwild = array( base word => base word length ... ) $length_filter = empty($tokenwild) ? $tokenlength : min(array_keys($tokenlength)); - $indexes_known = $this->_indexLengths($length_filter); + $indexes_known = $this->indexLengths($length_filter); if (!empty($tokenwild)) sort($indexes_known); // get word IDs $wids = array(); foreach ($indexes_known as $ixlen) { - $word_idx = $this->_getIndex('w', $ixlen); + $word_idx = $this->getIndex('w', $ixlen); // handle exact search if (isset($tokenlength[$ixlen])) { foreach ($tokenlength[$ixlen] as $xword) { @@ -697,14 +697,14 @@ class Doku_Indexer { * @author Tom N Harris */ public function getPages($key=null) { - $page_idx = $this->_getIndex('page', ''); + $page_idx = $this->getIndex('page', ''); if (is_null($key)) return $page_idx; $metaname = idx_cleanName($key); // Special handling for titles if ($key == 'title') { - $title_idx = $this->_getIndex('title', ''); + $title_idx = $this->getIndex('title', ''); array_splice($page_idx, count($title_idx)); foreach ($title_idx as $i => $title) if ($title === "") unset($page_idx[$i]); @@ -712,9 +712,9 @@ class Doku_Indexer { } $pages = array(); - $lines = $this->_getIndex($metaname, '_i'); + $lines = $this->getIndex($metaname, '_i'); foreach ($lines as $line) { - $pages = array_merge($pages, $this->_parseTuples($page_idx, $line)); + $pages = array_merge($pages, $this->parseTuples($page_idx, $line)); } return array_keys($pages); } @@ -738,7 +738,7 @@ class Doku_Indexer { $result = array(); if ($key == 'title') { - $index = $this->_getIndex('title', ''); + $index = $this->getIndex('title', ''); $index = array_count_values($index); foreach ($index as $val => $cnt) { if ($cnt >= $min && (!$max || $cnt <= $max) && strlen($val) >= $minlen) @@ -747,15 +747,15 @@ class Doku_Indexer { } elseif (!is_null($key)) { $metaname = idx_cleanName($key); - $index = $this->_getIndex($metaname.'_i', ''); + $index = $this->getIndex($metaname.'_i', ''); $val_idx = array(); foreach ($index as $wid => $line) { - $freq = $this->_countTuples($line); + $freq = $this->countTuples($line); if ($freq >= $min && (!$max || $freq <= $max) && strlen($val) >= $minlen) $val_idx[$wid] = $freq; } if (!empty($val_idx)) { - $words = $this->_getIndex($metaname.'_w', ''); + $words = $this->getIndex($metaname.'_w', ''); foreach ($val_idx as $wid => $freq) $result[$words[$wid]] = $freq; } @@ -764,13 +764,13 @@ class Doku_Indexer { $lengths = idx_listIndexLengths(); foreach ($lengths as $length) { if ($length < $minlen) continue; - $index = $this->_getIndex('i', $length); + $index = $this->getIndex('i', $length); $words = null; foreach ($index as $wid => $line) { - $freq = $this->_countTuples($line); + $freq = $this->countTuples($line); if ($freq >= $min && (!$max || $freq <= $max)) { if ($words === null) - $words = $this->_getIndex('w', $length); + $words = $this->getIndex('w', $length); $result[$words[$wid]] = $freq; } } @@ -786,7 +786,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _lock() { + protected function lock() { global $conf; $status = true; $run = 0; @@ -816,7 +816,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _unlock() { + protected function unlock() { global $conf; @rmdir($conf['lockdir'].'/_indexer.lock'); return true; @@ -827,7 +827,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _getIndex($idx, $suffix) { + protected function getIndex($idx, $suffix) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; if (!@file_exists($fn)) return array(); @@ -839,7 +839,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _saveIndex($idx, $suffix, &$lines) { + protected function saveIndex($idx, $suffix, &$lines) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix; $fh = @fopen($fn.'.tmp', 'w'); @@ -850,7 +850,7 @@ class Doku_Indexer { chmod($fn.'.tmp', $conf['fperm']); io_rename($fn.'.tmp', $fn.'.idx'); if ($suffix !== '') - $this->_cacheIndexDir($idx, $suffix, empty($lines)); + $this->cacheIndexDir($idx, $suffix, empty($lines)); return true; } @@ -859,7 +859,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _getIndexKey($idx, $suffix, $id) { + protected function getIndexKey($idx, $suffix, $id) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; if (!@file_exists($fn)) return ''; @@ -878,7 +878,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _saveIndexKey($idx, $suffix, $id, $line) { + protected function saveIndexKey($idx, $suffix, $id, $line) { global $conf; if (substr($line, -1) != "\n") $line .= "\n"; @@ -908,7 +908,7 @@ class Doku_Indexer { chmod($fn.'.tmp', $conf['fperm']); io_rename($fn.'.tmp', $fn.'.idx'); if ($suffix !== '') - $this->_cacheIndexDir($idx, $suffix); + $this->cacheIndexDir($idx, $suffix); return true; } @@ -917,13 +917,13 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _addIndexKey($idx, $suffix, $value) { - $index = $this->_getIndex($idx, $suffix); + protected function addIndexKey($idx, $suffix, $value) { + $index = $this->getIndex($idx, $suffix); $id = array_search($value, $index); if ($id === false) { $id = count($index); $index[$id] = $value; - if (!$this->_saveIndex($idx, $suffix, $index)) { + if (!$this->saveIndex($idx, $suffix, $index)) { trigger_error("Failed to write $idx index", E_USER_ERROR); return false; } @@ -931,7 +931,7 @@ class Doku_Indexer { return $id; } - private function _cacheIndexDir($idx, $suffix, $delete=false) { + protected function cacheIndexDir($idx, $suffix, $delete=false) { global $conf; if ($idx == 'i') $cachename = $conf['indexdir'].'/lengths'; @@ -968,7 +968,7 @@ class Doku_Indexer { * * @author YoBoY */ - private function _listIndexLengths() { + protected function listIndexLengths() { global $conf; $cachename = $conf['indexdir'].'/lengths'; clearstatcache(); @@ -1018,7 +1018,7 @@ class Doku_Indexer { * * @author YoBoY */ - private function _indexLengths($filter) { + protected function indexLengths($filter) { global $conf; $idx = array(); if (is_array($filter)) { @@ -1044,7 +1044,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _updateTuple($line, $id, $count) { + protected function updateTuple($line, $id, $count) { $newLine = $line; if ($newLine !== '') $newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine); @@ -1064,7 +1064,7 @@ class Doku_Indexer { * @author Tom N Harris * @author Andreas Gohr */ - private function _parseTuples(&$keys, $line) { + protected function parseTuples(&$keys, $line) { $result = array(); if ($line == '') return $result; $parts = explode(':', $line); @@ -1084,7 +1084,7 @@ class Doku_Indexer { * * @author Tom N Harris */ - private function _countTuples($line) { + protected function countTuples($line) { $freq = 0; $parts = explode(':', $line); foreach ($parts as $tuple) { -- cgit v1.2.3 From b9d8cc1e0b5aa06f2829aa0913283c2aca8a082c Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Tue, 22 Mar 2011 16:56:37 -0400 Subject: Clarify usage of some indexer methods --- inc/indexer.php | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'inc') diff --git a/inc/indexer.php b/inc/indexer.php index 335b6e25f..110901e58 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -185,6 +185,8 @@ class Doku_Indexer { /** * Split the words in a page and add them to the index. * + * @param string $text content of the page + * @return array list of word IDs and number of times used * @author Andreas Gohr * @author Christopher Smith * @author Tom N Harris @@ -274,13 +276,13 @@ class Doku_Indexer { foreach ($key as $name => $values) { $metaname = idx_cleanName($name); $this->addIndexKey('metadata', '', $metaname); - $metaidx = $this->getIndex($metaname, '_i'); - $metawords = $this->getIndex($metaname, '_w'); + $metaidx = $this->getIndex($metaname.'_i', ''); + $metawords = $this->getIndex($metaname.'_w', ''); $addwords = false; if (!is_array($values)) $values = array($values); - $val_idx = $this->getIndexKey($metaname, '_p', $pid); + $val_idx = $this->getIndexKey($metaname.'_p', '', $pid); if ($val_idx != '') { $val_idx = explode(':', $val_idx); // -1 means remove, 0 keep, 1 add @@ -533,7 +535,7 @@ class Doku_Indexer { if ($key == 'title') { $words = $this->getIndex('title', ''); } else { - $words = $this->getIndex($metaname, '_w'); + $words = $this->getIndex($metaname.'_w', ''); } if (!is_null($func)) { @@ -588,7 +590,7 @@ class Doku_Indexer { } } else { // load all lines and pages so the used lines can be taken and matched with the pages - $lines = $this->getIndex($metaname, '_i'); + $lines = $this->getIndex($metaname.'_i', ''); foreach ($value_ids as $value_id => $val_list) { // parse the tuples of the form page_id*1:page2_id*1 and so on, return value @@ -712,7 +714,7 @@ class Doku_Indexer { } $pages = array(); - $lines = $this->getIndex($metaname, '_i'); + $lines = $this->getIndex($metaname.'_i', ''); foreach ($lines as $line) { $pages = array_merge($pages, $this->parseTuples($page_idx, $line)); } @@ -825,6 +827,13 @@ class Doku_Indexer { /** * Retrieve the entire index. * + * The $suffix argument is for an index that is split into + * multiple parts. Different index files should use different + * base names. + * + * @param string $idx name of the index + * @param string $suffix subpart identifier + * @return array list of lines without CR or LF * @author Tom N Harris */ protected function getIndex($idx, $suffix) { @@ -837,6 +846,9 @@ class Doku_Indexer { /** * Replace the contents of the index with an array. * + * @param string $idx name of the index + * @param string $suffix subpart identifier + * @param arrayref $linex list of lines without LF * @author Tom N Harris */ protected function saveIndex($idx, $suffix, &$lines) { @@ -857,6 +869,10 @@ class Doku_Indexer { /** * Retrieve a line from the index. * + * @param string $idx name of the index + * @param string $suffix subpart identifier + * @param int $id the line number + * @return string a line with trailing whitespace removed * @author Tom N Harris */ protected function getIndexKey($idx, $suffix, $id) { @@ -876,6 +892,10 @@ class Doku_Indexer { /** * Write a line into the index. * + * @param string $idx name of the index + * @param string $suffix subpart identifier + * @param int $id the line number + * @param string $line line to write * @author Tom N Harris */ protected function saveIndexKey($idx, $suffix, $id, $line) { @@ -915,6 +935,10 @@ class Doku_Indexer { /** * Retrieve or insert a value in the index. * + * @param string $idx name of the index + * @param string $suffix subpart identifier + * @param string $value line to find in the index + * @return int line number of the value in the index * @author Tom N Harris */ protected function addIndexKey($idx, $suffix, $value) { -- cgit v1.2.3 From 988c134016f0557947bd6811e22086919f98fa8e Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Wed, 23 Mar 2011 09:43:38 +0530 Subject: Done with DifferenceEngine.php --- inc/DifferenceEngine.php | 99 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 89 insertions(+), 10 deletions(-) (limited to 'inc') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 906a17b2d..5473bf7e0 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -29,8 +29,14 @@ class _DiffOp { class _DiffOp_Copy extends _DiffOp { var $type = 'copy'; - + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function _DiffOp_Copy($orig, $closing = false) { + $this->__construct($orig, $closing); + } + + function __construct($orig, $closing = false) { if (!is_array($closing)) $closing = $orig; $this->orig = $orig; @@ -44,8 +50,14 @@ class _DiffOp_Copy extends _DiffOp { class _DiffOp_Delete extends _DiffOp { var $type = 'delete'; - + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function _DiffOp_Delete($lines) { + $this->__construct($lines); + } + + function __construct($lines) { $this->orig = $lines; $this->closing = false; } @@ -57,8 +69,14 @@ class _DiffOp_Delete extends _DiffOp { class _DiffOp_Add extends _DiffOp { var $type = 'add'; - + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function _DiffOp_Add($lines) { + $this->__construct($lines); + } + + function __construct($lines) { $this->closing = $lines; $this->orig = false; } @@ -70,8 +88,14 @@ class _DiffOp_Add extends _DiffOp { class _DiffOp_Change extends _DiffOp { var $type = 'change'; - + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function _DiffOp_Change($orig, $closing) { + $this->__construct($orig, $closing); + } + + function __construct($orig, $closing) { $this->orig = $orig; $this->closing = $closing; } @@ -490,6 +514,13 @@ class _DiffEngine { class Diff { var $edits; + + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ + function Diff($from_lines, $to_lines) { + $this->__construct($from_lines, $to_lines); + } /** * Constructor. @@ -499,7 +530,7 @@ class Diff { * (Typically these are lines from a file.) * @param $to_lines array An array of strings. */ - function Diff($from_lines, $to_lines) { + function __construct($from_lines, $to_lines) { $eng = new _DiffEngine; $this->edits = $eng->diff($from_lines, $to_lines); //$this->_check($from_lines, $to_lines); @@ -622,6 +653,13 @@ class Diff { * FIXME: bad name. */ class MappedDiff extends Diff { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ + function MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { + $this->__construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines); + } + /** * Constructor. * @@ -645,12 +683,12 @@ class MappedDiff extends Diff { * @param $mapped_to_lines array This array should * have the same number of elements as $to_lines. */ - function MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { + function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { assert(count($from_lines) == count($mapped_from_lines)); assert(count($to_lines) == count($mapped_to_lines)); - $this->Diff($mapped_from_lines, $mapped_to_lines); + parent::__construct($mapped_from_lines, $mapped_to_lines); $xi = $yi = 0; $ecnt = count($this->edits); @@ -827,7 +865,14 @@ class DiffFormatter { define('NBSP', "\xC2\xA0"); // utf-8 non-breaking space. class _HWLDF_WordAccumulator { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function _HWLDF_WordAccumulator() { + $this->__construct(); + } + + function __construct() { $this->_lines = array(); $this->_line = ''; $this->_group = ''; @@ -882,11 +927,18 @@ class _HWLDF_WordAccumulator { class WordLevelDiff extends MappedDiff { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function WordLevelDiff($orig_lines, $closing_lines) { + $this->__construct($orig_lines, $closing_lines); + } + + function __construct($orig_lines, $closing_lines) { list ($orig_words, $orig_stripped) = $this->_split($orig_lines); list ($closing_words, $closing_stripped) = $this->_split($closing_lines); - $this->MappedDiff($orig_words, $closing_words, $orig_stripped, $closing_stripped); + parent::__construct($orig_words, $closing_words, $orig_stripped, $closing_stripped); } function _split($lines) { @@ -924,11 +976,18 @@ class WordLevelDiff extends MappedDiff { class InlineWordLevelDiff extends MappedDiff { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function InlineWordLevelDiff($orig_lines, $closing_lines) { + $this->__construct($orig_lines, $closing_lines); + } + + function __construct($orig_lines, $closing_lines) { list ($orig_words, $orig_stripped) = $this->_split($orig_lines); list ($closing_words, $closing_stripped) = $this->_split($closing_lines); - $this->MappedDiff($orig_words, $closing_words, $orig_stripped, $closing_stripped); + parent::__construct($orig_words, $closing_words, $orig_stripped, $closing_stripped); } function _split($lines) { @@ -965,7 +1024,14 @@ class InlineWordLevelDiff extends MappedDiff { */ class UnifiedDiffFormatter extends DiffFormatter { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function UnifiedDiffFormatter($context_lines = 4) { + $this->__construct($context_lines); + } + + function __construct($context_lines = 4) { $this->leading_context_lines = $context_lines; $this->trailing_context_lines = $context_lines; } @@ -996,7 +1062,14 @@ class UnifiedDiffFormatter extends DiffFormatter { */ class TableDiffFormatter extends DiffFormatter { + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function TableDiffFormatter() { + $this->__construct(); + } + + function __construct() { $this->leading_context_lines = 2; $this->trailing_context_lines = 2; } @@ -1088,8 +1161,14 @@ class TableDiffFormatter extends DiffFormatter { */ class InlineDiffFormatter extends DiffFormatter { var $colspan = 4; - + /** + * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. + */ function InlineDiffFormatter() { + $this->__construct(); + } + + function __construct() { $this->leading_context_lines = 2; $this->trailing_context_lines = 2; } -- cgit v1.2.3 From 5891862cf7012cf81a76ba0378b67c60f593507a Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Wed, 23 Mar 2011 20:51:04 +0530 Subject: Using only __construct now --- inc/DifferenceEngine.php | 82 ++---------------------------------------------- 1 file changed, 2 insertions(+), 80 deletions(-) (limited to 'inc') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 5473bf7e0..2578d07ee 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -29,12 +29,6 @@ class _DiffOp { class _DiffOp_Copy extends _DiffOp { var $type = 'copy'; - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function _DiffOp_Copy($orig, $closing = false) { - $this->__construct($orig, $closing); - } function __construct($orig, $closing = false) { if (!is_array($closing)) @@ -50,12 +44,6 @@ class _DiffOp_Copy extends _DiffOp { class _DiffOp_Delete extends _DiffOp { var $type = 'delete'; - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function _DiffOp_Delete($lines) { - $this->__construct($lines); - } function __construct($lines) { $this->orig = $lines; @@ -69,12 +57,6 @@ class _DiffOp_Delete extends _DiffOp { class _DiffOp_Add extends _DiffOp { var $type = 'add'; - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function _DiffOp_Add($lines) { - $this->__construct($lines); - } function __construct($lines) { $this->closing = $lines; @@ -88,12 +70,6 @@ class _DiffOp_Add extends _DiffOp { class _DiffOp_Change extends _DiffOp { var $type = 'change'; - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function _DiffOp_Change($orig, $closing) { - $this->__construct($orig, $closing); - } function __construct($orig, $closing) { $this->orig = $orig; @@ -514,13 +490,6 @@ class _DiffEngine { class Diff { var $edits; - - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function Diff($from_lines, $to_lines) { - $this->__construct($from_lines, $to_lines); - } /** * Constructor. @@ -653,13 +622,6 @@ class Diff { * FIXME: bad name. */ class MappedDiff extends Diff { - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { - $this->__construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines); - } - /** * Constructor. * @@ -865,13 +827,7 @@ class DiffFormatter { define('NBSP', "\xC2\xA0"); // utf-8 non-breaking space. class _HWLDF_WordAccumulator { - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function _HWLDF_WordAccumulator() { - $this->__construct(); - } - + function __construct() { $this->_lines = array(); $this->_line = ''; @@ -927,13 +883,6 @@ class _HWLDF_WordAccumulator { class WordLevelDiff extends MappedDiff { - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function WordLevelDiff($orig_lines, $closing_lines) { - $this->__construct($orig_lines, $closing_lines); - } - function __construct($orig_lines, $closing_lines) { list ($orig_words, $orig_stripped) = $this->_split($orig_lines); list ($closing_words, $closing_stripped) = $this->_split($closing_lines); @@ -975,13 +924,6 @@ class WordLevelDiff extends MappedDiff { } class InlineWordLevelDiff extends MappedDiff { - - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function InlineWordLevelDiff($orig_lines, $closing_lines) { - $this->__construct($orig_lines, $closing_lines); - } function __construct($orig_lines, $closing_lines) { list ($orig_words, $orig_stripped) = $this->_split($orig_lines); @@ -1024,13 +966,6 @@ class InlineWordLevelDiff extends MappedDiff { */ class UnifiedDiffFormatter extends DiffFormatter { - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function UnifiedDiffFormatter($context_lines = 4) { - $this->__construct($context_lines); - } - function __construct($context_lines = 4) { $this->leading_context_lines = $context_lines; $this->trailing_context_lines = $context_lines; @@ -1062,13 +997,6 @@ class UnifiedDiffFormatter extends DiffFormatter { */ class TableDiffFormatter extends DiffFormatter { - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function TableDiffFormatter() { - $this->__construct(); - } - function __construct() { $this->leading_context_lines = 2; $this->trailing_context_lines = 2; @@ -1161,13 +1089,7 @@ class TableDiffFormatter extends DiffFormatter { */ class InlineDiffFormatter extends DiffFormatter { var $colspan = 4; - /** - * DONOT USE THIS. Its just to make sure nothing breaks because of the name change. - */ - function InlineDiffFormatter() { - $this->__construct(); - } - + function __construct() { $this->leading_context_lines = 2; $this->trailing_context_lines = 2; -- cgit v1.2.3 From a3f9f75c2624b73c4a57bf2a346ae71bf6a5fb98 Mon Sep 17 00:00:00 2001 From: Marc Schiffbauer Date: Tue, 29 Mar 2011 23:48:47 +0200 Subject: Make .htaccess access protection work in more setups Before this patch with a .htaccess file on a higher level in the hierarchy with "Satisfy Any" it has been possible that the directory protection didn't work as expected. --- inc/.htaccess | 7 ++++--- inc/lang/.htaccess | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'inc') diff --git a/inc/.htaccess b/inc/.htaccess index aebb21cd2..68ae43e72 100644 --- a/inc/.htaccess +++ b/inc/.htaccess @@ -1,3 +1,4 @@ -## no access to the inc directory -order allow,deny -deny from all +## no access to the inc directory +order allow,deny +deny from all +Satisfy All diff --git a/inc/lang/.htaccess b/inc/lang/.htaccess index 2ca129b12..572f5156f 100644 --- a/inc/lang/.htaccess +++ b/inc/lang/.htaccess @@ -1,3 +1,4 @@ -## no access to the lang directory -order allow,deny -deny from all +## no access to the lang directory +order allow,deny +deny from all +Satisfy All -- cgit v1.2.3 From 344763ad4e90e41c8a94b0a69a527ff2d6319ab5 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 2 Apr 2011 03:32:13 +0100 Subject: FS#2122 alter SafeFN safe and post indicator characters. Note, any filenames encoded with the previous SafeFN scheme will need to be converted to the new scheme. Users of the old SafeFN scheme should not use this new scheme until after converting their filenames. --- inc/SafeFN.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/SafeFN.class.php b/inc/SafeFN.class.php index ac6698a63..43b19e9ab 100644 --- a/inc/SafeFN.class.php +++ b/inc/SafeFN.class.php @@ -16,9 +16,9 @@ class SafeFN { // 'safe' characters are a superset of $plain, $pre_indicator and $post_indicator - private static $plain = '-/_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted + private static $plain = '-./[_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted private static $pre_indicator = '%'; - private static $post_indicator = '.'; + private static $post_indicator = ']'; /** * Convert an UTF-8 string to a safe ASCII String @@ -37,7 +37,7 @@ class SafeFN { * - reduce codepoint value for non-printable ASCII characters (0x00 - 0x1f). Space becomes our zero. * - convert reduced value to base36 (0-9a-z) * - append $pre_indicator characater followed by base36 string to output, set converted flag - * continue to next character) + * (continue to next character) * * @param string $filename a utf8 string, should only include printable characters - not 0x00-0x1f * @return string an encoded representation of $filename using only 'safe' ASCII characters -- cgit v1.2.3 From c006739e4780df86d205d5ebc6f39af141cbc3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Izidor=20Matu=C5=A1ov?= Date: Sun, 20 Mar 2011 23:03:20 +0100 Subject: If the page link is empty, it should link to current page -- FS#2178 --- inc/pageutils.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc') diff --git a/inc/pageutils.php b/inc/pageutils.php index cd01dcae7..c9bf60135 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -423,8 +423,14 @@ function resolve_mediaid($ns,&$page,&$exists){ */ function resolve_pageid($ns,&$page,&$exists){ global $conf; + global $ID; $exists = false; + //empty address should point to current page + if ($page === "") { + $page = $ID; + } + //keep hashlink if exists then clean both parts if (strpos($page,'#')) { list($page,$hash) = explode('#',$page,2); -- cgit v1.2.3 From fda14ffc7c57c4451df9196e8125cd39b1d5c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Izidor=20Matu=C5=A1ov?= Date: Thu, 7 Apr 2011 19:44:54 +0200 Subject: Check if link exists and set right caption --- inc/parser/xhtml.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'inc') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 9405d9420..ab295dd01 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -574,11 +574,20 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $params = $parts[1]; } + // For empty $id we need to know the current $ID + // We need this check because _simpleTitle needs + // correct $id and resolve_pageid() use cleanID($id) + // (some things could be lost) + if ($id === '') { + $id = $ID; + } + // default name is based on $id as given $default = $this->_simpleTitle($id); // now first resolve and clean up the $id resolve_pageid(getNS($ID),$id,$exists); + $name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype); if ( !$isImage ) { if ( $exists ) { -- cgit v1.2.3 From 32ed2b361abb0cb00bee6572d022684260f0edd2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 11 Apr 2011 17:21:36 +0200 Subject: stay logged in when updating your password This functionality broke in recent updates to the cookie handling. This patch makes it work again. Binding to the session is now a functionality of auth_cookiesalt() --- inc/auth.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'inc') diff --git a/inc/auth.php b/inc/auth.php index 53376be34..a480a4a8a 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -189,8 +189,7 @@ function auth_login($user,$pass,$sticky=false,$silent=false){ if ($auth->checkPass($user,$pass)){ // make logininfo globally available $_SERVER['REMOTE_USER'] = $user; - $secret = auth_cookiesalt(); - if(!$sticky) $secret .= session_id; //bind non-sticky to session + $secret = auth_cookiesalt(!$sticky); //bind non-sticky to session auth_setCookie($user,PMA_blowfish_encrypt($pass,$secret),$sticky); return true; }else{ @@ -220,8 +219,7 @@ function auth_login($user,$pass,$sticky=false,$silent=false){ return true; } // no we don't trust it yet - recheck pass but silent - $secret = auth_cookiesalt(); - if(!$sticky) $secret .= session_id(); //bind non-sticky to session + $secret = auth_cookiesalt(!$sticky); //bind non-sticky to session $pass = PMA_blowfish_decrypt($pass,$secret); return auth_login($user,$pass,$sticky,true); } @@ -303,10 +301,10 @@ function auth_browseruid(){ * and stored in this file. * * @author Andreas Gohr - * + * @param bool $addsession if true, the sessionid is added to the salt * @return string */ -function auth_cookiesalt(){ +function auth_cookiesalt($addsession=false){ global $conf; $file = $conf['metadir'].'/_htcookiesalt'; $salt = io_readFile($file); @@ -314,6 +312,9 @@ function auth_cookiesalt(){ $salt = uniqid(rand(),true); io_saveFile($file,$salt); } + if($addsession){ + $salt .= session_id(); + } return $salt; } @@ -814,11 +815,11 @@ function updateprofile() { if ($result = $auth->triggerUserMod('modify', array($_SERVER['REMOTE_USER'], $changes))) { // update cookie and session with the changed data - $cookie = base64_decode($_COOKIE[DOKU_COOKIE]); - list($user,$sticky,$pass) = explode('|',$cookie,3); - if ($changes['pass']) $pass = PMA_blowfish_encrypt($changes['pass'],auth_cookiesalt()); - - auth_setCookie($_SERVER['REMOTE_USER'],$pass,(bool)$sticky); + if ($changes['pass']){ + list($user,$sticky,$pass) = auth_getCookie(); + $pass = PMA_blowfish_encrypt($changes['pass'],auth_cookiesalt(!$sticky)); + auth_setCookie($_SERVER['REMOTE_USER'],$pass,(bool)$sticky); + } return true; } } -- cgit v1.2.3 From c6792be7965e27a806043ef0dc82c3c0ed7b4060 Mon Sep 17 00:00:00 2001 From: Tanguy Ortolo Date: Wed, 13 Apr 2011 22:22:15 +0200 Subject: chmod -x inc/lang/az/* These regular files were executable for no reason. They needed a special rule for the Debian package, better to fix it upstream. --- inc/lang/az/admin.txt | 0 inc/lang/az/adminplugins.txt | 0 inc/lang/az/backlinks.txt | 0 inc/lang/az/conflict.txt | 0 inc/lang/az/denied.txt | 0 inc/lang/az/diff.txt | 0 inc/lang/az/draft.txt | 0 inc/lang/az/edit.txt | 0 inc/lang/az/editrev.txt | 0 inc/lang/az/index.txt | 0 inc/lang/az/install.html | 0 inc/lang/az/locked.txt | 0 inc/lang/az/login.txt | 0 inc/lang/az/mailtext.txt | 0 inc/lang/az/newpage.txt | 0 inc/lang/az/norev.txt | 0 inc/lang/az/password.txt | 0 inc/lang/az/preview.txt | 0 inc/lang/az/pwconfirm.txt | 0 inc/lang/az/read.txt | 0 inc/lang/az/recent.txt | 0 inc/lang/az/register.txt | 0 inc/lang/az/registermail.txt | 0 inc/lang/az/resendpwd.txt | 0 inc/lang/az/revisions.txt | 0 inc/lang/az/searchpage.txt | 0 inc/lang/az/showrev.txt | 0 inc/lang/az/stopwords.txt | 0 inc/lang/az/updateprofile.txt | 0 inc/lang/az/uploadmail.txt | 0 inc/lang/az/wordblock.txt | 0 31 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 inc/lang/az/admin.txt mode change 100755 => 100644 inc/lang/az/adminplugins.txt mode change 100755 => 100644 inc/lang/az/backlinks.txt mode change 100755 => 100644 inc/lang/az/conflict.txt mode change 100755 => 100644 inc/lang/az/denied.txt mode change 100755 => 100644 inc/lang/az/diff.txt mode change 100755 => 100644 inc/lang/az/draft.txt mode change 100755 => 100644 inc/lang/az/edit.txt mode change 100755 => 100644 inc/lang/az/editrev.txt mode change 100755 => 100644 inc/lang/az/index.txt mode change 100755 => 100644 inc/lang/az/install.html mode change 100755 => 100644 inc/lang/az/locked.txt mode change 100755 => 100644 inc/lang/az/login.txt mode change 100755 => 100644 inc/lang/az/mailtext.txt mode change 100755 => 100644 inc/lang/az/newpage.txt mode change 100755 => 100644 inc/lang/az/norev.txt mode change 100755 => 100644 inc/lang/az/password.txt mode change 100755 => 100644 inc/lang/az/preview.txt mode change 100755 => 100644 inc/lang/az/pwconfirm.txt mode change 100755 => 100644 inc/lang/az/read.txt mode change 100755 => 100644 inc/lang/az/recent.txt mode change 100755 => 100644 inc/lang/az/register.txt mode change 100755 => 100644 inc/lang/az/registermail.txt mode change 100755 => 100644 inc/lang/az/resendpwd.txt mode change 100755 => 100644 inc/lang/az/revisions.txt mode change 100755 => 100644 inc/lang/az/searchpage.txt mode change 100755 => 100644 inc/lang/az/showrev.txt mode change 100755 => 100644 inc/lang/az/stopwords.txt mode change 100755 => 100644 inc/lang/az/updateprofile.txt mode change 100755 => 100644 inc/lang/az/uploadmail.txt mode change 100755 => 100644 inc/lang/az/wordblock.txt (limited to 'inc') diff --git a/inc/lang/az/admin.txt b/inc/lang/az/admin.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/adminplugins.txt b/inc/lang/az/adminplugins.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/backlinks.txt b/inc/lang/az/backlinks.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/conflict.txt b/inc/lang/az/conflict.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/denied.txt b/inc/lang/az/denied.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/diff.txt b/inc/lang/az/diff.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/draft.txt b/inc/lang/az/draft.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/edit.txt b/inc/lang/az/edit.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/editrev.txt b/inc/lang/az/editrev.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/index.txt b/inc/lang/az/index.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/install.html b/inc/lang/az/install.html old mode 100755 new mode 100644 diff --git a/inc/lang/az/locked.txt b/inc/lang/az/locked.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/login.txt b/inc/lang/az/login.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/mailtext.txt b/inc/lang/az/mailtext.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/newpage.txt b/inc/lang/az/newpage.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/norev.txt b/inc/lang/az/norev.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/password.txt b/inc/lang/az/password.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/preview.txt b/inc/lang/az/preview.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/pwconfirm.txt b/inc/lang/az/pwconfirm.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/read.txt b/inc/lang/az/read.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/recent.txt b/inc/lang/az/recent.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/register.txt b/inc/lang/az/register.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/registermail.txt b/inc/lang/az/registermail.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/resendpwd.txt b/inc/lang/az/resendpwd.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/revisions.txt b/inc/lang/az/revisions.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/searchpage.txt b/inc/lang/az/searchpage.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/showrev.txt b/inc/lang/az/showrev.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/stopwords.txt b/inc/lang/az/stopwords.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/updateprofile.txt b/inc/lang/az/updateprofile.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/uploadmail.txt b/inc/lang/az/uploadmail.txt old mode 100755 new mode 100644 diff --git a/inc/lang/az/wordblock.txt b/inc/lang/az/wordblock.txt old mode 100755 new mode 100644 -- cgit v1.2.3 From 45a0fa152ba78aed840341ef83613c58c0ea706e Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Thu, 14 Apr 2011 07:57:49 +0200 Subject: Support the empty link [[]] --- inc/parser/parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index e47ce56fa..68d4e4569 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -828,7 +828,7 @@ class Doku_Parser_Mode_internallink extends Doku_Parser_Mode { function connectTo($mode) { // Word boundaries? - $this->Lexer->addSpecialPattern("\[\[(?:(?:[^[\]]*?\[.*?\])|.+?)\]\]",$mode,'internallink'); + $this->Lexer->addSpecialPattern("\[\[(?:(?:[^[\]]*?\[.*?\])|.*?)\]\]",$mode,'internallink'); } function getSort() { -- cgit v1.2.3 From 8e65cd510bfa93eba1b847b6cbea1764fad480af Mon Sep 17 00:00:00 2001 From: Otto Vainio Date: Fri, 1 Apr 2011 19:56:32 +0200 Subject: Finnish language update --- inc/lang/fi/lang.php | 3 +++ inc/lang/fi/stopwords.txt | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'inc') diff --git a/inc/lang/fi/lang.php b/inc/lang/fi/lang.php index bc52625e0..f8042a645 100644 --- a/inc/lang/fi/lang.php +++ b/inc/lang/fi/lang.php @@ -159,6 +159,9 @@ $lang['yours'] = 'Sinun versiosi'; $lang['diff'] = 'Näytä eroavaisuudet nykyiseen versioon'; $lang['diff2'] = 'Näytä eroavaisuudet valittuun versioon'; $lang['difflink'] = 'Linkki vertailunäkymään'; +$lang['diff_type'] = 'Näytä erot:'; +$lang['diff_inline'] = 'Sisäkkäin'; +$lang['diff_side'] = 'Vierekkäin'; $lang['line'] = 'Rivi'; $lang['breadcrumb'] = 'Jäljet'; $lang['youarehere'] = 'Olet täällä'; diff --git a/inc/lang/fi/stopwords.txt b/inc/lang/fi/stopwords.txt index 82d3daa44..509dd0d03 100644 --- a/inc/lang/fi/stopwords.txt +++ b/inc/lang/fi/stopwords.txt @@ -5,7 +5,19 @@ www eli tai +minä sinä +hän +tämä +tuo +nämä +nuo +kuka +mikä +kumpi sinun com oli +jos +kun +joka -- cgit v1.2.3 From 7b89361c0d7aaa6bdf28c200aa93fc8f1435cad9 Mon Sep 17 00:00:00 2001 From: Otto Vainio Date: Sat, 16 Apr 2011 09:18:56 +0200 Subject: Finnish language update --- inc/lang/fi/lang.php | 2 +- inc/lang/fi/stopwords.txt | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'inc') diff --git a/inc/lang/fi/lang.php b/inc/lang/fi/lang.php index f8042a645..35f7b3c09 100644 --- a/inc/lang/fi/lang.php +++ b/inc/lang/fi/lang.php @@ -159,7 +159,7 @@ $lang['yours'] = 'Sinun versiosi'; $lang['diff'] = 'Näytä eroavaisuudet nykyiseen versioon'; $lang['diff2'] = 'Näytä eroavaisuudet valittuun versioon'; $lang['difflink'] = 'Linkki vertailunäkymään'; -$lang['diff_type'] = 'Näytä erot:'; +$lang['diff_type'] = 'Näytä eroavaisuudet:'; $lang['diff_inline'] = 'Sisäkkäin'; $lang['diff_side'] = 'Vierekkäin'; $lang['line'] = 'Rivi'; diff --git a/inc/lang/fi/stopwords.txt b/inc/lang/fi/stopwords.txt index 509dd0d03..82d3daa44 100644 --- a/inc/lang/fi/stopwords.txt +++ b/inc/lang/fi/stopwords.txt @@ -5,19 +5,7 @@ www eli tai -minä sinä -hän -tämä -tuo -nämä -nuo -kuka -mikä -kumpi sinun com oli -jos -kun -joka -- cgit v1.2.3 From e8af313f1b6657e3a1b32d6fdd40bc0133a2d371 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 16 Apr 2011 12:02:38 +0100 Subject: fixed invalid html in diff options --- inc/html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/html.php b/inc/html.php index fcfa54b6c..27f862219 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1004,7 +1004,7 @@ function html_diff($text='',$intro=true,$type=null){ if($intro) print p_locale_xhtml('diff'); if (!$text) { - ptln('
'); $form = new Doku_Form(array('action'=>wl())); $form->addHidden('id',$ID); @@ -1030,8 +1030,8 @@ function html_diff($text='',$intro=true,$type=null){ 'rev2[1]' => $r_rev, 'difftype' => $type, )); - ptln('
'.$lang['difflink'].''); - ptln('

'); + ptln('

'.$lang['difflink'].'

'); + ptln('
'); } ?> -- cgit v1.2.3 From be62ff971ce968b0e42730e7316728d13abe3489 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 16 Apr 2011 12:08:10 +0100 Subject: removed nbsps from some clearer divs --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/html.php b/inc/html.php index 27f862219..be4cb4f9c 100644 --- a/inc/html.php +++ b/inc/html.php @@ -355,7 +355,7 @@ function html_search(){ } print ' '; //clear float (see http://www.complexspiral.com/publications/containing-floats/) - print '
 
'; + print '
'; print ''; } flush(); -- cgit v1.2.3 From c2e7388603824fb21afecae11b46d07de5d1c54c Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 16 Apr 2011 12:51:56 +0100 Subject: don't use form_makeTag() for blank.gif as empty attributes are not passed on (which resulted in a missing alt attribute) --- inc/html.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'inc') diff --git a/inc/html.php b/inc/html.php index be4cb4f9c..0774086f9 100644 --- a/inc/html.php +++ b/inc/html.php @@ -457,11 +457,7 @@ function html_revisions($first=0){ $form->addElement($date); $form->addElement(form_makeCloseTag('span')); - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => '15', - 'height' => '11', - 'alt' => ''))); + $form->addElement(''); $form->addElement(form_makeOpenTag('a', array( 'class' => 'wikilink1', @@ -499,11 +495,7 @@ function html_revisions($first=0){ 'name' => 'rev2[]', 'value' => $rev))); }else{ - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => 14, - 'height' => 11, - 'alt' => ''))); + $form->addElement(''); } $form->addElement(form_makeOpenTag('span', array('class' => 'date'))); @@ -524,11 +516,7 @@ function html_revisions($first=0){ $form->addElement($ID); $form->addElement(form_makeCloseTag('a')); }else{ - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => '15', - 'height' => '11', - 'alt' => ''))); + $form->addElement(''); $form->addElement($ID); } -- cgit v1.2.3 From d8f5fe8a1b2231ff584f43c25217b16950600656 Mon Sep 17 00:00:00 2001 From: lupo49 Date: Sat, 16 Apr 2011 14:37:13 +0200 Subject: eo: updates for esperanto language --- inc/lang/eo/lang.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc') diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php index 305c080f1..4bb1c005d 100644 --- a/inc/lang/eo/lang.php +++ b/inc/lang/eo/lang.php @@ -161,6 +161,9 @@ $lang['yours'] = 'Via Versio'; $lang['diff'] = 'Montri diferencojn el la aktuala versio'; $lang['diff2'] = 'Montri diferencojn inter la elektitaj revizioj'; $lang['difflink'] = 'Ligilo al kompara rigardo'; +$lang['diff_type'] = 'Rigardi malsamojn:'; +$lang['diff_inline'] = 'Samlinie'; +$lang['diff_side'] = 'Apude'; $lang['line'] = 'Linio'; $lang['breadcrumb'] = 'Paŝoj'; $lang['youarehere'] = 'Vi estas ĉi tie'; -- cgit v1.2.3 From cfcd890b39045ce68b2589654b508b4d8d62a802 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 16 Apr 2011 20:16:25 +0100 Subject: removed incorrect nbsps in diff view (FS#2223) --- inc/DifferenceEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 2578d07ee..6e1d07382 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -1021,7 +1021,7 @@ class TableDiffFormatter extends DiffFormatter { $l1 = $lang['line'].' '.$xbeg; $l2 = $lang['line'].' '.$ybeg; $r = '
\n". - ' \n". + '\n". "\n"; return $r; } -- cgit v1.2.3 From 23ae1b94a29fd9c3219a8cb37f3f2e21fbe03bc6 Mon Sep 17 00:00:00 2001 From: Kiril Velikov Date: Sun, 17 Apr 2011 08:55:59 +0200 Subject: Bulgarian language update --- inc/lang/bg/install.html | 9 ++++----- inc/lang/bg/lang.php | 4 ++-- inc/lang/bg/pwconfirm.txt | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'inc') diff --git a/inc/lang/bg/install.html b/inc/lang/bg/install.html index 6dde7e4ce..9d275d82a 100644 --- a/inc/lang/bg/install.html +++ b/inc/lang/bg/install.html @@ -7,12 +7,11 @@ За да функционира нормално DokuWiki трябва да има право за писане в директориите, които съдържат тези файлове. Инсталаторът не може да настройва правата на директориите. -Обикновено трябва да направите това директно от командният ред или ако -ползвате хостинг - през FTP или контролния панела на хоста (примерно cPanel).

+Вие трябва да направите това директно от командният ред или ако ползвате хостинг през FTP или контролния панела на хоста (примерно cPanel).

Инсталаторът ще настрои вашата DokuWiki конфигурация на ACL, което ще позволи на администратора да се впише и ползва администраторското меню в DokuWiki за инсталиране на приставки, контрол -на потребители, управление на достъпа до страниците и промяна на останалите настройки. Това не е необходимо за функционирането на DokuWiki, но направи администрирането на DokuWiki по-лесно.

+на потребители, управление на достъпа до страниците и промяна на останалите настройки. Това не е необходимо за функционирането на DokuWiki, но направи администрирането по-лесно.

-

Опитните потребители или потребителите със специални изисквания към настройките имат на разположение информация относно инсталациятанастройките.

+

Опитните потребители и потребителите със специални изисквания към настройките имат на разположение допълнителна информация относно инсталиранетонастройването.

diff --git a/inc/lang/bg/lang.php b/inc/lang/bg/lang.php index c7c52b70f..1acf39acb 100644 --- a/inc/lang/bg/lang.php +++ b/inc/lang/bg/lang.php @@ -134,7 +134,7 @@ $lang['uploadexist'] = 'Файлът вече съществува. Н $lang['uploadbadcontent'] = 'Каченото съдържание не съответства на файлово разширение %s .'; $lang['uploadspam'] = 'Качването е блокирано от SPAM списъка.'; $lang['uploadxss'] = 'Качването е блокирано, поради възможно зловредно съдържание.'; -$lang['uploadsize'] = 'Файльт за качване е прекалено голям. (макс. %s)'; +$lang['uploadsize'] = 'Файлът за качване е прекалено голям. (макс. %s)'; $lang['deletesucc'] = 'Файлът "%s" бе изтрит.'; $lang['deletefail'] = '"%s" не може да бъде изтрит - проверете правата.'; $lang['mediainuse'] = 'Файлът "%s" не бе изтрит - все още се ползва.'; @@ -241,7 +241,7 @@ $lang['i_wikiname'] = 'Име на Wiki-то'; $lang['i_enableacl'] = 'Ползване на списък за достъп (ACL) [препоръчително]'; $lang['i_superuser'] = 'Супер потребител'; $lang['i_problems'] = 'Открити са проблеми, които възпрепятстват инсталирането. Ще можете да продължите след като отстраните долуизброените проблеми.'; -$lang['i_modified'] = 'Поради мерки за сигурност скрипта ще работи само с нова и непроменена инсталация на Dokuwiki. Трябва да разархивирате отново файловете от сваления архив или да се посъветвате с Инструкциите за инсталация на Dokuwiki.'; +$lang['i_modified'] = 'Поради мерки за сигурност инсталатора работи само с нова и непроменена инсталация на Dokuwiki. Трябва да разархивирате отново файловете от сваления архив или да се посъветвате с Инструкциите за инсталиране на Dokuwiki.'; $lang['i_funcna'] = 'PHP функцията %s не е достъпна. Може би е забранена от доставчика на хостинг.'; $lang['i_phpver'] = 'Инсталираната версия %s на PHP е по-стара от необходимата %s. Актуализирайте PHP инсталацията.'; $lang['i_permfail'] = '%s не е достъпна за писане от DokuWiki. Трябва да промените правата за достъп до директорията!'; diff --git a/inc/lang/bg/pwconfirm.txt b/inc/lang/bg/pwconfirm.txt index 2c4252e15..802153fd4 100644 --- a/inc/lang/bg/pwconfirm.txt +++ b/inc/lang/bg/pwconfirm.txt @@ -3,7 +3,7 @@ Някой е поискал нова парола за потребител @TITLE@ на @DOKUWIKIURL@ -Ако не сте поискали нова парола, товава просто игнорирайте това писмо. +Ако не сте поискали нова парола, тогава просто игнорирайте това писмо. За да потвърдите, че искането е наистина от вас, моля ползвайте следния линк: -- cgit v1.2.3 From 9f09385fc680aa6ef95555c50854d5867ea7831c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 Apr 2011 09:18:10 +0200 Subject: do not strip empty form parameters FS#2222 --- inc/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/form.php b/inc/form.php index 30e16b626..e74c52c5d 100644 --- a/inc/form.php +++ b/inc/form.php @@ -252,7 +252,7 @@ class Doku_Form { global $lang; $form = ''; $this->params['accept-charset'] = $lang['encoding']; - $form .= '
params,true) . '>
' . DOKU_LF; + $form .= 'params,false) . '>
' . DOKU_LF; if (!empty($this->_hidden)) { foreach ($this->_hidden as $name=>$value) $form .= form_hidden(array('name'=>$name, 'value'=>$value)); -- cgit v1.2.3 From 90f84a7bade2815d67930b18333a327777e22e53 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 17 Apr 2011 10:41:35 +0100 Subject: removed empty id in register form (FS#2222) --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/html.php b/inc/html.php index 0774086f9..4c206327d 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1097,7 +1097,7 @@ function html_register(){ $form->startFieldset($lang['btn_register']); $form->addHidden('do', 'register'); $form->addHidden('save', '1'); - $form->addElement(form_makeTextField('login', $_POST['login'], $lang['user'], null, 'block', array('size'=>'50'))); + $form->addElement(form_makeTextField('login', $_POST['login'], $lang['user'], '', 'block', array('size'=>'50'))); if (!$conf['autopasswd']) { $form->addElement(form_makePasswordField('pass', $lang['pass'], '', 'block', array('size'=>'50'))); $form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', array('size'=>'50'))); -- cgit v1.2.3 From f24af5915f464b0df29700b68b51a16ac41aeabf Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 17 Apr 2011 11:14:45 +0100 Subject: tiny fixes for xhtml strict --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/html.php b/inc/html.php index 4c206327d..6e187ebe1 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1424,7 +1424,7 @@ function html_admin(){ // data security check // @todo: could be checked and only displayed if $conf['savedir'] is under the web root - echo ' Your data directory seems to be protected properly.'; -- cgit v1.2.3 From f76f425eb307e0ab1a44dc2808da622fd752ae36 Mon Sep 17 00:00:00 2001 From: Yuji TAKENAKA Date: Sun, 17 Apr 2011 16:17:48 +0200 Subject: Japanese update Signed-off-by: Guy Brand --- inc/lang/ja/lang.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc') diff --git a/inc/lang/ja/lang.php b/inc/lang/ja/lang.php index d503bae31..e8999e05b 100644 --- a/inc/lang/ja/lang.php +++ b/inc/lang/ja/lang.php @@ -158,6 +158,9 @@ $lang['yours'] = 'あなたのバージョン'; $lang['diff'] = '現在のリビジョンとの差分を表示'; $lang['diff2'] = '選択したリビジョン間の差分を表示'; $lang['difflink'] = 'この比較画面にリンクする'; +$lang['diff_type'] = '差分の表示方法:'; +$lang['diff_inline'] = 'インライン'; +$lang['diff_side'] = '横に並べる'; $lang['line'] = 'ライン'; $lang['breadcrumb'] = 'トレース'; $lang['youarehere'] = '現在位置'; -- cgit v1.2.3
'.$l1.":'.$l2.":'.$l2.":