1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

241 Commits

Author SHA1 Message Date
Cameron
55980a29a8 Generated PHPDoc for all classes in e107_handlers where one was missing. toNumber() updated to always return int or float. 2022-04-04 10:54:24 -07:00
Nick Liu
20882920a0
Fix all PHP 8.1 test failures
* `strftime()` has been replaced with a polyfill based on `DateTime`.
* Explicit type casts/assertions added where required by PHP 8.1
* `filter_var(…, FILTER_SANITIZE_STRING)` replaced with `strip_tags()`
  or HTML entity encoding of quotation marks, depending on a guess of
  what the intended "sanitization" was
* `http_build_query()` usage type mismatches fixed
* Removed usages of the `FILE_TEXT` constant
* To avoid breaking PHP 5.6 compatibility (function return types),
  `e_session_db` no longer implements `SessionHandlerInterface`.
  Instead, the alternative non-OOP invocation of
  `session_set_save_handler()` is used instead to apply the session
  handler.
* The shim for `strptime()` still calls the native function if available
  but now suppresses the deprecation warning.

* `e_db_pdo` explicitly asks for `PDO::ATTR_STRINGIFY_FETCHES` to
  maintain consistent behavior with past versions of PHP.
* `e_db_mysql` explicitly sets `mysqli_report(MYSQLI_REPORT_OFF)` to
  maintain consistent behavior with past versions of PHP.

* Removed pointless random number generator seed from `banner` plugin
* Workaround for `COUNT(*)` SQL query in
  `validatorClass::dbValidateArray()` without a proper API for avoiding
  SQL injection
2021-09-04 15:06:19 +02:00
Cameron
522d71d243 Reduced some memory usage. 2021-01-24 17:00:02 -08:00
Cameron
402d1f4126 Closes #1801 Code cleanup. Deprecated method errors added. 2020-12-22 14:48:28 -08:00
Cameron
630f3f415f Improved detection of deprecated functions/methods and display in DEBUG mode: deprecated. 2020-12-21 10:00:28 -08:00
Cameron
601df26d51 Code optimization for speed and reduced memory usage. 2020-12-20 11:50:10 -08:00
Cameron
5b82c292b1 Code cleanup 2020-12-18 19:55:12 -08:00
Cameron
7238743542 Regex fixes and path fix for TinyMce. 2020-12-18 13:07:45 -08:00
Cameron
0e90d4aa66 Code optimization and cleaning 2020-12-17 13:13:29 -08:00
Cameron
44e260b121 Code cleanup and optimization 2020-12-14 16:21:48 -08:00
Cameron
072c1b3a90 Fixes #4268 - missing field in table definition. Tests added. 2020-11-29 14:05:14 -08:00
Cameron
834ea354e4 Core Cleanup. 2020-05-02 15:35:30 -07:00
Cameron
5471a84746 Fixes #4111 Inconsistent results under some circumstances with e107::getDb()->retrieve(). Tests have been added to this commit. 2020-03-13 15:06:26 -07:00
Cameron
d23c65b30c Fixes #4083 Column selector displaying improperly defined field.
Admin-UI: Multi-language database language only displays when a table match is found.
2020-02-22 10:03:41 -08:00
Nick Liu
8b354adf44
Don't spam database server with connections
- MOD: Silently ignore failures to e_db_mysql::close(); if it's failing, it's probably already closed
- FIX: Close the PDO or mysqli connection after each e_db_abstractTest test
- MOD: Changed class2.php's $sql variable to be hinted as an e_db instead of e_db_mysql
2020-01-19 14:33:11 +01:00
Nick Liu
8c528de191
e_db_mysql: Replaced mysql with mysqli
Finally no longer using the mysql_* functions removed in PHP 7.0
2020-01-19 13:33:52 +01:00
Nick Liu
4a26ac5fd7
Removed unused USE_PERSISTANT_DB constant 2020-01-19 12:57:39 +01:00
Nick Liu
c78976750c
Removed PDO from e_db_mysql
e_db_mysql has divorced e_db_pdo. They are now independently functioning implementations of e_db.
2020-01-19 12:52:22 +01:00
Nick Liu
72d3f07410
PHP 5.6 fixes for e_db_mysql
- FIX: Don't redefine MYSQL_* constants in e_db_pdo_class.php
- FIX: e_db_mysql::rowCount() could try to use mysql_num_rows() to count rows of a non-resource
- FIX: e_db_mysql::delete() stores the number of deleted rows in e_db_mysql::$mySQLrows
- FIX: e_db_abstractTest::testDb_Query() was fetching in PDO mode but shouldn't have been
- FIX: Typos in e_db_abstractTest::testDelete()
- MOD: Moved PDO-exclusive testBackup() from e_db_abstractTest to e_db_pdoTest
- FIX: e_db_mysqlTest now works in PHP 5.6 if the main e_db instance was in PDO mode but the test
       class initializes in legacy mode
- MOD: e_db_mysqlTest now asserts that PDO mode is not in use
- FIX: e_db_mysqlTest::testGetServerInfo() should now actually get a version number
- FIX: e_db_mysqlTest::testGetLastErrorNumber() has a different error code compared to PDO
- FIX: e_db_mysqlTest::testEscape() should actually get something from mysql_real_escape_string()
2020-01-19 12:30:23 +01:00
Nick Liu
be8f2bbeb6
Fixed PHP 7.3 warnings
- FIX: Silenced compact() in e107Test::testInitCore()
- FIX: Null check in e_db_pdo::makeTableDef()
- FIX: Null check in e_db_mysql::makeTableDef()
- FIX: userlogin::login() had this warning on line 148:
       "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
