Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    379
    Plugin Contributions
    2

    Default Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    1.5.7c

    I am looking at adding a configuration value that has HTML as part of the value. I want to use WORDS_AND_SYMBOLS_REGEX sanitization.
    My options seem to be:
    1) duplicate configuration.php and adjust for the required sanitisation. (OR write my own)
    2) Modify the init_sanitize.php to add the configuration key to the list that uses WORDS_AND_SYMBOLS_REGEX.

    option 1 seems to be over kill,
    Option 2 modifies a base file and i would rather not do that.

    What am is missing? Is there an other way to do this?

    I was wanting to add a shipping message and was going to add it to the configuration>shipping menu.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  2. #2
    Join Date
    Jun 2009
    Location
    Sparta, TN
    Posts
    153
    Plugin Contributions
    0

    Default Re: Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    Have you looked at this? Go to your admin's Tools :: Define Pages Editor and choose to edit define_checkout_success.php.

  3. #3
    Join Date
    Apr 2009
    Posts
    379
    Plugin Contributions
    2

    Default Re: Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    Know about that, thanks. I wanted to add the message to many pages and be consistent. I could add an include file but for me was easier to add a new value to database, so was wondeting if there was a way to set a new configuration value that is sanitized with WORDS_AND_SYMBOLS_REGEX. Have set it up but have to edit in the database as it is sanitised and < becomes &lt; etc.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    11,312
    Plugin Contributions
    80

    Default Re: Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    I had a similar issue with my One-Page Checkout (https://www.zen-cart.com/downloads.p...file&id=2095); see this (https://github.com/lat9/one_page_che...t_one.php#L143) code fragment that changes the < and > symbols back to their 'native' format (instead of &lt; and &gt;).

  5. #5
    Join Date
    Apr 2009
    Posts
    379
    Plugin Contributions
    2

    Default Re: Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    Quote Originally Posted by lat9 View Post
    I had a similar issue with my One-Page Checkout (https://www.zen-cart.com/downloads.p...file&id=2095); see this (https://github.com/lat9/one_page_che...t_one.php#L143) code fragment that changes the < and > symbols back to their 'native' format (instead of < and >).
    As homer simpson would say DOH! I didn't think of that such and easy solution.
    Thanks!
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  6. #6
    Join Date
    Jul 2012
    Posts
    16,447
    Plugin Contributions
    17

    Default Re: Add configuration value that used WORDS_AND_SYMBOLS_REGEX

    Could also include a non null/non empty val_function that would return true from the admin function zen_validate_configuration_entry for the configuration_key and later/separately direct sanitization of the associated configuration_key. By it being non null/non empty, no action is taken against the configuration value allowing the desired sanitization to subsequently be executed... Hoops to jump through to get there (e.g. more complex), but an alternate method to directly apply the admin sanitization as currently designed.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v155 Use of Configuration value in if statement
    By Dave224 in forum General Questions
    Replies: 3
    Last Post: 5 Jun 2020, 10:51 PM
  2. v151 Gift certificates that have been used
    By attroll in forum General Questions
    Replies: 4
    Last Post: 3 Mar 2016, 06:08 PM
  3. Replies: 6
    Last Post: 2 Dec 2013, 08:26 PM
  4. Need to have 1 option value used in all dropdown options
    By skruzich in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 22 May 2012, 05:21 PM
  5. Currency value (how is this defined/used?) and updating currencies
    By spidersilk in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jun 2006, 10:50 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