Plugin Directory

Changeset 3019209


Ignore:
Timestamp:
01/09/2024 11:26:23 AM (2 years ago)
Author:
soft8soft
Message:

New version 4.5.3

Location:
verge3d/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • verge3d/trunk/app.php

    r3007908 r3019209  
    629629
    630630            // prevent harmful file types to be uploaded to the server
    631             $ext = strtolower(pathinfo($fullpath, PATHINFO_EXTENSION));
    632             $denied = ['php', 'phps', 'phar', 'exe'];
    633             if (in_array($ext, $denied)) {
     631            $allowed_mimes = get_allowed_mime_types();
     632
     633            $v3d_mimes = get_option('v3d_upload_mime_types');
     634            if (!empty($v3d_mimes)) {
     635                foreach (explode(PHP_EOL, $v3d_mimes) as $line) {
     636                    $line = wp_strip_all_tags($line);
     637                    $line_split = preg_split('/ +/', $line, null, PREG_SPLIT_NO_EMPTY);
     638
     639                    if (count($line_split) != 2)
     640                        continue;
     641
     642                    $mime = trim($line_split[0]);
     643                    $ext = trim($line_split[1]);
     644
     645                    if (!empty($mime) && !empty($ext))
     646                        $allowed_mimes[$ext] = $mime;
     647                }
     648            }
     649
     650            $validate = wp_check_filetype($fullpath, $allowed_mimes);
     651            if ($validate['type'] === false) {
     652                //error_log('invalid: '.$fullpath);
    634653                wp_die('error');
    635654            }
  • verge3d/trunk/css/admin.css

    r2825703 r3019209  
    123123}
    124124
     125textarea.v3d-tall-textarea {
     126    height: 300px;
     127}
     128
    125129p.error {
    126130    color: red;
  • verge3d/trunk/js/admin.js

    r2347252 r3019209  
    44    'blend1',
    55    'max',
    6     'ma',
    7     'mb'
     6    'ma',       // maya
     7    'mb',       // maya
     8    'mat',      // max material file
     9    'mel'       // e.g workspace.mel
    810]
    911
     
    4143
    4244        // prevent upload of some files
    43         if (ext in V3D_IGNORE_EXT || path.indexOf('v3d_app_data') > -1) {
     45        if (V3D_IGNORE_EXT.includes(ext) || path.indexOf('v3d_app_data') > -1) {
    4446            updateProgress();
    4547            continue;
  • verge3d/trunk/order.php

    r3004985 r3019209  
    456456                // NOTE: undocumented wkhtmltopdf feature
    457457                if (basename($chrome_path) == 'wkhtmltopdf')
    458                     v3d_terminal($chrome_path.' -s Letter --print-media-type '.$pdf_html.' '.$pdf);
     458                    v3d_terminal($chrome_path.' -s Letter --print-media-type '.$pdf_html.' '.escapeshellarg($pdf));
    459459                else
    460                     v3d_terminal($chrome_path.' --headless --disable-gpu --print-to-pdf='.$pdf.' '.$pdf_html);
     460                    v3d_terminal($chrome_path.' --headless --disable-gpu --print-to-pdf='.escapeshellarg($pdf).' '.$pdf_html);
     461
    461462                if (is_file($pdf))
    462463                    $attachments[] = $pdf;
  • verge3d/trunk/readme.txt

    r3007908 r3019209  
    55Tested up to: 6.4.1
    66Requires PHP: 7.0
    7 Stable tag: 4.5.1
     7Stable tag: 4.5.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70
     71= 4.5.3 =
     72* Implement proper MIME filter for uploaded files.
     73* Fix uploaded file types not being ignored.
     74* Security fixes.
    7075
    7176= 4.5.2 =
  • verge3d/trunk/verge3d.php

    r3007908 r3019209  
    44Plugin URI: https://www.soft8soft.com/verge3d
    55Description: Verge3D is the most artist-friendly toolkit for creating interactive web-based experiences. It can be used to create product configurators, 3D presentations, online stores, e-learning apps, 3D portfolios, browser games and more.
    6 Version: 4.5.2
     6Version: 4.5.3
    77Author: Soft8Soft LLC
    88Author URI: https://www.soft8soft.com
     
    287287    delete_option('v3d_cross_domain');
    288288    delete_option('v3d_custom_products');
     289    delete_option('v3d_upload_mime_types');
    289290}
    290291register_deactivation_hook(__FILE__, 'v3d_cleanup_options');
     
    355356    add_option('v3d_cross_domain', 1);
    356357    add_option('v3d_custom_products', 1);
     358    add_option('v3d_upload_mime_types',
     359        "application/json json\n".
     360        "application/octet-stream bin\n".
     361        "application/wasm wasm\n".
     362        "application/x-xz xz\n".
     363        "font/ttf ttf\n".
     364        "font/woff woff\n".
     365        "font/woff2 woff2\n".
     366        "image/ktx2 ktx2\n".
     367        "image/svg+xml svg\n".
     368        "image/vnd.radiance hdr\n".
     369        "model/gltf-binary glb\n".
     370        "model/gltf+json gltf\n".
     371        "text/csv csv\n".
     372        "text/xml xml");
    357373
    358374    register_setting('verge3d_general', 'v3d_currency');
     
    791807    register_setting('verge3d_security', 'v3d_cross_domain');
    792808    register_setting('verge3d_security', 'v3d_custom_products');
     809    register_setting('verge3d_security', 'v3d_upload_mime_types');
    793810
    794811    add_settings_section(
     
    823840    );
    824841
     842    add_settings_field(
     843        'v3d_upload_mime_types',
     844        'Allowed MIME types',
     845        'v3d_upload_mime_types_cb',
     846        'verge3d_security',
     847        'v3d_security_settings'
     848    );
    825849}
    826850add_action('admin_init', 'v3d_settings_init');
     
    13271351}
    13281352
     1353function v3d_upload_mime_types_cb() {
     1354    $content = get_option('v3d_upload_mime_types');
     1355    ?>
     1356    <textarea name="v3d_upload_mime_types" class="v3d-wide-textarea v3d-tall-textarea"><?php echo isset($content) ? esc_attr($content) : ''; ?></textarea>
     1357    <p class="description">Additional MIME types allowed for upload.</p>
     1358    <?php
     1359}
    13291360
    13301361function v3d_init_custom_styles() {
Note: See TracChangeset for help on using the changeset viewer.