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

386 Commits

Author SHA1 Message Date
Cameron
d6b0391a2d Fixed corruption of carousel attributes and other 'data-' keys. Test added. 2021-10-14 08:08:43 -07:00
Cameron
78d72fa139 Added 'defer' to bootstrap5 and fontawesome5 <script> tags. 2021-10-12 08:00:41 -07:00
Cameron
0442ba138a addJs() method cleanup. Work-in-progress. 2021-10-11 19:06:03 -07:00
Cameron
7755dd1743 Added option for themes to load only the css or js portion of a library via theme.xml attribute. See bootstrap5/theme.xml for an example.
Empty comments in glyphs removed due to conflict with Fontawesome JS. Tests updated.
2021-10-11 12:33:59 -07:00
Nick Liu
840e818f40
e_form: Allow HTML attribute "value" keys with blank values
Otherwise, something like `<option>Nope</option>` will get a value of
"Nope" instead of "" as in `<option value=''>Nope</option>`.
2021-10-08 18:03:44 -05:00
Nick Liu
2fa9d10c57
e_form: Handle attribute HTML entities properly for most form elements
The result is a much more consistent form experience with less fear that
some values put into an `e_form` method will break the web page.

This commit covers the most common uses of `e_form` with HTML attribute
quoting via `e_form::attributes()`.
2021-10-06 20:14:51 -05:00
Nick Liu
19f48180dc
Restore htmlspecialchars() for e_parse::filter(…, 'str')
Fixes regression from 20882920a0b68937570264949512acc0c4841dbd where
data would get inserted into the database with literal quotation marks,
but e107 has always expected `&quot;` and `&#39;` to come directly from
the database
2021-10-06 13:06:31 -05:00
Nick Liu
010492b67e
Stub e_date::convert_date() in e_parse_shortcodeTest
Prevents this flaky error:

---------
1) e_parse_shortcodeTest: Forum shortcodes
 Test  tests/unit/e_parse_shortcodeTest.php:testForumShortcodes
{INFO} != sc_info()
Failed asserting that two strings are equal.
- Expected | + Actual
@@ @@
'Welcome e107-cli<br />There are no new posts since your last visit.<br />
You last visited at  <br />
-			It is now Tuesday 28 September 2021 - 16:25:39'
+			It is now Tuesday 28 September 2021 - 16:25:38'
#1  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1656
#2  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1147
#3  e_parse_shortcodeTest->testForumShortcodes
#4  {closure}
2021-09-28 12:27:09 -05:00
Cameron
06e88e5fb7 Linkwords plugin update.
Fixes issue with admin preferences not being respected or no linking occurring.
Prefs now moved out of core and into plugin prefs.
Test page added to admin area.
Relationship field added.
e_tohtml.php deprecated in favor of e_parse.php
Tests updated.
2021-09-28 08:56:54 -07:00
Cameron
320287f6ad Fix PHP error on some legacy themes that are missing meta-data. e107_tests composer update. 2021-09-27 10:45:06 -07:00
Nick Liu
45bce2a7aa
#4572: e_form: No htmlspecialchars() on "other" attributes
Fixes: #4572

Discussion:
https://github.com/e107inc/e107/pull/4554#issuecomment-926113601
2021-09-23 16:12:52 -05:00
Nick Liu
64cd796605
Update test dependencies
Fixes: #4551
2021-09-04 15:08:15 +02:00
Cameron
f173b59672 Closes #4539 2021-08-13 10:58:42 -07:00
Cameron
64e705ced0 {SITELINKS_ALT} fix and test. 2021-08-07 12:26:23 -07:00
Cameron
c4f76c3687 Issue #4270 - perform all webp conversion checks within e_thumbnail class. WebP conversion now works with SEF media URLS. 2021-06-18 09:31:45 -07:00
Cameron
7302803a75 Issue #4270 Added .webp browser-support detection. Media-Manager "Convert to webp during render" can now be safely enabled and will temporarily fallback to the regular image if the browser does not support webp images. 2021-06-18 08:43:53 -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
0deb235ee7 Unit test fixes. 2021-06-14 16:51:43 -07:00
Cameron
4e75903292 Fix for empty image. 2021-06-13 12:59:01 -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
Nick Liu
cdde5ef86b
db_table_adminTest::testGet_current_table(): Alias utf8mb3 => utf8
MySQL 8.0 compatibility

