6d766b6ac1513bbaf35aabfee1a700dfc21ebbe5..0085dcb4e3ab76219819b8a53950df1261c04453
2 days ago Filippo Bertilotti
aggiunta controllo regex per prevenire xss attacks e rimo...
0085dc diff | tree
2 days ago Filippo Bertilotti
config purifier
162198 diff | tree
2 days ago Filippo Bertilotti
installazione purifier
067143 diff | tree
6 files modified
174 ■■■■ changed files
app/Http/Controllers/Profiles/ProfilesController.php 7 ●●●● patch | view | raw | blame | history
app/Http/Requests/SSOFormRequest.php 9 ●●●●● patch | view | raw | blame | history
app/Vola/Services/FakeSSODatabase/FakeSSODatabaseHandler.php 9 ●●●●● patch | view | raw | blame | history
composer.json 1 ●●●● patch | view | raw | blame | history
composer.lock 143 ●●●●● patch | view | raw | blame | history
config/app.php 5 ●●●● patch | view | raw | blame | history
app/Http/Controllers/Profiles/ProfilesController.php
@@ -87,13 +87,8 @@
    }
    public function saveUser(SSOFormRequest $request) {
        $data = $request->all();
        //print_r($data);
        var_dump($data);
        $databaseHandler = new FakeSSODatabaseHandler;
        $databaseHandler->insertDataIntoTables($data);
        //$databaseHandler->testMultiSelect($data);
        return view("vodafone_fake_sso.db-create-view");
    }
app/Http/Requests/SSOFormRequest.php
@@ -3,6 +3,7 @@
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Mews\Purifier\Purifier;
class SSOFormRequest extends FormRequest
{
@@ -24,10 +25,10 @@
    public function rules()
    {
        return [
            'EmailAddress' => 'required|email',
            'Name' => 'required',
            'Surname' => 'required',
            'sim_1' => 'digits_between:10,10'
            'EmailAddress' => 'required|email|not_regex:/<[^>]+?>/',
            'Name' => 'required|not_regex:/<[^>]+?>/',
            'Surname' => 'required|not_regex:/<[^>]+?>/',
            'sim_1' => 'digits_between:10,10|not_regex:/<[^>]+?>/'
        ];
    }
}
app/Vola/Services/FakeSSODatabase/FakeSSODatabaseHandler.php
@@ -21,11 +21,8 @@
                                           'IdPiano' => $data['IdPiano'],
                                           'LinkedUser' => $userModel->id]);
            print_r($data["products_select"]);
            foreach ($data["products_select"] as $index => $value) {
                $product = Products::find($value);
                echo "iproduct: $product->id, id msisdn: $msisdnModel->id ";
                $product->msisdn()->attach($msisdnModel->id);
            }
