Support » Plugin: Download Monitor » [Plugin: WordPress Download Monitor] retrieves wrong document with similar name (subset)

  • Hi, Mike – no reply needed, of course, but I found a bug/feature? in your WordPress Download Monitor (which is a great program). In download.php at about line 131 you have this:

    $query_select_1 = $wpdb->prepare( "SELECT * FROM $wp_dlm_db WHERE filename LIKE '%s' ORDER BY LENGTH(filename) ASC LIMIT 1;", "%".$id );

    But I have a lot of similar files 1a.pptx, 11a.pptx, etc and when trying to get 1a the download was instead returning 11a. So, I modified that line to:

    $query_select_1 = $wpdb->prepare( "SELECT * FROM $wp_dlm_db WHERE filename LIKE '%s' ORDER BY LENGTH(filename) ASC LIMIT 1;", "%/".$id );

    Thanks,
    Ed

    http://wordpress.org/extend/plugins/download-monitor/

  • The topic ‘[Plugin: WordPress Download Monitor] retrieves wrong document with similar name (subset)’ is closed to new replies.