Ignore:
Timestamp:
Sep 13, 2011, 10:03:04 PM (13 years ago)
Author:
Eric
Message:
  • Use data serialization for database storage
  • Use pwg_db_real_escape_string() instead of addslashes()
Location:
extensions/HistoryIPExcluder/branches/2.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/HistoryIPExcluder/branches/2.2/admin/HIPE_admin.php

    r6758 r12151  
    4242    'Version'   => $version,
    4343  );
    44  
    45   $conf['HistoryIPConfig'] = serialize($newconf_HIPE);
    46 
    47   $query = '
    48     UPDATE '.CONFIG_TABLE.'
    49     SET value="'.addslashes($conf['HistoryIPConfig']).'"
    50     WHERE param="HistoryIPConfig"
    51     LIMIT 1';
    52   pwg_query($query);
     44
     45  conf_update_param('HistoryIPConfig', pwg_db_real_escape_string(serialize($newconf_HIPE)));
    5346
    5447  // information message
  • extensions/HistoryIPExcluder/branches/2.2/include/dbupgrade.inc.php

    r10046 r12151  
    33/* Database upgrading functions */
    44
    5 // This wil update only current plugin version number in database
     5// This will update only current plugin version number in database
    66function global_version_update()
    77{
     
    2525 
    2626  $Newconf_HIPE['Version'] = $version;
    27  
    28   $update_conf = serialize($Newconf_HIPE);
    2927
    30   $query = '
    31 UPDATE '.CONFIG_TABLE.'
    32 SET value="'.addslashes($update_conf).'"
    33 WHERE param="HistoryIPConfig"
    34 LIMIT 1
    35 ;';
    36 
    37         pwg_query($query);
     28  conf_update_param('HistoryIPConfig', pwg_db_real_escape_string(serialize($Newconf_HIPE)));
    3829}
    3930
     
    7162  $q = '
    7263INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
    73 VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
     64VALUES ("HistoryIPConfig","'.pwg_db_real_escape_string(serialize($default)).'","History IP Excluder options");
    7465';
    7566     
  • extensions/HistoryIPExcluder/branches/2.2/language/it_IT/index.php

    r5121 r12151  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
     3// | Piwigo - a PHP based photo gallery                                    |
    64// +-----------------------------------------------------------------------+
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
    9 // | last modifier : $Author: rub $
    10 // | revision      : $Revision: 1912 $
     5// | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    118// +-----------------------------------------------------------------------+
    129// | This program is free software; you can redistribute it and/or modify  |
  • extensions/HistoryIPExcluder/branches/2.2/main.inc.php

    r10046 r12151  
    3232
    33332.2.3             - Improved update mechanism. When no structural update of database is necessary, it sets the correct version number in plugin's configuration
    34 
    3534--------------------------------------------------------------------------------
    3635*/
  • extensions/HistoryIPExcluder/branches/2.2/maintain.inc.php

    r10046 r12151  
    4949    $q = '
    5050INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
    51 VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
     51VALUES ("HistoryIPConfig","'.pwg_db_real_escape_string(serialize($default)).'","History IP Excluder options");
    5252';
    5353    pwg_query($q);
Note: See TracChangeset for help on using the changeset viewer.