From 798eadcebb185d72e36aac734579253c74ba6900 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Sun, 14 May 2023 11:37:10 -0700 Subject: [PATCH] Clean up some warnings. --- Rocksolid_Light/common/config.inc.php | 4 +++- Rocksolid_Light/common/header.php | 22 +++++++++---------- Rocksolid_Light/rocksolid/article-flat.php | 3 +++ Rocksolid_Light/rocksolid/check.php | 6 ----- Rocksolid_Light/rocksolid/config.inc.php | 6 ----- Rocksolid_Light/rocksolid/lib/message.inc.php | 10 +++++++-- Rocksolid_Light/rocksolid/lib/thread.inc.php | 7 +++--- Rocksolid_Light/rocksolid/newsportal.php | 18 ++++++++++----- Rocksolid_Light/rocksolid/overboard.php | 2 +- Rocksolid_Light/rocksolid/thread.php | 4 +++- Rocksolid_Light/spoolnews/files.php | 8 +------ Rocksolid_Light/spoolnews/upload.php | 13 ++++++----- Rocksolid_Light/version.txt | 2 +- 13 files changed, 53 insertions(+), 52 deletions(-) delete mode 100644 Rocksolid_Light/rocksolid/check.php diff --git a/Rocksolid_Light/common/config.inc.php b/Rocksolid_Light/common/config.inc.php index 98e6dbc..2bb316d 100644 --- a/Rocksolid_Light/common/config.inc.php +++ b/Rocksolid_Light/common/config.inc.php @@ -15,5 +15,7 @@ if(isset($config_name) && file_exists($config_dir.$config_name.'.inc.php')) { /* Include main config file for rslight */ $CONFIG = include $config_file; -ini_set('error_reporting', E_ERROR ); +if(!file_exists($config_dir.'/DEBUG')) { + ini_set('error_reporting', E_ERROR ); +} ?> diff --git a/Rocksolid_Light/common/header.php b/Rocksolid_Light/common/header.php index 057a2a4..929e876 100644 --- a/Rocksolid_Light/common/header.php +++ b/Rocksolid_Light/common/header.php @@ -1,7 +1,6 @@ '; } else { echo ''; } -if (file_exists($rootdir.'common/themes/'.$_SESSION['theme'].'/images/rocksolidlight.png')) { +if ((isset($_SESSION['theme'])) && file_exists($rootdir.'common/themes/'.$_SESSION['theme'].'/images/rocksolidlight.png')) { $header_image=$rootdir.'common/themes/'.$_SESSION['theme'].'/images/rocksolidlight.png'; } else { $header_image=$rootdir.'common/images/rocksolidlight.png'; @@ -61,7 +61,7 @@ if (file_exists($rootdir.'common/themes/'.$_SESSION['theme'].'/images/rocksolidl '; echo ''; foreach($menulist as $menu) { diff --git a/Rocksolid_Light/rocksolid/article-flat.php b/Rocksolid_Light/rocksolid/article-flat.php index 24a1662..0a1d8fe 100644 --- a/Rocksolid_Light/rocksolid/article-flat.php +++ b/Rocksolid_Light/rocksolid/article-flat.php @@ -61,6 +61,9 @@ $_SESSION['rsactive'] = true; + if(!isset($_SERVER['REQUEST_STRING'])) { + $_SERVER['REQUEST_STRING'] = ''; + } $location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING']; $_SESSION['return_page'] = $location.'#'.$id; diff --git a/Rocksolid_Light/rocksolid/check.php b/Rocksolid_Light/rocksolid/check.php deleted file mode 100644 index fbbc7c0..0000000 --- a/Rocksolid_Light/rocksolid/check.php +++ /dev/null @@ -1,6 +0,0 @@ -$iconv_enable=false - in config.inc.php to disable automatic charset recoding.'); -?> \ No newline at end of file diff --git a/Rocksolid_Light/rocksolid/config.inc.php b/Rocksolid_Light/rocksolid/config.inc.php index 081deb2..60bfa93 100644 --- a/Rocksolid_Light/rocksolid/config.inc.php +++ b/Rocksolid_Light/rocksolid/config.inc.php @@ -29,9 +29,6 @@ $CONFIG = include($config_file); $logdir=$spooldir.'/log'; $lockdir=$spooldir.'/lock'; -if(!file_exists($config_dir.'/debug')) { - ini_set('error_reporting', E_ERROR ); -} /* Permanent configuration changes */ @mkdir($logdir,0755,'recursive'); @mkdir($spooldir.'/upload',0755,'recursive'); @@ -233,9 +230,6 @@ if((isset($group)) && (isset($group_config))) { } } -// check the settings -include "lib/check.php"; - // load the english language definitions first because some of the other // definitions are incomplete include("lang/english.lang"); diff --git a/Rocksolid_Light/rocksolid/lib/message.inc.php b/Rocksolid_Light/rocksolid/lib/message.inc.php index dc1aacd..3ac412b 100644 --- a/Rocksolid_Light/rocksolid/lib/message.inc.php +++ b/Rocksolid_Light/rocksolid/lib/message.inc.php @@ -489,7 +489,9 @@ function display_full_headers($article,$group,$name,$from,$getface=false) { } $message=file($thisgroup."/".$article, FILE_IGNORE_NEW_LINES); } - unlink($sendface); + if(isset($sendface)) { + unlink($sendface); + } $isface = 0; foreach($message as $line) { if(trim($line) == '') { @@ -511,6 +513,7 @@ function display_full_headers($article,$group,$name,$from,$getface=false) { if(stripos($line, 'Xref: ') === 0) { continue; } + $return = ''; if(stripos($line, 'From: ') === 0) { $return.='From: '; if(isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) { @@ -527,7 +530,7 @@ function display_full_headers($article,$group,$name,$from,$getface=false) { $return.=mb_decode_mimeheader(htmlspecialchars($line)).'
'; } if($getface) { - if($sendface) { + if(isset($sendface)) { return($sendface); } else { return FALSE; @@ -610,6 +613,9 @@ function message_show($group,$id,$attachment=0,$article_data=false,$maxlen=false $article_data=message_read($id,$attachment,$group); $head=$article_data->header; $local_poster=false; + if(!isset($head->rslight_site)) { + $head->rslight_site = ''; + } if(password_verify($CONFIG['thissitekey'].$head->id, $head->rslight_site)) { $local_poster=true; } diff --git a/Rocksolid_Light/rocksolid/lib/thread.inc.php b/Rocksolid_Light/rocksolid/lib/thread.inc.php index fbcdaad..ae7ca29 100644 --- a/Rocksolid_Light/rocksolid/lib/thread.inc.php +++ b/Rocksolid_Light/rocksolid/lib/thread.inc.php @@ -68,6 +68,7 @@ function thread_pageselect($group,$article_count,$first) { function thread_cache_load($group) { global $spooldir,$compress_spoolfiles; $filename=$spooldir."/".$group."-data.dat"; + $waiting = 0; $now = time(); while(file_exists($filename."-writing")) { $waiting = 1; @@ -686,7 +687,7 @@ function formatTreeText($tree) { * format the subject inside the thread */ function thread_format_subject($c,$group,$highlightids=false) { - global $file_article, $thread_maxSubject, $frame_article, $thread_show, $spooldir, $CONFIG; + global $file_article, $thread_maxSubject, $frame_article, $frame, $thread_show, $spooldir, $CONFIG; if(isset($_COOKIE['tzo'])) { $offset=$_COOKIE['tzo']; } else { @@ -849,9 +850,9 @@ function thread_format_lastmessage($c,$group='') { } if($ovfound == 1) { $url = 'article-flat.php?id='.$found['number'].'&group='.urlencode($group).'#'.$found['number']; - $return.='

