Skip to content

Commit

Permalink
Moved some resources out :)
Browse files Browse the repository at this point in the history
  • Loading branch information
devtoolboxuk committed Jun 2, 2019
1 parent d14a3fa commit 1d5cf06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/SoteriaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SoteriaService implements SoteriaInterface
* @param bool $force
* @return Sanitise|null
*/
public function sanitise($force = false)
public function sanitise($force = true)
{
if (self::$instance === null || $force) {
self::$instance = new Sanitise();
Expand All @@ -25,7 +25,7 @@ public function sanitise($force = false)
* @param bool $force
* @return Xss|null
*/
public function xss($force = false)
public function xss($force = true)
{
if (self::$instance === null || $force) {
self::$instance = new Xss();
Expand Down
30 changes: 14 additions & 16 deletions tests/integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,28 @@ function __construct($name = null, array $data = [], $dataName = '')

function testIntegration()
{
// $xss = $this->security->xss();
$xss = $this->security->xss();
$sanitise = $this->security->sanitise();


echo "\nXSS";
$string = 'Visit my website http://www.doajob.org?redirect=https://www.google.com';
// echo "\nString: " . $string;
// $cleanString = $xss->clean($string);
// echo "\nString: " . $cleanString;
// echo "\n";
// echo "\nXSS Url";
// $string = 'Visit my website http://www.doajob.org?redirect=https://www.google.com';
// echo "\nString: " . $string;
// $cleanString = $xss->cleanUrl($string);
// echo "\nString: " . $cleanString;
// echo "\n";
// echo "\nSanitiser";

echo "\nString: " . $sanitise->removeUrl($string);
$unCleanString = 'Visit my website http://www.doajob.org?redirect=https://www.google.com';



echo "\nUnclean String: " . $unCleanString;
$cleanString = $xss->clean($unCleanString);
echo "\nXSS Cleaned String: " . $cleanString;
$cleanString = $xss->cleanUrl($unCleanString);
echo "\nXSS Cleaned Url: " . $cleanString;
echo "\n";

echo "\nSanitised Url: " . $sanitise->removeUrl($unCleanString);
if ($sanitise->isSanitised()) {
echo "\n1";
}

echo "\nString: " . $sanitise->removeUrl("Rob WIlson");
echo "\nString without a Url: " . $sanitise->removeUrl("Rob WIlson");
if ($sanitise->isSanitised()) {
echo "\n1";
}
Expand Down

0 comments on commit 1d5cf06

Please sign in to comment.