@@ -39,11 +36,5 @@
    public function readProducts(): array {
        $productsList = Products::select("Name", "id")->get()?->toArray();
        return $productsList;
    }
    public function testMultiSelect(array $data) {
        var_dump($data["products_select"]);
        print_r($data["products_select"][0]);
        print_r($data["products_select"][1]);
    }
}
composer.json
@@ -11,6 +11,7 @@
        "laravel/framework": "^9.0",
        "laravel/sanctum": "^2.14",
        "laravel/tinker": "^2.7",
        "mews/purifier": "*",
        "tymon/jwt-auth": "^2.0.0"
    },
    "require-dev": {
composer.lock
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "925a8b526edd2fce82a329bec2969723",
    "content-hash": "ea077d2dc37e37c3916eb46faf1bfddb",
    "packages": [
        {
            "name": "asm89/stack-cors",
@@ -556,6 +556,67 @@
                }
            ],
            "time": "2023-10-06T06:47:41+00:00"
        },
        {
            "name": "ezyang/htmlpurifier",
            "version": "v4.17.0",
            "source": {
                "type": "git",
                "url": "https://github.com/ezyang/htmlpurifier.git",
                "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c",
                "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c",
                "shasum": ""
            },
            "require": {
                "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
            },
            "require-dev": {
                "cerdic/css-tidy": "^1.7 || ^2.0",
                "simpletest/simpletest": "dev-master"
            },
            "suggest": {
                "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
                "ext-bcmath": "Used for unit conversion and imagecrash protection",
                "ext-iconv": "Converts text to and from non-UTF-8 encodings",
                "ext-tidy": "Used for pretty-printing HTML"
            },
            "type": "library",
            "autoload": {
                "files": [
                    "library/HTMLPurifier.composer.php"
                ],
                "psr-0": {
                    "HTMLPurifier": "library/"
                },
                "exclude-from-classmap": [
                    "/library/HTMLPurifier/Language/"
                ]
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "LGPL-2.1-or-later"
            ],
            "authors": [
                {
                    "name": "Edward Z. Yang",
                    "email": "admin@htmlpurifier.org",
                    "homepage": "http://ezyang.com"
                }
            ],
            "description": "Standards compliant HTML filter written in PHP",
            "homepage": "http://htmlpurifier.org/",
            "keywords": [
                "html"
            ],
            "support": {
                "issues": "https://github.com/ezyang/htmlpurifier/issues",
                "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0"
            },
            "time": "2023-11-17T15:01:25+00:00"
        },
        {
            "name": "fruitcake/laravel-cors",
@@ -2085,6 +2146,84 @@
                }
            ],
            "time": "2024-01-28T23:22:08+00:00"
        },
        {
            "name": "mews/purifier",
            "version": "3.4.2",
            "source": {
                "type": "git",
                "url": "https://github.com/mewebstudio/Purifier.git",
                "reference": "d4d3830267eeda7b385d61dd680ace14dcf142df"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/mewebstudio/Purifier/zipball/d4d3830267eeda7b385d61dd680ace14dcf142df",
                "reference": "d4d3830267eeda7b385d61dd680ace14dcf142df",
                "shasum": ""
            },
            "require": {
                "ezyang/htmlpurifier": "^4.16.0",
                "illuminate/config": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
                "illuminate/filesystem": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
                "illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
                "php": "^7.2|^8.0"
            },
            "require-dev": {
                "graham-campbell/testbench": "^3.2|^5.5.1|^6.1",
                "mockery/mockery": "^1.3.3",
                "phpunit/phpunit": "^8.0|^9.0|^10.0"
            },
            "suggest": {
                "laravel/framework": "To test the Laravel bindings",
                "laravel/lumen-framework": "To test the Lumen bindings"
            },
            "type": "package",
            "extra": {
                "laravel": {
                    "providers": [
                        "Mews\\Purifier\\PurifierServiceProvider"
                    ],
                    "aliases": {
                        "Purifier": "Mews\\Purifier\\Facades\\Purifier"
                    }
                }
            },
            "autoload": {
                "files": [
                    "src/helpers.php"
                ],
                "psr-4": {
                    "Mews\\Purifier\\": "src/"
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Muharrem ERİN",
                    "email": "me@mewebstudio.com",
                    "homepage": "https://github.com/mewebstudio",
                    "role": "Developer"
                }
            ],
            "description": "Laravel 5/6/7/8/9/10 HtmlPurifier Package",
            "homepage": "https://github.com/mewebstudio/purifier",
            "keywords": [
                "Laravel Purifier",
                "Laravel Security",
                "Purifier",
                "htmlpurifier",
                "laravel HtmlPurifier",
                "security",
                "xss"
            ],
            "support": {
                "issues": "https://github.com/mewebstudio/Purifier/issues",
                "source": "https://github.com/mewebstudio/Purifier/tree/3.4.2"
            },
            "time": "2024-03-20T16:18:22+00:00"
        },
        {
            "name": "monolog/monolog",
@@ -8656,5 +8795,5 @@
    "platform-overrides": {
        "php": "8.2"
    },
    "plugin-api-version": "2.3.0"
    "plugin-api-version": "2.6.0"
}
config/app.php
@@ -179,6 +179,7 @@
        // service and repository providers
        App\Providers\RepositoryServiceProvider::class,
        App\Providers\ServiceServiceProvider::class,
        Mews\Purifier\PurifierServiceProvider::class
    ],
@@ -196,7 +197,9 @@
    'aliases' => Facade::defaultAliases()->merge([
        'VolaFakeHTTPResponder' => App\Vola\Services\VolaFakeHTTPResponder\VolaFakeHTTPResponder::class,
        'RequestLogger' => \App\Vola\Services\RequestLogger\RequestLogger::class,
        'FakeSSODatabaseHandler' => \App\Vola\Services\FakeSSODatabase\FakeSSODatabaseHandler::class
        'FakeSSODatabaseHandler' => \App\Vola\Services\FakeSSODatabase\FakeSSODatabaseHandler::class,
        'Purifier' => Mews\Purifier\Facades\Purifier::class
    ])->toArray(),
];