Plugin Directory

Changeset 2180657


Ignore:
Timestamp:
10/26/2019 02:42:42 PM (6 years ago)
Author:
magent
Message:

Updated so that wpdb->prepare always has the expected number of arguments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vampire-character/trunk/inc/stnews.php

    r2056045 r2180657  
    136136        global $wpdb;
    137137       
     138        $args = array($postid);
    138139        $sql = "SELECT c.NAME as name, s.NAME as status, c.EMAIL as email
    139140                FROM
     
    147148        if ($status != "all") {
    148149            $sql .= " AND s.NAME = %s";
    149         }
    150         $sql = $wpdb->prepare($sql, $postid, $status);
     150            array_push($args, $status);
     151        }
     152        $sql = $wpdb->prepare($sql, $args);
    151153        //echo "<p>SQL: $sql</p>";
    152154        return $wpdb->get_results($sql);
Note: See TracChangeset for help on using the changeset viewer.