} // END - if
// Load the extension and maybe found language and function files.
-function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run = false) {
+function loadExtension ($ext_name, $ext_mode, $ext_ver = '', $dry_run = false) {
// If this happens twice, we need the bug report from you, except for updates/tests
if ((isset($GLOBALS['loaded_extension'][$ext_name][$ext_mode])) && (!in_array($ext_mode, array('update', 'test')))) {
debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
// Test again
if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && (getFileHash() != '') && (getMasterSalt() != '') && (getPassScramble() != '')) {
// File hash fas generated so we can also file the secret file... hopefully.
- $hashFile = sprintf("%sinc/cache/.%s", getPath(), getFileHash());
+ $hashFile = sprintf("%sinc/cache/.%s.cache", getPath(), getFileHash());
if (isFileReadable($hashFile)) {
// Read file
setConfigEntry('secret_key', readFromFile($hashFile));
if (getFileHash() == '') {
// Create filename from hashed random string
$fileHash = sha1(generatePassword(mt_rand(128, 256)));
- $FQFN = sprintf("%sinc/cache/.%s",
+ $FQFN = sprintf("%sinc/cache/.%s.cache",
getPath(),
$fileHash
);
WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result_media) == 0) {
// Not found so we create it (mode will be ignored here!)
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mediadata` (media_key, media_value) VALUES ('%s', '%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mediadata` (`media_key`, `media_value`) VALUES ('%s', '%s')",
array($key, $value), __FUNCTION__, __LINE__);
} else {
// Update entry
if ($mode == 'init') {
// Initialize entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mediadata` SET media_value=%s WHERE media_key='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mediadata` SET `media_value`=%s WHERE `media_key`='%s' LIMIT 1",
array($value, $key), __FUNCTION__, __LINE__);
} else {
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mediadata` SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mediadata` SET `media_value`=`media_value`".$mode."%s WHERE `media_key`='%s' LIMIT 1",
array($value, $key), __FUNCTION__, __LINE__);
}
}