From de3eb1d7f990c4cc17722ce3bdff7b9568ab8b9c Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Tue, 28 Sep 2010 16:38:14 +0200 Subject: Small fixes / cleanup --- feed.php | 5 -- inc/HTTPClient.php | 3 +- inc/SimplePie.php | 2 +- inc/TarLib.class.php | 76 -------------------------- inc/actions.php | 4 -- inc/changelog.php | 2 +- inc/common.php | 1 - inc/feedcreator.class.php | 6 +- inc/lang/tr/install.html | 2 +- inc/media.php | 2 + inc/pageutils.php | 1 - inc/search.php | 3 +- inc/template.php | 2 +- inc/toolbar.php | 2 - lib/plugins/plugin/classes/ap_info.class.php | 2 +- lib/plugins/plugin/classes/ap_manage.class.php | 1 + lib/plugins/revert/admin.php | 1 + lib/scripts/media.js | 2 +- 18 files changed, 18 insertions(+), 99 deletions(-) diff --git a/feed.php b/feed.php index 50786dd3a..0980dfaa8 100644 --- a/feed.php +++ b/feed.php @@ -248,7 +248,6 @@ function rss_buildItems(&$rss,&$data,$opt){ // add user # FIXME should the user be pulled from metadata as well? - $user = null; $user = @$ditem['user']; // the @ spares time repeating lookup $item->author = ''; if($user && $conf['useacl'] && $auth){ @@ -309,9 +308,6 @@ function rss_buildItems(&$rss,&$data,$opt){ * @author Andreas Gohr */ function rssRecentChanges($opt){ - global $conf; - global $auth; - $flags = RECENTS_SKIP_DELETED; if(!$opt['show_minor']) $flags += RECENTS_SKIP_MINORS; @@ -347,7 +343,6 @@ function rssSearch($opt){ if(!$opt['search_query']) return; require_once(DOKU_INC.'inc/fulltext.php'); - $data = array(); $data = ft_pageSearch($opt['search_query'],$poswords); $data = array_keys($data); diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index eea01f9d5..4e64668d5 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -276,7 +276,7 @@ class HTTPClient { // open socket $socket = @fsockopen($server,$port,$errno, $errstr, $this->timeout); if (!$socket){ - $resp->status = '-100'; + $this->status = -100; $this->error = "Could not connect to $server:$port\n$errstr ($errno)"; return false; } @@ -560,6 +560,7 @@ class HTTPClient { * @author Andreas Gohr */ function _postEncode($data){ + $url = ''; foreach($data as $key => $val){ if($url) $url .= '&'; $url .= urlencode($key).'='.urlencode($val); diff --git a/inc/SimplePie.php b/inc/SimplePie.php index 276a654ee..99c9f3226 100644 --- a/inc/SimplePie.php +++ b/inc/SimplePie.php @@ -9120,7 +9120,7 @@ class SimplePie_Misc } else { - trigger_error('Unknown class passed as parameter', E_USER_WARNNG); + trigger_error('Unknown class passed as parameter', E_USER_WARNING); } } return false; diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php index 3e9e81234..3da3c72c2 100644 --- a/inc/TarLib.class.php +++ b/inc/TarLib.class.php @@ -457,82 +457,6 @@ class TarLib { return isset($ecodes[$i]) ? $ecodes[$i] : $ecodes[0]; } - /** - * Display informations about the MaxgTar Class. - * - * This function will display vaious informations about the server - * MaxgTar is running on. - * - * The optional parameter DispHeaders is used to generate a full page with - * HTML headers (TRUE by default) or just the table with the informations - * (FALSE). Note that the HTML page generated is verified compatible XHTML - * 1.0, but not HTML 4.0 compatible. - */ - function TarInfo($headers = true) { - if($headers) { - ?> - - - - - MaxgComp TAR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MaxgComp TAR
This software was created by the Maxg Network, http://maxg.info -
It is distributed under the GNU Lesser General Public License -
You can find the documentation of this class here
MaxgComp TAR
MaxgComp TAR version
ZLIB extensionsYes' : 'No')?>
BZ2 extensionsYes' : 'No')?>
Allow URL fopenYes' : 'No')?>
Time limit
PHP Version
- Special thanks to « Vincent Blavet » for his PEAR::Archive_Tar class -
- '; - } - function _seek($p_flen, $tell=0) { if($this->_nomf === TarLib::ARCHIVE_DYNAMIC) $this->_memdat=substr($this->_memdat,0,($tell ? strlen($this->_memdat) : 0) + $p_flen); diff --git a/inc/actions.php b/inc/actions.php index 3e0cb1207..d9f5d017c 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -16,13 +16,10 @@ if(!defined('DOKU_INC')) die('meh.'); * @triggers ACTION_HEADERS_SEND */ function act_dispatch(){ - global $INFO; global $ACT; global $ID; global $QUERY; global $lang; - global $conf; - global $license; $preact = $ACT; @@ -57,7 +54,6 @@ function act_dispatch(){ $ACT = act_permcheck($ACT); //register - $nil = array(); if($ACT == 'register' && $_POST['save'] && register()){ $ACT = 'login'; } diff --git a/inc/changelog.php b/inc/changelog.php index d5cd8308c..bb00df76c 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -104,7 +104,7 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr * @author Ben Coburn */ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null){ - global $conf, $INFO; + global $conf; $id = cleanid($id); diff --git a/inc/common.php b/inc/common.php index bf5987c28..003546409 100644 --- a/inc/common.php +++ b/inc/common.php @@ -97,7 +97,6 @@ function pageinfo(){ global $REV; global $RANGE; global $USERINFO; - global $conf; global $lang; // include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php index e7b8d7afc..68b9bdd2b 100644 --- a/inc/feedcreator.class.php +++ b/inc/feedcreator.class.php @@ -685,7 +685,8 @@ class FeedDate { $months = Array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); $this->unix = mktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]); if (substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-') { - $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; + $tzOffset = (((int) substr($matches[7],0,3) * 60) + + (int) substr($matches[7],-2)) * 60; } else { if (strlen($matches[7])==1) { $oneHour = 3600; @@ -709,7 +710,8 @@ class FeedDate { if (preg_match("~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~",$dateString,$matches)) { $this->unix = mktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1]); if (substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-') { - $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; + $tzOffset = (((int) substr($matches[7],0,3) * 60) + + (int) substr($matches[7],-2)) * 60; } else { if ($matches[7]=="Z") { $tzOffset = 0; diff --git a/inc/lang/tr/install.html b/inc/lang/tr/install.html index 59e7f57a7..d479ca4e8 100644 --- a/inc/lang/tr/install.html +++ b/inc/lang/tr/install.html @@ -1,6 +1,6 @@

Bu sayfa Dokuwiki kurmanıza yardımcı olmaktadır. Kurulum hakkında bilgi sahibi olmak için bu sayfayı ziyaret edebilirsiniz.

-

DokuWiki wiki sayfalarını ve wiki sayfalarına ilişkin verileri (resimler, arama indeksi, geçmiş sürümler) dosyalarda tutar. DokuWikiyi sorunsuz olarak kullanmak için bu dosyaların bulunduğu dizinlere mutlaka yazma izniniz olması gereklidir. Bu kurulum betiği yazma izinlerini ayarlayamamaktadır. İzinleri shell, FTP veya kontrol paneliniz (CPanel, Plesk vs.) aracılığı ile düzenleyebilirsiniz.

+

DokuWiki wiki sayfalarını ve wiki sayfalarına ilişkin verileri (resimler, arama indeksi, geçmiş sürümler) dosyalarda tutar. DokuWikiyi sorunsuz olarak kullanmak için bu dosyaların bulunduğu dizinlere mutlaka yazma izniniz olması gereklidir. Bu kurulum betiği yazma izinlerini ayarlayamamaktadır. İzinleri shell, FTP veya kontrol paneliniz (CPanel, Plesk vs.) aracılığı ile düzenleyebilirsiniz.

Kurulum betiği ACL'yi otomatik olarak ayarlamaktadır. Böylece yönetici izinleri belirlenip, DokuWiki kullanımı kolaylaştırılmaktadır.

diff --git a/inc/media.php b/inc/media.php index 668f42d6a..3dacd12b7 100644 --- a/inc/media.php +++ b/inc/media.php @@ -391,6 +391,7 @@ function media_contentcheck($file,$mime){ function media_notify($id,$file,$mime){ global $lang; global $conf; + global $INFO; if(empty($conf['notify'])) return; //notify enabled? $ip = clientIP(); @@ -729,6 +730,7 @@ function media_nstree($ns){ // currently selected namespace $ns = cleanID($ns); if(empty($ns)){ + global $ID; $ns = dirname(str_replace(':','/',$ID)); if($ns == '.') $ns =''; } diff --git a/inc/pageutils.php b/inc/pageutils.php index 969a6ea0d..42a485bdf 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -96,7 +96,6 @@ function getID($param='id',$clean=true){ */ function cleanID($raw_id,$ascii=false,$media=false){ global $conf; - global $lang; static $sepcharpat = null; global $cache_cleanid; diff --git a/inc/search.php b/inc/search.php index ea8897662..8273eef8c 100644 --- a/inc/search.php +++ b/inc/search.php @@ -322,6 +322,7 @@ function search_backlinks(&$data,$base,$file,$type,$lvl,$opts){ $instructions = p_cached_instructions($base.$file,true); if(is_null($instructions)) return false; + global $conf; //check all links for match foreach($instructions as $ins){ if($ins[0] == 'internallink' || ($conf['camelcase'] && $ins[0] == 'camelcaselink') ){ @@ -595,7 +596,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){ if(!$opts['listfiles']) return $return; if(!$opts['skipacl'] && $item['perm'] < AUTH_READ) return $return; if($opts['pagesonly'] && (substr($file,-4) != '.txt')) return $return; - if(!$conf['showhidden'] && isHiddenPage($id)) return $return; + if(!$opts['showhidden'] && isHiddenPage($item['id'])) return $return; if($opts['filematch'] && !preg_match('/'.$opts['filematch'].'/',$file)) return $return; if($opts['idmatch'] && !preg_match('/'.$opts['idmatch'].'/',$item['id'])) return $return; } diff --git a/inc/template.php b/inc/template.php index f7c104cdb..4eed30591 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1169,7 +1169,7 @@ function tpl_actiondropdown($empty='',$button='>'){ global $lang; global $auth; - echo '
'; #FIXME action + echo ''; echo ''; if($REV) echo ''; echo ''; diff --git a/inc/toolbar.php b/inc/toolbar.php index a07bfb93d..8bcf6f030 100644 --- a/inc/toolbar.php +++ b/inc/toolbar.php @@ -16,8 +16,6 @@ if(!defined('DOKU_INC')) die('meh.'); * @author Andreas Gohr */ function toolbar_JSdefines($varname){ - global $ID; - global $conf; global $lang; $menu = array(); diff --git a/lib/plugins/plugin/classes/ap_info.class.php b/lib/plugins/plugin/classes/ap_info.class.php index cebbf090a..44926c035 100644 --- a/lib/plugins/plugin/classes/ap_info.class.php +++ b/lib/plugins/plugin/classes/ap_info.class.php @@ -15,7 +15,7 @@ class ap_info extends ap_manage { foreach ($component_list as $component) { - if ($obj = & plugin_load($component['type'],$component['name'],false,true) === NULL) continue; + if (($obj = &plugin_load($component['type'],$component['name'],false,true)) === NULL) continue; $compname = explode('_',$component['name']); if($compname[1]){ diff --git a/lib/plugins/plugin/classes/ap_manage.class.php b/lib/plugins/plugin/classes/ap_manage.class.php index eb5348672..656b4762b 100644 --- a/lib/plugins/plugin/classes/ap_manage.class.php +++ b/lib/plugins/plugin/classes/ap_manage.class.php @@ -120,6 +120,7 @@ class ap_manage { @touch(reset($config_cascade['main']['local'])); // update latest plugin date - FIXME + global $ID; send_redirect(wl($ID,array('do'=>'admin','page'=>'plugin'),true)); } diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php index 1a327ca8a..8a2cd5553 100644 --- a/lib/plugins/revert/admin.php +++ b/lib/plugins/revert/admin.php @@ -126,6 +126,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { */ function _list($filter){ global $conf; + global $lang; echo '

'; echo '
'; echo ''; diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 95b1ab69e..dcd692f42 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -1,5 +1,5 @@ /** - * JavaScript functionalitiy for the media management popup + * JavaScript functionality for the media management popup * * @author Andreas Gohr */ -- cgit v1.2.3