WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
retrieves wrong document with similar name (subset) (1 post)

  1. edblackwood
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags