2017 © Pedro Peláez
 

cakephp-plugin escape

Auto escaping plugin for CakePHP

image

k1low/escape

Auto escaping plugin for CakePHP

  • Tuesday, March 18, 2014
  • by k1LoW
  • Repository
  • 1 Watchers
  • 7 Stars
  • 4,229 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Auto escaping plugin for CakePHP

Installation

First, put `escape’ directory on app/plugins in your CakePHP application., (*1)

Second, add the following code in app_controller.php, (*2)

<?php
    class AppController extends Controller {
        var $components = array('Escape.Escape');
    }

Escape type

use htmlspecialchars() and html_entity_decode()

Escape / decode valiables., (*3)

  • `d()' decode escaped valiables.

app_controller.php example, (*4)

<?php
    class AppController extends Controller {
        var $components = array('Escape.Escape');
    }

view.ctp example, (*5)

<?php echo $escaped; // echo escaped value; ?>
<?php echo d($escaped); // echo decode value; ?>  

create object and set escaped/raw value

app_controller.php example, (*6)

<?php
    class AppController extends Controller {
        var $components = array('Escape.Escape' => array('objectEscape' => true));
    }

view.ctp example, (*7)

<?php echo $escaped; // echo escaped value; ?>
<?php echo $escaped->raw; // echo raw value; ?>  

$this->data escape

If you do not escape $this->data, add the following code in app_controller.php., (*8)

<?php
    class AppController extends Controller {
        var $components = array('Escape.Escape' => array('formDataEscape' => false));
    }

TODO

  • Auto Decoding in FormHelper::input()

The Versions

18/03 2014

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/k1LoW/escape

Auto escaping plugin for CakePHP

  Sources   Download

MIT

The Requires

 

cakephp escape

18/03 2014

2.0.0

2.0.0.0 https://github.com/k1LoW/escape

Auto escaping plugin for CakePHP

  Sources   Download

MIT

The Requires

 

cakephp escape