Skip to content

Instantly share code, notes, and snippets.

@BlueSkyDetector
Created October 17, 2013 03:30
Show Gist options
  • Select an option

  • Save BlueSkyDetector/7018855 to your computer and use it in GitHub Desktop.

Select an option

Save BlueSkyDetector/7018855 to your computer and use it in GitHub Desktop.

Revisions

  1. BlueSkyDetector created this gist Oct 17, 2013.
    21 changes: 21 additions & 0 deletions ZBX-7091_fix_profile_for_1.8.x.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    Index: frontends/php/include/profiles.inc.php
    ===================================================================
    --- frontends/php/include/profiles.inc.php (revision 39357)
    +++ frontends/php/include/profiles.inc.php (working copy)
    @@ -133,7 +133,7 @@
    'profileid' => get_dbid('profiles', 'profileid'),
    'userid' => $USER_DETAILS['userid'],
    'idx' => zbx_dbstr($idx),
    - $value_type => ($value_type == 'value_str') ? zbx_dbstr($value) : $value,
    + $value_type => zbx_dbstr($value),
    'type' => zbx_dbstr($type),
    'idx2' => zbx_dbstr($idx2)
    );
    @@ -153,7 +153,6 @@
    if($idx2 > 0) $sql_cond.= ' AND idx2='.$idx2.' AND '.DBin_node('idx2', false);

    $value_type = self::getFieldByType($type);
    - $value = ($value_type == 'value_str') ? zbx_dbstr($value) : $value;

    $sql = 'UPDATE profiles SET '.
    $value_type.'='.zbx_dbstr($value).','.