Make WordPress Core

Ticket #46840: 46840-2.patch

File 46840-2.patch, 7.2 KB (added by SaeedFard, 6 years ago)

Summarize for #42227, #46779, #46840.

  • wp-admin/includes/class-wp-filesystem-base.php

     
    8989         * @since 2.7.0
    9090         *
    9191         * @param string $theme The Theme stylesheet or template for the directory.
    92          * @return string The location of the remote path.
     92         * @return string|false The location of the remote path.
    9393         */
    9494        public function wp_themes_dir( $theme = false ) {
    9595                $theme_root = get_theme_root( $theme );
     
    267267                        /*
    268268                         * Working from /home/ to /user/ to /wordpress/ see if that file exists within
    269269                         * the current folder, If it's found, change into it and follow through looking
    270                          * for it. If it cant find WordPress down that route, it'll continue onto the next
     270                         * for it. If it can't find WordPress down that route, it'll continue onto the next
    271271                         * folder level, and see if that matches, and so on. If it reaches the end, and still
    272                          * cant find it, it'll return false for the entire function.
     272                         * can't find it, it'll return false for the entire function.
    273273                         */
    274274                        if ( isset( $files[ $key ] ) ) {
    275275
     
    544544         * @abstract
    545545         *
    546546         * @param string $file      Path to the file.
    547          * @param int    $mode      Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
     547         * @param int|false    $mode      Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
    548548         * @param bool   $recursive Optional. If set True changes file group recursively. Defaults to False.
    549549         * @return bool|string
    550550         */
     
    588588         * @param string $destination Path to the destination file.
    589589         * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
    590590         *                            Default false.
    591          * @param int    $mode        Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
     591         * @param int|false    $mode        Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
    592592         *                            Default false.
    593593         * @return bool True if file copied successfully, False otherwise.
    594594         */
  • wp-admin/includes/class-wp-filesystem-direct.php

     
    5050         *
    5151         * @param string $file     Remote path to the file where to write the data.
    5252         * @param string $contents The data to write.
    53          * @param int    $mode     Optional. The file permissions as octal number, usually 0644.
     53         * @param int|false    $mode     Optional. The file permissions as octal number, usually 0644.
    5454         *                         Default false.
    5555         * @return bool False upon failure, true otherwise.
    5656         */
     
    130130         * Changes filesystem permissions
    131131         *
    132132         * @param string $file      Path to the file.
    133          * @param int    $mode      Optional. The permissions as octal number, usually 0644 for files,
     133         * @param int|false    $mode      Optional. The permissions as octal number, usually 0644 for files,
    134134         *                          0755 for dirs. Default false.
    135135         * @param bool   $recursive Optional. If set True changes file group recursively. Default false.
    136136         * @return bool Returns true on success or false on failure.
     
    236236         * @param string $source
    237237         * @param string $destination
    238238         * @param bool   $overwrite
    239          * @param int    $mode
     239         * @param int|false    $mode
    240240         * @return bool
    241241         */
    242242        public function copy( $source, $destination, $overwrite = false, $mode = false ) {
  • wp-admin/includes/class-wp-filesystem-ftpext.php

     
    156156        /**
    157157         * @param string $file
    158158         * @param string $contents
    159          * @param bool|int $mode
     159         * @param int|false $mode
    160160         * @return bool
    161161         */
    162162        public function put_contents( $file, $contents, $mode = false ) {
     
    214214
    215215        /**
    216216         * @param string $file
    217          * @param int $mode
     217         * @param int|false $mode
    218218         * @param bool $recursive
    219219         * @return bool
    220220         */
     
    274274         * @param string $source
    275275         * @param string $destination
    276276         * @param bool   $overwrite
    277          * @param string|bool $mode
     277         * @param int|false $mode
    278278         * @return bool
    279279         */
    280280        public function copy( $source, $destination, $overwrite = false, $mode = false ) {
     
    537537                }
    538538
    539539                $pwd = @ftp_pwd( $this->link );
    540                 if ( ! @ftp_chdir( $this->link, $path ) ) { // Cant change to folder = folder doesn't exist
     540                if ( ! @ftp_chdir( $this->link, $path ) ) { // Can't change to folder = folder doesn't exist
    541541                        return false;
    542542                }
    543543                $list = @ftp_rawlist( $this->link, '-a', false );
  • wp-admin/includes/class-wp-filesystem-ftpsockets.php

     
    167167        /**
    168168         * @param string $file
    169169         * @param string $contents
    170          * @param int|bool $mode
     170         * @param int|false $mode
    171171         * @return bool
    172172         */
    173173        public function put_contents( $file, $contents, $mode = false ) {
     
    225225
    226226        /**
    227227         * @param string $file
    228          * @param int|bool $mode
     228         * @param int|false $mode
    229229         * @param bool $recursive
    230230         * @return bool
    231231         */
     
    283283         * @param string   $source
    284284         * @param string   $destination
    285285         * @param bool     $overwrite
    286          * @param int|bool $mode
     286         * @param int|false $mode
    287287         * @return bool
    288288         */
    289289        public function copy( $source, $destination, $overwrite = false, $mode = false ) {
  • wp-admin/includes/class-wp-filesystem-ssh2.php

     
    246246        /**
    247247         * @param string   $file
    248248         * @param string   $contents
    249          * @param bool|int $mode
     249         * @param int|false $mode
    250250         * @return bool
    251251         */
    252252        public function put_contents( $file, $contents, $mode = false ) {
     
    299299
    300300        /**
    301301         * @param string $file
    302          * @param int    $mode
     302         * @param int|false   $mode
    303303         * @param bool   $recursive
    304304         * @return bool|string
    305305         */
     
    329329         *
    330330         * @param string     $file      Path to the file.
    331331         * @param string|int $owner     A user name or number.
    332          * @param bool       $recursive Optional. If set True changes file owner recursivly. Default False.
     332         * @param bool       $recursive Optional. If set True changes file owner recursively. Default False.
    333333         * @return bool True on success or false on failure.
    334334         */
    335335        public function chown( $file, $owner, $recursive = false ) {
     
    386386         * @param string   $source
    387387         * @param string   $destination
    388388         * @param bool     $overwrite
    389          * @param int|bool $mode
     389         * @param int|false $mode
    390390         * @return bool
    391391         */
    392392        public function copy( $source, $destination, $overwrite = false, $mode = false ) {