fix: rename category after adding and sort order of categories
fix: allow redirects on logo search
This commit is contained in:
@@ -6,10 +6,22 @@ session_start();
|
||||
|
||||
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
|
||||
if (isset($_GET['action']) && $_GET['action'] == "add") {
|
||||
$stmt = $db->prepare('SELECT MAX("order") as maxOrder FROM categories');
|
||||
$result = $stmt->execute();
|
||||
$row = $result->fetchArray(SQLITE3_ASSOC);
|
||||
$maxOrder = $row['maxOrder'];
|
||||
|
||||
if ($maxOrder === NULL) {
|
||||
$maxOrder = 0;
|
||||
}
|
||||
|
||||
$order = $maxOrder + 1;
|
||||
|
||||
$categoryName = "Category";
|
||||
$sqlInsert = "INSERT INTO categories (name) VALUES (:name)";
|
||||
$sqlInsert = 'INSERT INTO categories ("name", "order") VALUES (:name, :order)';
|
||||
$stmtInsert = $db->prepare($sqlInsert);
|
||||
$stmtInsert->bindParam(':name', $categoryName, SQLITE3_TEXT);
|
||||
$stmtInsert->bindParam(':order', $order, SQLITE3_INTEGER);
|
||||
$resultInsert = $stmtInsert->execute();
|
||||
|
||||
if ($resultInsert) {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $backupUrl);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
$envVars = array_change_key_case($_SERVER, CASE_LOWER);
|
||||
$httpProxy = isset($envVars['http_proxy']) ? $envVars['http_proxy'] : null;
|
||||
$httpsProxy = isset($envVars['https_proxy']) ? $envVars['https_proxy'] : null;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
|
||||
// Convert all environment variable keys to lowercase
|
||||
$envVars = array_change_key_case($_SERVER, CASE_LOWER);
|
||||
@@ -29,6 +30,7 @@
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $backupUrl);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
$envVars = array_change_key_case($_SERVER, CASE_LOWER);
|
||||
$httpProxy = isset($envVars['http_proxy']) ? $envVars['http_proxy'] : null;
|
||||
$httpsProxy = isset($envVars['https_proxy']) ? $envVars['https_proxy'] : null;
|
||||
|
||||
Reference in New Issue
Block a user