Code Duplication    Length = 5-9 lines in 4 locations

admin/index.php 1 location

@@ 1845-1849 (lines=5) @@
1842
1843
    case 'delete':
1844
        $storyid = 0;
1845
        if (isset($_GET['storyid'])) {
1846
            $storyid = (int)$_GET['storyid'];
1847
        } elseif (isset($_POST['storyid'])) {
1848
            $storyid = (int)$_POST['storyid'];
1849
        }
1850
1851
        if (!empty($_POST['ok'])) {
1852
            if (empty($storyid)) {

ratenews.php 1 location

@@ 82-88 (lines=7) @@
79
80
// 2) Is the story published ?
81
$storyid = 0;
82
if (isset($_GET['storyid'])) {
83
    $storyid = (int)$_GET['storyid'];
84
} else {
85
    if (isset($_POST['storyid'])) {
86
        $storyid = (int)$_POST['storyid'];
87
    }
88
}
89
90
if (!empty($storyid)) {
91
    $article = new NewsStory($storyid);

submit.php 2 locations

@@ 180-188 (lines=9) @@
177
    case 'preview':
178
        $topic_id = (int)$_POST['topic_id'];
179
        $xt       = new NewsTopic($topic_id);
180
        if (isset($_GET['storyid'])) {
181
            $storyid = (int)$_GET['storyid'];
182
        } else {
183
            if (isset($_POST['storyid'])) {
184
                $storyid = (int)$_POST['storyid'];
185
            } else {
186
                $storyid = 0;
187
            }
188
        }
189
190
        if (!empty($storyid)) {
191
            $story     = new NewsStory($storyid);
@@ 302-310 (lines=9) @@
299
            $uid = 0;
300
        }
301
302
        if (isset($_GET['storyid'])) {
303
            $storyid = (int)$_GET['storyid'];
304
        } else {
305
            if (isset($_POST['storyid'])) {
306
                $storyid = (int)$_POST['storyid'];
307
            } else {
308
                $storyid = 0;
309
            }
310
        }
311
312
        if (empty($storyid)) {
313
            $story    = new NewsStory();