Plugin Directory

Changeset 1468601


Ignore:
Timestamp:
08/05/2016 12:47:53 PM (10 years ago)
Author:
aueda
Message:

media-file-manager 1.4.1

Location:
media-file-manager
Files:
23 added
3 edited

Legend:

Unmodified
Added
Removed
  • media-file-manager/trunk/media-relocator.php

    r1335996 r1468601  
    44Plugin URI: http://tempspace.net/plugins/?page_id=111
    55Description: You can make sub-directories in the upload directory, and move files into them. At the same time, this plugin modifies the URLs/path names in the database. Also an alternative file-selector is added in the editing post/page screen, so you can pick up media files from the subfolders easily.
    6 Version: 1.4.0
     6Version: 1.4.1
    77Author: Atsushi Ueda
    88Author URI: http://tempspace.net/plugins/
  • media-file-manager/trunk/media-selector.php

    r1335996 r1468601  
    5959    global $wpdb;
    6060    $id = $_POST['id'];
    61 
    62     $res = $wpdb->get_results(
     61    if (!is_numeric($id)) {
     62        die("error");
     63    }
     64
     65    $query = $wpdb->prepare(
    6366        "SELECT * from $wpdb->posts ".
    64         "WHERE id=".$id." ".
    65         " ");
     67        "WHERE id='%d'",$id);
     68    $res = $wpdb->get_results($query);
    6669    $ret->posts = $res[0];
    6770
     
    6972    $ret->meta = $meta;
    7073
    71     $file = $wpdb->get_results(
    72         "SELECT meta_value FROM $wpdb->postmeta WHERE post_id=".$id." AND  meta_key='_wp_attached_file'");
     74    $query = $wpdb->prepare(
     75        "SELECT meta_value FROM $wpdb->postmeta WHERE post_id='%d' AND meta_key='_wp_attached_file'", $id);
     76    $file = $wpdb->get_results($query);
    7377    $ret->file = $file[0]->meta_value;
    7478
    75     $alt = $wpdb->get_results(
    76         "SELECT meta_value FROM $wpdb->postmeta WHERE post_id=".$id." AND meta_key='_wp_attachment_image_alt'");
     79    $query = $wpdb->prepare(
     80        "SELECT meta_value FROM $wpdb->postmeta WHERE post_id='%d' AND meta_key='_wp_attachment_image_alt'", $id);
     81    $alt = $wpdb->get_results($query);
    7782    if ($alt) {
    7883        $ret->alt = $alt[0]->meta_value;
     
    9499
    95100    $id = $_POST['id'];
     101    if (!is_numeric($id)) {
     102        die("error");
     103    }
    96104
    97105    $mime_type = "";
     
    108116    $dat =  array();
    109117
    110     $res = $wpdb->get_results(
     118    $query = $wpdb->prepare(
    111119        "SELECT * from $wpdb->posts ".
    112         "WHERE id=".$id." ".
    113         " ");
     120        "WHERE id='%d'", $id);
     121    $res = $wpdb->get_results($query);
    114122    if (count($res)) {
    115123        $mime_type = $res[0]->post_mime_type;
     
    123131    $is_image = (substr($mime_type, 0, 5)=='image');
    124132
    125     $res = $wpdb->get_results(
    126         "SELECT meta_value FROM $wpdb->postmeta WHERE post_id=".$id." AND  meta_key='_wp_attached_file'");
     133    $query = $wpdb->prepare(
     134        "SELECT meta_value FROM $wpdb->postmeta WHERE post_id='%d' AND meta_key='_wp_attached_file'", $id);
     135    $res = $wpdb->get_results($query);
    127136    if (count($res)) {
    128137        $file = $res[0]->meta_value;
     
    170179        $size_full='('.$meta['width']." x ".$meta['height'].')';
    171180
    172         $res = $wpdb->get_results(
    173             "SELECT meta_value FROM $wpdb->postmeta WHERE post_id=".$id." AND meta_key='_wp_attachment_image_alt'");
     181        $query = $wpdb->prepare(
     182            "SELECT meta_value FROM $wpdb->postmeta WHERE post_id='%d' AND meta_key='_wp_attachment_image_alt'", $id);
     183        $res = $wpdb->get_results($query);
    174184        if (count($res)) {
    175185            $alt = esc_html($res[0]->meta_value);
  • media-file-manager/trunk/readme.txt

    r1335996 r1468601  
    33Donate link: http://tempspace.net/plugins/
    44Tags: media,file,manager,explorer,relocate,folder,folders,files,rename,make directory,directories,organize,organizer,select,selector,database
    5 Requires at least: 4.3.0
    6 Tested up to: 4.4.1
    7 Stable tag: 1.4.0
     5Requires at least: 4.5.0
     6Tested up to: 4.5.3
     7Stable tag: 1.4.1
    88
    99You can make sub-directories in the upload directory, and move files into them.
     
    5656== Changelog ==
    5757
     58= 1.4.1 =
     59* Fixed security bugs.
     60
    5861= 1.4.0 =
    5962* Added an option of disabling set_time_limit().
Note: See TracChangeset for help on using the changeset viewer.