Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed $errors array that wasn't being initialized in various files.

  • Loading branch information...
commit f5ecb8acb63a94339ab0e30017187654e82fb087 1 parent fb8d6fc
@dietrichm dietrichm authored
View
1  Changelog.txt
@@ -11,6 +11,7 @@ UseBB 0.3 Changelog
- Fixed bug 935564: Notice: Array to string conversion in common.php (PHP < 4.3.0).
- Fixed bug 935924: Session ID's are passed twice on some PHP config (+ revised once).
- Fixed htmlentities() problem in user signatures.
+- Fixed $errors array that wasn't being initialized in various files.
- Optimalizations in template.php, debug also works without </body> tag and more
powerful and better output compression method.
- Better and safer BBCode parser, new [mailto] tag and URL's don't need to have [url]
View
3  mail.php
@@ -127,6 +127,7 @@
//
// Some fields have not been filled in,
//
+ $errors = array();
if ( empty($_POST['subject']) )
$errors[] = strtolower($lang['Subject']);
if ( empty($_POST['body']) )
@@ -135,7 +136,7 @@
//
// Show an error message
//
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
View
3  sources/panel_editpwd.php
@@ -67,6 +67,7 @@
//
// Define missing fields
//
+ $errors = array();
if ( md5($_POST['current_passwd']) != $session->sess_info['user_info']['passwd'] )
$errors[] = strtolower($lang['CurrentPassword']);
if ( strlen($_POST['new_passwd1']) < 5 || !preg_match(PWD_PREG, $_POST['new_passwd1']) || $_POST['new_passwd1'] != $_POST['new_passwd2'] )
@@ -75,7 +76,7 @@
//
// Show an error message
//
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
View
3  sources/panel_login.php
@@ -149,12 +149,13 @@
if ( !empty($_POST['submitted']) ) {
+ $errors = array();
if ( !preg_match(USER_PREG, $_POST['user']) )
$errors[] = strtolower($lang['Username']);
if ( !preg_match(PWD_PREG, $_POST['passwd']) || strlen($_POST['passwd']) < 5 )
$errors[] = strtolower($lang['Password']);
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
View
3  sources/panel_sendpwd.php
@@ -136,12 +136,13 @@
if ( !empty($_POST['submitted']) ) {
+ $errors = array();
if ( !preg_match(USER_PREG, $_POST['user']) )
$errors[] = strtolower($lang['Username']);
if ( !preg_match(EMAIL_PREG, $_POST['email']) )
$errors[] = strtolower($lang['Email']);
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
View
3  sources/post_reply.php
@@ -153,12 +153,13 @@
} else {
+ $errors = array();
if ( !$session->sess_info['user_id'] && ( empty($_POST['user']) || !preg_match(USER_PREG, $_POST['user']) ) )
$errors[] = strtolower($lang['Username']);
if ( empty($_POST['content']) )
$errors[] = strtolower($lang['Content']);
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
View
3  sources/post_topic.php
@@ -138,6 +138,7 @@
} else {
+ $errors = array();
if ( !$session->sess_info['user_id'] && ( empty($_POST['user']) || !preg_match(USER_PREG, $_POST['user']) ) )
$errors[] = strtolower($lang['Username']);
if ( empty($_POST['subject']) )
@@ -145,7 +146,7 @@
if ( empty($_POST['content']) )
$errors[] = strtolower($lang['Content']);
- if ( is_array($errors) ) {
+ if ( count($errors) ) {
$template->parse('msgbox', array(
'box_title' => $lang['Error'],
Please sign in to comment.
Something went wrong with that request. Please try again.