Plugin Directory


Ignore:
Timestamp:
10/25/2022 11:19:50 AM (2 years ago)
Author:
codepeople
Message:

New version 1.3.73, see changelog for updates included in this version.

Location:
appointment-hour-booking
Files:
435 added
5 edited

Legend:

Unmodified
Added
Removed
  • appointment-hour-booking/trunk/README.txt

    r2801936 r2803896  
    13091309* Feedback update
    13101310
     1311= 1.3.73 =
     1312* Stronger captcha validation
     1313* CSV export improvements
     1314* Stronger data validation
     1315
    13111316== Upgrade Notice ==
    13121317
    1313 = 1.3.72 =
    1314 * Feedback update
     1318= 1.3.73 =
     1319* Stronger captcha validation
     1320* CSV export improvements
     1321* Stronger data validation
  • appointment-hour-booking/trunk/app-booking-plugin.php

    r2801936 r2803896  
    44Plugin URI: https://apphourbooking.dwbooster.com
    55Description: Appointment Hour Booking is a plugin for creating booking forms for appointments with a start time and a defined duration.
    6 Version: 1.3.72
     6Version: 1.3.73
    77Author: CodePeople
    88Author URI: https://apphourbooking.dwbooster.com
  • appointment-hour-booking/trunk/captcha/captcha.php

    r2307376 r2803896  
    6565$_SESSION['rand_code'.sanitize_key($_GET["ps"])] = str_replace(" ", "", $str);
    6666
    67 setCookie('rand_code'.sanitize_key($_GET["ps"]), md5(str_replace(" ", "", $str)), time()+36000,"/");
     67$uidt = uniqid();
     68
     69set_transient( "ahb-captcha-".$uidt , str_replace(" ", "", $str) , 1800 );
     70
     71setCookie('rand_code'.sanitize_key($_GET["ps"]), $uidt, time()+36000,"/");
    6872
    6973$image = imagecreatetruecolor($imgX, $imgY);
  • appointment-hour-booking/trunk/classes/cp-base-class.inc.php

    r2797080 r2803896  
    8585   
    8686    function sanitize ( $v )
    87     {
     87    { 
    8888        if (is_array($v))
    8989        {
     
    9494        {
    9595            $allowed_tags = wp_kses_allowed_html( 'post' );
     96            if (isset($allowed_tags["script"])) unset($allowed_tags["sript"]);
     97            if (isset($allowed_tags["iframe"])) unset($allowed_tags["iframe"]);           
    9698            $v = wp_kses($v, $allowed_tags);
    9799        }
  • appointment-hour-booking/trunk/cp-main-class.inc.php

    r2800061 r2803896  
    12111211                            if ($_REQUEST['cp_app_action'] == 'mv' && $this->check_current_user_access($formid))
    12121212                            {
    1213                                 $data["INFO"] = $myrows[$i]->data;
    1214                                 $tmp2[count($tmp2)-1]["info"] = $this->replace_tags($t_content_admin, $data, false, $k);  //   $myrows[$i]->data;
    1215                                 $tmp2[count($tmp2)-1]["e"] = $this->replace_tags($t_title_admin, $data, false, $k);  // sanitize_email($myrows[$i]->notifyto);
     1213                                $data["INFO"] = $this->sanitize($myrows[$i]->data);
     1214                                $tmp2[count($tmp2)-1]["info"] = $this->replace_tags( $this->sanitize($t_content_admin), $data, false, $k);  //   $myrows[$i]->data;
     1215                                $tmp2[count($tmp2)-1]["e"] = $this->replace_tags( $this->sanitize($t_title_admin), $data, false, $k);  // sanitize_email($myrows[$i]->notifyto);
    12161216                            }
    12171217                        }
     
    12921292        @session_start();
    12931293        if (isset($_GET["ps"])) $sequence = $_GET["ps"]; else if (isset($_POST["cp_pform_psequence"])) $sequence = $_POST["cp_pform_psequence"];
     1294        $captcha_tr = '';
     1295        if (!empty($_COOKIE['rand_code'.$sequence])) $captcha_tr = get_transient( "ahb-captcha-".sanitize_key($_COOKIE['rand_code'.$sequence]));
    12941296        if (
    12951297               !apply_filters( 'cpappb_valid_submission', true) ||
     
    13001302                   )
    13011303                   &&
    1302                    ( (md5(strtolower($this->get_param('hdcaptcha_'.$this->prefix.'_post'))) != ($_COOKIE['rand_code'.$sequence])) ||
    1303                      ($_COOKIE['rand_code'.$sequence] == '')
     1304                   ( (strtolower($this->get_param('hdcaptcha_'.$this->prefix.'_post')) != $captcha_tr) ||
     1305                     ($captcha_tr == '')
    13041306                   )
    13051307               )
     
    13461348            if ($item->ftype != 'fapp' && !defined('CPAPPHOURBK_BLOCK_TIMES_PROCESS'))
    13471349            {
     1350                if ($item->ftype == 'femail' && isset($posted_items[$item->name.$sequence]))
     1351                    $posted_items[$item->name.$sequence] = sanitize_email($posted_items[$item->name.$sequence]);
    13481352                $fields[$item->name] = $item->title;
    13491353                if ($item->ftype == 'fPhone') // join fields for phone fields
     
    16221626                    $item_split = explode(' ',$app_item_text);
    16231627                    $subid++;
     1628                    $item_split[2] = intval($item_split[2]);
    16241629                    $fieldtotalcost += $field->services[ $item_split[2] ]->price;
    1625                     $apps[] = array (
    1626                                      'id' => $subid,
    1627                                      'cancelled' => $status,
    1628                                      'serviceindex' => $item_split[2],
    1629                                      'service' => $field->services[ $item_split[2] ]->name,
    1630                                      'duration' => $field->services[ $item_split[2] ]->duration,
    1631                                      'price' => 0, //$field->services[ $item_split[2] ]->price,
    1632                                      'date' => $item_split[0],
    1633                                      'slot' => $item_split[1],
    1634                                      'military' => @$field->militaryTime,
    1635                                      'field' => $field->name,
    1636                                      'quant' => $item_split[3],
    1637                                      'sid' => (isset($field->services[ $item_split[2] ]->idx)?$field->services[ $item_split[2] ]->idx:'')  // service ID
    1638                                      );
     1630                    $sdate = strtotime($item_split[0]);
     1631                    if ($sdate > 0)
     1632                        $apps[] = array (
     1633                                         'id' => $subid,
     1634                                         'cancelled' => $status,
     1635                                         'serviceindex' => $item_split[2],
     1636                                         'service' => $field->services[ $item_split[2] ]->name,
     1637                                         'duration' => $field->services[ $item_split[2] ]->duration,
     1638                                         'price' => 0, //$field->services[ $item_split[2] ]->price,
     1639                                         'date' =>  date("Y-m-d", $sdate),
     1640                                         'slot' => sanitize_text_field($item_split[1]),
     1641                                         'military' => @$field->militaryTime,
     1642                                         'field' => $field->name,
     1643                                         'quant' => intval($item_split[3]),
     1644                                         'sid' => (isset($field->services[ $item_split[2] ]->idx)?$field->services[ $item_split[2] ]->idx:'')  // service ID
     1645                                         );
    16391646                }
    16401647                //if ($fieldtotalcost < $fieldpostedcost)      // this is to support javascript price calculations
     
    21332140    }
    21342141
     2142    function clean_csv_value($value)
     2143    {
     2144        $value = trim($value);
     2145        while (strlen($value) > 1 && in_array($value[0],array('=','@')))
     2146            $value = trim(substr($value, 1));
     2147        return $value;
     2148    }
     2149   
    21352150
    21362151    function export_csv ()
     
    22562271        {
    22572272            $hlabel = $this->iconv("utf-8", "ISO-8859-1//TRANSLIT//IGNORE", $this->get_form_field_label($fields[$i],$form));
    2258             echo '"'.str_replace('"','""', $hlabel).'"'.$separator;
     2273            echo '"'.str_replace('"','""', $this->clean_csv_value($hlabel)).'"'.$separator;
    22592274        }
    22602275
     
    22692284                    $item[$i] = implode(',',$item[$i]);
    22702285                $item[$i] = $this->iconv("utf-8", "ISO-8859-1//TRANSLIT//IGNORE", $item[$i]);
    2271                 echo '"'.str_replace('"','""', trim($item[$i])).'"'.$separator;
     2286                echo '"'.str_replace('"','""', $this->clean_csv_value($item[$i])).'"'.$separator;
    22722287            }
    22732288            echo "\n";
     
    23872402                }
    23882403                $value = str_replace('"','""', $value);
    2389                 echo trim($value);
     2404                echo $this->clean_csv_value($value);
    23902405                echo '"';
    23912406            }
     
    24132428        {
    24142429            $hlabel = $this->iconv("utf-8", "ISO-8859-1//TRANSLIT//IGNORE", $this->get_form_field_label($fields[$i],$form));
    2415             echo '"'.str_replace('"','""', $hlabel).'"'.$separator;
     2430            echo '"'.str_replace('"','""', $this->clean_csv_value($hlabel)).'"'.$separator;
    24162431        }
    24172432        echo "\n";
Note: See TracChangeset for help on using the changeset viewer.