Ideally, we'd be using utf8mb4 everywhere, but alas...
2021-04-22 20:57:28 -05:00
Cameron
e5ff5f53c8 Issue #550 - Expanded filetypes.xml display in admin preferences area to include Admin and Main admin perms. Additional defaults for admin and mainadmin added to filetypes.xml during installation. 2021-04-21 16:48:04 -07:00
Cameron
098660d38a Issue #550 - filetypes.xml now used by media-manager. 2021-04-21 11:51:53 -07:00
Nick Liu
dc3ac65a70
Fix implementation of e_front_model::sanitize()
Handles recursive data field validation now
2021-04-17 02:57:10 -05: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
Nick Liu
bdc5c20df2
pluginsTest::testPluginScripts(): Standard sort file order 2021-04-16 15:46:14 -05:00
Nick Liu
d83c31fb8c
Stub e_date::computeLapse() in e_parse_shortcodeTest
Prevents this flaky error:

---------
1) e_parse_shortcodeTest: User shortcodes
 Test  tests/unit/e_parse_shortcodeTest.php:testUserShortcodes
{USER_DAYSREGGED} != sc_user_daysregged()
Failed asserting that two strings are equal.
- Expected | + Actual
@@ @@
-'3 years, 2 months, 1 day, 5 hours, 17 minutes, 16 seconds ago'
+'3 years, 2 months, 1 day, 5 hours, 17 minutes, 15 seconds ago'
#1  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1591
#2  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:767
2021-04-13 15:12:39 -05:00
Nick Liu
687db04bcb
Revert "Removed failing test with no assertions"
This reverts commit 22e3f5383e5a62a3a8a1b6f7828c515402aa8123.
2021-04-13 15:03:37 -05:00
Nick Liu
7cfc79d335
Tests: Removed weird 17 rows threshold for clearing user_extended_struct
Should fix rare flaky
e107_user_extendedTest::testUserExtendedAllShortcode()
2021-04-13 15:03:37 -05:00
Nick Liu
e261e4fb2d
Fix undefined constants when e107Test::testGetCoreTemplate() runs first
---------
1) e_navigationTest: Admin links plugins
 Test  tests/unit/e_navigationTest.php:testAdminLinksPlugins

Error: ;1m  [Error] Undefined constant "E_16_PLUGMANAGER"

#1  /__w/e107/e107/e107_handlers/sitelinks_class.php:882
#2  /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:528

---------
2) e_navigationTest: Admin links legacy
 Test  tests/unit/e_navigationTest.php:testAdminLinksLegacy

Error: ;1m  [Error] Undefined constant "E_32_MAIN"

#1  /__w/e107/e107/e107_handlers/sitelinks_class.php:735
#2  /__w/e107/e107/e107_handlers/sitelinks_class.php:887
#3  /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:374

---------
3) e_formTest: Render value
 Test  tests/unit/e_formTest.php:testRenderValue

Error: ;1m  [Error] Undefined constant "ADMIN_TRUE_ICON"

#1  /__w/e107/e107/e107_tests/tests/unit/e_formTest.php:943

---------
4) scriptsTest: Admin scripts
 Test  tests/unit/scriptsTest.php:testAdminScripts

Error: ;1m  [Error] Undefined constant "E_32_MAIN"

#1  /__w/e107/e107/e107_handlers/sitelinks_class.php:735
#2  /__w/e107/e107/e107_handlers/sitelinks_class.php:887
#3  /__w/e107/e107/e107_admin/includes/infopanel.php:110
#4  /__w/e107/e107/e107_admin/includes/flexpanel.php:66
#5  /__w/e107/e107/e107_admin/admin.php:63
#6  /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:140
#7  /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:27

---------
5) e_formTest: Render value inline
 Test  tests/unit/e_formTest.php:testRenderValueInline

Error: ;1m  [Error] Undefined constant "ADMIN_FALSE_ICON"

#1  /__w/e107/e107/e107_handlers/form_handler.php:5829
#2  /__w/e107/e107/e107_tests/tests/unit/e_formTest.php:1029

---------
6) e_navigationTest: Admin links sub
 Test  tests/unit/e_navigationTest.php:testAdminLinksSub

Error: ;1m  [Error] Undefined constant "E_32_MAIN"

