Changeset 3245912
- Timestamp:
- 02/24/2025 05:40:41 PM (13 months ago)
- Location:
- stafflist/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
stafflist.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stafflist/trunk/readme.txt
r3245050 r3245912 103 103 104 104 == Changelog == 105 = 3.2.6 = 106 * Fixed deprecation warnings that appeared in PHP8+, found by @thomasprice61 (thank you); 107 105 108 = 3.2.5 = 106 109 * Fixed deprecation warnings that appeared in PHP8+, found by @thomasprice61 (thank you); -
stafflist/trunk/stafflist.php
r3245050 r3245912 4 4 Plugin URI: http://wordpress.org/plugins/stafflist/ 5 5 Description: A super simplified staff directory tool 6 Version: 3.2. 56 Version: 3.2.6 7 7 Author: era404 8 8 Author URI: http://www.era404.com … … 729 729 case "email": 730 730 //special case for email to use mailto hyperlink 731 if(""!=trim($s['email']) && strstr($s['email'],"@")){ 732 $cleanemail = strip_tags($s['email']); 731 $colval = trim($s['email']??""); 732 if(""!=$colval && strstr($colval,"@")){ 733 $cleanemail = strip_tags($colval); 733 734 $cleantitle = "Email ".esc_html(strip_tags($s['firstname']." ".$s['lastname'])); 734 $html .= "\t\t\t<td><a href='mailto:{$cleanemail}' title='{$cleantitle}'>{$ s['email']}</a></td>\n";735 $html .= "\t\t\t<td><a href='mailto:{$cleanemail}' title='{$cleantitle}'>{$colval}</a></td>\n"; 735 736 } else { 736 $html .= "\t\t\t<td>{$ s['email']}</td>\n";737 $html .= "\t\t\t<td>{$colval}</td>\n"; 737 738 } 738 739 break; … … 743 744 //special case for phone to use tel hyperlink 744 745 $urlcol = $col['col']; 745 if(""!=trim($s[$urlcol]) && ""!=($cleannumber = preg_replace('/[^0-9]/', '', $s[$urlcol]))){ 746 $colval = trim($s[$urlcol]??""); 747 if(""!=$colval && ""!=($cleannumber = preg_replace('/[^0-9]/', '', $colval))){ 746 748 $cleantitle = "Call ".esc_html(strip_tags($s['firstname']." ".$s['lastname'])); 747 $html .= "\t\t\t<td><a href='tel:{$cleannumber}' title='{$cleantitle}'>{$ s[$urlcol]}</a></td>\n";749 $html .= "\t\t\t<td><a href='tel:{$cleannumber}' title='{$cleantitle}'>{$colval}</a></td>\n"; 748 750 } else { 749 $html .= "\t\t\t<td>{$ s[$urlcol]}</td>\n";751 $html .= "\t\t\t<td>{$colval}</td>\n"; 750 752 } 751 753 break; … … 757 759 $hasUrl = true; 758 760 $urlcol = $col['col']; 759 $cleanurl = strip_tags(stripslashes(preg_replace('/\s+/','',trim($s[$urlcol])))); 761 $colval = trim($s[$urlcol]??""); 762 $cleanurl = strip_tags(stripslashes(preg_replace('/\s+/','',$colval))); 760 763 $cleanurl = filter_var($cleanurl, FILTER_VALIDATE_URL); 761 764 $cleanurl = esc_url($cleanurl); … … 769 772 //all others (including img tags) 770 773 default: 771 if(substr($s[ $col['col'] ],0,4)=="img:"){ 772 $img = strip_tags(trim(substr($s[ $col['col'] ],4))); 774 $colval = trim($s[ $col['col'] ]??""); 775 if(substr($colval,0,4)=="img:"){ 776 $img = strip_tags(trim(substr($colval,4))); 773 777 if(filter_var($img,FILTER_VALIDATE_URL)){ 774 778 $html .= "\t\t\t<td><img src='{$img}' class='stafflist_image_small' /></td>\n"; … … 777 781 } 778 782 } else { 779 $html .= "\t\t\t<td>{$ s[$col['col']]}</td>\n";783 $html .= "\t\t\t<td>{$colval}</td>\n"; 780 784 } 781 785 break;
Note: See TracChangeset
for help on using the changeset viewer.