Commit 92e08c93 authored by pkdille's avatar pkdille

A few tiny fixes (empty statements, forbidden functions, functions in for...

A few tiny fixes (empty statements, forbidden functions, functions in for loops). Seen on quality.tiki.org
parent a6d6b051
......@@ -1115,7 +1115,7 @@ class AccountingLib extends LogsLib
if ($res === false) {
$errors[] = tra('Error deleting entry from stack') . $this->ErrorNo() . ": " . $this->ErrorMsg() . "<br /><pre>$query</pre>";
}
if (sizeof($errors) != 0) {
if (count($errors) != 0) {
return $errors;
}
return true;
......@@ -1247,7 +1247,7 @@ class AccountingLib extends LogsLib
$cols = explode($defs['bankDelimeter'], $header);
$columns = array();
for ($i=0, $isizeof_cols = sizeof($cols); $i < $isizeof_cols; $i++) {
for ($i=0, $icount_cols = count($cols); $i < $icount_cols; $i++) {
switch($cols[$i]) {
case $defs['fieldNameAccount'] : $columns['accountId'] = $i;
break;
......
......@@ -38,19 +38,19 @@ class Multilingual_Aligner_UpdatePages
$target_modified_sentences = $segmentor->segment($target_modified_string);
$target_modified_sentences[count($target_modified_sentences)] = 'dummy';
$i = -1;
for ($a=0; $a<count($source_outofdate_sentences); $a++) {
for ($a=0, $aCountSourceOutofdateSentences = count($source_outofdate_sentences); $a<$aCountSourceOutofdateSentences; $a++) {
$source_outofdate_sentences[$a] = trim($source_outofdate_sentences[$a]);
}
for ($a=0; $a<count($source_modified_sentences); $a++) {
for ($a=0, $aCountSourceModifiedSentences = count($source_modified_sentences); $a<$aCountSourceModifiedSentences; $a++) {
$source_modified_sentences[$a] = trim($source_modified_sentences[$a]);
}
for ($a=0; $a<count($target_outofdate_sentences); $a++) {
for ($a=0, $aCountTargetOutofdateSentences = count($target_outofdate_sentences); $a<$aCountTargetOutofdateSentences; $a++) {
$target_outofdate_sentences[$a] = trim($target_outofdate_sentences[$a]);
}
for($a=0; $a<count($target_modified_sentences); $a++) {
for($a=0, $aCountTargetModifiedSentences = count($target_modified_sentences); $a<$aCountTargetModifiedSentences; $a++) {
$target_modified_sentences[$a] = trim($target_modified_sentences[$a]);
}
......@@ -58,17 +58,17 @@ class Multilingual_Aligner_UpdatePages
$source_diff = $update->DifferencebetweenOriginalFileandModifiedFile($source_outofdate_sentences, $source_modified_sentences, $this->alignments, $this->translator, 'en', 'fr', 1);
$target_diff = $update->DifferencebetweenOriginalFileandModifiedFile($target_outofdate_sentences, $target_modified_sentences, $this->alignments, $this->translator, 'en', 'fr', 0);
for ($a=0; $a<count($source_diff); $a++) {
for ($a=0, $aCountSourceDiff = count($source_diff); $a<$aCountSourceDiff; $a++) {
$source_diff[$a] = trim($source_diff[$a]);
}
for ($a=0; $a<count($target_diff); $a++) {
for ($a=0, $aCountTargetDiff = count($target_diff); $a<$aCountTargetDiff; $a++) {
$target_diff[$a] = trim($target_diff[$a]);
if ($target_diff[$a] == '+dummy')
unset($target_diff[$a]);
}
$target_diff = array_values($target_diff);
for ($a=0; $a<count($source_diff); $a++) {
for ($a=0, $aCountSourceDiff = count($source_diff); $a<$aCountSourceDiff; $a++) {
$index = 0;
$i = 2;
if ($source_diff[$a] == '' || ($source_diff[$a][0] != '+')) {
......@@ -96,7 +96,7 @@ class Multilingual_Aligner_UpdatePages
}
}
for ($a=0; $a<count($target_diff); $a++) {
for ($a=0, $aCountTargetDiff = count($target_diff); $a<$aCountTargetDiff; $a++) {
$index = 1;
$i = 2;
if ($target_diff[$a] == '' || ($target_diff[$a][0] != '+')) {
......@@ -144,11 +144,11 @@ class Multilingual_Aligner_UpdatePages
{
$source_array = explode('<br/>', $source_file);
$target_array = explode('<br/>', $target_file);
for ($i=1; $i<count($target_array); $i++) {
//$target_array[$i]=utf8_decode($target_array[$i]);
}
for ($i=0; $i<count($source_array); $i++) {
$this->alignments->addSentencePair($source_array[$i], $source_lng, $target_array[$i], $target_lng);
// for ($i=1; $i<count($target_array); $i++) {
// $target_array[$i]=utf8_decode($target_array[$i]);
// }
for ($i=0, $iCountSourceArray = count($source_array); $i<$iCountSourceArray; $i++) {
$this->alignments->addSentencePair($source_array[$i], $source_lng, $target_array[$i], $target_lng);
}
}
......@@ -156,7 +156,7 @@ class Multilingual_Aligner_UpdatePages
public function array_search_function($temp, $array, $index)
{
$i = 0;
for ($i=$index; $i<count($array); $i++) {
for ($i=$index, $iCountArray = count($array); $i<$iCountArray; $i++) {
$val = $array[$i];
if (strcmp($temp, $val) == 0) {
return $i;
......
......@@ -301,7 +301,7 @@ class EditLib
if ($more_spans === 0) {
break;
}
} else if ($c[$j]['data']['name'] == 'br' && $more_spans === 1 && $other_elements === 0) {
// } else if ($c[$j]['data']['name'] == 'br' && $more_spans === 1 && $other_elements === 0) {
} else if ($c[$j]['data']['name'] == $elem_type && $c[$j]['data']['type'] == 'open') {
$more_spans++;
} else if ($c[$j]['data']['type'] == 'open' && $c[$j]['data']['name'] != 'br' && $c[$j]['data']['name'] != 'img' && $c[$j]['data']['name'] != 'input') {
......
......@@ -110,7 +110,7 @@ if (is_array($result)) {
$debitAccount=array();
$debitAmount=array();
$debitText=array();
for($i=0;$i<count($stackEntry['debit']);$i++) {
for($i=0, $iCountStackEntryDebit = count($stackEntry['debit']); $i<$iCountStackEntryDebit; $i++) {
$debitAccount[]=$stackEntry['debit'][$i]['stackItemAccountId'];
$debitAmount[]=$stackEntry['debit'][$i]['stackItemAmount'];
$debitText[]=$stackEntry['debit'][$i]['stackItemText'];
......@@ -118,7 +118,7 @@ if (is_array($result)) {
$creditAccount=array();
$creditAmount=array();
$creditText=array();
for($i=0;$i<count($stackEntry['credit']);$i++) {
for($i=0, $iCountStackEntryCredit = count($stackEntry['credit']);$i<$iCountStackEntryCredit; $i++) {
$creditAccount[]=$stackEntry['credit'][$i]['stackItemAccountId'];
$creditAmount[]=$stackEntry['credit'][$i]['stackItemAmount'];
$creditText[]=$stackEntry['credit'][$i]['stackItemText'];
......
......@@ -107,9 +107,6 @@ if (!empty($prefs['freetags_cloud_colors'])) {
$i = 0;
} elseif (count($colors) == 2) {
$i = $prev ? 0 : 1;
} else {
while (($i = rand(0, count($colors) - 1)) == $prev) {
}
}
$most_popular_tags[$id]['color'] = $colors[$i];
$prev = $i;
......
......@@ -8,12 +8,12 @@
require_once ('tiki-setup.php');
$access->check_user($user);
if (0 and $prefs['feature_ajax'] == 'y') { // AJAX_TODO
//if (0 and $prefs['feature_ajax'] == 'y') { // AJAX_TODO
// include_once ('register_ajax.php');
// $ajaxlib->registerFunction('chkRegName');
// $ajaxlib->registerFunction('chkRegEmail');
// $ajaxlib->registerTemplate('tiki-register.tpl');
}
//}
$smarty->assign('msg', '');
$smarty->assign('alldone', false);
......
......@@ -110,9 +110,9 @@ if ($_REQUEST['locSection'] == 'read') {
$attachments = array();
if ($message->isMultipart()) {
// TODO deal with attachments here??
}
// if ($message->isMultipart()) {
// TODO deal with attachments here??
// }
$bodies = $webmaillib->get_mail_content($user, $current['accountId'], $_REQUEST['msgid'], true);
......@@ -139,9 +139,9 @@ if ($_REQUEST['locSection'] == 'read') {
// reply text
$smarty->assign('plainbody', format_email_reply($bodies[$i]['body'], $aux['from'], $aux['date']));
$bodies[$i]['body'] = nl2br( $bodies[$i]['body'] );
} else {
}// else {
// attachments?
}
//}
}
array_multisort($bodies); // this doesn't do what we need properly but seems to fluke it mostly - TODO a manual re-sort
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment