[www-doc] [Git][VideoLAN.org/websites][master] Fix sql handling

Marvin Scholz gitlab at videolan.org
Wed Mar 22 08:23:11 CET 2017


Marvin Scholz pushed to branch master at VideoLAN organization / websites


Commits:
68ee69ab by Marvin Scholz at 2017-03-22T08:20:56+01:00
Fix sql handling

- - - - -


1 changed file:

- www.videolan.org/vlc/skins.php


Changes:

=====================================
www.videolan.org/vlc/skins.php
=====================================
--- a/www.videolan.org/vlc/skins.php
+++ b/www.videolan.org/vlc/skins.php
@@ -7,7 +7,7 @@ if( isset( $_POST["skin_id"] ) && isset( $_POST["rating"] ) )
 {
   if( $_COOKIE["skinrated_{$_POST["skin_id"]}"] != $_POST["skin_id"] )
   {
-    pg_query( "INSERT INTO \"skins-rating\" (\"skin_id\", \"rating\") VALUES ('{$_POST["skin_id"]}','{$_POST["rating"]}')" );
+    pg_query_params('INSERT INTO "skins-rating" ("skin_id", "rating") VALUES ($1, $2) = $1', array($_POST["skin_id"], $_POST["rating"]));
     setcookie( "skinrated_{$_POST["skin_id"]}", $_POST["skin_id"], time()+24*60*60, "/", ".videolan.org" );
     $_COOKIE["skinrated_{$_POST["skin_id"]}"] = $_POST["skin_id"];
   }



View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/commit/68ee69abf1f8dd5a750ab578ddf9c5fa9a426785


More information about the www-doc mailing list