Add more abstraction possibilites, gathered throughout the last weeks
This commit is contained in:
parent
5e3201e7a8
commit
29b46f0c53
@ -423,9 +423,16 @@ function serendipity_issueAutologin($array) {
|
|||||||
$rnd = md5(uniqid(time(), true) . $_SERVER['REMOTE_ADDR']);
|
$rnd = md5(uniqid(time(), true) . $_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
// Delete possible current cookie. Also delete any autologin keys that smell like 3-week-old, dead fish.
|
// Delete possible current cookie. Also delete any autologin keys that smell like 3-week-old, dead fish.
|
||||||
|
if (stristr($serendipity['dbType'], 'sqlite')) {
|
||||||
|
$cast = "name";
|
||||||
|
} else {
|
||||||
|
// Adds explicits casting for mysql, postgresql and others.
|
||||||
|
$cast = "cast(name as integer)";
|
||||||
|
}
|
||||||
|
|
||||||
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
|
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}options
|
||||||
WHERE okey = 'l_" . serendipity_db_escape_string($serendipity['COOKIE']['author_information']) . "'
|
WHERE okey = 'l_" . serendipity_db_escape_string($serendipity['COOKIE']['author_information']) . "'
|
||||||
OR (okey LIKE 'l_%' AND name < " . (time() - 1814400) . ")");
|
OR (okey LIKE 'l_%' AND $cast < " . (time() - 1814400) . ")");
|
||||||
|
|
||||||
// Issue new autologin cookie
|
// Issue new autologin cookie
|
||||||
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}options (name, value, okey) VALUES ('" . time() . "', '" . serendipity_db_escape_string($package) . "', 'l_" . $rnd . "')");
|
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}options (name, value, okey) VALUES ('" . time() . "', '" . serendipity_db_escape_string($package) . "', 'l_" . $rnd . "')");
|
||||||
|
@ -408,7 +408,7 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
|
|||||||
{$serendipity['fullCountQuery']}
|
{$serendipity['fullCountQuery']}
|
||||||
{$cond['group']}
|
{$cond['group']}
|
||||||
{$cond['having']}
|
{$cond['having']}
|
||||||
ORDER BY {$cond['orderby']}
|
" . (!empty($cond['orderby']) ? "ORDER BY {$cond['orderby']}" : "") . "
|
||||||
$limit";
|
$limit";
|
||||||
|
|
||||||
// DEBUG:
|
// DEBUG:
|
||||||
|
@ -548,11 +548,11 @@ class serendipity_archives_plugin extends serendipity_plugin {
|
|||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'timestamp DESC',
|
null,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
'count(e.id) AS orderkey',
|
'count(DISTINCT e.id) AS orderkey',
|
||||||
'',
|
'',
|
||||||
'single',
|
'single',
|
||||||
false, $category_set // the joins used
|
false, $category_set // the joins used
|
||||||
|
Loading…
x
Reference in New Issue
Block a user