Changeset 2831421
- Timestamp:
- 12/10/2022 03:05:58 AM (3 years ago)
- Location:
- business-listing/trunk
- Files:
-
- 5 edited
-
admin.php (modified) (1 diff)
-
business-listing.php (modified) (1 diff)
-
helpers/validation_helper.php (modified) (6 diffs)
-
helpers/view_helper.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
business-listing/trunk/admin.php
r2674650 r2831421 115 115 116 116 if (!empty($listing['name'])) { 117 // *** Add http:// to link if missing ***118 if (!empty($listing['link']) && (0 != strncasecmp($listing['link'], 'http://', 7) && 0 != strncasecmp($listing['link'], "https://", 8))) {119 $listing['link'] = 'http://' . $listing['link'];120 }121 117 if (empty($listing['listing_id'])) { 122 118 $listing['listing_id'] = $otgblist_Listings_Model->create_listing($listing['name'], $listing['city'], $listing['state'], $listing['region_id'], -
business-listing/trunk/business-listing.php
r2829728 r2831421 5 5 Description: List businesses in tiles with a photo and link in a random order 6 6 Author: Chris Hood, On The Grid Web Design LLC 7 Version: 2.1. 17 Version: 2.1.2 8 8 Author URI: https://chrishood.me 9 Updated: 12/ 6/2022; Created: 4/23/20159 Updated: 12/9/2022; Created: 4/23/2015 10 10 */ 11 11 -
business-listing/trunk/helpers/validation_helper.php
r2674650 r2831421 12 12 * @param string $field 13 13 * @param string $default 14 * @param string $key14 * @param boolean $allow_html 15 15 * @return string|null 16 16 */ 17 function otgblist_get_request_string ($field, $default=null ) {17 function otgblist_get_request_string ($field, $default=null, $allow_html=false) { 18 18 if (empty($_REQUEST[$field])) { 19 19 return $default; 20 20 } else { 21 return sanitize_text_field(wp_unslash(trim($_REQUEST[$field]))); 21 if ($allow_html) 22 return trim(filter_var(stripslashes_deep($_REQUEST[$field]), FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW)); 23 else 24 return trim(filter_var(stripslashes_deep($_REQUEST[$field]), FILTER_SANITIZE_SPECIAL_CHARS)); 22 25 } 23 26 } … … 62 65 return $default; 63 66 } else { 64 $link = trim( $_REQUEST[$field]);65 if (0 != strncasecmp($link, "http://", 7) && 0 != strncasecmp($link, "https://", 8))67 $link = trim(stripslashes_deep($_REQUEST[$field])); 68 if (0 != strncasecmp($link, 'http://', 7) && 0 != strncasecmp($link, 'https://', 8)) 66 69 $link = 'http://' . $link; 67 70 return filter_var($link, FILTER_SANITIZE_URL); … … 78 81 return $default; 79 82 } else { 80 return trim(filter_var( wp_unslash($_REQUEST[$field]), FILTER_SANITIZE_STRING));83 return trim(filter_var(stripslashes_deep($_REQUEST[$field]), FILTER_SANITIZE_SPECIAL_CHARS)); 81 84 } 82 85 } … … 87 90 function otgblist_get_bulk_action_list () { 88 91 $bulk_action_list = array(); 89 if (!empty($_POST['bulk_action_list'])) foreach ($_POST['bulk_action_list'] as $ record_id) {90 if (is_int($ record_id) || ctype_digit($record_id)) {91 $bulk_action_list[] = (int)$ record_id;92 if (!empty($_POST['bulk_action_list'])) foreach ($_POST['bulk_action_list'] as $id) { 93 if (is_int($id) || ctype_digit($id)) { 94 $bulk_action_list[] = (int)$id; 92 95 } 93 96 } … … 109 112 110 113 /** Get the Bulk Action List and Only Allows Integers in the List 111 * @param string $ name114 * @param string $field 112 115 * @return array 113 116 */ … … 115 118 $field_array = array(); 116 119 if (!empty($_POST[$field])) foreach ($_POST[$field] as $key => $value) { 117 $field_array[ sanitize_text_field(wp_unslash(trim($key)))] = sanitize_text_field(wp_unslash(trim($value)));120 $field_array[trim(filter_var(stripslashes_deep($key), FILTER_SANITIZE_SPECIAL_CHARS))] = trim(filter_var(stripslashes_deep($value), FILTER_SANITIZE_SPECIAL_CHARS)); 118 121 } 119 122 return $field_array; 120 123 } 124 125 /** Replace Quotes with HTML Entity Names 126 * @param string $in 127 * @return string 128 */ 129 function otgblist_filter_quotes ($in) { 130 return trim(str_replace(['"', "'"], ['"', '''], $in)); 131 } -
business-listing/trunk/helpers/view_helper.php
r2829728 r2831421 19 19 $selected_text = ' selected="selected"'; 20 20 echo "<select name='$name'>"; 21 echo "<option value='1'";21 echo '<option value="1"'; 22 22 if (1 == $default) echo $selected_text; 23 echo ">On</option> \n";24 echo "<option value='0'";23 echo ">On</option>"; 24 echo '<option value="0"'; 25 25 if (0 == $default) echo $selected_text; 26 echo ">Off</option> \n";26 echo ">Off</option>"; 27 27 echo "</select>"; 28 28 } … … 35 35 $selected_text = ' selected="selected"'; 36 36 echo "<select name='$name'>"; 37 echo "<option value='1'";37 echo '<option value="1"'; 38 38 if (1 == $default) echo $selected_text; 39 echo ">Yes</option> \n";40 echo "<option value='0'";39 echo ">Yes</option>"; 40 echo '<option value="0"'; 41 41 if (0 == $default) echo $selected_text; 42 echo ">No</option>\n";43 echo "</select>";42 echo '>No</option>'; 43 echo '</select>'; 44 44 } 45 45 … … 90 90 // ***** End if Empty ***** 91 91 if (empty($message_list)) return false; 92 92 93 93 // ***** Order by Third Field ***** 94 94 usort($message_list, function($a, $b) { 95 95 return $a[2] - $b[2]; 96 }); 96 }); 97 97 foreach ($message_list as $message) { 98 98 // ***** Set Class Second Field ***** … … 111 111 } 112 112 // ***** Print It ***** 113 echo "<p class='$class'>" . htmlentities($message[0]). '</p>';113 echo "<p class='$class'>" . $message[0] . '</p>'; 114 114 } 115 115 } -
business-listing/trunk/readme.txt
r2829728 r2831421 6 6 Tested up to: 6.1 7 7 Requires PHP: 5.6 8 Stable tag: 2.1. 08 Stable tag: 2.1.2 9 9 License: GPLv3 10 10 … … 46 46 47 47 == Changelog == 48 2.1.2 (12/69/2022) 49 - Validation, Filter and View helpers improvements and updates for PHP 8.2. 50 48 51 2.1.1 (12/6/2022) 49 52 - Updated Datatables Javascript library 50 53 - Tweaks and code improvements. 51 2.1 54 55 2.1 (2/7/2022) 52 56 - Switched lists to use Datatables Javascript library 53 57 - Added ability to rename categories and region from list 54 58 55 2.0 59 2.0 (5/11/2021) 56 60 - First openly released version 57 61 - Brought the plugin up to current standards … … 64 68 - Improved responsiveness 65 69 66 1.0 70 1.0 (5/5/2015) 67 71 - Plugin created in April 2015 as custom plugin for specific site. 68 72 - Originally called Store Listings
Note: See TracChangeset
for help on using the changeset viewer.