From ef230a1c05342c651c51a575d5b90aec18688336 Mon Sep 17 00:00:00 2001 From: quix0r Date: Thu, 1 Jul 2010 17:00:09 +0000 Subject: [PATCH] Directories with a dot caused some trouble, rewritten all code to make no longer usage of it --- inc/extensions-functions.php | 2 +- inc/extensions/ext-sql_patches.php | 2 +- inc/gen_sql_patches.php | 2 +- inc/libs/mediadata_functions.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index ee5ff4908f..db650b47e2 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { } // 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)); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 138f723c1d..4d73669ae9 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -772,7 +772,7 @@ INDEX (`ip`) // 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)); diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 1173c4b3b2..184eb28e30 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -70,7 +70,7 @@ if (getMasterSalt() == '') { 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 ); diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php index db14350b4d..fc06a8e4a0 100644 --- a/inc/libs/mediadata_functions.php +++ b/inc/libs/mediadata_functions.php @@ -52,7 +52,7 @@ function updateMediadataEntry ($keys_array, $mode, $value) { 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 @@ -63,11 +63,11 @@ WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__); 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__); } } -- 2.39.5