Advertisement
barryd

OpenEMR 4.1.2 (7) mysqli update/fixes

Jun 20th, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. Please use caution when making ANY of the following changes. Some are required changes, and they will mention the mysqli_* function replacement, but will be missing the semi-colon. This means that the function needs to be replaced but not the entire line, where as a line fix that does include a semi-colon will be the entire line.
  2.  
  3. /setup.php
  4.  
  5. line 14 - Notice: Undefined index: state in setup.php
  6. if (isset($_POST["state"]))
  7. $state = $_POST['state'] ?: NULL;
  8.  
  9. line 179 - Notice: Undefined index: inst in setup.php
  10. if (isset($_POST["inst"]))
  11. $inst = $_POST['inst'] ?: NULL;
  12.  
  13.  
  14. /library/globals.inc.php
  15.  
  16. line 58 - date_default_timezone_set('America/...'); //Required default timezone set PHP5
  17.  
  18.  
  19. /library/classes/Installer.class.php
  20.  
  21. line 8 - (Optional) - Suggested so these are the global object variables which aren't being set properally
  22. public $iuser = NULL;
  23. public $iuserpass = NULL;
  24. public $iuname = NULL;
  25. public $iufname = NULL;
  26. public $igroup = NULL;
  27. public $server = NULL;
  28. public $loginhost = NULL;
  29. public $port = NULL;
  30. public $root = NULL;
  31. public $rootpass = NULL;
  32. public $pass = NULL;
  33. public $dbname = NULL;
  34. public $collate = NULL;
  35. public $site = NULL;
  36. public $source_site_id = NULL;
  37. public $clone_database = NULL;
  38. public $no_root_db_access = NULL;
  39. public $development_translations = NULL;
  40. public $ippf_specific = NULL;
  41. public $conffile = NULL;
  42.  
  43. line 31 - Notice: Undefined index: "$key" in setup.php
  44. foreach ($cgi_variables as $key => $var) {
  45. if (array_key_exists($key, $_REQUEST))
  46. $this->$key = $var;
  47. }
  48.  
  49. line 122 - mysqli_select_db( $this->dbh, $this->dbname)
  50.  
  51. line 149 - mysqli_close()
  52.  
  53. line 209 - mysqli_error( $this->dbh) mysqli_errno( $this->dbh)
  54. line 217 - mysqli_error( $this->dbh) mysqli_errno( $this->dbh)
  55. line 225 - mysqli_error( $this->dbh) mysqli_errno( $this->dbh)
  56. line 233 - mysqli_error( $this->dbh) mysqli_errno( $this->dbh)
  57.  
  58. line 286 - (Optional) - Suggested so that errors are printed and timezone is set
  59. ini_set("display_errors", 1);
  60. error_reporting(E_ALL);
  61.  
  62. date_default_timezone_set("America/Vancouver");
  63.  
  64. line 325 - mysqli_fetch_array($res, MYSQLI_ASSOC)
  65.  
  66. line 445 - mysqli_query( $this->dbh, $sql)
  67. line 449 - mysqli_error($this->dbh)
  68.  
  69. line 457 - mysqli_connect()
  70. line 459 - mysqli_connect()
  71.  
  72.  
  73. /library/classes/Controller.class.php
  74.  
  75. line 79 - public static function act($qarray) {
  76.  
  77.  
  78. /library/classes/Tree.class.php
  79.  
  80. line 54 - if ($this->_root_type == ROOT_TYPE_NAME) {
  81. line 329 - $arrays = func_get_args();
  82.  
  83.  
  84. /controllers/C_Document.class.php
  85.  
  86. line 1049 - if (@is_array($categories[$id])) {
  87.  
  88.  
  89. /library/sql.inc
  90.  
  91. line 25 -
  92. //require_once(dirname(__FILE__) . "/adodb/drivers/adodb-mysql.inc.php");
  93. require_once(dirname(__FILE__) . "/adodb/drivers/adodb-mysqli.inc.php");
  94.  
  95. line 34 - class ADODB_mysqli_log extends ADODB_mysqli
  96. line 126 - mysqli_insert_id($this->_connectionID)
  97. line 136 - NewADOConnection("mysqli_log")
  98. line 202 - mysqli_query($GLOBALS['dbh'], $statement)
  99. line 244 - mysqli_query($GLOBALS['dbh'], $statement)
  100. line 284 -
  101. function sqlFetchArray($r)
  102. {
  103. if (is_object($r) && get_class($r) == 'mysqli_result') {
  104. //ensure it's an object (ie. is set)
  105. return mysqli_fetch_array($r, MYSQLI_ASSOC);
  106. }
  107. elseif(is_string($r))
  108. return mysqli_fetch_array(sqlStatement($r), MYSQLI_ASSOC);
  109. else { //$r != FALSE
  110. //treat as an adodb recordset
  111. if (is_a($r->connection->_connectionID, 'mysqli')) {
  112. if ($r === FALSE)
  113. return false;
  114. if (!is_object($r))
  115. return false;
  116. if ($r->EOF)
  117. return false;
  118. return $r->FetchRow();
  119.  
  120. }
  121. }
  122. }
  123.  
  124. line 497 - mysqli_error($GLOBALS['dbh'])
  125. line 510 - mysqli_real_escape_string($GLOBALS['dbh'], $table)
  126. line 513 - mysqli_fetch_array($resource, MYSQLI_ASSOC)
  127. line 532 -
  128. function sqlNumRows($r)
  129. {
  130. if (is_object($r) && get_class($r) == 'mysqli_result') {
  131. //treat as a mysql_query resource
  132. return mysqli_num_rows($r);
  133. }
  134. else {
  135. //treat as an adodb recordset
  136. return $r->RecordCount();
  137. }
  138. }
  139. line 597 - mysqli_query($GLOBALS['dbh'], $statement)
  140.  
  141.  
  142. /gacl/gacl.class.php
  143.  
  144. line 39 - (Optional) To use the most recent and single adodb from /library/adodb
  145. define('ADODB_DIR', realpath(dirname(__FILE__) . '/../library/adodb'));
  146.  
  147. line 74 - var $_db_type = 'mysqli';
  148.  
  149.  
  150. /gacl/gacl.ini.php
  151.  
  152. line 5 - (Optional/Reconmended)
  153. _db_type = "mysqli"
  154. _db_host = "localhost"
  155. _db_user = "openemr"
  156. _db_password = "password"
  157. _db_name = "openemr"
  158.  
  159.  
  160. /gacl/gacl_api.class.php
  161.  
  162. line 1089 - Strict Standards: Only variables should be assigned by reference
  163. $object_id = $this->get_object_id($section_value, $value, $map);
  164. line 1122 - Strict Standards: Only variables should be assigned by reference
  165. $group_data = $this->get_group_data($group_id, $map);
  166.  
  167.  
  168. /gacl/setup.php
  169.  
  170. line 38 -
  171. /*
  172. * Test database connection
  173. */
  174. echo 'Testing database connection...<br/>'."\n";
  175.  
  176. if (!mysqli_real_connect($db->_connectionID, $gacl->_db_host, $gacl->_db_user, $gacl->_db_password, $gacl->_db_name)) {
  177. echo_failed('<b>ERROR</b> connecting to database,<br/>
  178. are you sure you specified the proper host, user name, password, and database in <b>admin/gacl_admin.inc.php</b>?<br/>
  179. Did you create the database, and give read/write permissions to &quot;<b>'.$db_user.'</b>&quot; already?');
  180. exit;
  181. } else {
  182. echo_success('Connected to &quot;<b>'.$db_type.'</b>&quot; database on &quot;<b>'.$db_host.'</b>&quot;.');
  183. }
  184.  
  185.  
  186. /library/formdata.inc.php
  187.  
  188. line 32 - mysqli_real_escape_string($GLOBALS['dbh'], $s)
  189.  
  190.  
  191. /library/log.inc
  192.  
  193. line 6 - function newEvent($event, $user, $groupname, $success, $comments="", $patient_id=null) {
  194. line 17 - if(($patient_id=="NULL") || ($patient_id==null))$patient_id=0;
  195. line 126 - mysqli_insert_id($GLOBALS['dbh']);
  196.  
  197.  
  198. /library/onotes.inc
  199.  
  200. line 50 - $all = array();
  201.  
  202.  
  203. /interface/globals.php
  204.  
  205. line 3 - date_default_timezone_set('America/...'); //Required default timezone set PHP5
  206.  
  207.  
  208. /interface/main/calendar/config.php
  209.  
  210. line 29 - $pnconfig['dbtype'] = 'mysqli';
  211.  
  212.  
  213. /interface/main/onotes/office_comments_full.php
  214.  
  215. line 111 - $result_count = 0;
  216. line 112 - $notes_count = 0;
  217.  
  218.  
  219. /interface/usergroup/usergroup_admin.php
  220.  
  221. line 43 - mysqli_fetch_array(sqlStatement("select * from users where id={$_POST["id"]}"))
  222. line 183 - mysqli_fetch_array(sqlStatement("select username from users where id={$_POST["id"]}"))
  223. line 205 - mysqli_fetch_array($res)
  224.  
  225.  
  226. /interface/usergroup/addrbook_list.php
  227.  
  228. line 37 -
  229. $form_fname = @trim($_POST['form_fname']) ?: NULL;
  230. $form_lname = @trim($_POST['form_lname']) ?: NULL;
  231. $form_specialty = @trim($_POST['form_specialty']) ?: NULL;
  232. $form_organization = @trim($_POST['form_organization']) ?: NULL;
  233. $form_abook_type = @trim($_REQUEST['form_abook_type']) ?: NULL;
  234. $form_external = @$_POST['form_external'] ? 1 : 0;
  235.  
  236. line 102 - attr($form_organization)
  237. line 105 - attr($form_fname)
  238. line 108 - attr($form_lname)
  239. line 111 - attr($form_specialty)
  240. line 117 - generate_select_list("form_abook_type", "abook_type", $form_abook_type, '', 'All')
  241.  
  242.  
  243. /library/patient.inc
  244.  
  245. line 266 - mysqli_real_escape_string($GLOBALS['dbh'], $providerID)
  246. line 297 - mysql1_real_escape_string($providerID)
  247. line 782 - mysql1_insert_id($GLOBALS['dbh'])
  248.  
  249.  
  250. /library/calendar.inc
  251.  
  252. line 45 - mysqli_real_escape_string($GLOBALS['dbh'], $name)
  253.  
  254.  
  255. /library/classes/Provider.class.php
  256.  
  257. line 44 - mysqli_real_escape_string($GLOBALS['dbh'], $this->id)
  258.  
  259.  
  260. /library/classes/InsuranceNumbers.class.php
  261.  
  262. line 55 - mysqli_fetch_array($results, MYSQLI_ASSOC)
  263.  
  264.  
  265. /library/classes/Prescription.class.php
  266.  
  267. line 528 - mysqli_real_escape_string($GLOBALS['dbh'], $this->provider->id)
  268. line 571 - mysqli_real_escape_string($GLOBALS['dbh'], $this->provider->id)
  269. line 625 - mysqli_real_escape_string($GLOBALS['dbh'], $patient_id)
  270. line 626 - mysqli_real_escape_string($GLOBALS['dbh'], $order_by)
  271. line 628 - mysqli_fetch_array($results, MYSQLI_ASSOC)
  272.  
  273.  
  274. /library/classes/Tree.class.php
  275.  
  276. line 41 - mysqli_real_escape_string($GLOBALS['dbh'], $root)
  277. line 42 - mysqli_real_escape_string($root_type)
  278.  
  279.  
  280. /library/acl.inc
  281.  
  282. line 387 - mysqli_fetch_array(sqlStatement("select * from users where username='" .
  283. $username . "'"))
  284. line 417 - mysqli_fetch_array(sqlStatement("select * from users where username='" .
  285. $username . "'"))
  286.  
  287.  
  288. /library/report.inc
  289.  
  290. line 258 - mysqli_real_escape_string($GLOBALS['dbh'], $pid)
  291. line 259 - mysqli_real_escape_string($GLOBALS['dbh'], $encounter)
  292.  
  293.  
  294. /library/transactions.inc
  295.  
  296. line 22 - mysqli_real_escape_string($GLOBALS['dbh'], $body);
  297.  
  298.  
  299. /library/registry.inc
  300.  
  301. line 20 - mysqli_real_escape_string($GLOBALS['dbh'], $directory)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement