summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-17 17:09:06 +0200
committerandi <andi@splitbrain.org>2005-04-17 17:09:06 +0200
commit15cfe3031ce6b583a235b74987e5e6700767fdf1 (patch)
tree143c8255f57e850e8610212871a28ca38fb90552
parentc112d57805d6740c6e0a200fd5fd3f2717f86c69 (diff)
downloadrpg-15cfe3031ce6b583a235b74987e5e6700767fdf1.tar.gz
rpg-15cfe3031ce6b583a235b74987e5e6700767fdf1.tar.bz2
section editing fixed
darcs-hash:20050417150906-9977f-96fcdc018414606bc58252631708c8b55d82354a.gz
-rw-r--r--doku.php5
-rw-r--r--inc/common.php12
2 files changed, 6 insertions, 11 deletions
diff --git a/doku.php b/doku.php
index 0d7fe667a..6f4ce89b2 100644
--- a/doku.php
+++ b/doku.php
@@ -29,11 +29,6 @@
$HIGH = $_REQUEST['s'];
if(empty($HIGH)) $HIGH = getGoogleQuery();
-# $ACL_USER = urldecode($_REQUEST['acl_user']);
-# $ACL_SCOPE = urldecode($_REQUEST['acl_scope']);
-# $ACL_LEVEL = $_REQUEST['acl_level'];
-# $ACL_CHECKBOX = $_REQUEST['acl_checkbox'];
-
$TEXT = cleanText($_POST['wikitext']);
$PRE = cleanText($_POST['prefix']);
$SUF = cleanText($_POST['suffix']);
diff --git a/inc/common.php b/inc/common.php
index 6d0a28ebb..74dc13cea 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -382,7 +382,8 @@ function rawWiki($id,$rev=''){
* Returns the raw Wiki Text in three slices.
*
* The range parameter needs to have the form "from-to"
- * and gives the range of the section.
+ * and gives the range of the section in bytes - no
+ * UTF-8 awareness is needed.
* The returned order is prefix, section and suffix.
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -390,13 +391,12 @@ function rawWiki($id,$rev=''){
function rawWikiSlices($range,$id,$rev=''){
list($from,$to) = split('-',$range,2);
$text = io_readFile(wikiFN($id,$rev));
- $text = split("\n",$text);
if(!$from) $from = 0;
- if(!$to) $to = count($text);
+ if(!$to) $to = strlen($text);
- $slices[0] = join("\n",array_slice($text,0,$from));
- $slices[1] = join("\n",array_slice($text,$from,$to + 1 - $from));
- $slices[2] = join("\n",array_slice($text,$to+1));
+ $slices[0] = substr($text,0,$from-1);
+ $slices[1] = substr($text,$from-1,$to-$from);
+ $slices[2] = substr($text,$to);
return $slices;
}