Plugin Directory

Changeset 3364114


Ignore:
Timestamp:
09/18/2025 04:46:47 PM (6 months ago)
Author:
wpyog
Message:

Added sanitize_text_field function to input parameters

Location:
wpyog-documents/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpyog-documents/trunk/index.php

    r3051728 r3364114  
    55Author: WPYog
    66Author URI: http://wpyog.com/
    7 Version: 1.3.3
     7Version: 1.3.4
    88License:            GPLv2 or later
    99License URI:        http://www.gnu.org/licenses/gpl-2.0.html
     
    164164function save_wpyog_document_meta_data($post_id , $post ) {
    165165    if($post->post_type == 'wpyog_document') {
    166         $document_link = !empty($_POST['document_link']) ? $_POST['document_link'] : '';
     166        $document_link = !empty($_POST['document_link']) ? sanitize_text_field($_POST['document_link']) : '';
    167167        update_post_meta($post_id, 'document_link', $document_link);
    168168    }
     
    313313
    314314if (isset($_REQUEST['download_url']) && !empty($_REQUEST['download_url'])) {
    315     $downloadUrl = $_REQUEST['download_url'];
     315    $downloadUrl = sanitize_text_field($_REQUEST['download_url']);
    316316    $post_id = base64_decode( urldecode( $downloadUrl));
    317317    $document_link = get_post_meta( $post_id, 'document_link', true );
     
    410410    $taxonomy  = 'wpyog_document_category'; // change to your taxonomy
    411411    if ($typenow == $post_type) {
    412         $selected      = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : '';
     412        $selected      = isset($_GET[$taxonomy]) ? sanitize_text_field($_GET[$taxonomy]) : '';
    413413        $info_taxonomy = get_taxonomy($taxonomy);
    414414        wp_dropdown_categories(array(
  • wpyog-documents/trunk/readme.txt

    r3037244 r3364114  
    33Contributors: wpyog
    44Donate link: http://wpyog.com/
    5 Tags: Document Management, Document, Simple Documents , Topics, PDF document upload, Word document upload
     5Tags: Simple Document Management, Documents, PDF & Word document upload
    66Requires at least: 4.0
    7 Tested up to: 6.4.3
    8 Stable tag: trunk
     7Tested up to: 6.8.2
     8Stable tag: 1.3.4
     9Requires PHP: 7.0
    910License: GPLv2 or later
    1011License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3738        * This attribute filters the shortcode view to only show documents that are in the specified category.
    3839    * Only accepts category ID.
    39         * Examples: [wpyog-document-list category=”7”]
     40        * Examples: [wpyog-document-list category="7"]
    4041    * Desc
    4142        This attribute turns on or off the display of description of the document in the document list.
    42         Only accepts “0” or “1”. 1 is to display and 0 is to hide.
    43         Examples: [wpyog-document-list desc=”0”]
     43        Only accepts "0" or "1". 1 is to display and 0 is to hide.
     44        Examples: [wpyog-document-list desc="0"]
    4445    * Date
    4546        * This attribute turns on or off the display of document uploaded date in the document list.
    46         * Only accepts “0” or “1”. 1 is to display and 0 is to hide.
    47         * Examples: [wpyog-document-list date=”0”]
     47        * Only accepts "0" or "1". 1 is to display and 0 is to hide.
     48        * Examples: [wpyog-document-list date="0"]
    4849    * Order By
    4950        * This attribute tells which field to use to order the document list.
    50         * Only accepts “date” to order documents by date.
    51         * Examples: [wpyog-document-list orderby=”date”]
     51        * Only accepts "date" to order documents by date.
     52        * Examples: [wpyog-document-list orderby="date"]
    5253    * Order
    5354        * This attribute decides the order of the document list. By default documents are listed by Descending date.
    54         * Only accepts “desc” or “asc”. Desc  is to display in descending order  and ASC is to display in Ascending order. This is used together with OrderBy Attribute
    55         * Examples: [wpyog-document-list order=”desc”]
     55        * Only accepts "desc" or "asc". Desc  is to display in descending order  and ASC is to display in Ascending order. This is used together with OrderBy Attribute
     56        * Examples: [wpyog-document-list order="desc"]
    5657    * Download
    5758        * This attribute turns on or off the display of the download option in the document list.
    58         * Only accepts “0” or “1”. 1 is to display and 0 is to hide.
    59         * Examples: [wpyog-document-list download=”0”]
     59        * Only accepts "0" or "1". 1 is to display and 0 is to hide.
     60        * Examples: [wpyog-document-list download="0"]
    6061    * Limit
    6162        * This attribute limits the number of records/documents to list. By default it lists all documents.
    62         * Accepts numeric values like “3” or “4”. 3 is to limit 3 documents.
    63         * Examples: [wpyog-document-list limit=”3”]
     63        * Accepts numeric values like "3" or "4". 3 is to limit 3 documents.
     64        * Examples: [wpyog-document-list limit="3"]
    6465    * ID
    6566        * This attribute is used to display individual documents.
    66         * Accepts numeric values like “3” or “4”. 3 is the ID of the document that you wish to display.
    67         * Examples: [wpyog-document-list id=”4”]
     67        * Accepts numeric values like '3' or "4". 3 is the ID of the document that you wish to display.
     68        * Examples: [wpyog-document-list id="4"]
    6869* This is a VARSHYL TECH Project.
    6970* SUMMARY
     
    76773. Activate the plugin from the plugins tab of your Wordpress admin.
    77784. Upload documents to "WPYog Document".
    78 5. Place shortcodes [wpyog-document-list] or single document shortcode [wpyog-document id=16]id=“16” is the id of the document, replace with your own document id or copy from “WPYog Document” section.
     795. Place shortcodes [wpyog-document-list] or single document shortcode [wpyog-document id=16] where id=16 is the id of the document, replace with your own document id or copy from "WPYog Document" section.
    7980
    8081== Frequently Asked Questions ==
     
    9293
    93941. The WPYog Documents menu.
     95
     96== Changelog ==
     97
     98= 1.3.4 =
     99* Added Sanitize function for the text input field.
     100
     101
     102== Upgrade Notice ==
     103
     104= 1.3.4 =
     105Sanitized the text input field to prevent XSS attack.
Note: See TracChangeset for help on using the changeset viewer.