summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/entities.conf2
-rw-r--r--data/pages/wiki/syntax.txt16
-rw-r--r--inc/fetch.functions.php13
-rw-r--r--inc/lang/ko/install.html26
-rw-r--r--inc/lessc.inc.php2
-rw-r--r--inc/template.php13
-rw-r--r--lib/exe/css.php3
-rw-r--r--lib/exe/fetch.php2
-rw-r--r--lib/plugins/config/lang/ko/intro.txt1
-rw-r--r--lib/scripts/edit.js6
-rw-r--r--lib/scripts/editor.js8
-rw-r--r--lib/scripts/linkwiz.js4
-rw-r--r--lib/scripts/textselection.js26
-rw-r--r--lib/scripts/toolbar.js2
14 files changed, 74 insertions, 50 deletions
diff --git a/conf/entities.conf b/conf/entities.conf
index be9ed6d40..c0d653c18 100644
--- a/conf/entities.conf
+++ b/conf/entities.conf
@@ -2,7 +2,7 @@
#
# Order does matter!
#
-# You can use HTML entities here, but it is not recomended because it may break
+# You can use HTML entities here, but it is not recommended because it may break
# non-HTML renderers. Use UTF-8 chars directly instead.
<-> ↔
diff --git a/data/pages/wiki/syntax.txt b/data/pages/wiki/syntax.txt
index f2c2864ed..02b49dc3d 100644
--- a/data/pages/wiki/syntax.txt
+++ b/data/pages/wiki/syntax.txt
@@ -427,25 +427,25 @@ PHP example:
<code>
<php>
-echo 'A logo generated by PHP:';
-echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
-echo '(generated inline HTML)';
+echo 'The PHP version: ';
+echo phpversion();
+echo ' (generated inline HTML)';
</php>
<PHP>
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
-echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
+echo '<td>'.phpversion().'</td>';
echo '</tr></table>';
</PHP>
</code>
<php>
-echo 'A logo generated by PHP:';
-echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
-echo '(inline HTML)';
+echo 'The PHP version: ';
+echo phpversion();
+echo ' (inline HTML)';
</php>
<PHP>
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
-echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
+echo '<td>'.phpversion().'</td>';
echo '</tr></table>';
</PHP>
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php
index 207ad9e5f..3eacaa2fe 100644
--- a/inc/fetch.functions.php
+++ b/inc/fetch.functions.php
@@ -15,13 +15,15 @@
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @author Gerry Weissbach <dokuwiki@gammaproduction.de>
* @param string $file local file to send
* @param string $mime mime type of the file
* @param bool $dl set to true to force a browser download
* @param int $cache remaining cache time in seconds (-1 for $conf['cache'], 0 for no-cache)
* @param bool $public is this a public ressource or a private one?
+ * @param string $orig original file to send - the file name will be used for the Content-Disposition
*/
-function sendFile($file, $mime, $dl, $cache, $public = false) {
+function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
global $conf;
// send mime headers
header("Content-Type: $mime");
@@ -62,11 +64,16 @@ function sendFile($file, $mime, $dl, $cache, $public = false) {
$fmtime = @filemtime($file);
http_conditionalRequest($fmtime);
+ // Use the current $file if is $orig is not set.
+ if ( $orig == null ) {
+ $orig = $file;
+ }
+
//download or display?
if($dl) {
- header('Content-Disposition: attachment; filename="'.utf8_basename($file).'";');
+ header('Content-Disposition: attachment; filename="'.utf8_basename($orig).'";');
} else {
- header('Content-Disposition: inline; filename="'.utf8_basename($file).'";');
+ header('Content-Disposition: inline; filename="'.utf8_basename($orig).'";');
}
//use x-sendfile header to pass the delivery to compatible webservers
diff --git a/inc/lang/ko/install.html b/inc/lang/ko/install.html
index 886ed2d30..ecc0d3caa 100644
--- a/inc/lang/ko/install.html
+++ b/inc/lang/ko/install.html
@@ -1,10 +1,22 @@
-<p>이 페이지는 <a href="http://dokuwiki.org">Dokuwiki</a> 설치와 환경 설정을 도와줍니다.
-설치 과정에 대한 더 자세한 정보는 <a href="http://dokuwiki.org/ko:installer">관련 문서</a>를 참고하시기 바랍니다.</p>
+<p>이 페이지는 <a href="http://dokuwiki.org">도쿠위키</a>의 첫
+설치와 환경 설정을 도와줍니다. 이 설치 프로그램에 대한 자세한 정보는
+<a href="http://dokuwiki.org/ko:installer">설명문 페이지</a>에서
+볼 수 있습니다.</p>
-<p>DokuWiki는 위키 문서와 문서와 관련된 정보(예를 들어 그림, 검색 색인, 이전 판 문서)를 저장하기 위해 일반적인 텍스트 파일을 사용합니다. 정상적으로 DokuWiki를 사용하려면 이 파일을 담고 있는 디렉토리에 대한 쓰기 권한을 가지고 있어야 합니다.
-현재 설치 과정 중에는 디렉토리 권한 설정이 불가능합니다. 보통 직접 셸 명령어를 사용하거나, 호스팅을 사용한다면 FTP나 호스팅 제어판(예를 들어 CPanel)을 사용해서 설정해야 합니다.</p>
+<p>도쿠위키는 위키 문서와 해당 문서와 관련된 정보(예를 들어 그림,
+검색 색인, 이전 판 문서 등)를 저장하기 위해 일반적인 텍스트 파일을
+사용합니다. 성공적으로 작동하려면 도쿠위키는 이 파일을 담고
+있는 디렉토리에 대한 쓰기 권한이 <strong>있어야</strong> 합니다.
+이 설치 프로그램은 디렉토리 권한을 설정할 수 없습니다. 보통
+직접 명령 셸에 수행하거나 호스팅을 사용한다면, FTP나 호스팅
+제어판(예를 들어 CPanel)을 통해 수행해야 합니다.</p>
-<p>현재 설치 과정중에 관리자로 로그인 후 DokuWiki의 관리 메뉴(플러그인 설치, 사용자 관리, 위키 문서 접근 권한 관리, 옵션 설정)를 가능하게 <acronym title="접근 제어 목록">ACL</acronym>에 대한 환경 설정을 수행합니다.
-DokuWiki가 동작하는데 필요한 사항은 아니지만, 어쨌든 더 쉽게 관리자가 관리할 수 있도록 해줍니다.</p>
+<p>이 설치 프로그램은 관리자로 로그인하고 나서 플러그인 설치, 사용자 관리,
+위키 문서로의 접근 관리와 환경 설정을 바꾸기 위한 도쿠위키의 관리 메뉴에
+접근할 수 있는, <acronym title="access control list; 접근 제어 목록">ACL</acronym>에
+대한 도쿠위키 환경을 설정합니다. 도쿠위키가 작동하는데 필요하지 않지만,
+도쿠위키를 쉽게 관리할 수 있도록 해줍니다.</p>
-<p>숙련된 사용자나 특별한 설치 과정이 필요한 경우에는 <a href="http://dokuwiki.org/ko:install">설치 과정</a>과 <a href="http://dokuwiki.org/ko:config">환경 설정</a> 링크를 참고하시기 바랍니다.</p> \ No newline at end of file
+<p>숙련된 사용자나 특수한 설치가 필요한 사용자에게 자세한 내용은
+<a href="http://dokuwiki.org/ko:install">설치 지침</a>과
+<a href="http://dokuwiki.org/ko:config">환경 설정</a> 링크를 사용해야 합니다.</p>
diff --git a/inc/lessc.inc.php b/inc/lessc.inc.php
index 0699de52f..3d0ed768a 100644
--- a/inc/lessc.inc.php
+++ b/inc/lessc.inc.php
@@ -708,7 +708,7 @@ class lessc {
}
$oldParent = $mixin->parent;
- if ($mixin != $block) $mixin->parent = $block;
+ if ($mixin !== $block) $mixin->parent = $block;
foreach ($this->sortProps($mixin->props) as $subProp) {
if ($suffix !== null &&
diff --git a/inc/template.php b/inc/template.php
index 60e178d1a..0a6a9e4aa 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1123,10 +1123,11 @@ function tpl_indexerWebBug() {
*
* use this function to access template configuration variables
*
- * @param string $id
- * @return string
+ * @param string $id name of the value to access
+ * @param mixed $notset what to return if the setting is not available
+ * @return mixed
*/
-function tpl_getConf($id) {
+function tpl_getConf($id, $notset=false) {
global $conf;
static $tpl_configloaded = false;
@@ -1143,7 +1144,11 @@ function tpl_getConf($id) {
}
}
- return $conf['tpl'][$tpl][$id];
+ if(isset($conf['tpl'][$tpl][$id])){
+ return $conf['tpl'][$tpl][$id];
+ }
+
+ return $notset;
}
/**
diff --git a/lib/exe/css.php b/lib/exe/css.php
index c96dedd37..f273b7ee4 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -456,8 +456,9 @@ class DokuCssFile {
if (defined('DOKU_UNITTEST')) {
$basedir[] = realpath(TMP_DIR);
}
- $regex = '#^('.join('|',$basedir).')#';
+ $basedir = array_map('preg_quote_cb', $basedir);
+ $regex = '/^('.join('|',$basedir).')/';
$this->relative_path = preg_replace($regex, '', dirname($this->filepath));
}
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index f33b3f2f8..5f82ad0e0 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -89,7 +89,7 @@ if (defined('SIMPLE_TEST')) {
// finally send the file to the client
$evt = new Doku_Event('MEDIA_SENDFILE', $data);
if($evt->advise_before()) {
- sendFile($data['file'], $data['mime'], $data['download'], $data['cache'], $data['ispublic']);
+ sendFile($data['file'], $data['mime'], $data['download'], $data['cache'], $data['ispublic'], $data['orig']);
}
// Do something after the download finished.
$evt->advise_after(); // will not be emitted on 304 or x-sendfile
diff --git a/lib/plugins/config/lang/ko/intro.txt b/lib/plugins/config/lang/ko/intro.txt
index d0b85606c..979bbcb14 100644
--- a/lib/plugins/config/lang/ko/intro.txt
+++ b/lib/plugins/config/lang/ko/intro.txt
@@ -6,4 +6,3 @@
이 페이지를 떠나기 전에 **저장** 버튼을 누르지 않으면 바뀜이 사라지는 것에 주의하세요.
-
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index b1dbff683..56c185db7 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -148,7 +148,7 @@ function addBtnActionSignature($btn, props, edid) {
function currentHeadlineLevel(textboxId){
var field = jQuery('#' + textboxId)[0],
s = false,
- opts = [field.value.substr(0,getSelection(field).start)];
+ opts = [field.value.substr(0,DWgetSelection(field).start)];
if (field.form.prefix) {
// we need to look in prefix context
opts.push(field.form.prefix.value);
@@ -217,10 +217,10 @@ jQuery(function () {
}
// set focus and place cursor at the start
- var sel = getSelection($edit_text[0]);
+ var sel = DWgetSelection($edit_text[0]);
sel.start = 0;
sel.end = 0;
- setSelection(sel);
+ DWsetSelection(sel);
$edit_text.focus();
}
diff --git a/lib/scripts/editor.js b/lib/scripts/editor.js
index 2c0924eb7..74919cb98 100644
--- a/lib/scripts/editor.js
+++ b/lib/scripts/editor.js
@@ -134,7 +134,7 @@ var dw_editor = {
if(jQuery.inArray(e.keyCode,[8, 13, 32]) === -1) {
return;
}
- var selection = getSelection(this);
+ var selection = DWgetSelection(this);
if(selection.getLength() > 0) {
return; //there was text selected, keep standard behavior
}
@@ -155,7 +155,7 @@ var dw_editor = {
this.value.substr(selection.start);
selection.start = linestart + 1;
selection.end = linestart + 1;
- setSelection(selection);
+ DWsetSelection(selection);
} else {
insertAtCarret(this.id,match[1]);
}
@@ -180,7 +180,7 @@ var dw_editor = {
selection.start = linestart;
selection.end = linestart;
}
- setSelection(selection);
+ DWsetSelection(selection);
e.preventDefault(); // prevent backspace
return false;
}
@@ -192,7 +192,7 @@ var dw_editor = {
this.value.substr(linestart);
selection.start = selection.start + 2;
selection.end = selection.start;
- setSelection(selection);
+ DWsetSelection(selection);
e.preventDefault(); // prevent space
return false;
}
diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js
index f6ac9b032..e8191dbcb 100644
--- a/lib/scripts/linkwiz.js
+++ b/lib/scripts/linkwiz.js
@@ -214,7 +214,7 @@ var dw_linkwiz = {
return;
}
- sel = getSelection(dw_linkwiz.textArea);
+ sel = DWgetSelection(dw_linkwiz.textArea);
if(sel.start == 0 && sel.end == 0) {
sel = dw_linkwiz.selection;
}
@@ -295,7 +295,7 @@ var dw_linkwiz = {
* Show the link wizard
*/
show: function(){
- dw_linkwiz.selection = getSelection(dw_linkwiz.textArea);
+ dw_linkwiz.selection = DWgetSelection(dw_linkwiz.textArea);
dw_linkwiz.$wiz.show();
dw_linkwiz.$entry.focus();
dw_linkwiz.autocomplete();
diff --git a/lib/scripts/textselection.js b/lib/scripts/textselection.js
index 26b4196f2..818d5d950 100644
--- a/lib/scripts/textselection.js
+++ b/lib/scripts/textselection.js
@@ -5,7 +5,7 @@
/**
* selection prototype
*
- * Object that capsulates the selection in a textarea. Returned by getSelection.
+ * Object that capsulates the selection in a textarea. Returned by DWgetSelection.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
@@ -34,7 +34,7 @@ function selection_class(){
* @link http://linebyline.blogspot.com/2006/11/textarea-cursor-position-in-internet.html
* @returns object - a selection object
*/
-function getSelection(textArea) {
+function DWgetSelection(textArea) {
var sel = new selection_class();
sel.obj = textArea;
@@ -119,14 +119,14 @@ function getSelection(textArea) {
/**
* Set the selection
*
- * You need to get a selection object via getSelection() first, then modify the
+ * You need to get a selection object via DWgetSelection() first, then modify the
* start and end properties and pass it back to this function.
*
* @link http://groups.drupal.org/node/1210
* @author Andreas Gohr <andi@splitbrain.org>
- * @param object selection - a selection object as returned by getSelection()
+ * @param {selection_class} selection a selection object as returned by DWgetSelection()
*/
-function setSelection(selection){
+function DWsetSelection(selection){
if(document.getSelection){ // FF
// what a pleasure in FF ;)
selection.obj.setSelectionRange(selection.start,selection.end);
@@ -144,11 +144,11 @@ function setSelection(selection){
* selection
*
* @author Andreas Gohr <andi@splitbrain.org>
- * @param string text - the new text to be pasted
- * @param objct selecttion - selection object returned by getSelection
- * @param int opts.startofs - number of charcters at the start to skip from new selection
- * @param int opts.endofs - number of characters at the end to skip from new selection
- * @param bool opts.nosel - set true if new text should not be selected
+ * @param {string} text the new text to be pasted
+ * @param {selection_class} selection selection object returned by DWgetSelection
+ * @param {int} opts.startofs number of charcters at the start to skip from new selection
+ * @param {int} opts.endofs number of characters at the end to skip from new selection
+ * @param {boolean} opts.nosel set true if new text should not be selected
*/
function pasteText(selection,text,opts){
if(!opts) opts = {};
@@ -173,7 +173,7 @@ function pasteText(selection,text,opts){
// no selection wanted? set cursor to end position
if(opts.nosel) selection.start = selection.end;
- setSelection(selection);
+ DWsetSelection(selection);
}
@@ -188,7 +188,7 @@ function pasteText(selection,text,opts){
function insertTags(textAreaID, tagOpen, tagClose, sampleText){
var txtarea = jQuery('#' + textAreaID)[0];
- var selection = getSelection(txtarea);
+ var selection = DWgetSelection(txtarea);
var text = selection.getText();
var opts;
@@ -226,6 +226,6 @@ function insertTags(textAreaID, tagOpen, tagClose, sampleText){
*/
function insertAtCarret(textAreaID, text){
var txtarea = jQuery('#' + textAreaID)[0];
- var selection = getSelection(txtarea);
+ var selection = DWgetSelection(txtarea);
pasteText(selection,text,{nosel: true});
}
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js
index 88cae1e8c..09c374bc4 100644
--- a/lib/scripts/toolbar.js
+++ b/lib/scripts/toolbar.js
@@ -101,7 +101,7 @@ function tb_format(btn, props, edid) {
function tb_formatln(btn, props, edid) {
var sample = props.sample || props.title,
opts,
- selection = getSelection(jQuery('#'+edid)[0]);
+ selection = DWgetSelection(jQuery('#'+edid)[0]);
sample = fixtxt(sample);
props.open = fixtxt(props.open);