'.get_date_interval(date("D, j M Y H:i T",$c->date_thread)).''; + $return='

'.get_date_interval(date("D, j M Y H:i T",$c->date_thread)).''; } else { - $return.='

'.get_date_interval(date("D, j M Y H:i T",$c->date_thread)).'

'; + $return='

'.get_date_interval(date("D, j M Y H:i T",$c->date_thread)).'

'; } $return.='

By: '.create_name_link($poster_name, $name_from).'

'; return($return); diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index abffa44..7d3e4fc 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -683,12 +683,14 @@ function groups_show($gruppen) { $groupdisplay.=create_name_link(mb_decode_mimeheader($lastarticleinfo['name']), $lastarticleinfo['from']); $groupdisplay.='
'; } - $groupdisplay.="\n"; - flush(); - if(isset($userdata[$g->name])) { - $subs[] = $groupdisplay; - } else { - $nonsubs[] = $groupdisplay; + if(isset($groupdisplay)) { + $groupdisplay.="\n"; + flush(); + if(isset($userdata[$g->name])) { + $subs[] = $groupdisplay; + } else { + $nonsubs[] = $groupdisplay; + } } } // END foreach($subs as $sub) { @@ -1090,6 +1092,10 @@ function group_display_name($gname) function check_bbs_auth($username, $password) { global $config_dir,$CONFIG; + if($username == '' && $password == '') { + return false; + } + $workpath = $config_dir."users/"; $username = trim(strtolower($username)); $userFilename = $workpath.$username; diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php index cae9d4f..6927772 100755 --- a/Rocksolid_Light/rocksolid/overboard.php +++ b/Rocksolid_Light/rocksolid/overboard.php @@ -322,7 +322,7 @@ function display_threads($threads, $oldest) { } function show_overboard_header($grouplist) { - global $text_thread, $text_article, $file_index, $file_thread, $user_time; + global $text_thread, $frame, $text_article, $file_index, $file_thread, $user_time; if (isset($_GET['thisgroup'])) { echo '

