summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorHakan Sandell <hakan.sandell@home.se>2010-10-03 14:16:13 +0200
committerHakan Sandell <hakan.sandell@home.se>2010-10-03 14:16:13 +0200
commit7cceaa7443c80b526a6bbad32b6cbdf5d759fd39 (patch)
tree37b75aab8bf88ad11745c8abe37ec6ebb8d68e8c /inc
parent831c10d03192413b75ee2be21fb314e0797fdc23 (diff)
parentc1e6807d8013592efafd00472f75ea08dc7347ec (diff)
downloadrpg-7cceaa7443c80b526a6bbad32b6cbdf5d759fd39.tar.gz
rpg-7cceaa7443c80b526a6bbad32b6cbdf5d759fd39.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php5
-rw-r--r--inc/fulltext.php24
-rw-r--r--inc/html.php2
-rw-r--r--inc/lang/en/index.txt4
-rw-r--r--inc/lang/en/lang.php2
-rw-r--r--inc/lang/pt-br/lang.php9
-rw-r--r--inc/parser/handler.php2
-rw-r--r--inc/template.php2
8 files changed, 36 insertions, 14 deletions
diff --git a/inc/common.php b/inc/common.php
index 003546409..390b038a5 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -987,9 +987,10 @@ function saveWikiText($id,$text,$summary,$minor=false){
$mfiles = metaFiles($id);
$changelog = metaFN($id, '.changes');
$metadata = metaFN($id, '.meta');
+ $subscribers = metaFN($id, '.mlist');
foreach ($mfiles as $mfile) {
- // but keep per-page changelog to preserve page history and keep meta data
- if (@file_exists($mfile) && $mfile!==$changelog && $mfile!==$metadata) { @unlink($mfile); }
+ // but keep per-page changelog to preserve page history, keep subscriber list and keep meta data
+ if (@file_exists($mfile) && $mfile!==$changelog && $mfile!==$metadata && $mfile!==$subscribers) { @unlink($mfile); }
}
// purge meta data
p_purge_metadata($id);
diff --git a/inc/fulltext.php b/inc/fulltext.php
index e90205e9c..943a5d401 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -313,7 +313,7 @@ function ft_snippet($id,$highlight){
$len = utf8_strlen($text);
// build a regexp from the phrases to highlight
- $re1 = '('.join('|',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";
@@ -387,6 +387,24 @@ function ft_snippet($id,$highlight){
}
/**
+ * Wraps a search term in regex boundary checks.
+ */
+function ft_snippet_re_preprocess($term) {
+ if(substr($term,0,2) == '\\*'){
+ $term = substr($term,2);
+ }else{
+ $term = '\b'.$term;
+ }
+
+ if(substr($term,-2,2) == '\\*'){
+ $term = substr($term,0,-2);
+ }else{
+ $term = $term.'\b';
+ }
+ return $term;
+}
+
+/**
* Combine found documents and sum up their scores
*
* This function is used to combine searched words with a logical
@@ -678,7 +696,7 @@ function ft_queryParser($query){
break;
case 'W+:':
$q['words'][] = $body;
- $q['highlight'][] = str_replace('*', '', $body);
+ $q['highlight'][] = $body;
$q['and'][] = $body; // for backward compatibility
break;
case 'P-:':
@@ -686,7 +704,7 @@ function ft_queryParser($query){
break;
case 'P+:':
$q['phrases'][] = $body;
- $q['highlight'][] = str_replace('*', '', $body);
+ $q['highlight'][] = $body;
break;
}
}
diff --git a/inc/html.php b/inc/html.php
index add559971..968a63e4e 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -285,7 +285,7 @@ function html_draft(){
*/
function html_hilight($html,$phrases){
$phrases = array_filter((array) $phrases);
- $regex = join('|',array_map('preg_quote_cb',$phrases));
+ $regex = join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',$phrases)));
if ($regex === '') return $html;
$html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html);
diff --git a/inc/lang/en/index.txt b/inc/lang/en/index.txt
index 5adbfd898..152911bbb 100644
--- a/inc/lang/en/index.txt
+++ b/inc/lang/en/index.txt
@@ -1,4 +1,4 @@
-====== Index ======
+====== Sitemap ======
-This is an index over all available pages ordered by [[doku>namespaces|namespaces]].
+This is a sitemap over all available pages ordered by [[doku>namespaces|namespaces]].
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 5414f7a88..5c890246c 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -29,7 +29,7 @@ $lang['btn_revs'] = 'Old revisions';
$lang['btn_recent'] = 'Recent changes';
$lang['btn_upload'] = 'Upload';
$lang['btn_cancel'] = 'Cancel';
-$lang['btn_index'] = 'Index';
+$lang['btn_index'] = 'Sitemap';
$lang['btn_secedit']= 'Edit';
$lang['btn_login'] = 'Login';
$lang['btn_logout'] = 'Logout';
diff --git a/inc/lang/pt-br/lang.php b/inc/lang/pt-br/lang.php
index 135d20d97..6bbd4c520 100644
--- a/inc/lang/pt-br/lang.php
+++ b/inc/lang/pt-br/lang.php
@@ -17,8 +17,9 @@
* @author Jair Henrique <jair.henrique@gmail.com>
* @author Luis Dantas <luisdantas@gmail.com>
* @author Sergio Motta sergio@cisne.com.br
+ * @author Isaias Masiero Filho <masiero@masiero.org>
*/
-$lang['encoding'] = 'utf-8';
+$lang['encoding'] = 'utf-8<';
$lang['direction'] = 'ltr';
$lang['doublequoteopening'] = '“';
$lang['doublequoteclosing'] = '”';
@@ -121,7 +122,7 @@ $lang['js']['mediasmall'] = 'Versão Pequena';
$lang['js']['mediamedium'] = 'Versão Média';
$lang['js']['medialarge'] = 'Versão Grande';
$lang['js']['mediaoriginal'] = 'Versão Original';
-$lang['js']['medialnk'] = 'Link para pagina de detalhes';
+$lang['js']['medialnk'] = 'Link para página de detalhes';
$lang['js']['mediadirect'] = 'Link direto para original';
$lang['js']['medianolnk'] = 'Sem Link';
$lang['js']['medianolink'] = 'Sem link na imagem';
@@ -152,6 +153,7 @@ $lang['deletefail'] = 'Não foi possível excluir "%s" - verifique as
$lang['mediainuse'] = 'O arquivo "%s" não foi excluído - ele ainda está em uso.';
$lang['namespaces'] = 'Espaços de nome';
$lang['mediafiles'] = 'Arquivos disponíveis em';
+$lang['accessdenied'] = 'Você não tem permissão para visualizar esta página.';
$lang['mediausage'] = 'Use a seguinte sintaxe para referenciar esse arquivo:';
$lang['mediaview'] = 'Ver o arquivo original';
$lang['mediaroot'] = 'raiz';
@@ -167,6 +169,7 @@ $lang['current'] = 'atual';
$lang['yours'] = 'Sua versão';
$lang['diff'] = 'Mostrar diferenças com a revisão atual';
$lang['diff2'] = 'Mostrar diferenças entre as revisões selecionadas';
+$lang['difflink'] = 'Link para esta página de comparações';
$lang['line'] = 'Linha';
$lang['breadcrumb'] = 'Visitou';
$lang['youarehere'] = 'Você está aqui';
@@ -188,7 +191,7 @@ $lang['qb_bold'] = 'Texto em negrito';
$lang['qb_italic'] = 'Texto em itálico';
$lang['qb_underl'] = 'Texto sublinhado';
$lang['qb_code'] = 'Texto de código';
-$lang['qb_strike'] = 'Texto riscado';
+$lang['qb_strike'] = 'Texto tachado';
$lang['qb_h1'] = 'Cabeçalho de nível 1';
$lang['qb_h2'] = 'Cabeçalho de nível 2';
$lang['qb_h3'] = 'Cabeçalho de nível 3';
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index acca3f5a1..a96e6b9db 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -440,7 +440,7 @@ class Doku_Handler {
array($link[0],$link[1],strtolower($interwiki[0]),$interwiki[1]),
$pos
);
- }elseif ( preg_match('/^\\\\\\\\[\w.:?\-;,]+?\\\\/u',$link[0]) ) {
+ }elseif ( preg_match('/^\\\\\\\\[^\\\\]+?\\\\/u',$link[0]) ) {
// Windows Share
$this->_addCall(
'windowssharelink',
diff --git a/inc/template.php b/inc/template.php
index 4eed30591..2693c485b 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -664,7 +664,7 @@ function tpl_searchform($ajax=true,$autocomplete=true){
// don't print the search form if search action has been disabled
if (!actionOk('search')) return false;
- print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search"><div class="no">';
+ print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search" method="get"><div class="no">';
print '<input type="hidden" name="do" value="search" />';
print '<input type="text" ';
if($ACT == 'search') print 'value="'.htmlspecialchars($QUERY).'" ';