diff options
author | Alex Auvolat <alex@adnab.me> | 2017-01-18 19:12:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-01-18 19:12:01 +0100 |
commit | cb727d392892ba2b6199a918f320dc6423d74d4c (patch) | |
tree | 8f451bfa89c1d85c404e2f16be37705c89eb2fb6 /lib/notes/view.php | |
parent | 77048675abf5fad43e8b5371c35e1c86b3be59c2 (diff) | |
download | Bits-cb727d392892ba2b6199a918f320dc6423d74d4c.tar.gz Bits-cb727d392892ba2b6199a918f320dc6423d74d4c.zip |
Start update to PDO instead of old mysql_ functions
Diffstat (limited to 'lib/notes/view.php')
-rw-r--r-- | lib/notes/view.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/notes/view.php b/lib/notes/view.php index a6a014c..d29732d 100644 --- a/lib/notes/view.php +++ b/lib/notes/view.php @@ -3,12 +3,12 @@ assert_redir(count($args) == 3, 'notes'); $noteid = intval($args[2]); -$note = mysql_fetch_assoc(sql( +$note = sql( "SELECT na.id AS id, na.title AS title, na.text_html AS html, na.public AS public, na.owner AS owner, ". "nb.title AS parent_title, nb.id AS parent_id, account.login AS ownername FROM notes na ". "LEFT JOIN notes nb ON na.parent = nb.id LEFT JOIN account ON account.id = na.owner ". - "WHERE na.id = $noteid" -)); + "WHERE na.id = ?", $noteid +)->fetch(); assert_error($note && ($note['public'] != 0 || $note['owner'] == $user['id'] || $user['priv'] >= $priv_admin), "This note does not exist, or you are not allowed to see it."); |