Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plg_content_loadmodule] Prevent issues with regular expression characters #22034

Merged
merged 12 commits into from
Jan 22, 2020
Merged

[plg_content_loadmodule] Prevent issues with regular expression characters #22034

merged 12 commits into from
Jan 22, 2020

Conversation

SharkyKZ
Copy link
Contributor

@SharkyKZ SharkyKZ commented Sep 7, 2018

Pull Request for Issue #21329.

Summary of Changes

This is an alternative to Rosie-Eagle#1 and #21948.

This fixes the issue of module positions and modules with titles containing special regular expression characters not being loaded.

Testing Instructions

Note, the use of } hasn't been fixed.

Copied from #21329 by franz-wohlkoenig:

  1. Log in at the backend of joomla
  2. Go to menu "Extensions > Modules".
  3. Create a "Custom" module.
  4. Give field 'title' the following value (without the quotes): "Some math: 1 + 1 = 2"
  5. Save the module.
  6. Next create a new article (or edit an existing one).
  7. Make sure you can later view the article at the fronted of joomla, where visitors normally view the article.
  8. Enter load module shortcode with your module type and title, e.g. {loadmodule mod_custom, Some math: 1 + 1 = 2}
  9. Save the article.
  10. View the article at the frontend of joomla.

Notice "{loadmodule mod_custom, Some math: 1 + 1 = 2}" not beeing replaced by the actual rendering of the module you created at steps 3 to 5. The text "{loadmodule mod_custom, Some math: 1 + 1 = 2}" is still there as if it were untouched.

Documentation Changes Required

No.

@ghost ghost added the J3 Issue label Apr 5, 2019
@ghost ghost removed the J3 Issue label Apr 19, 2019
@ghost ghost changed the title [plg_content_loadmodule] Prevent issues with regular expression characters Prevent issues with regular expression characters Apr 19, 2019
@ghost
Copy link

ghost commented Jul 20, 2019

I have tested this item 🔴 unsuccessfully on 61ff38b

Module isn't rendered also by using this PR.

Note: Append a Module by click on "Module"-Button load it by ID, so this Problem didn't exist.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22034.

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Aug 5, 2019

There's an error in testing instructions. The shortcode should contain module name, not just title. So, for example, {loadmodule Some math: 1 + 1 = 2} should become {loadmodule mod_login,Some math: 1 + 1 = 2}.

@ghost
Copy link

ghost commented Aug 6, 2019

I have tested this item ✅ successfully on a30e151


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22034.

@HLeithner
Copy link
Member

wouldn't it be easier to use preg_quote?

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Aug 7, 2019

This was meant to be faster but now I'm wondering whether we need to use utf8 string functions from Joomla\String\StringHelper here.

@SharkyKZ SharkyKZ changed the title Prevent issues with regular expression characters [plg_content_loadmodule] Prevent issues with regular expression characters Oct 12, 2019
@SharkyKZ
Copy link
Contributor Author

No need to use utf8 functions. Works fine like this.

@jwaisner
Copy link
Member

I have tested this item ✅ successfully on c6c07d6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22034.

@jwaisner
Copy link
Member

@franz-wohlkoenig Please test latest commit.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22034.

@SharkyKZ
Copy link
Contributor Author

RTC as previous test still good (latest commits include only branch updates).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22034.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 14, 2020
@HLeithner HLeithner merged commit 149e26d into joomla:staging Jan 22, 2020
@HLeithner
Copy link
Member

Thanks

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 22, 2020
@HLeithner HLeithner added this to the Joomla! 3.9.15 milestone Jan 22, 2020
@SharkyKZ SharkyKZ deleted the plgContentLoadModule_1 branch January 22, 2020 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants