Uploaded image for project: 'Olio'
  1. Olio
  2. OLIO-16

update SQL statement always gets executed in events.php

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • php-app
    • None

    Description

      In events.php on line 87 there is a check:

      else if (isset($editCRforCid)) {
      ...
      }

      which is always true, because $editCRforCid is set just about this expression (it's set to two unset values .'ed together, but it's still set). This means that the SQL statement:

      "update COMMENTS_RATING set comments='$editcomments', ratings='$rating' where username='$username' and socialeventid='$se' and commentid='$cid'";

      will always execute (when someone's not adding a comment in which case the first part of the if would be true). It won't do anything because $cid isn't set so the SQL is actually invalid, but it will hurt performance.

      To fix simply change the else if to:

      else if (isset($_POST['editcommentsratingsubmit']) && isset($_POST['editingcid'])) {
      ...
      }

      and get rid of $editCRforCid all together

      Attachments

        Activity

          People

            akara Akara Sucharitakul
            nick1 Nick Lanham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified