Skip to content

Commit 6fff6a9

Browse files
committed
General housekeeping.
1 parent e47d7ff commit 6fff6a9

4 files changed

Lines changed: 36 additions & 23 deletions

File tree

‎do_feeds.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
$doc = null;
5454
$text_item = null;
55-
if (isset($_REQUEST['marked_items'])) {
55+
if (isset($_REQUEST['marked_items']) && is_array($_REQUEST['marked_items'])) {
5656
$marked_items = implode(',', $_REQUEST['marked_items']);
5757
$res = do_mysqli_query(
5858
"SELECT * FROM (

‎edit_texts.php‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -912,34 +912,37 @@ function edit_texts_show_text_row($txrecord, $currentlang, $statuses)
912912
} else {
913913
$audio = '';
914914
}
915-
echo '<tr>
915+
916+
?>
917+
<tr>
916918
<td class="td1 center">
917-
<a name="rec' . $txid . '">
918-
<input name="marked[]" class="markcheck" type="checkbox" value="' . $txid . '" ' . checkTest($txid, 'marked') . ' />
919+
<a name="rec<?php echo $txid; ?>">
920+
<input name="marked[]" class="markcheck" type="checkbox" value="<?php echo $txid; ?>" <?php echo checkTest($txid, 'marked'); ?> />
919921
</a>
920922
</td>
921923
<td nowrap="nowrap" class="td1 center">&nbsp;
922-
<a href="do_text.php?start=' . $txid . '">
924+
<a href="do_text.php?start=<?php echo $txid; ?>">
923925
<img src="icn/book-open-bookmark.png" title="Read" alt="Read" />
924926
</a>&nbsp;
925-
<a href="do_test.php?text=' . $txid . '">
927+
<a href="do_test.php?text=<?php echo $txid; ?>">
926928
<img src="icn/question-balloon.png" title="Test" alt="Test" />
927929
</a>&nbsp;
928930
</td>
929931
<td nowrap="nowrap" class="td1 center">&nbsp;
930-
<a href="print_text.php?text=' . $txid . '">
932+
<a href="print_text.php?text=<?php echo $txid; ?>">
931933
<img src="icn/printer.png" title="Print" alt="Print" />
932934
</a>&nbsp;
933-
<a href="' . $_SERVER['PHP_SELF'] . '?arch=' . $txid . '">
935+
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?arch=<?php echo $txid; ?>">
934936
<img src="icn/inbox-download.png" title="Archive" alt="Archive" />
935937
</a>&nbsp;
936-
<a href="' . $_SERVER['PHP_SELF'] . '?chg=' . $txid . '">
938+
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?chg=<?php echo $txid; ?>">
937939
<img src="icn/document--pencil.png" title="Edit" alt="Edit" />
938940
</a>&nbsp;
939-
<span class="click" onclick="if (confirmDelete()) location.href=\'' . $_SERVER['PHP_SELF'] . '?del=' . $txid . '\';">
941+
<span class="click" onclick="if (confirmDelete()) location.href=\'<?php echo $_SERVER['PHP_SELF']; ?>?del=<?php echo $txid; ?>\';">
940942
<img src="icn/minus-button.png" title="Delete" alt="Delete" />
941943
</span>&nbsp;
942-
</td>';
944+
</td>
945+
<?php
943946
if ($currentlang == '') {
944947
echo '<td class="td1 center">' . tohtml($txrecord['LgName']) . '</td>';
945948
}
@@ -962,29 +965,31 @@ function edit_texts_show_text_row($txrecord, $currentlang, $statuses)
962965
}
963966
echo '</td>';
964967

965-
echo '<!-- total + composition -->
968+
?>
969+
<!-- total + composition -->
966970
<td class="td1 center">
967-
<span title="Total" id="total_' . $txid . '"></span>
971+
<span title="Total" id="total_<?php echo $txid; ?>"></span>
968972
</td>
969973
<td class="td1 center">
970-
<span title="Saved" data_id="' . $txid . '">
971-
<a class="status4" id="saved_' . $txid . '"
972-
href="edit_words.php?page=1&amp;query=&amp;status=&amp;tag12=0&amp;tag2=&amp;tag1=&amp;text_mode=0&amp;text=' . $txid . '">
974+
<span title="Saved" data_id="<?php echo $txid; ?>">
975+
<a class="status4" id="saved_<?php echo $txid; ?>"
976+
href="edit_words.php?page=1&amp;query=&amp;status=&amp;tag12=0&amp;tag2=&amp;tag1=&amp;text_mode=0&amp;text=<?php echo $txid; ?>">
973977
</a>
974978
</span>
975979
</td>
976980
<!-- unknown count -->
977981
<td class="td1 center">
978-
<span title="Unknown" class="status0" id="todo_' . $txid . '"></span>
982+
<span title="Unknown" class="status0" id="todo_<?php echo $txid; ?>"></span>
979983
</td>
980984
<!-- unknown percent (added) -->
981985
<td class="td1 center">
982-
<span title="Unknown (%)" id="unknownpercent_' . $txid . '"></span>
986+
<span title="Unknown (%)" id="unknownpercent_<?php echo $txid; ?>"></span>
983987
</td>
984988
<!-- chart -->
985989
<td class="td1 center">
986990
<ul class="barchart">';
987991

992+
<?php
988993
$i = array(0,1,2,3,4,5,99,98);
989994
foreach ($i as $cnt) {
990995
echo '<li class="bc' . $cnt .
@@ -993,9 +998,11 @@ function edit_texts_show_text_row($txrecord, $currentlang, $statuses)
993998
<span id="stat_' . $cnt . '_' . $txid .'">0</span>
994999
</li>';
9951000
}
996-
echo ' </ul>
1001+
?>
1002+
</ul>
9971003
</td>
998-
</tr>';
1004+
</tr>
1005+
<?php
9991006
}
10001007

10011008
/**

‎inc/mobile_interactions.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Return false. Before 2.2.1, return true if we should use mobile mode.
2020
*
21-
* @return false Mobile mode shoud be activated or not
21+
* @return bool Mobile mode shoud be activated or not
2222
*
2323
* @since 2.2.1 You should not use this function since mobiledetect is no longer used.
2424
* @since 2.6.0-fork No longer deprecated and use no external library.

‎inc/session_utility.php‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,8 +2974,14 @@ function createDictLinksInEditWin3($lang,$sentctljs,$wordctljs): string
29742974
return $r;
29752975
}
29762976

2977-
// -------------------------------------------------------------
2978-
2977+
/**
2978+
* Return checked attribute if $val is in array $_REQUEST[$name]
2979+
*
2980+
* @param mixed $val Value to look for, needle
2981+
* @param string $name Key of request haystack.
2982+
*
2983+
* @return string ' ' of ' checked="checked" ' if the qttribute should be checked.
2984+
*/
29792985
function checkTest($val, $name): string
29802986
{
29812987
if (!isset($_REQUEST[$name])) {

0 commit comments

Comments
 (0)