rename p1

This commit is contained in:
Joey Kimsey
2025-02-03 12:29:16 -05:00
parent 394e752094
commit 20f09e6789
29 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php
/**
* functions/sanitize.php
*
* This class is used to sanitize user input.
*
* @version 1.1.2
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com/libraries/Bedrock
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Bedrock\Functions;
class Sanitize {
/**
* This function strips all html tags except for p/a/br from the given string.
*
* @param {string} [$data] - The string to be parsed
* @return {string} - The sanitized string.
*/
public static function contentShort( $data ) {
return strip_tags( $data, '<p><a><br>' );
}
/**
* This function is to remove $'s and brackets from the rich HTML editor
* which are the only parts that cause parse issues
*
* @param {string} [$data] - The string to be parsed
* @return {string} - The sanitized string.
*/
public static function rich( $data ) {
$data = preg_replace( '#\{#', '&#123;', $data );
$data = preg_replace( '#\}#', '&#125;', $data );
$data = preg_replace( '#\$#', '&#36;', $data );
return $data;
}
public static function url( $data ) {
$trimmed = rtrim( $data, '/' );
$filtered = filter_var( $trimmed, FILTER_SANITIZE_URL );
return $filtered;
}
}