Download the PHP package taitava/silverstripe-cloakemail without Composer

On this page you can find all versions of the php package taitava/silverstripe-cloakemail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-cloakemail

silverstripe-cloakemail

Module to easily encode email addresses inside templates, page content and PHP code so that SPAM bots can't understand them, but human readers see them clearly.

Maintainer Contact

Jarkko Linnanvirta posti (at) taitavasti (dot) fi (in English or in Finnish) www.taitavasti.fi (only in Finnish)

Requirements

Installation

The recommended way to install this module is by using composer:

Documentation

This module makes it easy to cloak email addresses in webpage content and templates to prevent SPAM bots from getting them. The module uses JavaScript + jQuery to reveal the email addresses, although this can be turned off if you don't wish to bloat your website with JavaScript.

The following datatypes are extended to be able to cloak email addresses: text, varchar and enum. To cloak an email address in a template file, just trail the variable containing the email address with .Cloak().

For example:

$SiteConfig.ContactEmailAddress.Cloak()

You can also use $Cloak('[email protected]') inside a template (only inside a Page context).

Email addresses in Page objects' contents are cloaked automatically, but only if page_content is set to true in cloakemail.yml.

Configuration

app/_config/cloakemail.yml

---
after: cloakemail
---
Taitava\CloakEmail\CloakEmail:
  mode: simple
  convert_page_content: true
  page_insert_links: false
  template_insert_links: false
  purge_mailto_links: true
  at: ' [a] '
  dot: ' [dot] '
  hard_noscript_error: 'JavaScript must be turned on in order to see this email address'

mode

There are multiple cloaking modes:

Default: 'simple'

convert_page_content

If true, CloakEmail processes page content and cloaks all email addresses in Page objects' contents automatically.

WARNING! This feature can easily break things. A simple email address just laying around between text should work just fine, but if an email address resides inside an HTML tag (for example Feedback) it will break the tag because it fills in its own HTML code! Exception: [i]nojs[/i] mode does not fill in any HTML code unless you have [i]page_insert_links[/i] set to true.

Default: false

page_insert_links and template_insert_links

If true, wraps cloaked email addresses inside mailto-links (CLOAKED ADDRESS). However, this is not done if [i]mode[/i] is set to [i]none[/i].

Default: false for both variables

purge_mailto_links

The purpose of this option is to prevent malformed HTML code from being generated if set to true and if the source HTML content contains email address links like <a href="mailto:[email protected]">[email protected]</a>. If this option is off, the module would convert the email address in the href attribute in a way that would insert HTML inside the attribute, which would simply break the outputted HTML.

This option provides a "quirky" workaround to this problem by removing all mailto links from the HTML content before starting to process it. So it replaces the link with the email address found from the href attribute. Please note that the anchor text of the link is not preserved in any way!

You can use page_insert_links and/or template_insert_links options to recreate the mailto links, but you still can't get the original anchor texts back, instead the email address itself will be used as the anchor text - which is usually correct.

So while this feature does not perfectly fix the bug that it relates to, at least it offers a better-than-nothing solution. If you want to start a discussion about this topic, please see the issue #3 . Please do not hesitate to ask if you have any questions about this feature/bug! :)

Default: false

at and dot

@ and . will be replaced with these strings in email addresses when mode is either 'simple' or 'nojs'. In 'hard' mode these are not used, because the email addresses get totally scrambled in that mode. HTML code is allowed here.

Defaults: ' at ' and ' dot '

hard_noscript_error

Error message that will be shown if JavaScript is turned off. This only affects 'hard' mode. The message appears in the place of the email address.

Default: 'JavaScript must be turned on in order to see this email address.'

TODO

Here is a list of some ideas. I make no promises about future development, but I gadly welcome pull requests if you want to implement these or your own ideas! :)


All versions of silverstripe-cloakemail with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ^3.7
silverstripe/cms Version ^3.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package taitava/silverstripe-cloakemail contains the following files

Loading the files please wait ....