From: quix0r Date: Mon, 29 Jul 2013 23:30:41 +0000 (+0000) Subject: Even more double->single converted X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5feba25313d1ef15f35ef29c6b98ae7bc496afa5;p=mailer.git Even more double->single converted --- diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 33c542893c..4a94e8f9b9 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -614,10 +614,10 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement // Shall we add numbers or strings? if ('' . $val . '' == '' . $test . '') { // Add numbers - array_push($tableData, sprintf("`%s`=%s", $id, $test)); + array_push($tableData, sprintf('`%s`=%s', $id, $test)); } elseif (is_null($val)) { // Add NULL - array_push($tableData, sprintf("`%s`=NULL", $id)); + array_push($tableData, sprintf('`%s`=NULL', $id)); } else { // Add strings array_push($tableData, sprintf("`%s`='%s'", $id, trim($val))); @@ -1247,7 +1247,7 @@ function adminUpdateTaskData ($id, $row, $data) { reportBug(__FUNCTION__, __LINE__, 'id=' . $id . ',row=' . $row . ',data=' . $data . ' - isAdmin()=false'); } elseif ($id <= 0) { // Initiate backtrace - reportBug(__FUNCTION__, __LINE__, sprintf("id is invalid: %s. row=%s, data=%s", + reportBug(__FUNCTION__, __LINE__, sprintf('id is invalid: %s. row=%s, data=%s', $id, $row, $data @@ -1531,7 +1531,7 @@ function adminProcessMenuEditForm ($type, $subMenu) { break; default: // Unexpected action - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok'))); + logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok'))); displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}'); break; } // END - switch @@ -1663,7 +1663,7 @@ function registerFirstAdmin () { default: // Any other kind will be logged - $errorMessage = sprintf("Unknown return code %s from ifAdminLoginDataIsValid().", $ret); + $errorMessage = sprintf('Unknown return code %s from ifAdminLoginDataIsValid().', $ret); logDebugMessage(__FUNCTION__, __LINE__, $errorMessage); // Set this to have our error message displayed diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 026068e6fb..e42defec89 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -319,7 +319,7 @@ LIMIT 1", // @TODO This may also be rewritten to include files switch ($mode) { default: // @TODO Unknown support mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction.", $mode)); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown support mode %s detected. This part is under construction.', $mode)); $OUT .= '
{%message,ADMIN_UNKNOWN_SUPPORT_MODE=' . $mode . '%}
'; break; } // END - switch @@ -386,7 +386,7 @@ LIMIT 1", break; default: // Unknown task type - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type'])); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', $taskData['task_type'])); $OUT .= '
' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '
'; break; } @@ -418,7 +418,7 @@ LIMIT 1", } // END - foreach } else { // Unknown action - reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=
%s
", print_r($postData, TRUE))); + reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=
%s
', print_r($postData, TRUE))); } // Update query diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index d2bd89be2b..28b590b0cc 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -185,7 +185,7 @@ LIMIT 1", break; default: // Unexpected action - logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok'))); + logDebugMessage(__FILE__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok'))); displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}'); break; } // END - switch diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 7753f42c22..b255c9cea8 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -78,12 +78,12 @@ if ((isFormSent('do_delete')) || (isFormSent('do_edit')) || (isFormSent('do_add' ); if ((getRefPayout() == '0') && (postRequestElement('ref_payout') > 0)) { // Update account's ref_payout for "must-confirm" - addSql(sprintf("UPDATE + addSql(sprintf('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`) WHERE - `mails_confirmed` < %s", $REF, $REF)); + `mails_confirmed` < %s', $REF, $REF)); } elseif ((getRefPayout() > 0) && (postRequestElement('ref_payout') == '0')) { // Update account's ref_payout for "not-must-confirm" addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0"); diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index 1fe5197c2e..e96163d621 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -65,7 +65,7 @@ LIMIT 1", $content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh'); // Init variables here - $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('do')); + $TPL = sprintf('admin_edit_sponsor_%s', getRequestElement('do')); initSqls(); // Sponsor was found @@ -79,7 +79,11 @@ LIMIT 1", // Add points to account sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1", - array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__); + array( + $points, + bigintval(getRequestElement('id')) + ), __FILE__, __LINE__ + ); // Remember points /reason for the template $content['points'] = $points; @@ -145,10 +149,10 @@ LIMIT 1", break; default: // Unknown mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('do'))); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown mode %s detected.', getRequestElement('do'))); $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('do') . '%}'; break; - } + } // END - switch if (!empty($message)) { // Output message diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index d0b8d13655..31621b7a93 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -76,7 +76,7 @@ $SQL2 = ''; if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) { // Only a specific mail shall be displayed - $sql = sprintf("SELECT + $sql = sprintf('SELECT `id`, `sender`, `subject`, @@ -93,13 +93,13 @@ FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s -LIMIT 1", +LIMIT 1', bigintval(getRequestElement('id')) ); $WHO = '{--MAIL_ID--}' . ': ' . getRequestElement('id'); } elseif (isGetRequestElementSet('userid')) { // All mails by a specific member shall be displayed - $sql = sprintf("SELECT + $sql = sprintf('SELECT `id`, `sender`, `subject`, @@ -117,7 +117,7 @@ FROM WHERE `sender`=%s ORDER BY - `timestamp` DESC", + `timestamp` DESC', bigintval(getRequestElement('userid')) ); $WHO = '{--USER_ID--}' . ': ' . getRequestElement('userid'); diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php index b5140da685..eb3708d90b 100644 --- a/inc/modules/admin/what-list_links.php +++ b/inc/modules/admin/what-list_links.php @@ -112,7 +112,7 @@ if (isGetRequestElementSet('userid')) { break; default: // Problem in application detected! - reportBug(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $linkData['link_type'])); + reportBug(__FILE__, __LINE__, sprintf('Invalid email type %s detected.', $linkData['link_type'])); break; } // END - switch diff --git a/inc/modules/admin/what-list_network_array_translation.php b/inc/modules/admin/what-list_network_array_translation.php index 202791f80f..edcf7cbd7c 100644 --- a/inc/modules/admin/what-list_network_array_translation.php +++ b/inc/modules/admin/what-list_network_array_translation.php @@ -76,7 +76,7 @@ if (isGetRequestElementSet('network_id')) { $ADD = ''; if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) { // Only show from current type handler - $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id'))); + $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id'))); // Overwrite type $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id')); @@ -86,7 +86,7 @@ if (isGetRequestElementSet('network_id')) { } // END - if // Load all advert codes for given network - $result = sqlQueryEscaped("SELECT + $result = sqlQueryEscaped('SELECT `p`.`network_array_id`, `t`.`network_type_id`, `t`.`network_type_handler`, @@ -100,10 +100,10 @@ ON `p`.`network_type_id`=`t`.`network_type_id` WHERE `p`.`network_id`=%s - ".$ADD." + ' . $ADD . ' ORDER BY `t`.`network_type_handler` ASC, - `p`.`network_array_sort` ASC", + `p`.`network_array_sort` ASC', array( bigintval(getRequestElement('network_id')) ), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-list_network_request_params.php b/inc/modules/admin/what-list_network_request_params.php index 1f2487e30b..0ef1d095b6 100644 --- a/inc/modules/admin/what-list_network_request_params.php +++ b/inc/modules/admin/what-list_network_request_params.php @@ -74,7 +74,7 @@ if (isGetRequestElementSet('network_id')) { $ADD = ''; if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) { // Only show from current type handler - $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id'))); + $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id'))); // Overwrite type id $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id')); diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index ff171fded3..5f9da909cd 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -74,7 +74,7 @@ switch (getRequestElement('type')) { break; default: // Unknown type - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestElement('type'))); + logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', getRequestElement('type'))); displayMessage('{%message,ADMIN_TASK_UNKNOWN_MODE' . getRequestElement('type') . '%}'); break; } // END - switch @@ -121,7 +121,7 @@ ORDER BY } // END - foreach } else { // Unknown action performed - reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=
%s
", print_r(postRequestArray(), TRUE))); + reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=
%s
', print_r(postRequestArray(), TRUE))); } // Update query diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index cd6da112e6..822d58d766 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -57,7 +57,7 @@ $sql = ''; // List confirmation links from normal or bonus mails if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) { // SQL query for mail data - $sql = sprintf("SELECT + $sql = sprintf('SELECT `s`.`id`, `p`.`sender`, `p`.`subject`, @@ -73,7 +73,7 @@ ON `p`.`id`=`s`.`pool_id` WHERE `s`.`pool_id`=%s -LIMIT 1", +LIMIT 1', bigintval(getRequestElement('id')) ); @@ -87,7 +87,7 @@ LIMIT 1", $DATA = getRequestElement('id'); } elseif (((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'bonus')) && (isExtensionActive('bonus'))) { // SQL query for mail data (both ids are required for compatiblity to above normal mail - $sql = sprintf("SELECT + $sql = sprintf('SELECT `id`, NULL AS `sender`, `subject`, @@ -99,7 +99,7 @@ FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s -LIMIT 1", +LIMIT 1', bigintval(getRequestElement('id')) ); diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index 0d8c7aeeaa..8e08532f1a 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -50,13 +50,10 @@ $GLOBALS['theme_mode'] = 'test'; if (isPostRequestElementSet('theme')) { // Check if theme is there if (!ifThemeExists(postRequestElement('theme'))) { - // Import theme - $inc = sprintf("theme/%s/theme.php", sqlEscapeString(postRequestElement('theme'))); - // Is the theme readable? - if (isIncludeReadable($inc)) { + if (isThemeReadable(postRequestElement('theme'))) { // Load the theme header file - loadInclude($inc); + loadInclude(sprintf('theme/%s/theme.php', sqlEscapeString(postRequestElement('theme')))); // Register it ith the exchange sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)