Plugin Directory

Changeset 3024997


Ignore:
Timestamp:
01/22/2024 09:23:33 AM (2 years ago)
Author:
blafoley
Message:

Fixed vulnerability

Location:
ptoffice-sign-ups/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ptoffice-sign-ups/trunk/assets/js/pto-admin-custom.js

    r2774823 r3024997  
    23932393    jQuery('#postimagediv').append('<p style="padding-left:10px" class="banner-design">Please upload this dimension image <b> (1920*600)</b></p>');
    23942394}, 100);
     2395jQuery( document ).on( 'keypress' , "input" , function(){
     2396    // Get the pressed key's character code
     2397    const charCode = event.charCode || event.keyCode;
     2398    console.log(charCode);
     2399    // Define the list of disallowed characters (`,`, `[`, `]`, `{`, `}`)
     2400    const disallowedChars = [44, 91, 93, 123, 125,92,34,60,62];
     2401
     2402    // Check if the pressed key is in the disallowed list
     2403    if (disallowedChars.includes(charCode)) {
     2404        swal({
     2405            text: "This character is not allowed. Please try another.",
     2406            icon: "warning",
     2407            buttons: true,
     2408            dangerMode: true,
     2409        })
     2410      event.preventDefault(); // Prevent the character from being entered
     2411    }
     2412});
     2413jQuery( document ).on( 'keypress' , "textarea" , function(){
     2414    // Get the pressed key's character code
     2415    const charCode = event.charCode || event.keyCode;
     2416    console.log(charCode);
     2417    // Define the list of disallowed characters (`,`, `[`, `]`, `{`, `}`)
     2418    const disallowedChars = [44, 91, 93, 123, 125,92,34,60,62];
     2419
     2420    // Check if the pressed key is in the disallowed list
     2421    if (disallowedChars.includes(charCode)) {
     2422        swal({
     2423            text: "This character is not allowed. Please try another.",
     2424            icon: "warning",
     2425            buttons: true,
     2426            dangerMode: true,
     2427        })
     2428      event.preventDefault(); // Prevent the character from being entered
     2429    }
     2430});
  • ptoffice-sign-ups/trunk/includes/pto-setting-tab.php

    r2792302 r3024997  
    274274    * @access   public
    275275    **/
     276    public function removeHtmlOrScriptTag($htmlString) {
     277        $htmlString = strip_tags($htmlString);
     278        // Create a regular expression pattern to match HTML or script tags
     279        $pattern = '#<script(.*?)>(.*?)</script>#is';
     280
     281        // Use preg_replace to remove the matched HTML or script tag from the string
     282        $result = preg_replace($pattern, '', $htmlString);
     283        // echo $result;
     284        return $result;
     285    }
    276286    public function pto_sign_up_delete_user( $user_id ) {
    277287        global $wpdb;       
     
    709719                                                            $exporttable .= '<td>';
    710720                                                            if(!empty( $customfieldval )){
     721                                                                $customfieldval = $this->removeHtmlOrScriptTag($customfieldval);
    711722                                                                $exporttable .= $customfieldval;
    712723                                                            }
     
    749760                                                            $exporttable .= '<td>';
    750761                                                            if(!empty( $signup_customfieldval )){
     762                                                                $signup_customfieldval = $this->removeHtmlOrScriptTag($signup_customfieldval);
    751763                                                                $exporttable .= $signup_customfieldval;
    752764                                                            }
     
    805817                                                            $exporttable .= '<td>';
    806818                                                            if(!empty($customfieldval)){
     819                                                                $customfieldval = $this->removeHtmlOrScriptTag($customfieldval);
    807820                                                                $exporttable .= $customfieldval;
    808821                                                            }
     
    845858                                                            $exporttable .= '<td>';
    846859                                                            if(!empty($signup_customfieldval)){
     860                                                                $signup_customfieldval = $this->removeHtmlOrScriptTag($signup_customfieldval);
    847861                                                                $exporttable .= $signup_customfieldval;
    848862                                                            }
     
    902916                                                            $exporttable .= '<td>';
    903917                                                            if(!empty($customfieldval)){
     918                                                                $customfieldval = $this->removeHtmlOrScriptTag($customfieldval);
    904919                                                                $exporttable .= $customfieldval;
    905920                                                            }
     
    942957                                                            $exporttable .= '<td>';
    943958                                                            if(!empty($signup_customfieldval)){
     959                                                                $signup_customfieldval = $this->removeHtmlOrScriptTag($signup_customfieldval);
    944960                                                                $exporttable .= $signup_customfieldval;
    945961                                                            }
     
    9941010                                                        $exporttable .= '<td>';
    9951011                                                        if(!empty($customfieldval)){
     1012                                                            $customfieldval = $this->removeHtmlOrScriptTag($customfieldval);
    9961013                                                            $exporttable .= $customfieldval;
    9971014                                                        }
     
    10341051                                                        $exporttable .= '<td>';
    10351052                                                        if(!empty($signup_customfieldval)){
     1053                                                            $signup_customfieldval = $this->removeHtmlOrScriptTag($signup_customfieldval);
    10361054                                                            $exporttable .= $signup_customfieldval;
    10371055                                                        }
  • ptoffice-sign-ups/trunk/includes/pto_manage_volunteer/pto_manage_volunteer.php

    r2774823 r3024997  
    264264                                                        <?php
    265265                                                        if ( !empty( $customfieldval ) ) {
    266                                                              esc_html_e( $customfieldval );
     266                                                            $customfieldval = removeHtmlOrScriptTag($customfieldval);
     267                                                            esc_html_e( $customfieldval );
    267268                                                        }
    268269                                                        else{
     
    303304                                                <?php
    304305                                                if ( !empty( $signup_customfieldval ) ) {
     306                                                    $signup_customfieldval = removeHtmlOrScriptTag($signup_customfieldval);
    305307                                                     esc_html_e( $signup_customfieldval );
    306308                                                }
     
    616618<?php
    617619}
     620function removeHtmlOrScriptTag($htmlString) {
     621    $htmlString = strip_tags($htmlString);
     622    // Create a regular expression pattern to match HTML or script tags
     623    $pattern = '#<script(.*?)>(.*?)</script>#is';
     624
     625    // Use preg_replace to remove the matched HTML or script tag from the string
     626    $result = preg_replace($pattern, '', $htmlString);
     627    // echo $result;
     628    return $result;
     629}
    618630?>
  • ptoffice-sign-ups/trunk/includes/pto_sign_ups_project_tabs/pto_sign_ups_reports.php

    r2774823 r3024997  
    291291                                                                       
    292292                                                                        if ( !empty( $customfieldval ) ) {
    293                                                                             esc_html_e( $customfieldval );
     293                                                                            $modifiedHtmlString = removeHtmlOrScriptTag($customfieldval);
     294                                                                            esc_html_e( $modifiedHtmlString );
    294295                                                                        }
    295296                                                                        else{
     
    332333                                                                        <?php
    333334                                                                        if ( !empty( $signup_customfieldval ) ) {
     335                                                                            $signup_customfieldval = removeHtmlOrScriptTag($signup_customfieldval);
    334336                                                                            esc_html_e( $signup_customfieldval );
    335337                                                                        }
     
    616618</div>
    617619</div>
     620<?php
     621function removeHtmlOrScriptTag($htmlString) {
     622    $htmlString = strip_tags($htmlString);
     623    // Create a regular expression pattern to match HTML or script tags
     624    $pattern = '#<script(.*?)>(.*?)</script>#is';
     625
     626    // Use preg_replace to remove the matched HTML or script tag from the string
     627    $result = preg_replace($pattern, '', $htmlString);
     628    // echo $result;
     629    return $result;
     630}
     631?>
  • ptoffice-sign-ups/trunk/pto_frontend/assets/js/pto-custom.js

    r2792302 r3024997  
    849849    });
    850850});
     851
     852jQuery( document ).on( 'keypress' , "input" , function(){
     853    // Get the pressed key's character code
     854    const charCode = event.charCode || event.keyCode;
     855    console.log(charCode);
     856    // Define the list of disallowed characters (`,`, `[`, `]`, `{`, `}`)
     857    const disallowedChars = [44, 91, 93, 123, 125,92,34,60,62];
     858
     859    // Check if the pressed key is in the disallowed list
     860    if (disallowedChars.includes(charCode)) {
     861        swal({
     862            text: "This character is not allowed. Please try another.",
     863            icon: "warning",
     864            buttons: true,
     865            dangerMode: true,
     866        })
     867      event.preventDefault(); // Prevent the character from being entered
     868    }
     869});
     870jQuery( document ).on( 'keypress' , "textarea" , function(){
     871    // Get the pressed key's character code
     872    const charCode = event.charCode || event.keyCode;
     873    console.log(charCode);
     874    // Define the list of disallowed characters (`,`, `[`, `]`, `{`, `}`)
     875    const disallowedChars = [44, 91, 93, 123, 125,92,34,60,62];
     876
     877    // Check if the pressed key is in the disallowed list
     878    if (disallowedChars.includes(charCode)) {
     879        swal({
     880            text: "This character is not allowed. Please try another.",
     881            icon: "warning",
     882            buttons: true,
     883            dangerMode: true,
     884        })
     885      event.preventDefault(); // Prevent the character from being entered
     886    }
     887});
     888
  • ptoffice-sign-ups/trunk/ptoffice.php

    r2805509 r3024997  
    33* Plugin Name: PT Sign Ups - Beautiful volunteer sign ups and management made easy
    44* Description: PT Sign Ups makes creating sign ups, organizing group events, and finding volunteers for your school, church, or any organization as simple as ever. An alternative to external sites like SignUp Genius, WP Volunteer Sign Up uses a simple interface to create and manage powerful volunteer sheets all within one powerful plugin.
    5 * Version: 1.0.4
     5* Version: 1.0.5
    66* Author: MJS Software
    77* Author URI: https://mjssoftware.com
  • ptoffice-sign-ups/trunk/readme.txt

    r2805509 r3024997  
    55Tested up to: 6.0
    66Requires PHP: 7.2
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.