'; diff --git a/Rocksolid_Light/rocksolid/thread.php b/Rocksolid_Light/rocksolid/thread.php index a407a87..74fba6f 100644 --- a/Rocksolid_Light/rocksolid/thread.php +++ b/Rocksolid_Light/rocksolid/thread.php @@ -66,7 +66,9 @@ if(isset($frames_on) && $frames_on === true) { $userdata[$group] = time(); file_put_contents($userfile, serialize($userdata)); } - + if(!isset($_SERVER['REQUEST_STRING'])) { + $_SERVER['REQUEST_STRING'] = ''; + } $_SESSION['return_page'] = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING']; echo ''; diff --git a/Rocksolid_Light/spoolnews/files.php b/Rocksolid_Light/spoolnews/files.php index 7e51f21..7d0bd47 100644 --- a/Rocksolid_Light/spoolnews/files.php +++ b/Rocksolid_Light/spoolnews/files.php @@ -11,7 +11,7 @@ include "newsportal.php"; $offset=$CONFIG['timezone']; } - if($_REQUEST['command'] == 'Show' && password_verify($CONFIG['thissitekey'], $_REQUEST['key'])) { + if((isset($_REQUEST['command']) && $_REQUEST['command'] == 'Show') && password_verify($CONFIG['thissitekey'], $_REQUEST['key'])) { $getfilename = $spooldir.'/upload/'.$_REQUEST['showfile']; $getfh = fopen($getfilename, "rb"); $getfile = fread($getfh, filesize($getfilename)); @@ -30,8 +30,6 @@ include "head.inc"; echo ''; echo '
'; echo ''; - echo ''; - echo ''; echo ''; echo '
'; echo ''; @@ -39,8 +37,6 @@ include "head.inc"; echo ''; echo '
'; echo ''; - echo ''; - echo ''; echo ''; echo '
'; echo ''; @@ -67,8 +63,6 @@ include "head.inc"; echo '
'; echo ''; echo ''; - echo ''; - echo ''; echo ''; - echo ''; - echo ''; echo ''; echo '
'; echo ''; @@ -34,15 +32,13 @@ include "head.inc"; echo ''; echo '
'; echo ''; - echo ''; - echo ''; echo ''; echo '
'; echo ''; echo ''; echo '
'; -if(isset($_FILES)) { +if(isset($_FILES['photo'])) { $_FILES['photo']['name'] = preg_replace('/[^a-zA-Z0-9\.]/', '_', $_FILES['photo']['name']); // Check auth here if(isset($_POST['key']) && password_verify($CONFIG['thissitekey'].$_POST['username'], $_POST['key'])) { @@ -63,7 +59,6 @@ if(isset($_FILES)) { echo 'There was an error saving '.$_FILES['photo']['name']; } } - $authkey = password_hash($_POST['username'].$keys[0].get_user_config($_POST['username'],'encryptionkey'), PASSWORD_DEFAULT); ?>