Plugin Directory

Changeset 2584669


Ignore:
Timestamp:
08/18/2021 08:31:45 AM (5 years ago)
Author:
msh134
Message:

Escaped outputs

Location:
wp-upload-restriction/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-upload-restriction/trunk/content.php

    r2584039 r2584669  
    1 <h4><?php _e('Allowed File Types', 'wp_upload_restriction'); ?></h4>
    2 <p><?php _e('Files with selected types will be allowed for uploading.', 'wp_upload_restriction'); ?></p>
    3 <div class="check-uncheck-links"><a class="check" href="#"><?php _e('Check all', 'wp_upload_restriction'); ?></a> | <a class="uncheck" href="#"><?php _e('Uncheck all', 'wp_upload_restriction'); ?></a></div>
     1<?php if(!defined('ABSPATH')){ exit(); } ?>
     2<h4><?php esc_html_e('Allowed File Types', 'wp_upload_restriction'); ?></h4>
     3<p><?php esc_html_e('Files with selected types will be allowed for uploading.', 'wp_upload_restriction'); ?></p>
     4<div class="check-uncheck-links"><a class="check" href="#"><?php esc_html_e('Check all', 'wp_upload_restriction'); ?></a> | <a class="uncheck" href="#"><?php esc_html_e('Uncheck all', 'wp_upload_restriction'); ?></a></div>
    45<div class="list">
    56<?php
     
    1011?>
    1112    <div>
    12         <label for="ext_<?php echo $i; ?>">
    13             <input id="ext_<?php echo $i; ?>" type="checkbox" name="types[]" class="chk-mime-types" <?php echo $checked; ?> value="<?php echo esc_attr($ext); ?>::<?php echo esc_attr($type); ?>"> <?php echo $this->processExtention($ext); ?>
     13        <label for="ext_<?php esc_attr_e($i); ?>">
     14            <input id="ext_<?php esc_attr_e($i); ?>" type="checkbox" name="types[]" class="chk-mime-types" <?php esc_html_e($checked); ?> value="<?php esc_attr_e($ext); ?>::<?php esc_attr_e($type); ?>"> <?php echo $this->processExtention($ext); ?>
    1415        </label>
    1516    </div>
     
    1718        $i++;
    1819    }
    19    
    20      
    21 ?>     
     20?>
    2221</div>
    2322<p>&nbsp</p>
    24 <h4><?php _e('Allowed Upload Size', 'wp_upload_restriction'); ?>:</h4>
    25 <p><?php _e('Check the box below and enter value in the field to restrict upload size for the selected role.', 'wp_upload_restriction'); ?></p>
    26 <input type="checkbox" name="restrict_upload_size" value="1" <?php echo $restrict_upload_size ? 'checked="checked"' : ''; ?>> <lable for="restrict_upload_size"><?php _e('Restrict upload size to', 'wp_upload_restriction'); ?></lable>
     23<h4><?php esc_html_e('Allowed Upload Size', 'wp_upload_restriction'); ?>:</h4>
     24<p><?php esc_html_e('Check the box below and enter value in the field to restrict upload size for the selected role.', 'wp_upload_restriction'); ?></p>
     25<input type="checkbox" name="restrict_upload_size" value="1" <?php esc_attr_e($restrict_upload_size ? 'checked="checked"' : ''); ?>> <lable for="restrict_upload_size"><?php esc_html_e('Restrict upload size to', 'wp_upload_restriction'); ?></lable>
    2726<label>
    28     <input type="text" maxlength="5" size="6" name="upload_size" value="<?php echo esc_attr($upload_size); ?>">
     27    <input type="text" maxlength="5" size="6" name="upload_size" value="<?php esc_attr_e($upload_size); ?>">
    2928    <select name="upload_size_unit">
    30         <option value="KB" <?php echo $upload_size_unit == 'KB' ? 'selected="selected"' : ''; ?>>KB</option>
    31         <option value="MB" <?php echo empty($upload_size_unit) || $upload_size_unit == 'MB' ? 'selected="selected"' : ''; ?>>MB</option>
     29        <option value="KB" <?php esc_attr_e($upload_size_unit == 'KB' ? 'selected="selected"' : ''); ?>>KB</option>
     30        <option value="MB" <?php esc_attr_e(empty($upload_size_unit) || $upload_size_unit == 'MB' ? 'selected="selected"' : ''); ?>>MB</option>
    3231    </select>
    3332</label>
    34            
    35 
    3633
    3734<script type="text/javascript">
  • wp-upload-restriction/trunk/languages/wp_upload_restriction.pot

    r1904410 r2584669  
    88"Language-Team: Sajjad Hossain <[email protected]>\n"
    99"MIME-Version: 1.0\n"
    10 "Content-Type: text/plain; charset=iso-8859-1\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.8.7.1\n"
     12"X-Generator: Poedit 2.4.2\n"
    1313
    1414msgid "Select the extensions for allowing file upload"
     
    7474msgid "Enter the file extension here. If there are multiple extensions then seperate them with \"|\". Example, \"jpg|jpeg\"."
    7575msgstr ""
     76
     77msgid "Type successfully added."
     78msgstr ""
     79
     80msgid "Are you sure you want to delete this?"
     81msgstr ""
  • wp-upload-restriction/trunk/readme.txt

    r2584039 r2584669  
    33Tags: upload, media, developer tool
    44Tested up to: 5.8
    5 Stable tag: 2.2.5
     5Stable tag: 2.2.6
    66License: GPLv2 or later
    77
     
    3333
    3434== Changelog ==
    35 = 2.2.5 =
     35= 2.2.6 =
    3636* Fixed security issues.
    3737
  • wp-upload-restriction/trunk/settings.php

    r2584039 r2584669  
    11<?php
     2    if(!defined('ABSPATH')){ exit(); }
    23    wp_enqueue_style('wp-upload-restrictions-styles');
    34
     
    89?>
    910<script type="text/javascript">var wpur_ajax_nonce = "<?php echo $ajax_nonce; ?>";</script>
    10 <div id="message" class="updated fade"><p><?php _e('Settings saved.', 'wp_upload_restriction') ?></p></div>
    11 <div id="error_message" class="error fade"><p><?php _e('Settings could not be saved.', 'wp_upload_restriction') ?></p></div>
     11<div id="message" class="updated fade"><p><?php esc_html_e('Settings saved.', 'wp_upload_restriction') ?></p></div>
     12<div id="error_message" class="error fade"><p><?php esc_html_e('Settings could not be saved.', 'wp_upload_restriction') ?></p></div>
    1213<div class="wrap">
    1314    <div class="icon32" id="icon-options-general"><br></div>
    1415    <h2>WP Upload Restriction</h2>
    1516    <h2 class="nav-tab-wrapper">
    16         <a href="?page=wp-upload-restriction%2Fsettings.php" class="nav-tab <?php echo empty($tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Restrictions', 'wp_upload_restriction'); ?></a>
    17         <a href="?page=wp-upload-restriction%2Fsettings.php&tab=custom" class="nav-tab <?php echo $tab ==  'custom' ? 'nav-tab-active' : ''; ?>"><?php _e('Custom File Types', 'wp_upload_restriction'); ?></a>
     17        <a href="?page=wp-upload-restriction%2Fsettings.php" class="nav-tab <?php esc_attr_e(empty($tab) ? 'nav-tab-active' : ''); ?>"><?php esc_html_e('Restrictions', 'wp_upload_restriction'); ?></a>
     18        <a href="?page=wp-upload-restriction%2Fsettings.php&tab=custom" class="nav-tab <?php esc_attr_e($tab == 'custom' ? 'nav-tab-active' : ''); ?>"><?php esc_html_e('Custom File Types', 'wp_upload_restriction'); ?></a>
    1819    </h2>
    1920
     
    2122    <div class="role-list">
    2223
    23         <div class="sub-title"><?php _e('Roles', 'wp_upload_restriction'); ?></div>
     24        <div class="sub-title"><?php esc_html_e('Roles', 'wp_upload_restriction'); ?></div>
    2425        <div class="wp-roles">
    2526        <?php foreach($roles as $key => $role):?>
    26         <a href="<?php print $key; ?>"><?php print $role['name']; ?></a>
     27        <a href="<?php esc_attr_e($key); ?>"><?php esc_attr_e($role['name']); ?></a>
    2728        <?php endforeach; ?>
    2829        </div>
     
    3132    <div class="mime-list-section">
    3233        <form action="" method="post" id="wp-upload-restriction-form">
    33             <h2 id="role-name"><?php _e('Role', 'wp_upload_restriction'); ?>: <span></span></h2>
     34            <h2 id="role-name"><?php esc_html_e('Role', 'wp_upload_restriction'); ?>: <span></span></h2>
    3435            <div id="mime-list">
    3536 
     
    3839            <input type="hidden" name="action" value="save_selected_mimes_by_role">
    3940            <?php wp_nonce_field( 'wp-upload-restrict', 'wpur_nonce' ) ?>
    40             <p class="submit"><input type="button" value="<?php  _e('Save Changes', 'wp_upload_restriction'); ?>"> <span class="submit-loading ajax-loading-img"></span></p>
     41            <p class="submit"><input type="button" value="<?php esc_attr_e('Save Changes', 'wp_upload_restriction'); ?>"> <span class="submit-loading ajax-loading-img"></span></p>
    4142        </form>
    4243    </div>
     
    4647            <tbody>
    4748                <tr>
    48                     <th><?php  _e('Extenstions', 'wp_upload_restriction'); ?></th>
     49                    <th><?php esc_html_e('Extenstions', 'wp_upload_restriction'); ?></th>
    4950                    <td>
    50                         <input type="input" value="" name="extensions" id="extensions" size="50" maxlength="50" required data-msg="<?php  _e('Extensions field is required', 'wp_upload_restriction'); ?>">
    51                         <br><span class="description"><?php  _e('Enter the file extension here. If there are multiple extensions then seperate them with "|". Example, "jpg|jpeg".', 'wp_upload_restriction'); ?></span>
     51                        <input type="input" value="" name="extensions" id="extensions" size="50" maxlength="50" required data-msg="<?php esc_html_e('Extensions field is required', 'wp_upload_restriction'); ?>">
     52                        <br><span class="description"><?php esc_html_e('Enter the file extension here. If there are multiple extensions then seperate them with "|". Example, "jpg|jpeg".', 'wp_upload_restriction'); ?></span>
    5253                    </td>
    5354                </tr>
    5455                <tr>
    55                     <th><?php  _e('MIME Type', 'wp_upload_restriction'); ?></th>
    56                     <td><input type="input" value="" name="mime_type" id="mime_type" size="50" maxlength="50" required data-msg="<?php  _e('MIME Type field is required', 'wp_upload_restriction'); ?>"></td>
     56                    <th><?php esc_html_e('MIME Type', 'wp_upload_restriction'); ?></th>
     57                    <td><input type="input" value="" name="mime_type" id="mime_type" size="50" maxlength="50" required data-msg="<?php esc_html_e('MIME Type field is required', 'wp_upload_restriction'); ?>"></td>
    5758                </tr>
    5859                <tr>
    5960                    <th>&nbsp;</th>
    6061                    <td id="cont_save_type">
    61                         <input type="button" id="save_type" value="<?php  _e('Add Type', 'wp_upload_restriction'); ?>">
    62                         <div class="message">Type successfully added.</div>
     62                        <input type="button" id="save_type" value="<?php esc_html_e('Add Type', 'wp_upload_restriction'); ?>">
     63                        <div class="message"><?php esc_html_e('Type successfully added.', 'wp_upload_restriction'); ?></div>
    6364                    </td>
    6465                </tr>
     
    6768    </form>
    6869    <hr>
    69     <h3><?php  _e('Custom Extensions', 'wp_upload_restriction'); ?></h3>
     70    <h3><?php esc_html_e('Custom Extensions', 'wp_upload_restriction'); ?></h3>
    7071    <table class="wp-list-table widefat striped list-custom-types">
    7172        <thead>
    7273        <tr>
    73             <th><?php  _e('Extensions', 'wp_upload_restriction'); ?></th>
    74             <th><?php  _e('MIME Type', 'wp_upload_restriction'); ?></th>
     74            <th><?php esc_html_e('Extensions', 'wp_upload_restriction'); ?></th>
     75            <th><?php esc_html_e('MIME Type', 'wp_upload_restriction'); ?></th>
    7576            <th>&nbsp;</th>
    7677        </tr>
     
    7879        <tbody><?php echo $wpUploadRestriction->prepareCustomTypeHTML(); ?></tbody>
    7980    </table>
    80     <?php endif;?>
     81    <?php endif; ?>
    8182</div>
  • wp-upload-restriction/trunk/wp-upload-restriction.php

    r2584039 r2584669  
    44  Plugin URI: https://wordpress.org/plugins/wp-upload-restriction/
    55  Description: This plugin allows you to control upload of files based on file types and sizes.
    6   Version: 2.2.5
     6  Version: 2.2.6
    77  Author: Sajjad Hossain
    88  Author URI: http://www.sajjadhossain.com
    99 */
     10if(!defined('ABSPATH')){ exit(); }
    1011
    1112if(!defined('WP_UPLOAD_RESTRICTION_DB_VER')) {
     
    9091
    9192        if ($file == $this->plugin_name) {
    92             $settings_link = '<a href="options-general.php?page=wp-upload-restriction/settings.php">' . __('Settings', 'wp_upload_restriction') . '</a>';
     93            $settings_link = '<a href="options-general.php?page=wp-upload-restriction/settings.php">' . esc_html__('Settings', 'wp_upload_restriction') . '</a>';
    9394            array_unshift($links, $settings_link);
    9495        }
     
    512513            $i = 1;
    513514            foreach ($custom_types as $ext => $mime) {
    514                 $html .= '<tr id="row-' . $i . '">
     515                $html .= '<tr id="row-' . esc_attr($i) . '">
    515516                        <td>' . esc_attr($ext) . '</td>
    516517                        <td>' . esc_attr($mime) . '</td>
    517                         <td><a href="#" data-row="row-' . $i . '" data="' . esc_attr($ext) . '" class="del-mime">Delete</a></td>
     518                        <td><a href="#" data-row="row-' . esc_attr($i) . '" data="' . esc_attr($ext) . '" class="del-mime">Delete</a></td>
    518519                       </tr>';
    519520                $i++;
     
    521522        }
    522523        else {
    523             $html = '<tr><td colspan="3">' . __('No custom types found.', 'wp_upload_restriction') . '</td></tr>';
     524            $html = '<tr><td colspan="3">' . esc_html__('No custom types found.', 'wp_upload_restriction') . '</td></tr>';
    524525        }
    525526
Note: See TracChangeset for help on using the changeset viewer.