Thread: gv_no not set

Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,154
    Plugin Contributions
    11

    Default gv_no not set

    Basic 1.5.8a with no specific mods and PHP 8.0

    This cropped up in an earlier thread but got drowned out by the larger problem at the time.

    Code:
    [22-Dec-2023 17:20:14 UTC] Request URI: /index.php?main_page=gv_redeem, IP address: 158.91.17.198, Language id 1
    #1 require(/includes/modules/pages/gv_redeem/header_php.php) called at [/index.php:35]
    --> PHP Warning: Undefined array key "gv_no" in /includes/modules/pages/gv_redeem/header_php.php on line 13.
    The decision was made to add GCs and Discounts to a site.

    I'm not sure what triggers the setting of gv_no but it appears that it is trying to sanitize the gv_no

    Line 13 is
    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));$_GET['gv_no'] = zen_sanitize_string(trim($_GET['gv_no']));
    The quick fix was to use
    Code:
    if (isset($_GET['gv_no'])) {    $_GET['gv_no'] = zen_sanitize_string(trim($_GET['gv_no']));
    } else {
        // Handle the case when 'gv_no' is not set, perhaps provide a default value or perform some other action
        // For example, you can set it to an empty string:
    $_GET['gv_no'] = '';
    }
    This seems to avoid the warning, I just wanted to see if there was a better way to stop the warning.

    THANX

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,694
    Plugin Contributions
    9

    Default Re: gv_no not set

    Quote Originally Posted by dbltoe View Post
    ...I just wanted to see if there was a better way to stop the warning.
    Code:
    $_GET['gv_no'] = zen_sanitize_string(trim($_GET['gv_no'] ?? ''));
    TIS.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,154
    Plugin Contributions
    11

    Default Re: gv_no not set

    THANX

    good simplification.

 

 

Similar Threads

  1. includes/configure.php file contents invalid. ie: DIR_FS_CATALOG not valid or not set
    By ckosloff in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 16 Apr 2023, 05:20 PM
  2. Replies: 6
    Last Post: 29 Aug 2012, 12:28 PM
  3. Dir_fs_catalog_templates not set
    By calvin2 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 2 Jan 2011, 12:23 AM
  4. Receiving error _Autentication not set up or API not right.
    By wwwursa in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 2 Mar 2009, 06:27 PM
  5. Dir_fs_catalog_templates Not Set
    By sheba10 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 28 Sep 2008, 02:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR