🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 Sanitizer.php

📁 Path: /home/skhata/krishikranti.com.np/wp-content/plugins/ninja-forms/includes/Handlers/Sanitizer.php
📊 Size: 1.03 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php 

namespace NinjaForms\Includes\Handlers;

/**
 * Sanitize output for enhanced functionality while maintaining security
 */
class Sanitizer{

    const DISALLOWED_SCRIPT_TRIGGERS=[
        '/<\s*(script)/i', // < script (includes empty spaces after opening tag)
        '/(onload)/i', // word 'onload' 
        '/(onerror)/i', // word 'onerror'
        '/(onfocus)/i', // word 'onfocus'
        '/(javascript)/i' // word 'javascript'
    ];

    /**
     * Block disallowed script triggering text
     *
     * @param string $string
     * @return string
     */
   public static function preventScriptTriggerInHtmlOutput(string $string): string
    {
        $return = $string;

        $fail = false;

        foreach(self::DISALLOWED_SCRIPT_TRIGGERS as $disallowedString){
            $preg_match = preg_match($disallowedString,$string);

            if($preg_match){
                $fail = true;
            }
        }

        if($fail){
            $return = htmlspecialchars($return,\ENT_QUOTES);
        }

        return $return;
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