- remove warn on unset variable

- insert_user_comment expects now the comment content to be sql safe (works now exactly as update_user_comment)

git-svn-id: http://piwigo.org/svn/trunk@3488 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2009-07-01 20:56:41 +00:00
parent ae6ab9966b
commit 4fa8d36ed5
3 changed files with 41 additions and 39 deletions
+6 -6
View File
@@ -46,8 +46,8 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
}
$comm = array(
'author' => trim( stripslashes(@$_POST['author']) ),
'content' => trim( stripslashes($_POST['content']) ),
'author' => trim(@$_POST['author']),
'content' => trim($_POST['content']),
'image_id' => $page['image_id'],
);
@@ -121,8 +121,8 @@ SELECT COUNT(*) AS nb_comments
if ( !is_admin() )
{
$validated_clause = ' AND validated = \'true\'';
}
else
}
else
{
$validated_clause = '';
}
@@ -142,7 +142,7 @@ $validated_clause.'
while ($row = mysql_fetch_array($result))
{
if (!empty($row['author']))
if (!empty($row['author']))
{
$author = $row['author'];
if ($author == 'guest')
@@ -195,7 +195,7 @@ $validated_clause.'
{
if ($row['validated'] != 'true')
{
$tpl_comment['U_VALIDATE'] =
$tpl_comment['U_VALIDATE'] =
add_url_params($url_self,
array('action' => 'validate_comment',
'comment_to_validate' => $row['id']