2020-01-18 18:52:20 +01:00
Nick Liu
98911f0b8e
Guard type errors in e_db::insert() implementations 2020-01-18 11:05:08 +01:00
Nick Liu
ef34ef7ec8
Removed obsolete ALLOW_AUTO_FIELD_DEFS constant 2020-01-17 15:54:56 +01:00
Nick Liu
a93165efa5
Implemented missing e_db_mysql::resetTableList() method
e_db::resetTableList() is now an interface method (undocumented)
2019-12-23 17:12:47 +01:00
Nick Liu
a4ad81dd4c
Resolved e_db_mysql::db_Query() logging inconsistency
Logging change made in f34eeaf369678ddafe2842b391e3b1ec534aa324 for e_db_pdo was not applied to e_db_mysql

This commit makes the behaviors consistent between the two implementations of e_db.
2019-12-23 17:08:01 +01:00
Nick Liu
71e7f8778c
Merged e_db_mysql and e_db_pdo tests into e_db_abstractTest
- FIX: e_db::copyTable() is now an interface
- FIX: e_db_mysql now implements e_db
- FIX: Implemented missing e_db_mysql::copyTable() public method
- FIX: Implemented missing e_db_mysql::setLanguage() method
- FIX: Implemented missing e_db_mysql::getLanguage() method
- FIX: Implemented missing e_db_mysql::dropTable() method
- MOD: Merged e_db_mysqlTest and e_db_pdoTest into e_db_abstractTest
2019-12-23 16:37:48 +01:00
Cameron
7e90cfb4b5 Fix for mysql tests. 2019-06-06 07:07:59 -07:00
Cameron
60b7f3ae6d Minor tweaks. 2019-06-05 21:59:03 -07:00
Cameron
ce7f3feb38 PDO class now used by default. mysql_class.php currently deprecated until it is modified to use mysqli. Install routine upgraded. Install logging vastly improved. 2019-06-03 15:27:36 -07:00
Cameron
be8d2fca28 Fixes #3800 Issue with DB structure update and database name containing hyphens. 2019-05-28 10:49:32 -07:00
Cameron
614711ff21 Database: Prevent gaps in PRIMARY index when using DUPLICATE_KEY_UPDATE with insert() method. 2019-02-25 18:51:49 -08:00
Cameron
25c9a44a87 Fix for db_FieldList(); 2019-02-13 15:54:04 -08:00
Cameron
c45ed85c5c db_Fetch() e_LEGACY_MODE permanently removed. Old plugins should use $sql->fetch('both'); if this is still required. 2019-02-13 10:31:28 -08:00
Cameron
c34f8b41f3 Mysql class optimization and minor fixes. 2019-02-11 15:40:10 -08:00
Cameron
4e9f47c8b4 PDO class optimization 2019-02-10 16:19:25 -08:00
Cameron
f735292e3f More db class tweaks 2019-02-09 13:07:34 -08:00
Cameron
b471292a36 Removed globals from db_Write_log() method. 2019-02-09 12:47:54 -08:00
Achim Ennenbach
96a84a1e93 fixes an issue with pdoBind not being initialized properly
fixes an issue with update(), returning sometimes an object instead of
the number of updated records.
fixes an issue with delete(), returning sometimes an object instead of
the number of deleted records
2019-02-03 19:35:45 +01:00
Cameron
35ff23b55f MySQL backup - disable 'databases' flag for a more flexible import. 2019-01-28 18:38:01 -08:00
Cameron
7e5fe2eaad MySQL backup - automatically add '.gz' to the filename when gZip is enabled. 2019-01-28 18:24:11 -08:00
Cameron
6d75ea2145 Fixed mysql class backup method errors. Third-party Mysqldump class added and integrated. 2019-01-28 17:53:45 -08:00
Cameron
b19463b259 PHPDoc updates 2019-01-26 10:28:08 -08:00
Tijn Kuyper
1a40b80915 Make sure mysql_* functions are available, otherwise use PDO 2019-01-10 17:22:49 +01:00
Cameron
e44fc0c13a Fixes issues with secondary database connections. 2019-01-05 14:37:12 -08:00
Cameron
519001a690 PHP 7.2 null fix courtesy of Miro. 2018-12-18 12:12:46 -08:00
Cameron
b5157e70cb Fixes #3422 Installation issue with database names containing a hyphen. 2018-09-06 11:20:43 -07:00
Cameron
2bd651c630 Fixes #2593, Fixes #1586 User-extended 'database' field options were not being saved. 2018-08-26 10:23:55 -07:00
Nick Liu
3407b717c6
Reduce reliance on global var $db_ConnectionID
When one of the 11 methods in e_db_mysql look for a PDO object in
e_db_mysql::$mySQLaccess, global $db_ConnectionID can be NULL in some
cases, so it's more reliable to get the singleton e_db_mysql and use the
e_db_mysql::$mySQLaccess from that singleton.

This change still allows global $db_ConnectionID to be used, but if
$db_ConnectionID is NULL, the singleton fallback is used.

Fixes: e107inc/e107-test#6
2018-07-20 05:24:55 -05:00
Achim Ennenbach
eeaa9b22a8 New method to check table indexes 2018-06-08 22:59:24 +02:00
Cameron
c7c3c49daf Support for 'IGNORE' duplicate key on INSERT. 2018-05-09 11:13:05 -07:00
Achim Ennenbach
d01a97816f refactoring toNumber() into e_parse class 2018-05-04 19:27:00 +02:00