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

MyTextSanitizer refactor #437

Merged
merged 4 commits into from
Oct 31, 2015
Merged

MyTextSanitizer refactor #437

merged 4 commits into from
Oct 31, 2015

Conversation

geekwright
Copy link
Contributor

MyTextSanitizer has become Xoops\Core\Text\Sanitizer. Highlights:

  • Single unified configuration file xoops_data/configs/system_sanitizer_prefs.yml
  • Extensions (i.e. YouTube) are now a SanitizerComponent, a base class that also includes Filters (i.e. Xss)
  • Each SanitizerComponent auto-configures, and configuration is automatically updated with new additions
  • Custom components can be added via response to core.sanitizer.configuration.defaults event
  • ShortCodes (WordPress style) are now the basis of XoopsCode and extensions
  • Custom ShortCodes can be added via response to core.sanitizer.shortcodes.add event, or by directly accessing the ShortCodes engine with Sanitizer::getShortCodes()
  • All built-in components and shortcodes can be overridden with same named custom replacements

Some extensions have updated syntax. For example:
[youtube=640,385]https://www.youtube.com/watch?v=JxS5E-kZc2s[/youtube]

can now be:
[youtube url="JxS5E-kZc2s" width="640" height="385" /]

(It also can use virtually any known YouTube URL as the url attribute.)

Another example is SoundCloud, which now can directly support the "Wordpress code" option offered in the Share/Embed dialog on soundcloud.com.

The old styles are still accepted for compatibility with existing content, and not all extensions have conversions to new styles, yet. There is more work to be done, but the backing code is now in place.

@mambax7
Copy link
Contributor

mambax7 commented Oct 31, 2015

Fantastic!!!! 👍 👍 👍 👍

mambax7 added a commit that referenced this pull request Oct 31, 2015
@mambax7 mambax7 merged commit 208d319 into XOOPS:master Oct 31, 2015
@mambax7 mambax7 removed the QA Review label Oct 31, 2015
@geekwright geekwright deleted the sanitizer branch October 31, 2015 02:30
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.

None yet

2 participants