Code Duplication    Length = 18-18 lines in 2 locations

install/upgrade_ajax.php 1 location

@@ 162-179 (lines=18) @@
159
    return $res;
160
}
161
162
function tableExists($tablename)
163
{
164
    global $db_link, $database;
165
166
    $res = mysqli_query(
167
        $db_link,
168
        "SELECT COUNT(*) as count
169
        FROM information_schema.tables
170
        WHERE table_schema = '".$database."'
171
        AND table_name = '$tablename'"
172
    );
173
174
    if ($res > 0) {
175
        return true;
176
    } else {
177
        return false;
178
    }
179
}
180
181
if (isset($post_type)) {
182
    switch ($post_type) {

install/upgrade_run_db_original.php 1 location

@@ 77-94 (lines=18) @@
74
    return $res;
75
}
76
77
function tableExists($tablename)
78
{
79
    global $db_link, $database;
80
81
    $res = mysqli_query(
82
        $db_link,
83
        "SELECT COUNT(*) as count
84
        FROM information_schema.tables
85
        WHERE table_schema = '".$database."'
86
        AND table_name = '$tablename'"
87
    );
88
89
    if ($res > 0) {
90
        return true;
91
    }
92
93
    return false;
94
}
95
96
//define pbkdf2 iteration count
97
@define('ITCOUNT', '2072');