aboutsummaryrefslogtreecommitdiffhomepage
path: root/view.php
diff options
context:
space:
mode:
authornicosomb <nicolas@loeuillet.org>2013-04-15 09:58:34 +0200
committernicosomb <nicolas@loeuillet.org>2013-04-15 09:58:34 +0200
commit263d6c6756a2549100ae186042f157ff64944bfa (patch)
treedc7a9e874438584ab809393d88b41050b75cff34 /view.php
parent8046748b424f95a92ab599ecc973f57eb05246ce (diff)
downloadwallabag-263d6c6756a2549100ae186042f157ff64944bfa.tar.gz
wallabag-263d6c6756a2549100ae186042f157ff64944bfa.tar.zst
wallabag-263d6c6756a2549100ae186042f157ff64944bfa.zip
factorisation code
Diffstat (limited to 'view.php')
-rwxr-xr-xview.php17
1 files changed, 3 insertions, 14 deletions
diff --git a/view.php b/view.php
index 0ee8957b..dfc26b9d 100755
--- a/view.php
+++ b/view.php
@@ -10,22 +10,11 @@
10 10
11include dirname(__FILE__).'/inc/config.php'; 11include dirname(__FILE__).'/inc/config.php';
12 12
13if(isset($_GET['id']) && $_GET['id'] != '') { 13$id = (isset ($_GET['id'])) ? htmlspecialchars($_GET['id']) : '';
14 14
15 $sql = "SELECT * FROM entries WHERE id=?"; 15if(!empty($id)) {
16 $params = array(intval($_GET['id']));
17 16
18 # view article query 17 $entry = get_article($id);
19 try
20 {
21 $query = $db->getHandle()->prepare($sql);
22 $query->execute($params);
23 $entry = $query->fetchAll();
24 }
25 catch (Exception $e)
26 {
27 die('query error : '.$e->getMessage());
28 }
29 18
30 if ($entry != NULL) { 19 if ($entry != NULL) {
31 $tpl->assign('id', $entry[0]['id']); 20 $tpl->assign('id', $entry[0]['id']);