Cytat
Warning: Undefined array key "pozdrowienie" in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 42
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 42
Warning: Undefined variable $error in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 49
Fatal error: Uncaught Error: Undefined constant "send" in /home/p557631/public_html/engine/modules/pozdro/dotp.php:78 Stack trace: #0 /home/p557631/public_html/engine/cache/system/plugins/c2e2f04059af1dae22e2bb3361382e08.php(58): include() #1 /home/p557631/public_html/engine/init.php(1059): include_once('/home/p557631/p...') #2 /home/p557631/public_html/index.php(25): require_once('/home/p557631/p...') #3 {main} thrown in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 78
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 42
Warning: Undefined variable $error in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 49
Fatal error: Uncaught Error: Undefined constant "send" in /home/p557631/public_html/engine/modules/pozdro/dotp.php:78 Stack trace: #0 /home/p557631/public_html/engine/cache/system/plugins/c2e2f04059af1dae22e2bb3361382e08.php(58): include() #1 /home/p557631/public_html/engine/init.php(1059): include_once('/home/p557631/p...') #2 /home/p557631/public_html/index.php(25): require_once('/home/p557631/p...') #3 {main} thrown in /home/p557631/public_html/engine/modules/pozdro/dotp.php on line 78
całyt kod tego pliku to:
<?php { } require_once (ENGINE_DIR . '/modules/pozdro/data/pozdro_config.php'); require_once (ENGINE_DIR . '/modules/pozdro/language/admin.lng'); $active = $pozdro_config['online']; function clickable_links($text) { $ret = ' ' . $text; $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); // Remove our padding.. return $ret; } // Początek if ( $active == "yes") { $description = "<center>{$pozdro_config['title']}</center>"; } if($is_logged) { { { $error.= "<br /><div style='padding: 5px;background: #dadada;color: #000;border-left: #f00 35px solid;height: 34px;'><i class='fa fa-warning' style='color: #c3c3c3;margin-left: -35px;float: left;font-size: 25px;'></i><span style='position: relative;float: left;'>{$langs1['error_4']}</span></div><br />"; }elseif($tresc == "") { $error.= "<br /><div style='padding: 5px;background: #dadada;color: #000;border-left: #f00 35px solid;height: 34px;'><i class='fa fa-warning' style='color: #c3c3c3;margin-left: -35px;float: left;font-size: 25px;'></i><span style='position: relative;float: left;'>{$langs1['error_3']}</span></div><br />"; } if($error == "") { $qq = "INSERT INTO `dle_pozdro` (`id` ,`pozdro` ,`userid` ,`date`,`approve`)VALUES (NULL, '$tresc', '$member_id[user_id]', '$thistime', '0');"; $db->query($qq); $error.= "<br /><div style='padding: 5px;background: #dadada;color: #000;border-left: #0aae00 35px solid;height: 34px;'><i class='fa fa-check' style='color: #c3c3c3;margin-left: -34px;float: left;font-size: 25px;'></i><span style='position: relative;float: left;'>{$langs1['error_2']}</span></div><br />"; $error.= "<a href='java script:history.back()' style='text-decoration: none;'><div style='padding: 5px;background: #0aae00;width: 100px;text-align: center;color: #ffffff;float: right;'><i class='fa fa-reply' style='padding-right: 5px;'></i>{$langs1['back']}</div></a>"; } else { $error.= "<div style='padding: 5px;background: #dadada;color: #000;border-left: #ff6300 35px solid;height: 34px;'><i class='fa fa-exclamation' style='color: #c3c3c3;margin-left: -28px;float: left;font-size: 25px;'></i><span style='position: relative;float: left;'>{$langs1['error_1']}</span></div><br />"; $error.= "<a href='java script:history.back()' style='text-decoration: none;'><div style='padding: 5px;background: #0aae00;width: 100px;text-align: center;color: #ffffff;float: right;'><i class='fa fa-reply' style='padding-right: 5px;'></i>{$langs1['back']}</div></a>"; } } } else { $echo = "{$langs1['error_5']}"; } if ( $active == "yes") { { $echo.="<center><title>{$pozdro_config['title']}</title></center>"; $echo.="<center><B>{$pozdro_config['desc']}</B><br><br>"; $echo.="<form action=\"\" method=\"POST\">"; $echo.="Wpisz pozdrownienie (maksymalnie {$pozdro_config['limit_pozdro']} znaków) :<br /><br />"; $echo.="<textarea name=\"pozdrowienie\" cols=\"40\" rows=\"10\"></textarea><br /><br />"; $echo.="<input type=\"submit\" class=\"bbcodes\" name=\"send\" value=\"{$langs1['send']}\">"; $echo.="</form></center>"; }else{ $echo = $error; } } else{ $echo = "<div style='padding: 5px;background: #dadada;color: #000;border-left: #f00 35px solid;height: 34px;'><i class='fa fa-warning' style='color: #c3c3c3;margin-left: -35px;float: left;font-size: 25px;'></i><span style='position: relative;float: left;'>{$langs1['status_offline']}</span></div><br />"; } // Koniec $tpl->load_template('static.tpl'); $tpl->set('{description}', $description); $tpl->set('{static}', $echo); $tpl->set('{pages}', ''); $tpl->set_block( "'\\[print-link\\](.*?)\\[/print-link\\]'si", "" ); $tpl->compile('content'); $tpl->clear(); ?>
Wiem że problem jest z kodami:
1: $tresc = clickable_links(strip_tags($_POST['pozdrowienie']));
2: if(strlen($tresc) > $pozdro_config['limit_pozdro'])
3: if(!isset($_POST[send]))
Więcej błędów nie wychwyciłem. Próbowałem w/w kody przerobić na np: $tresc = clickable_links(strip_tags($_POST['pozdrowienie'], ? ? )); (bez spacji między "?")
ale wtedy "błędy" znikały i pokazywała się cała biała strona.
Niestety nie znam się aż tak dobrze na PHP dlatego byłbym wdzięczny za przystosowanie w/w skryptu pod PHP 8.1 (+) wraz z dopisanymi komentarzami co zostało zmienione aby na przyszłość mógł sam rozwiązać takie problemy
