| @@ 1260-1264 (lines=5) @@ | ||
| 1257 | $rs = mysqli_query($sqlParser->conn, |
|
| 1258 | "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"); |
|
| 1259 | $count_original_name = mysqli_num_rows($rs); |
|
| 1260 | if ($overwrite == 'false') { |
|
| 1261 | $newname = $name . '-' . str_replace('.', '_', $modx_version); |
|
| 1262 | $rs = mysqli_query($sqlParser->conn, |
|
| 1263 | "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"); |
|
| 1264 | $count_new_name = mysqli_num_rows($rs); |
|
| 1265 | } |
|
| 1266 | $update = $count_original_name > 0 && $overwrite == 'true'; |
|
| 1267 | if ($update) { |
|
| @@ 442-446 (lines=5) @@ | ||
| 439 | $chunk = mysqli_real_escape_string($conn, $chunk); |
|
| 440 | $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"); |
|
| 441 | $count_original_name = mysqli_num_rows($rs); |
|
| 442 | if($overwrite == 'false') { |
|
| 443 | $newname = $name . '-' . str_replace('.', '_', $modx_version); |
|
| 444 | $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"); |
|
| 445 | $count_new_name = mysqli_num_rows($rs); |
|
| 446 | } |
|
| 447 | $update = $count_original_name > 0 && $overwrite == 'true'; |
|
| 448 | if ($update) { |
|
| 449 | if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { |
|