#1  /__w/e107/e107/e107_handlers/sitelinks_class.php:735
#2  /__w/e107/e107/e107_handlers/sitelinks_class.php:887
#3  /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:418

---------
7) e_parse_shortcodeTest: Admin shortcodes
 Test  tests/unit/e_parse_shortcodeTest.php:testAdminShortcodes

Error: ;1m  [Error] Undefined constant "E_16_NEWS"

#1  /__w/e107/e107/e107_core/shortcodes/batch/admin_shortcodes.php:518
#2  /__w/e107/e107/e107_core/shortcodes/batch/admin_shortcodes.php:602
#3  /__w/e107/e107/e107_handlers/shortcode_handler.php:1130
#4  e_parse_shortcode->doCode
#5  /__w/e107/e107/e107_handlers/shortcode_handler.php:996
#6  /__w/e107/e107/e107_handlers/e_parse_class.php:823
#7  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1588
#8  /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:220

---------
8) scriptsTest: Admin includes
 Test  tests/unit/scriptsTest.php:testAdminIncludes

Error: ;1m  [Error] Undefined constant "E_32_MAIN"

#1  /__w/e107/e107/e107_handlers/sitelinks_class.php:735
#2  /__w/e107/e107/e107_handlers/sitelinks_class.php:887
#3  /__w/e107/e107/e107_admin/includes/categories.php:22
#4  /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:140
#5  /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:36

--

There was 1 failure:

---------
1) e107Test: Load admin icons
 Test  tests/unit/e107Test.php:testLoadAdminIcons
E_16_FACEBOOK is missing from admin_icons_template
#1  /__w/e107/e107/e107_tests/tests/unit/e107Test.php:1054
2021-04-13 15:03:36 -05:00
Nick Liu
c68604b971
Don't assume an empty table in e_db_abstractTest::testIsEmpty() 2021-04-13 15:03:36 -05:00
Nick Liu
99aa39a8e5
e107_tests: Removed usages of var_dump() 2021-04-13 15:03:36 -05:00
Nick Liu
2ebf1f7110
Removed failing test with no assertions
* pluginsTest::testPluginScripts()
2021-03-12 20:06:00 -06:00
Cameron
8f7ab86413 Fixes #4486 - Invalid attributes not being fully filtered. 2021-04-12 11:13:37 -07:00
Cameron
444d8d6dc0 Issue #4486 - iframe accepted attributes updated 2021-04-12 11:01:58 -07:00
Cameron
9e091aedf4 Added new hybridauth providers. (Apple, Pinterest etc) 2021-04-12 10:32:24 -07:00
Cameron
2862e18db9 Issue #4471 2021-04-06 18:41:15 -07:00
Cameron
5ed2440272 Issue #4473 - some merged code from Deltik 2021-03-31 13:04:20 -07:00
Cameron
8ff427cfc4 #Issue #4473 - some merged code. 2021-03-31 12:35:26 -07:00
Cameron
2904f1e792 All Unit tests passing locally. 2021-03-31 12:11:23 -07:00
Cameron
9053e6170f Fixes #4465 Some nested comments were not displaying. The number of DB queries when nested comments is active has now been dramatically reduced. Comments unit test added. 2021-03-25 13:52:05 -07:00
Cameron
56d4855192 Fixes #4464 - Updated comment render() example to match functionality. 2021-03-25 11:23:47 -07:00
Cameron
fb3888abc3 Fixes #4443 - set default stylesheet scope to 'front' when attribute has been omitted from theme.xml. 2021-03-11 09:27:38 -08:00
Cameron
4064389eb3 Restore e107_config.php on test failure. 2021-03-06 09:33:22 -08:00
Cameron
e4937d0819 Fixes #4427 - Also added test for diacritics in URL. 2021-03-01 18:47:45 -08:00
Cameron
a427c14806 Issue #3912 Fix for partial route match. Partials should always end with a '/' for predictable results. 2021-02-26 11:56:10 -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
Cameron
443c60cb52 News shortcode correction. 2021-02-24 15:43:58 -08:00
Cameron
52a554987b PHP error fixes. 2021-02-22 12:22:50 -08:00
Cameron
e425349661 Issue #3912 - Reverse lookup e_ROUTE from e_url.php 'legacy' entry. 2021-02-21 14:10:47 -08:00