From 7651b376ab78457d123e1c3513a6a4b8b0d5a7e7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 13 Mar 2012 19:21:17 +0100 Subject: pass the correct clean parameter when reading wiki pages DokuWiki's page loading is intended to be filesystem agnostic. DOS line endings in pages are supposed to be self healing. This behaviour was broken in a change in 2006. As long as you edited pages through DokuWiki only you never noticed the bug though. --- inc/io.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/io.php') diff --git a/inc/io.php b/inc/io.php index 034ac650e..c76d2f44c 100644 --- a/inc/io.php +++ b/inc/io.php @@ -63,7 +63,7 @@ function io_sweepNS($id,$basedir='datadir'){ */ function io_readWikiPage($file, $id, $rev=false) { if (empty($rev)) { $rev = false; } - $data = array(array($file, false), getNS($id), noNS($id), $rev); + $data = array(array($file, true), getNS($id), noNS($id), $rev); return trigger_event('IO_WIKIPAGE_READ', $data, '_io_readWikiPage_action', false); } -- cgit v1.2.3 From 3009a773c06e6e5d731c42b12ad82272f9706f03 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 28 Jul 2012 10:40:48 +0200 Subject: replaced use of basename() with utf8_basename() FS#2015 --- inc/io.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/io.php') diff --git a/inc/io.php b/inc/io.php index c76d2f44c..4c6eb97df 100644 --- a/inc/io.php +++ b/inc/io.php @@ -485,7 +485,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20 if (is_string($content_disposition) && preg_match('/attachment;\s*filename\s*=\s*"([^"]*)"/i', $content_disposition, $match)) { - $name = basename($match[1]); + $name = utf8_basename($match[1]); } } -- cgit v1.2.3 From cd2f903b3e35c080dc9c1aa0c9f7383573dcae31 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 7 Sep 2012 21:10:44 +0200 Subject: Correct and add some PHPDoc comments, initialize some variables --- inc/io.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'inc/io.php') diff --git a/inc/io.php b/inc/io.php index 4c6eb97df..b4da7d635 100644 --- a/inc/io.php +++ b/inc/io.php @@ -18,8 +18,8 @@ if(!defined('DOKU_INC')) die('meh.'); * * @todo use safemode hack * @param string $id - a pageid, the namespace of that id will be tried to deleted - * @param string $basadir - the config name of the type to delete (datadir or mediadir usally) - * @returns bool - true if at least one namespace was deleted + * @param string $basedir - the config name of the type to delete (datadir or mediadir usally) + * @return bool - true if at least one namespace was deleted * @author Andreas Gohr * @author Ben Coburn */ @@ -113,6 +113,7 @@ function io_readFile($file,$clean=true){ function bzfile($file){ $bz = bzopen($file,"r"); + $str = ''; while (!feof($bz)){ //8192 seems to be the maximum buffersize? $str = $str . bzread($bz,8192); @@ -477,8 +478,8 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20 $data = $http->get($url); if(!$data) return false; + $name = ''; if ($useAttachment) { - $name = ''; if (isset($http->resp_headers['content-disposition'])) { $content_disposition = $http->resp_headers['content-disposition']; $match=array(); @@ -578,8 +579,8 @@ function io_exec($cmd, $input, &$output){ * @param string $file The file to search * @param string $pattern PCRE pattern * @param int $max How many lines to return (0 for all) - * @param bool $baxkref When true returns array with backreferences instead of lines - * @return matching lines or backref, false on error + * @param bool $backref When true returns array with backreferences instead of lines + * @return array matching lines or backref, false on error */ function io_grep($file,$pattern,$max=0,$backref=false){ $fh = @fopen($file,'r'); -- cgit v1.2.3