diff options
author | andi <andi@splitbrain.org> | 2005-04-17 17:09:06 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-04-17 17:09:06 +0200 |
commit | 15cfe3031ce6b583a235b74987e5e6700767fdf1 (patch) | |
tree | 143c8255f57e850e8610212871a28ca38fb90552 /inc/common.php | |
parent | c112d57805d6740c6e0a200fd5fd3f2717f86c69 (diff) | |
download | rpg-15cfe3031ce6b583a235b74987e5e6700767fdf1.tar.gz rpg-15cfe3031ce6b583a235b74987e5e6700767fdf1.tar.bz2 |
section editing fixed
darcs-hash:20050417150906-9977f-96fcdc018414606bc58252631708c8b55d82354a.gz
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |