1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-29 04:38:07 +01:00
Commit Graph

4161 Commits

Author SHA1 Message Date
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
Nick Liu
f6d6d1b185 Deprecate e_parse::toJS()
`e_parse::toJS()`, documented with the description

> Convert text blocks which are to be embedded within JS

, does not protect strings from injections, which appears to be its
primary use.  Additionally, it performs multiple unrelated string
modifications:

* Replace Windows line breaks with a literal `\\n` (which would later be
  parsed as `\n` in JavaScript/JSON)
* Does not modify Unix line breaks (`\n`), which is inconsistent with
  the Windows line break behavior
* Removes HTML tags
* Replaces HTML entities as `htmlentities()` does

This method cannot be fixed because its usages are inconsistent.  Most
notably, some usages surround the method's output in single quotes while
others surround it with double quotes.  Strings cannot be JSON-encoded
without confounding quotation mark styles.

All core usages of `e_parse::toJS()` have been replaced with
alternatives, which are also documented in the method's DocBlock.

Fixes: #4546
2021-08-31 00:11:14 +02:00
Cameron
7973e10dea Debug code removal. Rel prev/next added. 2021-08-13 11:53:21 -07:00
Cameron
fe8ae40f30 Robot directive removed from default route. 2021-07-26 16:15:55 -07:00
Cameron
95fab15c02 Gsitemap: Display link visibility status while importing. 2021-07-22 13:51:35 -07:00
Cameron
fce00b4276 Gsitemap: Fix for importing navigation links that use a SEF URL configuration. 2021-07-22 12:15:04 -07:00
Nick Liu
7a04260b5f #4299: Wrap even more potentially undefined constants
In:
* Admin-UI
* Forums
2021-07-21 20:23:06 +02:00
Cameron
ebe9c8cf13 Precaution to avoid fatal error with some admin-ui configurations. Fontello preload code removed. (some cases may use FA instead) 2021-07-15 17:38:39 -07:00
Cameron
04576b9f79 Commented library preload code. 2021-07-14 12:20:57 -07:00
Nick Liu
ccf0f037aa #4299: Wrap more potentially undefined constants
In:
* Forums
* /e107_admin/menus.php
2021-07-13 13:10:59 +02:00
Cameron
c941e5b98d Issue #4024 - Pagination url option added to News preferences. Select between 'record' (legacy format eg. page=20, page=40 etc) or 'page' numbers (page=1, page=2 etc). Experimental - requires more testing. 2021-07-06 17:53:55 -07:00
Cameron
d2411404c4 Issue #4299 PHP8 Fix 2021-06-14 17:05:57 -07:00
Cameron
5652fd2bd9 Merge pull request #4515 from Deltik/fix/4512
#4512: faqs_shortcodes::sc_faq_count(): Return blank string instead of 0
2021-06-14 16:55:10 -07:00
Cameron
a1e7d29661 Optional {NEWS_PAGINATION} shortcode added. 2021-06-14 14:42:17 -07:00
Cameron
aa6e449aee New shortcode added on News view page: {NEWS_AUTHOR_REALNAME}
Tagcloud menu can now be sorted via shortcode parms. eg. {MENU: path=tagcloud&order=tag,asc&limit=20}
Animate.css library loading example added to bootstrap5/theme.xml
2021-06-12 16:18:51 -07:00
Nick Liu
7cef4264c6 #4512: faqs_shortcodes::sc_faq_count(): Return blank string instead of 0
Previously incorrect null coalesce returns 0 instead of a blank string

Fixes: #4512
2021-06-07 21:52:36 -05:00
Cameron
6674beaf82 Added a button to allow closing of "Developer Mode" alert message. Fixed default button styling of some news buttons under Bootstrap 5. 2021-05-08 12:39:17 -07:00
Cameron
4034d4ab0c Issue #4489 - Render comments code example added. 2021-04-20 13:44:14 -07:00
Nick Liu
ce7f3b5d56 Add: e_parse::toFlatArray() and e_parse::fromFlatArray()
Utility functions to convert multi-dimensional arrays to slash-delimited
single-dimensional arrays and vice versa
2021-04-17 02:56:12 -05:00
Cameron
51024a5e8e Fix PHP errors under some circumstances. 2021-04-16 13:43:26 -07:00
Cameron
ee464286e0 BC Fix for contact LANs. 2021-04-12 14:31:27 -07:00
Cameron
2862e18db9 Issue #4471 2021-04-06 18:41:15 -07:00
Cameron
240c088eff Issue #4478 - Fixes decorate_download_location() and check_download_limits() 'missing function' errors. 2021-04-06 10:40:58 -07:00
Cameron
2904f1e792 All Unit tests passing locally. 2021-03-31 12:11:23 -07:00
Cameron
0876e0d43b Contact LANs updated to v2 specifications. BC fix included. 2021-03-29 17:50:51 -07:00
Cameron
56d4855192 Fixes #4464 - Updated comment render() example to match functionality. 2021-03-25 11:23:47 -07:00
Cameron
87521f330f Issue #4458 NULL value example added to blank plugin's admin-ui. 2021-03-23 11:05:04 -07:00
Moc
cdc61c90ee Forum update fixes (duplicate SEF & logging) 2021-03-22 20:31:07 +01:00
Cameron
c33b91ee5c Issue #4368 Fixed hardcoded string for 'related' content. Now uses tablerender(). Shortcode processing of {---CAPTION---} added. 2021-03-22 11:26:51 -07:00
Moc
b2cf6c07b3 #4452 - Add e_print addon code and check 2021-03-17 19:42:21 +01:00
Cameron
07faad666a Issue #2726, Issue #4452 - Added new e_print.php addon which uses v2.x standards. 2021-03-17 11:22:25 -07:00
Cameron
b0bc9d344a Merge pull request #4426 from yesszus/patch-2
Update hero_template.php
2021-03-03 12:12:27 -08:00
Cameron
138b9568e6 Fixes #4407 - Endless database update request for 'hero' 2021-02-27 07:07:12 -08:00
Gábor
abbc3eb680 Update hero_template.php 2021-02-27 10:35:42 +01:00
Cameron
c896bc48a1 Merge pull request #4425 from Jimmi08/patch-23
Issue #3912 e_ROUTE for legacy news urls
2021-02-26 12:57:10 -08:00
Cameron
8e1b547171 Separate template added to hero for when used within a menu. (ie. Menu Manager)
{HERO_BGIMAGE} behavior modified.
2021-02-26 11:30:52 -08:00
Cameron
cb95b4b243 Hero cleanup for Bootstrap5. Switched to placeholder images. Admin-ui type 'image' now loads remote URLs correctly. 2021-02-26 10:13:07 -08:00
Jimako
9452a2986e #3912 e_ROUTE for non pretty news urls 2021-02-26 18:51:21 +01:00
Cameron
d5a4ef57d1 Merge pull request #4364 from yesszus/patch-2
Add Hero plugin translations
2021-02-26 07:14:07 -08:00
Gábor
d8280e5028 Update hero_template.php 2021-02-26 15:54:46 +01:00
Cameron
98d56e8bd9 Merge pull request #4422 from Jimmi08/patch-22
Issue #4402 fix wrong template key,
2021-02-25 15:44:24 -08:00
Cameron
58f129799b New feature: Previous/Next News item navigation. 2021-02-24 15:26:01 -08:00
Jimako
2d35fd27d0 #4402 fix wrong template key,
Probably just mistypo
2021-02-24 20:33:45 +01:00
Cameron
f30caaf18b Removed some LAN constant usage from core templates. 2021-02-23 12:58:51 -08:00
Cameron
76af210666 Issue #4332 - Bootstrap 5 styling fixes. 2021-02-23 11:11:35 -08:00
Cameron
2ca7ec4597 Issue #4332 - Bootstrap 5 styling fixes on comments and news templates. 2021-02-23 09:01:40 -08:00
Cameron
340ff05fcd Bootstrap5 markup added to download item pagination. Fallback added to e107.css 2021-02-21 14:13:01 -08:00
Cameron
e425349661 Issue #3912 - Reverse lookup e_ROUTE from e_url.php 'legacy' entry. 2021-02-21 14:10:47 -08:00
Cameron
84b105e8c7 Renamed forum 'parent' to 'parent_start' (with BC fix) and added 'parent_end' to default template. 2021-02-21 10:50:45 -08:00
Gábor
9bac3c322d Update plugin.xml 2021-02-21 12:00:09 +01:00