Skip to content

Commit

Permalink
2.1.27
Browse files Browse the repository at this point in the history
Fixes:
- not expected visible "custom fields"
- KB opening
- SQL query (droping _install table)
  • Loading branch information
nilsteampassnet committed Sep 11, 2017
1 parent 67cf179 commit 33cd61c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Custom Field value can be masked
Database password is encrypted in settings.php file
PHPMailer library updated to 5.2.23
TwoFactorAuth library was updated
Configuration variables are not set in SESSION anymore. Now read from tp.config.php file.
Fix: issue on offline export
#1891 Install error - Uncaught Defuse\\Crypto\\Exception\\BadFormatException: Encoded data is shorter than expected
Expand Down
2 changes: 1 addition & 1 deletion items.load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ function(data_raw) {
if (data.fields === "") {
$(".tr_fields").addClass("hidden");
} else {
$(".tr_cf, .tr_fields").addClass("hidden");
$(".tr_cf, .tr_fields").removeClass("hidden");
var liste = data.fields.split('_|_');
for (var i=0; i<liste.length; i++) {
var field = liste[i].split('~~');
Expand Down
4 changes: 2 additions & 2 deletions items.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@
foreach ($_SESSION['item_fields'] as $elem) {
$itemCatName = $elem[0];
echo '
<tr class="tr_fields" id="tr_catfield_'.$elem[0].'" style="display:none;">
<tr class="tr_fields hidden" id="tr_catfield_'.$elem[0].'">
<td valign="top" class="td_title">&nbsp;<i class="fa fa-angle-right"></i>&nbsp;'.$elem[1].' :</td>
<td></td>
</tr>';
foreach ($elem[2] as $field) {
echo '
<tr class="tr_cf tr_fields" id="cf_tr_'.$field[0].'" style="display:none;">
<tr class="tr_cf tr_fields hidden" id="cf_tr_'.$field[0].'">
<td valign="top" class="td_title">&nbsp;&nbsp;<i class="fa fa-caret-right"></i>&nbsp;<i>'.$field[1].'</i> :</td>
<td>';
if ($field[3] === "masked") {
Expand Down
2 changes: 1 addition & 1 deletion sources/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function delTree($dir)
}

// Delete temporary install table
DB::query("DROP TABLE `_install`");
DB::query("DROP TABLE IF EXISTS `_install`");

// Delete tag
DB::delete(
Expand Down
4 changes: 3 additions & 1 deletion sources/items.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@
||
(isset($SETTINGS['duplicate_item']) && $SETTINGS['duplicate_item'] === '1')
) {
// Handle case where pw is empty
// if not allowed then warn user
if ((isset($_SESSION['user_settings']['create_item_without_password'])
&& $_SESSION['user_settings']['create_item_without_password'] !== '1'
) ||
Expand Down Expand Up @@ -2589,7 +2591,7 @@
$counter_full = DB::count();
$uniqueLoadData['counter_full'] = $counter_full;
}

// Check list to be continued status
if ($post_nb_items_to_display_once !== 'max' && ($post_nb_items_to_display_once + $start) < $counter_full) {
$listToBeContinued = "yes";
Expand Down
7 changes: 6 additions & 1 deletion sources/kb.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function utf8Urldecode($value)
$post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
$post_data = filter_input(INPUT_POST, 'data', FILTER_SANITIZE_STRING);
$post_key = filter_input(INPUT_POST, 'key', FILTER_SANITIZE_STRING);
$post_id = filter_input(INPUT_POST, $_POST['id'], FILTER_SANITIZE_NUMBER_INT);

// Construction de la requéte en fonction du type de valeur
if (null !== $post_type) {
Expand Down Expand Up @@ -186,6 +185,8 @@ function utf8Urldecode($value)
break;
}

$post_id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);

$ret = DB::queryfirstrow(
"SELECT k.id AS id, k.label AS label, k.description AS description, k.category_id AScategory_id, k.author_id AS author_id, k.anyone_can_modify AS anyone_can_modify, u.login AS login, c.category AS category
FROM ".prefix_table("kb")." AS k
Expand Down Expand Up @@ -221,7 +222,11 @@ function utf8Urldecode($value)
echo '[ { "error" : "key_not_conform" } ]';
break;
}

$post_id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);

DB::delete(prefix_table("kb"), "id=%i", $post_id);

break;
}
}
2 changes: 1 addition & 1 deletion sources/main.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ function generateKey()
function dateToStamp($date)
{
global $SETTINGS;

$date = date_parse_from_format($SETTINGS['date_format'], $date);
if ($date['warning_count'] == 0 && $date['error_count'] == 0) {
return mktime(23, 59, 59, $date['month'], $date['day'], $date['year']);
Expand Down

0 comments on commit 33cd61c

Please sign in to comment.