Changeset 630
- Timestamp:
- Jun 8, 2018 3:41:16 AM (6 years ago)
- Location:
- trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r629 r630 1601 1601 1602 1602 /** 1603 * Force the user to connect via https (port 443) by redirecting them to 1604 * the same page but with https. 1603 * This function has changed to do nothing. SSL redirection should happen at the server layer, doing so here may result in a redirect loop. 1605 1604 */ 1606 1605 public function sslOn() 1607 1606 { 1608 if (function_exists('apache_get_modules')) { 1609 $modules = apache_get_modules(); 1610 } else { 1611 // It's safe to assume we have mod_ssl if we can't determine otherwise. 1612 $modules = array('mod_ssl'); 1613 } 1614 1615 if (!getenv('HTTPS') && $this->getParam('ssl_enabled') && in_array('mod_ssl', $modules)) { 1616 $this->raiseMsg(sprintf(_("Secure SSL connection made to %s"), $this->getParam('ssl_domain')), MSG_NOTICE, __FILE__, __LINE__); 1617 // Always append session because some browsers do not send cookie when crossing to SSL URL. 1618 $this->dieURL('https://' . $this->getParam('ssl_domain') . getenv('REQUEST_URI'), null, true); 1619 } 1607 $app =& App::getInstance(); 1608 $app->logMsg(sprintf('sslOn was called and ignored.', null), LOG_DEBUG, __FILE__, __LINE__); 1620 1609 } 1621 1610 … … 1626 1615 { 1627 1616 $app =& App::getInstance(); 1628 $app->logMsg(sprintf('sslOff was called and ignored.', null), LOG_ INFO, __FILE__, __LINE__);1617 $app->logMsg(sprintf('sslOff was called and ignored.', null), LOG_DEBUG, __FILE__, __LINE__); 1629 1618 } 1630 1619 -
trunk/lib/DB.inc.php
r627 r630 78 78 79 79 // Caches. 80 protected $existing_tables;81 protected $table_columns;80 protected static $existing_tables = null; 81 protected static $table_columns = null; 82 82 83 83 /** … … 377 377 } 378 378 379 if ( !isset($this->existing_tables) || !$use_cached_results) {380 $this->existing_tables = array();379 if (is_null(self::$existing_tables) || !$use_cached_results) { 380 self::$existing_tables = array(); 381 381 $qid = $this->query("SHOW TABLES"); 382 382 while (list($row) = mysql_fetch_row($qid)) { 383 $this->existing_tables[] = $row;383 self::$existing_tables[] = $row; 384 384 } 385 385 } 386 if (in_array($table, $this->existing_tables)) { 386 387 if (in_array($table, self::$existing_tables)) { 387 388 return true; 388 389 } else { … … 421 422 } 422 423 423 if (!isset( $this->table_columns[$table]) || !$use_cached_results) {424 if (!isset(self::$table_columns[$table]) || !$use_cached_results) { 424 425 // Populate and cache array of current columns for this table. 425 $this->table_columns[$table] = array();426 self::$table_columns[$table] = array(); 426 427 $qid = $this->query("DESCRIBE $table"); 427 428 while ($row = mysql_fetch_row($qid)) { 428 $this->table_columns[$table][] = $row[0];429 self::$table_columns[$table][] = $row[0]; 429 430 } 430 431 } … … 433 434 // Do an exact comparison of table schemas. 434 435 sort($columns); 435 sort( $this->table_columns[$table]);436 return $this->table_columns[$table] == $columns;436 sort(self::$table_columns[$table]); 437 return self::$table_columns[$table] == $columns; 437 438 } else { 438 439 // Only check that the specified columns are available in the table. 439 $match_columns = array_intersect( $this->table_columns[$table], $columns);440 $match_columns = array_intersect(self::$table_columns[$table], $columns); 440 441 sort($columns); 441 442 sort($match_columns); … … 467 468 public function resetCache() 468 469 { 469 $this->existing_tables = null;470 $this->table_columns = null;470 self::$existing_tables = null; 471 self::$table_columns = null; 471 472 } 472 473 -
trunk/lib/DBSessionHandler.inc.php
r583 r630 114 114 )"); 115 115 116 if (!$this->db->columnExists($this->_params['db_table'], array('session_id', 'session_data', 'last_access'))) { 116 if (!$this->db->columnExists($this->_params['db_table'], array( 117 'session_id', 118 'session_data', 119 'last_access' 120 ), false, false)) { 117 121 $app->logMsg(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->_params['db_table']), LOG_ALERT, __FILE__, __LINE__); 118 122 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->_params['db_table']), E_USER_ERROR); -
trunk/lib/Email.inc.php
r628 r630 78 78 ); 79 79 80 // String that contains filename of the template used (for logging). 81 protected $_template_filename; 82 80 83 // String that contains the email body. 81 84 protected $_template; … … 198 201 // This could be a new template, so reset the _template_replaced. 199 202 $this->_template_replaced = null; 203 204 $this->_template_filename = $template; 205 200 206 return true; 201 207 } … … 221 227 // This could be a new template, so reset the _template_replaced. 222 228 $this->_template_replaced = null; 229 230 $this->_template_filename = '(using Email::setString)'; 231 223 232 return true; 224 233 } … … 281 290 if (preg_match('/({[^}]+})/', $final_body, $unreplaced_match)) { 282 291 unset($unreplaced_match[0]); 283 $app->logMsg(sprintf('Cannot get email body. Unreplaced variable s in template:%s', getDump($unreplaced_match)), LOG_ERR, __FILE__, __LINE__);292 $app->logMsg(sprintf('Cannot get email body. Unreplaced variable %s in template %s', getDump($unreplaced_match)), LOG_ERR, __FILE__, __LINE__); 284 293 return false; 285 294 } … … 339 348 if (preg_match('/({[^}]+})/', $final_body, $unreplaced_match)) { 340 349 unset($unreplaced_match[0]); 341 $app->logMsg(sprintf('Cannot send email. Unreplaced variables in template: %s', getDump($unreplaced_match)), LOG_ERR, __FILE__, __LINE__); 342 return false; 350 $app->logMsg(sprintf('Unreplaced variable "%s" in template "%s"', getDump($unreplaced_match), $this->_template_filename), LOG_ERR, __FILE__, __LINE__); 343 351 } 344 352
Note: See TracChangeset
for help on using the changeset viewer.