Code Duplication    Length = 14-17 lines in 2 locations

install/cli-install.php 1 location

@@ 577-590 (lines=14) @@
574
    if (!$row) {
575
        // not installed
576
        $auto_template_logic = 'system';
577
    } else {
578
        if ($row[1] == 1) {
579
            // installed but disabled
580
            $auto_template_logic = 'system';
581
        } else {
582
            // installed, enabled .. see how it's configured
583
            $properties = parseProperties($row[0]);
584
            if (isset($properties['inheritTemplate'])) {
585
                if ($properties['inheritTemplate'] == 'From First Sibling') {
586
                    $auto_template_logic = 'sibling';
587
                }
588
            }
589
        }
590
    }
591
}
592
593

install/src/controllers/install.php 1 location

@@ 113-129 (lines=17) @@
110
            $query = "SELECT properties, disabled FROM " . $dbase . ".`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'";
111
            $rs = mysqli_query($conn, $query);
112
            $row = mysqli_fetch_row($rs);
113
            if (!$row) {
114
                // not installed
115
                $auto_template_logic = 'system';
116
            } else {
117
                if ($row[1] == 1) {
118
                    // installed but disabled
119
                    $auto_template_logic = 'system';
120
                } else {
121
                    // installed, enabled .. see how it's configured
122
                    $properties = parseProperties($row[0]);
123
                    if (isset($properties['inheritTemplate'])) {
124
                        if ($properties['inheritTemplate'] === 'From First Sibling') {
125
                            $auto_template_logic = 'sibling';
126
                        }
127
                    }
128
                }
129
            }
130
        }
131
132
        // open db connection