Skip to content

Commit 43dafc3

Browse files
committed
initial setup of xssinput
0 parents  commit 43dafc3

11 files changed

Lines changed: 648 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
composer.phar
3+
composer.lock
4+
.DS_Store

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
- 5.5
7+
8+
before_script:
9+
- curl -s http://getcomposer.org/installer | php
10+
- php composer.phar install --dev
11+
12+
script: phpunit

composer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "frozennode/xssinput",
3+
"description": "A simple extension of the Laravel Input facade that mimics CodeIgniter's xss filtering",
4+
"keywords": ["laravel", "xss"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Jan Hartigan",
9+
"email": "jan@frozennode.com"
10+
}
11+
],
12+
"require": {
13+
"php": ">=5.3.0",
14+
"illuminate/support": "~4"
15+
},
16+
"autoload": {
17+
"psr-0": {
18+
"Frozennode\\XssInput\\": "src/"
19+
}
20+
},
21+
"minimum-stability": "dev"
22+
}

phpunit.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Package Test Suite">
15+
<directory suffix=".php">./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>

public/.gitkeep

Whitespace-only changes.

readme.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# XssInput for Laravel
2+
3+
XssInput is a screamingly simple extension of Laravel's Input facade that somewhat mimics the XSS filtering of CodeIgniter's input library. In fact, underneath the hood, this package uses an altered form of CodeIgniter's Security library to filter inputs for XSS.
4+
5+
XSS filtering happens in one of two ways: by setting the `` option in this package's config to `true`, or by passing true as the third option to `Input::get()` or as the only option for `Input::all()`.
6+
7+
8+
- **Author:** Jan Hartigan
9+
- **Website:** [http://frozennode.com](http://frozennode.com)
10+
- **Version:** 1.0.0
11+
12+
## Composer
13+
14+
To install XssInput as a Composer package to be used with Laravel 4, simply add this to your composer.json:
15+
16+
```json
17+
"frozennode/xssinput": "dev-master"
18+
```
19+
20+
..and run `composer update`. Once it's installed, you can register the service provider in `app/config/app.php` in the `providers` array:
21+
22+
```php
23+
'providers' => array(
24+
'Frozennode\XssInput\XssInputServiceProvider',
25+
)
26+
```
27+
28+
..and change the `Input` alias to point to the facade for XssInput:
29+
30+
```php
31+
'aliases' => array(
32+
'Input' => 'Frozennode\XssInput\XssInput'
33+
)
34+
```
35+
36+
You could also, instead of doing this, give the XssInput facade a separate alias.
37+
38+
Then publish the config file with `php artisan config:publish frozennode/xssinput`. This will add the file `app/config/packages/frozennode/xssinput/xssinput.php`, which you should look at and understand because it's one option long.

0 commit comments

Comments
 (0)