Changeset 2584669
- Timestamp:
- 08/18/2021 08:31:45 AM (5 years ago)
- Location:
- wp-upload-restriction/trunk
- Files:
-
- 5 edited
-
content.php (modified) (3 diffs)
-
languages/wp_upload_restriction.pot (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
settings.php (modified) (8 diffs)
-
wp-upload-restriction.php (modified) (4 diffs)
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> 4 5 <div class="list"> 5 6 <?php … … 10 11 ?> 11 12 <div> 12 <label for="ext_<?php e cho $i; ?>">13 <input id="ext_<?php e cho $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); ?> 14 15 </label> 15 16 </div> … … 17 18 $i++; 18 19 } 19 20 21 ?> 20 ?> 22 21 </div> 23 22 <p> </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 e cho $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> 27 26 <label> 28 <input type="text" maxlength="5" size="6" name="upload_size" value="<?php e cho esc_attr($upload_size); ?>">27 <input type="text" maxlength="5" size="6" name="upload_size" value="<?php esc_attr_e($upload_size); ?>"> 29 28 <select name="upload_size_unit"> 30 <option value="KB" <?php e cho $upload_size_unit == 'KB' ? 'selected="selected"' : ''; ?>>KB</option>31 <option value="MB" <?php e cho 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> 32 31 </select> 33 32 </label> 34 35 36 33 37 34 <script type="text/javascript"> -
wp-upload-restriction/trunk/languages/wp_upload_restriction.pot
r1904410 r2584669 8 8 "Language-Team: Sajjad Hossain <[email protected]>\n" 9 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset= iso-8859-1\n"10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1.8.7.1\n"12 "X-Generator: Poedit 2.4.2\n" 13 13 14 14 msgid "Select the extensions for allowing file upload" … … 74 74 msgid "Enter the file extension here. If there are multiple extensions then seperate them with \"|\". Example, \"jpg|jpeg\"." 75 75 msgstr "" 76 77 msgid "Type successfully added." 78 msgstr "" 79 80 msgid "Are you sure you want to delete this?" 81 msgstr "" -
wp-upload-restriction/trunk/readme.txt
r2584039 r2584669 3 3 Tags: upload, media, developer tool 4 4 Tested up to: 5.8 5 Stable tag: 2.2. 55 Stable tag: 2.2.6 6 6 License: GPLv2 or later 7 7 … … 33 33 34 34 == Changelog == 35 = 2.2. 5=35 = 2.2.6 = 36 36 * Fixed security issues. 37 37 -
wp-upload-restriction/trunk/settings.php
r2584039 r2584669 1 1 <?php 2 if(!defined('ABSPATH')){ exit(); } 2 3 wp_enqueue_style('wp-upload-restrictions-styles'); 3 4 … … 8 9 ?> 9 10 <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> 12 13 <div class="wrap"> 13 14 <div class="icon32" id="icon-options-general"><br></div> 14 15 <h2>WP Upload Restriction</h2> 15 16 <h2 class="nav-tab-wrapper"> 16 <a href="?page=wp-upload-restriction%2Fsettings.php" class="nav-tab <?php e cho 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 e cho $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> 18 19 </h2> 19 20 … … 21 22 <div class="role-list"> 22 23 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> 24 25 <div class="wp-roles"> 25 26 <?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> 27 28 <?php endforeach; ?> 28 29 </div> … … 31 32 <div class="mime-list-section"> 32 33 <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> 34 35 <div id="mime-list"> 35 36 … … 38 39 <input type="hidden" name="action" value="save_selected_mimes_by_role"> 39 40 <?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> 41 42 </form> 42 43 </div> … … 46 47 <tbody> 47 48 <tr> 48 <th><?php _e('Extenstions', 'wp_upload_restriction'); ?></th>49 <th><?php esc_html_e('Extenstions', 'wp_upload_restriction'); ?></th> 49 50 <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> 52 53 </td> 53 54 </tr> 54 55 <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> 57 58 </tr> 58 59 <tr> 59 60 <th> </th> 60 61 <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> 63 64 </td> 64 65 </tr> … … 67 68 </form> 68 69 <hr> 69 <h3><?php _e('Custom Extensions', 'wp_upload_restriction'); ?></h3>70 <h3><?php esc_html_e('Custom Extensions', 'wp_upload_restriction'); ?></h3> 70 71 <table class="wp-list-table widefat striped list-custom-types"> 71 72 <thead> 72 73 <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> 75 76 <th> </th> 76 77 </tr> … … 78 79 <tbody><?php echo $wpUploadRestriction->prepareCustomTypeHTML(); ?></tbody> 79 80 </table> 80 <?php endif; ?>81 <?php endif; ?> 81 82 </div> -
wp-upload-restriction/trunk/wp-upload-restriction.php
r2584039 r2584669 4 4 Plugin URI: https://wordpress.org/plugins/wp-upload-restriction/ 5 5 Description: This plugin allows you to control upload of files based on file types and sizes. 6 Version: 2.2. 56 Version: 2.2.6 7 7 Author: Sajjad Hossain 8 8 Author URI: http://www.sajjadhossain.com 9 9 */ 10 if(!defined('ABSPATH')){ exit(); } 10 11 11 12 if(!defined('WP_UPLOAD_RESTRICTION_DB_VER')) { … … 90 91 91 92 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>'; 93 94 array_unshift($links, $settings_link); 94 95 } … … 512 513 $i = 1; 513 514 foreach ($custom_types as $ext => $mime) { 514 $html .= '<tr id="row-' . $i. '">515 $html .= '<tr id="row-' . esc_attr($i) . '"> 515 516 <td>' . esc_attr($ext) . '</td> 516 517 <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> 518 519 </tr>'; 519 520 $i++; … … 521 522 } 522 523 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>'; 524 525 } 525 526
Note: See TracChangeset
for help on using the changeset viewer.