Plugin Directory

Changeset 3185807


Ignore:
Timestamp:
11/11/2024 02:46:39 PM (17 months ago)
Author:
devianadim9
Message:

Release version 2.6.14

Location:
wedevs-project-manager/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • wedevs-project-manager/trunk/changelog.txt

    r3061130 r3185807  
    11== Changelog ==
     2
     3= v2.6.14 - Nov 11, 2024 =
     4
     5**Fix:** Vulnerable security issue.
     6**Fix:** XSS attack while uploading svg file.
     7**Fix:** Sub task duplicating issue.
    28
    39= v2.6.13 - Mar 29, 2024 =
  • wedevs-project-manager/trunk/config/app.php

    r3061130 r3185807  
    44    'name'        => 'Project Manager',
    55    'slug'        => 'pm',
    6     'version'     => '2.6.13',
     6    'version'     => '2.6.14',
    77    'api'         => '2',
    88    'db_version'  => '2.5',
  • wedevs-project-manager/trunk/core/Permissions/Abstract_Permission.php

    r2474296 r3185807  
    2222    public function __construct( WP_REST_Request $request ) {
    2323        $this->request = $request;
    24 
    25         $user_id = $request->get_param( 'user_id' );
    26         $user_id = empty( $user_id ) ? 0 : intval( $user_id );
    27 
    28         if ( empty( $user_id ) && ! empty( get_current_user_id() ) ) {
    29             $user_id = get_current_user_id();
    30         }
    31 
    32         wp_set_current_user( $user_id );
    3324    }
    3425
  • wedevs-project-manager/trunk/cpm.php

    r3061130 r3185807  
    66 * Author: weDevs
    77 * Author URI: https://wedevs.com
    8  * Version: 2.6.13
     8 * Version: 2.6.14
    99 * Text Domain: wedevs-project-manager
    1010 * Domain Path: /languages
  • wedevs-project-manager/trunk/readme.txt

    r3061130 r3185807  
    44Tags: project, project manager, project management, project management plugin, project manager tool
    55Requires at least: 4.4 or higher
    6 Tested up to: 6.4.3
     6Tested up to: 6.6.2
    77Requires PHP: 5.6
    8 Stable tag: 2.6.13
     8Stable tag: 2.6.14
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    310310== Changelog ==
    311311
     312= v2.6.14 - Nov 11, 2024 =
     313
     314**Fix:** Vulnerable security issue.
     315**Fix:** XSS attack while uploading svg file.
     316**Fix:** Sub task duplicating issue.
     317
     318
    312319= v2.6.13 - Mar 29, 2024 =
    313320
  • wedevs-project-manager/trunk/src/Comment/Controllers/Comment_Controller.php

    r2474296 r3185807  
    1616use WeDevs\PM\File\Models\File;
    1717use WeDevs\PM\Common\Traits\File_Attachment;
     18use WeDevs\PM\File\Helper\File as HelperFile;
    1819
    1920class Comment_Controller {
     
    8081   
    8182        $files      = array_key_exists( 'files', $media_data ) ? $media_data['files'] : null;
    82        
     83
     84        if( HelperFile::check_file_for_xss_code( $files ) ){
     85            return wp_send_json(
     86                [
     87                    'error_type' => 'svg_xss',
     88                    'message' => __( 'The SVG file you attempted to upload contains content that may pose security risks. Please ensure your file is safe and try again.', 'pm-pro' )
     89                ], 400
     90            );
     91            wp_die();
     92        }
     93 
    8394        $comment = Comment::create( $data );
    8495
     
    116127        // An array of files
    117128        $files = array_key_exists( 'files', $media_data ) ? $media_data['files'] : null;
     129
     130        if( HelperFile::check_file_for_xss_code( $files ) ){
     131            return wp_send_json(
     132                [
     133                    'error_type' => 'svg_xss',
     134                    'message' => __( 'The SVG file you attempted to upload contains content that may pose security risks. Please ensure your file is safe and try again.', 'pm-pro' )
     135                ], 400
     136            );
     137            wp_die();
     138        }
    118139
    119140        // An array of file ids that needs to be deleted
     
    165186        return $this->get_response(false, $message);
    166187    }
     188
    167189}
  • wedevs-project-manager/trunk/src/Discussion_Board/Controllers/Discussion_Board_Controller.php

    r2474296 r3185807  
    1818use WeDevs\PM\Common\Traits\File_Attachment;
    1919use Illuminate\Pagination\Paginator;
     20use WeDevs\PM\File\Helper\File as HelperFile;
    2021
    2122use WeDevs\PM\Task\Models\Task;
     
    7475        $milestone_id = $request->get_param( 'milestone' );
    7576        $files        = array_key_exists( 'files', $media_data ) ? $media_data['files'] : null;
     77
     78        if( HelperFile::check_file_for_xss_code( $files ) ){
     79            return wp_send_json(
     80                [
     81                    'error_type' => 'svg_xss',
     82                    'message' => __( 'The SVG file you attempted to upload contains content that may pose security risks. Please ensure your file is safe and try again.', 'pm-pro' )
     83                ], 400
     84            );
     85            wp_die();
     86        }
    7687
    7788        $is_private    = $request->get_param( 'privacy' );
     
    108119        $files               = array_key_exists( 'files', $media_data ) ? $media_data['files'] : null;
    109120        $files_to_delete     = $request->get_param( 'files_to_delete' );
     121
     122        if( HelperFile::check_file_for_xss_code( $files ) ){
     123            return wp_send_json(
     124                [
     125                    'error_type' => 'svg_xss',
     126                    'message' => __( 'The SVG file you attempted to upload contains content that may pose security risks. Please ensure your file is safe and try again.', 'pm-pro' )
     127                ], 400
     128            );
     129            wp_die();
     130        }
    110131
    111132        $is_private    = $request->get_param( 'privacy' );
  • wedevs-project-manager/trunk/src/File/Helper/File.php

    r2474296 r3185807  
    5353        return $response;
    5454    }
     55
     56    public static function check_file_for_xss_code( $files ) {
     57        if (isset($files['type']) && is_array($files['type'])) {
     58   
     59            foreach ($files['type'] as $index => $file_type) {
     60               
     61                if ($file_type === 'image/svg+xml') {
     62                    $svg_tmp_name = $files['tmp_name'][$index];
     63                    $svg_content = file_get_contents($svg_tmp_name);
     64   
     65                    if (self::contains_xss_code($svg_content)) {
     66                        return true;
     67                    }
     68                }
     69            }
     70        }
     71
     72        return false;
     73    }
     74
     75    public static function contains_xss_code( $content ) {
     76        $pattern = '/<script.*?>.*?<\/script>|on[a-z]+\s*=\s*["\'][^"\']*["\']/i';
     77
     78        return preg_match($pattern, $content);
     79    }
    5580
    5681    /**
  • wedevs-project-manager/trunk/src/Task/Models/Task.php

    r2474296 r3185807  
    7676    }
    7777
     78    public function scopeSubTasks( $query ) {
     79        return $query->where( 'parent_id', $this->id );
     80    }
     81
    7882    public function boards() {
    7983        return $this->belongsToMany( 'WeDevs\PM\Common\Models\Board', pm_tb_prefix() . 'pm_boardables', 'boardable_id', 'board_id' )
     
    8387    public function boardables() {
    8488        return $this->hasMany( 'WeDevs\PM\Common\Models\Boardable', 'boardable_id' )->where( 'boardable_type', 'task' );
     89    }
     90
     91    public function sub_boardables() {
     92        return $this->hasMany( 'WeDevs\PM\Common\Models\Boardable', 'boardable_id' )->where( 'boardable_type', 'sub_task' );
    8593    }
    8694
  • wedevs-project-manager/trunk/vendor/autoload.php

    r3061130 r3185807  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit1d90e6d12f552e726b8502c8f1a9fd6c::getLoader();
     25return ComposerAutoloaderInite36117ab3af2efa55804ee3f819c39bb::getLoader();
  • wedevs-project-manager/trunk/vendor/composer/ClassLoader.php

    r3033574 r3185807  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    482476
    483477    /**
    484      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    485      *
    486      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    487481     */
    488482    public static function getRegisteredLoaders()
  • wedevs-project-manager/trunk/vendor/composer/autoload_real.php

    r3061130 r3185807  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit1d90e6d12f552e726b8502c8f1a9fd6c
     5class ComposerAutoloaderInite36117ab3af2efa55804ee3f819c39bb
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit1d90e6d12f552e726b8502c8f1a9fd6c', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInite36117ab3af2efa55804ee3f819c39bb', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit1d90e6d12f552e726b8502c8f1a9fd6c', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInite36117ab3af2efa55804ee3f819c39bb', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInite36117ab3af2efa55804ee3f819c39bb::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c::$files;
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInite36117ab3af2efa55804ee3f819c39bb::$files;
    3737        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3838            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • wedevs-project-manager/trunk/vendor/composer/autoload_static.php

    r3061130 r3185807  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c
     7class ComposerStaticInite36117ab3af2efa55804ee3f819c39bb
    88{
    99    public static $files = array (
     
    991991    {
    992992        return \Closure::bind(function () use ($loader) {
    993             $loader->prefixLengthsPsr4 = ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c::$prefixLengthsPsr4;
    994             $loader->prefixDirsPsr4 = ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c::$prefixDirsPsr4;
    995             $loader->classMap = ComposerStaticInit1d90e6d12f552e726b8502c8f1a9fd6c::$classMap;
     993            $loader->prefixLengthsPsr4 = ComposerStaticInite36117ab3af2efa55804ee3f819c39bb::$prefixLengthsPsr4;
     994            $loader->prefixDirsPsr4 = ComposerStaticInite36117ab3af2efa55804ee3f819c39bb::$prefixDirsPsr4;
     995            $loader->classMap = ComposerStaticInite36117ab3af2efa55804ee3f819c39bb::$classMap;
    996996
    997997        }, null, ClassLoader::class);
  • wedevs-project-manager/trunk/vendor/composer/installed.php

    r3061130 r3185807  
    22    'root' => array(
    33        'name' => 'wedevsofficial/wp-project-manager',
    4         'pretty_version' => 'dev-develop',
    5         'version' => 'dev-develop',
    6         'reference' => '12d53caefa61856f4963de484a5ceb67f3e4df47',
     4        'pretty_version' => 'dev-master',
     5        'version' => 'dev-master',
     6        'reference' => 'a44a63bf961b9827614981d9aa5547b9e701bfb6',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    233233        ),
    234234        'wedevsofficial/wp-project-manager' => array(
    235             'pretty_version' => 'dev-develop',
    236             'version' => 'dev-develop',
    237             'reference' => '12d53caefa61856f4963de484a5ceb67f3e4df47',
     235            'pretty_version' => 'dev-master',
     236            'version' => 'dev-master',
     237            'reference' => 'a44a63bf961b9827614981d9aa5547b9e701bfb6',
    238238            'type' => 'wordpress-plugin',
    239239            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.