minor bugfix and boring error removal

darcs-hash:20060923203609-9b6ab-ecca679faa254a29772868508050fcf3206b0814.gz
This commit is contained in:
chris 2006-09-23 22:36:09 +02:00
parent a424cd8e52
commit bb4866bd74
10 changed files with 24 additions and 21 deletions

View File

@ -94,7 +94,7 @@ function act_dispatch(){
//handle admin tasks
if($ACT == 'admin'){
// retrieve admin plugin name from $_REQUEST['page']
if ($_REQUEST['page']) {
if (!empty($_REQUEST['page'])) {
$pluginlist = plugin_list('admin');
if (in_array($_REQUEST['page'], $pluginlist)) {
// attempt to load the plugin

View File

@ -543,7 +543,7 @@ function updateprofile() {
global $lang;
global $auth;
if(!$_POST['save']) return false;
if(empty($_POST['save'])) return false;
// should not be able to get here without Profile being possible...
if(!$auth->canDo('Profile')) {

View File

@ -181,6 +181,7 @@ class cache_parser extends cache {
}
function _addDependencies() {
global $conf;
$this->depends['age'] = isset($this->depends['age']) ?
min($this->depends['age'],$conf['cachetime']) : $conf['cachetime'];

View File

@ -103,8 +103,9 @@ function pageinfo(){
if($REV){
$revinfo = getRevisionInfo($ID, $REV, 1024);
}else{
$revinfo = $info['meta']['last_change'];
$revinfo = isset($info['meta']['last_change']) ? $info['meta']['last_change'] : getRevisionInfo($ID,$info['lastmod'],1024);
}
$info['ip'] = $revinfo['ip'];
$info['user'] = $revinfo['user'];
$info['sum'] = $revinfo['sum'];
@ -455,9 +456,9 @@ function checkwordblock(){
function clientIP($single=false){
$ip = array();
$ip[] = $_SERVER['REMOTE_ADDR'];
if($_SERVER['HTTP_X_FORWARDED_FOR'])
if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$ip = array_merge($ip,explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']));
if($_SERVER['HTTP_X_REAL_IP'])
if(!empty($_SERVER['HTTP_X_REAL_IP']))
$ip = array_merge($ip,explode(',',$_SERVER['HTTP_X_REAL_IP']));
// remove any non-IP stuff

View File

@ -1076,7 +1076,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed?
<div style="width:99%;">
<div class="toolbar">
<div id="draft__status"><?php if($INFO['draft']) echo $lang['draftdate'].' '.date($conf['dformat']);?></div>
<div id="draft__status"><?php if(!empty($INFO['draft'])) echo $lang['draftdate'].' '.date($conf['dformat']);?></div>
<div id="tool__bar"><?php if(!$ro){?><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
target="_blank"><?php echo $lang['mediaselect'] ?></a><?php }?></div>
@ -1143,7 +1143,7 @@ function html_minoredit(){
$p['id'] = 'minoredit';
$p['tabindex'] = 3;
$p['value'] = '1';
if($_REQUEST['minor']) $p['checked']='checked';
if(!empty($_REQUEST['minor'])) $p['checked']='checked';
$att = buildAttributes($p);
print '<span class="nowrap">';

View File

@ -133,9 +133,9 @@ function init_paths(){
'lockdir' => 'locks');
foreach($paths as $c => $p){
if(!$conf[$c]) $conf[$c] = $conf['savedir'].'/'.$p;
$conf[$c] = init_path($conf[$c]);
if(!$conf[$c]) nice_die("The $c does not exist, isn't accessable or writable.
if(empty($conf[$c])) $conf[$c] = $conf['savedir'].'/'.$p;
$conf[$c] = init_path($conf[$c]);
if(empty($conf[$c])) nice_die("The $c does not exist, isn't accessable or writable.
You should check your config and permission settings.
Or maybe you want to <a href=\"install.php\">run the
installer</a>?");

View File

@ -199,7 +199,7 @@ function io_saveFile($file,$content,$append=false){
fclose($fh);
}
if(!$fileexists and $conf['fperm']) chmod($file, $conf['fperm']);
if(!$fileexists and !empty($conf['fperm'])) chmod($file, $conf['fperm']);
io_unlock($file);
return true;
}
@ -291,7 +291,7 @@ function io_lock($file){
if ((time() - $timeStart) > 3) break;
$locked = @mkdir($lockDir, $conf['dmode']);
if($locked){
if($conf['dperm']) chmod($lockDir, $conf['dperm']);
if(!empty($conf['dperm'])) chmod($lockDir, $conf['dperm']);
break;
}
usleep(50);

View File

@ -915,11 +915,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$ret = '';
$ret .= $link['pre'];
$ret .= '<a href="'.$link['url'].'"';
if($link['class']) $ret .= ' class="'.$link['class'].'"';
if($link['target']) $ret .= ' target="'.$link['target'].'"';
if($link['title']) $ret .= ' title="'.$link['title'].'"';
if($link['style']) $ret .= ' style="'.$link['style'].'"';
if($link['more']) $ret .= ' '.$link['more'];
if(!empty($link['class'])) $ret .= ' class="'.$link['class'].'"';
if(!empty($link['target'])) $ret .= ' target="'.$link['target'].'"';
if(!empty($link['title'])) $ret .= ' title="'.$link['title'].'"';
if(!empty($link['style'])) $ret .= ' style="'.$link['style'].'"';
if(!empty($link['more'])) $ret .= ' '.$link['more'];
$ret .= '>';
$ret .= $link['name'];
$ret .= '</a>';

View File

@ -139,7 +139,7 @@ function tpl_content_core(){
function tpl_admin(){
$plugin = NULL;
if ($_REQUEST['page']) {
if (!empty($_REQUEST['page'])) {
$pluginlist = plugin_list('admin');
if (in_array($_REQUEST['page'], $pluginlist)) {
@ -181,7 +181,7 @@ function tpl_metaheaders($alt=true){
$head['meta'][] = array( 'name'=>'generator', 'content'=>'DokuWiki '.getVersion() );
$head['link'][] = array( 'rel'=>'start', 'href'=>'DOKU_BASE' );
$head['link'][] = array( 'rel'=>'contents', 'href'=> wl($ID,'do=index',false,'&'),
'title'=>$lang['index'] );
'title'=>$lang['btn_index'] );
if($alt){
$head['link'][] = array( 'rel'=>'alternate', 'type'=>'application/rss+xml',
@ -223,7 +223,7 @@ function tpl_metaheaders($alt=true){
}
// keywords (explicit or implicit)
if($INFO['meta']['subject']){
if(!empty($INFO['meta']['subject'])){
$head['meta'][] = array( 'name'=>'keywords', 'content'=>join(',',$INFO['meta']['subject']));
}else{
$head['meta'][] = array( 'name'=>'keywords', 'content'=>str_replace(':',',',$ID));
@ -369,7 +369,7 @@ function tpl_button($type){
#most complicated type - we need to decide on current action
if($ACT == 'show' || $ACT == 'search'){
if($INFO['writable']){
if($INFO['draft']){
if(!empty($INFO['draft'])){
echo html_btn('draft',$ID,'e',array('do' => 'draft'),'post');
}else{
if($INFO['exists']){

View File

@ -255,6 +255,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
*/
function _htmlUserForm($cmd,$user='',$userdata=array(),$indent=0) {
global $conf;
global $ID;
$name = $mail = $groups = '';
$notes = array();