Plugin Directory

Changeset 2847574


Ignore:
Timestamp:
01/12/2023 06:42:18 PM (3 years ago)
Author:
era404
Message:

Fixed bug with >PHP7.4:parse_str() for Custom Labels & Messages, discovered by @eddieatwp (thank you);

Location:
stafflist/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stafflist/trunk/readme.txt

    r2798476 r2847574  
    44Tags: staff, directory, faculty, personnel, phonebook, rubrik
    55Requires at least: 3.2.1
    6 Tested up to: 5.9.3
     6Tested up to: 6.1.1
    77Requires PHP: 5.6
    88Stable tag: trunk
     
    103103
    104104== Changelog ==
     105= 3.2.0 =
     106* Fixed bug with >PHP7.4:parse_str() for Custom Labels & Messages, discovered by @eddieatwp (thank you);
     107
    105108= 3.1.9 =
    106109* Added a new shortcode attribute `sort=n`, where n is the column to be use for sorting when StaffList is first rendered (Your website visitors may still change the sort as they please afterward). Hover the column names in the admin page to reference column numbers that can be used. Per request by @jorniel1 (Thank you);
  • stafflist/trunk/stafflist.php

    r2798476 r2847574  
    44Plugin URI: http://wordpress.org/plugins/stafflist/
    55Description: A super simplified staff directory tool
    6 Version: 3.1.9
     6Version: 3.2.0
    77Author: era404
    88Author URI: http://www.era404.com
     
    876876    /**********************************************************************************************
    877877    *   StaffList Admin > Set some custom labels for Standard Columns (and "No Results Found." message)
     878    *   $_POST['data']['stafflist']['rename'] = array() => $rns
    878879    ***********************************************************************************************/
    879880    function ajax_rename(){
    880         global $wpdb, $std, $messaging; parse_str($_POST['data']); $resp = array();
     881        global $wpdb, $std, $messaging; $resp = array();
     882        parse_str($_POST['data'],$rnp); $rns = $rnp['stafflist']['rename'];
    881883
    882884        //rename standard column labels
    883885        foreach($std as $fd => $fdn){
    884             if(isset($stafflist['rename'][$fd])){
    885                 $title = sanitize_option("stafflist_rename_{$fd}", (string) stripslashes(trim($stafflist['rename'][$fd])));
     886            if(isset($rns[$fd])){
     887                $title = sanitize_option("stafflist_rename_{$fd}", (string) stripslashes(trim($rns[$fd])));
    886888                if(update_option("stafflist_rename_{$fd}", $title)){
    887889                    if(""!=$title && strlen($title)>0){
     
    895897        //rename some messaging too
    896898        foreach($messaging as $fd => $f){
    897             if(isset($stafflist['rename'][$fd])){
    898                 $title = sanitize_option("stafflist_rename_{$fd}", (string) stripslashes(trim($stafflist['rename'][$fd])));
     899            if(isset($rns[$fd])){
     900                $title = sanitize_option("stafflist_rename_{$fd}", (string) stripslashes(trim($rns[$fd])));
    899901                if(update_option("stafflist_rename_{$fd}", $title)){
    900902                    if(""!=$title && strlen($title)>0){
Note: See TracChangeset for help on using the changeset viewer.