Zen Cart Logo
Forums / Bug Reports / [Not a bug] includes/functions_general.php typo?

[Not a bug] includes/functions_general.php typo?

Views: 535

Results 1 to 3 of 3
04 Dec 2019, 12:46
#1
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

[Not a bug] includes/functions_general.php typo?

in the includes/functions_general.php

/**
 * Alias to $db->prepareInput() for sanitizing db inserts
 * @param string $string
 * @return string
 */
  function zen_db_input($string) {
    global $db;
    return $db->prepareInput($string);
  }

should be

return $db->prepare_input($string);

??

04 Dec 2019, 13:24
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: [Not a bug] includes/functions_general.php typo?

The prepareInput method is a synonym for the prepare_input method, so they're identical.

04 Dec 2019, 13:28
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: [Not a bug] includes/functions_general.php typo?

I can't seem to find a conversation I had regarding this "difference". Both $db->prepareInput and $db->prepare_input are valid methods recognized in the query_factory class. The first references the second.

Question may be, what prompted identification of this as in what issue(s) are caused by the current usage? Also, if changed here, wouldn't it need to be changed everywhere it is used?

I wish I could find that conversation as there seemed to be a valid enough reason for it to remain. I tried to search GitHub issues and PRs to find that conversation as I thought I had it where it would likely remain more "permanent" with the code. My search was individually on both prepareinput and prepare_input on closed and open issues and PRs.