Added Tools Route

This commit is contained in:
Olu Amey
2021-09-19 01:48:23 -04:00
parent 32eb3ab418
commit a6e8a48d2e
8 changed files with 109 additions and 86 deletions
+3
View File
@@ -38,6 +38,9 @@ $routes->get('/security', 'Home::security');
$routes->get('/terms', 'Home::terms');
$routes->get('/privacy', 'Home::privacy');
$routes->get('/contact', 'Home::contact');
$routes->get('/howitworks', 'Home::howitworks');
$routes->get('/tools', 'Tools::index');
/*
* --------------------------------------------------------------------
* Additional Routing
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace App\Controllers;
class Tools extends BaseController
{
public function index()
{
return view('tools/index');
}
}
+10 -26
View File
@@ -81,7 +81,8 @@
<li><a href="#pricing" class="smoothscroll">PLANS</a></li>
<li><a href="#download" class="smoothscroll">APP</a></li>
<li><a href="#contact" class="smoothscroll">CONTACT</a></li>
<li style="background-color: #7367f0;" onclick="viewLogin(); return;"><a href="/auth" >START</a></li>
<!-- li style="background-color: #7367f0;" onclick="viewLogin(); return;"><a href="/auth" >START</a></li -->
<li style="background-color: #7367f0;"><a href="https://app.coregrade.com" >START</a></li>
</ul>
</div>
</div>
@@ -330,8 +331,9 @@
<div class="footer-box">
<h4>Learn More</h4>
<ul class="footer-menu">
<li><a href="/home/howitworks">How it works?</a></li>
<li><a href="/howitworks">How it works?</a></li>
<li><a href="https://blog.coregrade.com">CoreGrade Blog</a></li>
<li><a href="/tools">Tools</a></li>
</ul>
</div>
</div>
@@ -339,10 +341,10 @@
<div class="footer-box">
<h4>About Us</h4>
<ul class="footer-menu">
<li><a href="/home/aboutus">About us</a></li>
<li><a href="/home/security">Security</a></li>
<li><a href="/home/privacy">Privacy policy</a></li>
<li><a href="/home/terms">Terms & Conditions</a></li>
<li><a href="/about">About us</a></li>
<li><a href="/security">Security</a></li>
<li><a href="/privacy">Privacy policy</a></li>
<li><a href="/terms">Terms & Conditions</a></li>
</ul>
</div>
</div>
@@ -350,8 +352,8 @@
<div class="footer-box">
<h4>Support</h4>
<ul class="footer-menu">
<li><a href="/home/faq">F.A.Q.</a></li>
<li><a href="/home/contactus">Contact us</a></li>
<li><a href="/faq">F.A.Q.</a></li>
<li><a href="/contactus">Contact us</a></li>
</ul>
</div>
</div>
@@ -408,23 +410,5 @@
<script src="/assets/js/typed.min.js"></script>
<script src="/assets/js/theme.js"></script>
<script type="text/javascript">
<!--
function viewLogin() {
$.ajax({
url: "/welcome/viewLogin?proc=PROCESS&welcome=welcome"
}).done(function (data) {
// alert(100);
});
return true;
}
// -->
</script>
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
<?php
echo "Tools Home page";
+76 -45
View File
@@ -1,13 +1,30 @@
<?php
/**
* @see https://github.com/laminas/laminas-escaper for the canonical source repository
* @copyright https://github.com/laminas/laminas-escaper/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-escaper/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
namespace Laminas\Escaper;
use function bin2hex;
use function ctype_digit;
use function function_exists;
use function hexdec;
use function htmlspecialchars;
use function iconv;
use function in_array;
use function mb_convert_encoding;
use function ord;
use function preg_match;
use function preg_replace_callback;
use function rawurlencode;
use function sprintf;
use function strlen;
use function strtolower;
use function strtoupper;
use function substr;
use const ENT_QUOTES;
use const ENT_SUBSTITUTE;
/**
* Context specific methods for use in secure output escaping
*/
@@ -24,10 +41,10 @@ class Escaper
* @var array
*/
protected static $htmlNamedEntityMap = [
34 => 'quot', // quotation mark
38 => 'amp', // ampersand
60 => 'lt', // less-than sign
62 => 'gt', // greater-than sign
34 => 'quot', // quotation mark
38 => 'amp', // ampersand
60 => 'lt', // less-than sign
62 => 'gt', // greater-than sign
];
/**
@@ -73,42 +90,61 @@ class Escaper
* @var array
*/
protected $supportedEncodings = [
'iso-8859-1', 'iso8859-1', 'iso-8859-5', 'iso8859-5',
'iso-8859-15', 'iso8859-15', 'utf-8', 'cp866',
'ibm866', '866', 'cp1251', 'windows-1251',
'win-1251', '1251', 'cp1252', 'windows-1252',
'1252', 'koi8-r', 'koi8-ru', 'koi8r',
'big5', '950', 'gb2312', '936',
'big5-hkscs', 'shift_jis', 'sjis', 'sjis-win',
'cp932', '932', 'euc-jp', 'eucjp',
'eucjp-win', 'macroman'
'iso-8859-1',
'iso8859-1',
'iso-8859-5',
'iso8859-5',
'iso-8859-15',
'iso8859-15',
'utf-8',
'cp866',
'ibm866',
'866',
'cp1251',
'windows-1251',
'win-1251',
'1251',
'cp1252',
'windows-1252',
'1252',
'koi8-r',
'koi8-ru',
'koi8r',
'big5',
'950',
'gb2312',
'936',
'big5-hkscs',
'shift_jis',
'sjis',
'sjis-win',
'cp932',
'932',
'euc-jp',
'eucjp',
'eucjp-win',
'macroman',
];
/**
* Constructor: Single parameter allows setting of global encoding for use by
* the current object.
*
* @param string $encoding
* @throws Exception\InvalidArgumentException
*/
public function __construct($encoding = null)
public function __construct(?string $encoding = null)
{
if ($encoding !== null) {
if (! is_string($encoding)) {
throw new Exception\InvalidArgumentException(
get_class($this) . ' constructor parameter must be a string, received ' . gettype($encoding)
);
}
if ($encoding === '') {
throw new Exception\InvalidArgumentException(
get_class($this) . ' constructor parameter does not allow a blank value'
static::class . ' constructor parameter does not allow a blank value'
);
}
$encoding = strtolower($encoding);
if (! in_array($encoding, $this->supportedEncodings)) {
throw new Exception\InvalidArgumentException(
'Value of \'' . $encoding . '\' passed to ' . get_class($this)
'Value of \'' . $encoding . '\' passed to ' . static::class
. ' constructor parameter is invalid. Provide an encoding supported by htmlspecialchars()'
);
}
@@ -139,10 +175,9 @@ class Escaper
* Escape a string for the HTML Body context where there are very few characters
* of special meaning. Internally this will use htmlspecialchars().
*
* @param string $string
* @return string
*/
public function escapeHtml($string)
public function escapeHtml(string $string)
{
return htmlspecialchars($string, $this->htmlSpecialCharsFlags, $this->encoding);
}
@@ -152,10 +187,9 @@ class Escaper
* to escape that are not covered by htmlspecialchars() to cover cases where an attribute
* might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE).
*
* @param string $string
* @return string
*/
public function escapeHtmlAttr($string)
public function escapeHtmlAttr(string $string)
{
$string = $this->toUtf8($string);
if ($string === '' || ctype_digit($string)) {
@@ -175,10 +209,9 @@ class Escaper
* Backslash escaping is not used as it still leaves the escaped character as-is and so
* is not useful in a HTML context.
*
* @param string $string
* @return string
*/
public function escapeJs($string)
public function escapeJs(string $string)
{
$string = $this->toUtf8($string);
if ($string === '' || ctype_digit($string)) {
@@ -194,10 +227,9 @@ class Escaper
* an entire URI - only a subcomponent being inserted. The function is a simple proxy
* to rawurlencode() which now implements RFC 3986 since PHP 5.3 completely.
*
* @param string $string
* @return string
*/
public function escapeUrl($string)
public function escapeUrl(string $string)
{
return rawurlencode($string);
}
@@ -206,10 +238,9 @@ class Escaper
* Escape a string for the CSS context. CSS escaping can be applied to any string being
* inserted into CSS and escapes everything except alphanumerics.
*
* @param string $string
* @return string
*/
public function escapeCss($string)
public function escapeCss(string $string)
{
$string = $this->toUtf8($string);
if ($string === '' || ctype_digit($string)) {
@@ -236,7 +267,8 @@ class Escaper
* The following replaces characters undefined in HTML with the
* hex entity for the Unicode replacement character.
*/
if (($ord <= 0x1f && $chr != "\t" && $chr != "\n" && $chr != "\r")
if (
($ord <= 0x1f && $chr !== "\t" && $chr !== "\n" && $chr !== "\r")
|| ($ord >= 0x7f && $ord <= 0x9f)
) {
return '&#xFFFD;';
@@ -276,7 +308,7 @@ class Escaper
protected function jsMatcher($matches)
{
$chr = $matches[0];
if (strlen($chr) == 1) {
if (strlen($chr) === 1) {
return sprintf('\\x%02X', ord($chr));
}
$chr = $this->convertEncoding($chr, 'UTF-16BE', 'UTF-8');
@@ -285,7 +317,7 @@ class Escaper
return sprintf('\\u%04s', $hex);
}
$highSurrogate = substr($hex, 0, 4);
$lowSurrogate = substr($hex, 4, 4);
$lowSurrogate = substr($hex, 4, 4);
return sprintf('\\u%04s\\u%04s', $highSurrogate, $lowSurrogate);
}
@@ -299,7 +331,7 @@ class Escaper
protected function cssMatcher($matches)
{
$chr = $matches[0];
if (strlen($chr) == 1) {
if (strlen($chr) === 1) {
$ord = ord($chr);
} else {
$chr = $this->convertEncoding($chr, 'UTF-32BE', 'UTF-8');
@@ -310,7 +342,6 @@ class Escaper
/**
* Converts a string to UTF-8 from the base encoding. The base encoding is set via this
* class' constructor.
*
* @param string $string
* @throws Exception\RuntimeException
@@ -335,7 +366,7 @@ class Escaper
/**
* Converts a string from UTF-8 to the base encoding. The base encoding is set via this
* class' constructor.
*
* @param string $string
* @return string
*/
@@ -356,7 +387,7 @@ class Escaper
*/
protected function isUtf8($string)
{
return ($string === '' || preg_match('/^./su', $string));
return $string === '' || preg_match('/^./su', $string);
}
/**
@@ -377,7 +408,7 @@ class Escaper
$result = mb_convert_encoding($string, $to, $from);
} else {
throw new Exception\RuntimeException(
get_class($this)
static::class
. ' requires either the iconv or mbstring extension to be installed'
. ' when escaping for non UTF-8 strings.'
);
+1 -5
View File
@@ -1,10 +1,6 @@
<?php
/**
* @see https://github.com/laminas/laminas-escaper for the canonical source repository
* @copyright https://github.com/laminas/laminas-escaper/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-escaper/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
namespace Laminas\Escaper\Exception;
@@ -1,10 +1,6 @@
<?php
/**
* @see https://github.com/laminas/laminas-escaper for the canonical source repository
* @copyright https://github.com/laminas/laminas-escaper/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-escaper/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
namespace Laminas\Escaper\Exception;
+1 -5
View File
@@ -1,10 +1,6 @@
<?php
/**
* @see https://github.com/laminas/laminas-escaper for the canonical source repository
* @copyright https://github.com/laminas/laminas-escaper/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-escaper/blob/master/LICENSE.md New BSD License
*/
declare(strict_types=1);
namespace Laminas\Escaper\Exception;