Version 1.2 ()
------------------------------------------------------------------------
+ * Patch #1697590: Proper directory name of SQLite DB-error messages,
+ thanks to Thijs Kinkhorst
+
* Enabled setting cache-control headers by default.
* Fix wrong next/previous page links when using wrapper.php indexFile
return $serendipity['dbConn'];
}
+function serendipity_db_reconnect() {
+}
+
/**
* Returns a escaped string, so that it can be safely included in a SQL string encapsulated within quotes, without allowing SQL injection.
*
if (!is_array($search_ids)) {
return false;
}
-
+
foreach($search_ids AS $id) {
$sql[] = $col . ' = ' . $id;
}
-
+
$cond = '(' . implode($type, $sql) . ')';
return $cond;
}
fwrite($fp, '[' . date('d.m.Y H:i') . '] SQLITE QUERY: ' . $sql . "\n\n");
fclose($fp);
}
-
+
if ($reportErr && !$expectError) {
$res = sqlite_query($sql, $serendipity['dbConn']);
} else {
$rows = array();
while (($row = serendipity_db_sqlite_fetch_array($res, $type_map[$result_type]))) {
- if (!empty($assocKey) && !empty($assocVal)) {
+ if (!empty($assocKey)) {
// You can fetch a key-associated array via the two function parameters assocKey and assocVal
- $rows[$row[$assocKey]] = $row[$assocVal];
+ if (empty($assocVal)) {
+ $rows[$row[$assocKey]] = $row;
+ } else {
+ $rows[$row[$assocKey]] = $row[$assocVal];
+ }
} else {
$rows[] = $row;
}
return false;
}
- $serendipity['dbConn'] = sqlite_open($serendipity['serendipityPath'] . $dbName . '.db');
+ if (defined('S9Y_DATA_PATH')) {
+ // Shared installations!
+ $dbfile = S9Y_DATA_PATH . $dbName . '.db';
+ } else {
+ $dbfile = $serendipity['serendipityPath'] . $dbName . '.db';
+ }
+
+ $serendipity['dbConn'] = sqlite_open($dbfile);
if ($serendipity['dbConn']) {
return true;
}
- $errs[] = "Unable to open \"{$serendipity['serendipityPath']}$dbName.db\" - check permissions (directory needs to be writeable for webserver)!";
+ $errs[] = "Unable to open \"$dbfile\" - check permissions (directory needs to be writeable for webserver)!";
return false;
}