From ae707279a1945e383c312cd648d288606a79e341 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 19 Oct 2013 17:43:04 +0000 Subject: remove all array_push (50% slower than []) + some changes missing for feature:2978 git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_comment.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/functions_comment.inc.php') diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php index 42ceb5cc3..9ea597672 100644 --- a/include/functions_comment.inc.php +++ b/include/functions_comment.inc.php @@ -93,7 +93,7 @@ function insert_user_comment( &$comm, $key, &$infos ) { if ($conf['comments_author_mandatory']) { - array_push($infos, l10n('Username is mandatory') ); + $infos[] = l10n('Username is mandatory'); $comment_action='reject'; } $comm['author'] = 'guest'; @@ -110,7 +110,7 @@ SELECT COUNT(*) AS user_exists $row = pwg_db_fetch_assoc( pwg_query( $query ) ); if ( $row['user_exists'] == 1 ) { - array_push($infos, l10n('This login is already used by another user') ); + $infos[] = l10n('This login is already used by another user'); $comment_action='reject'; } } @@ -141,7 +141,7 @@ SELECT COUNT(*) AS user_exists } if (!url_check_format($comm['website_url'])) { - array_push($infos, l10n('Your website URL is invalid')); + $infos[] = l10n('Your website URL is invalid'); $comment_action='reject'; } } @@ -155,13 +155,13 @@ SELECT COUNT(*) AS user_exists } else if ($conf['comments_email_mandatory']) { - array_push($infos, l10n('Email address is missing. Please specify an email address.') ); + $infos[] = l10n('Email address is missing. Please specify an email address.'); $comment_action='reject'; } } else if (!email_check_format($comm['email'])) { - array_push($infos, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)')); + $infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'); $comment_action='reject'; } @@ -192,7 +192,7 @@ SELECT count(1) FROM '.COMMENTS_TABLE.' list($counter) = pwg_db_fetch_row(pwg_query($query)); if ( $counter > 0 ) { - array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') ); + $infos[] = l10n('Anti-flood system : please wait for a moment before trying to post another comment'); $comment_action='reject'; } } -- cgit v1.2.3