diff --git a/chat.php b/chat.php
index 7f5d8ea..c8c3356 100644
--- a/chat.php
+++ b/chat.php
@@ -91,7 +91,7 @@ function route(){
check_session();
if($_REQUEST['what']==='all'){
if(isset($_REQUEST['confirm'])){
- del_all_messages($U['nickname'], $U['status']==1 ? $U['entry'] : 0);
+ del_all_messages($U['nickname'], (int) ($U['status']==1 ? $U['entry'] : 0));
}else{
send_del_confirm();
}
@@ -153,17 +153,18 @@ function route(){
}
}
-function route_admin(){
+function route_admin() : string {
global $U, $db;
if($U['status']<5){
send_access_denied();
}
if(!isset($_REQUEST['do'])){
+ return '';
}elseif($_REQUEST['do']==='clean'){
if($_REQUEST['what']==='choose'){
send_choose_messages();
}elseif($_REQUEST['what']==='selected'){
- clean_selected($U['status'], $U['nickname']);
+ clean_selected((int) $U['status'], $U['nickname']);
}elseif($_REQUEST['what']==='room'){
clean_room();
}elseif($_REQUEST['what']==='nick'){
@@ -218,6 +219,7 @@ function route_admin(){
}elseif($_REQUEST['do']==='passreset'){
return passreset($_REQUEST['name'], $_REQUEST['pass']);
}
+ return '';
}
function route_setup(){
@@ -251,7 +253,7 @@ function route_setup(){
}
// html output subs
-function prepare_stylesheets($init = false){
+function prepare_stylesheets(bool $init = false){
global $U, $db, $styles;
$styles['fatal_error'] = 'body{background-color:#000000;color:#FF0033}';
$styles['default'] = 'body,frame{background-color:#000000;color:#FFFFFF;font-size:14px;text-align:center} ';
@@ -290,7 +292,7 @@ function prepare_stylesheets($init = false){
$styles['custom'] = preg_replace("/(\r?\n|\r\n?)/u", '', "body,frame{background-color:#$colbg;color:#$coltxt} $css");
}
-function print_stylesheet($init = false){
+function print_stylesheet(bool $init = false){
global $styles;
//default css
echo "";
@@ -306,15 +308,15 @@ function print_end(){
exit;
}
-function credit(){
+function credit() : string {
return '
LE CHAT-PHP - ' . VERSION . '';
}
-function meta_html(){
+function meta_html() : string {
return '';
}
-function form($action, $do=''){
+function form(string $action, string $do='') : string {
global $language;
$form="
$I[admmembers] | ";
echo form('admin', 'status');
- echo " |
|
---|
|