🔒 EXCLUSIVE: Changeset/ - Uncensored 2025

Changeset 3369397


Ignore:
Timestamp:
09/29/2025 03:46:49 AM (3 months ago)
Author:
shenyanzhi
Message:

Update to version 1.4.2 from GitHub

Location:
obs-huaweicloud
Files:
2 added
58 edited
1 copied

Legend:

Unmodified
Added
Removed
  • obs-huaweicloud/tags/1.4.2/huaweicloud-obs-wordpress.php

    r3214598 r3369397  
    44Plugin URI: https://github.com/sy-records/huaweicloud-obs-wordpress
    55Description: 使用华为云对象存储服务 OBS 作为附件存储空间。(This is a plugin that uses HuaWei Cloud Object Storage Service for attachments remote saving.)
    6 Version: 1.4.1
     6Version: 1.4.2
    77Author: 沈唁
    88Author URI: https://qq52o.me
     
    1515use Obs\ObsException;
    1616
    17 define('OBS_VERSION', '1.4.1');
     17define('OBS_VERSION', '1.4.2');
    1818define('OBS_BASEFOLDER', plugin_basename(dirname(__FILE__)));
    1919
     
    136136    $bucket = obs_get_bucket_name();
    137137    $obsClient = obs_get_client();
    138     $obsClient->deleteObject(array('Bucket' => $bucket, 'Key' => $file));
     138    $obsClient->deleteObject(['Bucket' => $bucket, 'Key' => $file]);
    139139}
    140140
     
    153153    $bucket = obs_get_bucket_name();
    154154    $obsClient = obs_get_client();
    155     $obsClient->deleteObjects(array('Bucket' => $bucket, 'Objects' => $deleteObjects, 'Quiet' => false));
     155    $obsClient->deleteObjects(['Bucket' => $bucket, 'Objects' => $deleteObjects, 'Quiet' => false]);
    156156}
    157157
     
    308308
    309309// 当upload_path为根目录时,需要移除URL中出现的“绝对路径”
    310 function obs_modefiy_img_url($url, $post_id)
     310function obs_modify_img_url($url, $post_id)
    311311{
    312312    // 移除 ./ 和 项目根路径
    313     $url = str_replace(['./', get_home_path()], '', $url);
    314     return $url;
     313    return str_replace(['./', get_home_path()], '', $url);
    315314}
    316315
    317316if (get_option('upload_path') == '.') {
    318     add_filter('wp_get_attachment_url', 'obs_modefiy_img_url', 30, 2);
     317    add_filter('wp_get_attachment_url', 'obs_modify_img_url', 30, 2);
    319318}
    320319
     
    332331}
    333332add_filter('sanitize_file_name', 'obs_sanitize_file_name', 10, 1);
    334 
    335 function obs_function_each(&$array)
    336 {
    337     $res = [];
    338     $key = key($array);
    339     if ($key !== null) {
    340         next($array);
    341         $res[1] = $res['value'] = $array[$key];
    342         $res[0] = $res['key'] = $key;
    343     } else {
    344         $res = false;
    345     }
    346     return $res;
    347 }
    348333
    349334/**
     
    439424        wp_die('Insufficient privileges!');
    440425    }
     426    if (!empty($_POST) && !empty($_POST['type'])) {
     427        $nonce = $_POST["{$_POST['type']}-nonce"] ?? '';
     428        if (empty($nonce) || !wp_verify_nonce($nonce, $_POST['type'])) {
     429            wp_die('Illegal requests!');
     430        }
     431    }
    441432    $options = [];
    442     if (!empty($_POST) && $_POST['type'] == 'obs_set') {
     433    if (!empty($_POST) && $_POST['type'] == 'huaweicloud_obs_set') {
    443434        $options['bucket'] = isset($_POST['bucket']) ? sanitize_text_field($_POST['bucket']) : '';
    444435        $options['regional'] = isset($_POST['regional']) ? sanitize_text_field($_POST['regional']) : '';
     
    447438        $options['nothumb'] = isset($_POST['nothumb']) ? 'true' : 'false';
    448439        $options['nolocalsaving'] = isset($_POST['nolocalsaving']) ? 'true' : 'false';
    449         //仅用于插件卸载时比较使用
    450440        $options['upload_url_path'] = isset($_POST['upload_url_path']) ? sanitize_text_field(stripslashes($_POST['upload_url_path'])) : '';
    451441        $options['update_file_name'] = isset($_POST['update_file_name']) ? sanitize_text_field($_POST['update_file_name']) : 'false';
     
    465455        $new_url = esc_url_raw($_POST['new_url']);
    466456
    467         if (!empty($old_url) && !empty($new_url)) {
     457        if (!empty($old_url)) {
    468458            global $wpdb;
    469459            // 文章内容
     
    511501
    512502    $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';
    513     ?>
     503?>
    514504    <div class="wrap" style="margin: 10px;">
    515505        <h1>华为云 OBS 设置 <span style="font-size: 13px;">当前版本:<?php echo OBS_VERSION; ?></span></h1>
    516506        <p>如果觉得此插件对你有所帮助,不妨到 <a href="https://github.com/sy-records/huaweicloud-obs-wordpress" target="_blank">GitHub</a> 上点个<code>Star</code>,<code>Watch</code>关注更新;<a href="https://go.qq52o.me/qm/ccs" target="_blank">欢迎加入云存储插件交流群,QQ群号:887595381</a>;</p>
    517507        <hr/>
    518         <form name="form1" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     508        <form method="post">
    519509            <table class="form-table">
    520510                <tr>
     
    523513                    </th>
    524514                    <td>
    525                         <input type="text" name="bucket" value="<?php echo $obs_bucket; ?>" size="50" placeholder="请填写桶名称"/>
     515                        <input type="text" name="bucket" required value="<?php echo $obs_bucket; ?>" size="50" placeholder="请填写桶名称"/>
    526516
    527517                        <p>请先访问 <a href="https://storage.huaweicloud.com/obs/?region=cn-east-3#/obs/create" target="_blank">华为云控制台</a> 创建<code>桶</code>,再填写以上内容。</p>
     
    541531                        <legend>key</legend>
    542532                    </th>
    543                     <td><input type="text" name="key" value="<?php echo $obs_key; ?>" size="50" placeholder="key"/></td>
     533                    <td><input type="text" name="key" required value="<?php echo $obs_key; ?>" size="50" placeholder="key"/></td>
    544534                </tr>
    545535                <tr>
     
    548538                    </th>
    549539                    <td>
    550                         <input type="text" name="secret" value="<?php echo $obs_secret; ?>" size="50" placeholder="secret"/>
     540                        <input type="text" name="secret" required value="<?php echo $obs_secret; ?>" size="50" placeholder="secret"/>
    551541                    </td>
    552542                </tr>
     
    586576                    </th>
    587577                    <td>
    588                         <input type="text" name="upload_path" value="<?php echo $upload_path; ?>" size="50" placeholder="请输入上传文件夹"/>
     578                        <input type="text" name="upload_path" required value="<?php echo $upload_path; ?>" size="50" placeholder="请输入上传文件夹"/>
    589579                        <p>附件在服务器上的存储位置,例如: <code>wp-content/uploads</code> (注意不要以“/”开头和结尾),根目录请输入<code>.</code>。</p>
    590580                    </td>
     
    595585                    </th>
    596586                    <td>
    597                         <input type="text" name="upload_url_path" value="<?php echo $upload_url_path; ?>" size="50" placeholder="请输入URL前缀"/>
     587                        <input type="text" name="upload_url_path" required value="<?php echo $upload_url_path; ?>" size="50" placeholder="请输入URL前缀"/>
    598588
    599589                        <p><b>注意:</b></p>
     
    608598                <tr>
    609599                    <th><legend>保存/更新选项</legend></th>
    610                     <td><input type="submit" name="submit" class="button button-primary" value="保存更改"/></td>
     600                    <td><input type="submit" class="button button-primary" value="保存更改"/></td>
    611601                </tr>
    612602            </table>
    613             <input type="hidden" name="type" value="obs_set">
     603            <input type="hidden" name="type" value="huaweicloud_obs_set">
     604            <?php wp_nonce_field('huaweicloud_obs_set', 'huaweicloud_obs_set-nonce'); ?>
    614605        </form>
    615         <form name="form2" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     606        <form method="post">
    616607            <table class="form-table">
    617608                <tr>
     
    620611                    </th>
    621612                    <input type="hidden" name="type" value="huaweicloud_obs_all">
    622                     <td>
    623                         <input type="submit" name="submit" class="button button-secondary" value="开始同步"/>
     613                    <?php wp_nonce_field('huaweicloud_obs_all', 'huaweicloud_obs_all-nonce'); ?>
     614                    <td>
     615                        <input type="submit" class="button button-secondary" value="开始同步"/>
    624616                        <p><b>注意:如果是首次同步,执行时间将会十分十分长(根据你的历史附件数量),有可能会因执行时间过长,页面显示超时或者报错。<br> 所以,建议那些几千上万附件的大神们,考虑官方的 <a target="_blank" rel="nofollow" href="https://support.huaweicloud.com/utiltg-obs/obs_11_0001.html">同步工具</a></b></p>
    625617                    </td>
     
    628620        </form>
    629621        <hr>
    630         <form name="form3" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     622        <form method="post">
    631623            <table class="form-table">
    632624                <tr>
     
    651643                    </th>
    652644                    <input type="hidden" name="type" value="huaweicloud_obs_replace">
    653                     <td>
    654                         <input type="submit" name="submit"  class="button button-secondary" value="开始替换"/>
     645                    <?php wp_nonce_field('huaweicloud_obs_replace', 'huaweicloud_obs_replace-nonce'); ?>
     646                    <td>
     647                        <input type="submit" class="button button-secondary" value="开始替换"/>
    655648                        <p><b>注意:如果是首次替换,请注意备份!此功能会替换文章以及设置的特色图片(题图)等使用的资源链接</b></p>
    656649                    </td>
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/autoload.php

    r3201267 r3369397  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/InstalledVersions.php

    r3214598 r3369397  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    326355
    327356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    328358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    329360                if (isset(self::$installedByVendor[$vendorDir])) {
    330361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334365                    self::$installedByVendor[$vendorDir] = $required;
    335366                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337368                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     369                        self::$installedIsLocalDir = true;
    339370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    340374                }
    341375            }
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/autoload_psr4.php

    r3214598 r3369397  
    88return array(
    99    'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
    10     'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
     10    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
    1111    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
    1212    'Obs\\' => array($vendorDir . '/obs/esdk-obs-php/Obs'),
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/autoload_static.php

    r3214598 r3369397  
    4343        'Psr\\Http\\Message\\' =>
    4444        array (
    45             0 => __DIR__ . '/..' . '/psr/http-message/src',
    46             1 => __DIR__ . '/..' . '/psr/http-factory/src',
     45            0 => __DIR__ . '/..' . '/psr/http-factory/src',
     46            1 => __DIR__ . '/..' . '/psr/http-message/src',
    4747        ),
    4848        'Psr\\Http\\Client\\' =>
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/installed.json

    r3214598 r3369397  
    33        {
    44            "name": "guzzlehttp/guzzle",
    5             "version": "7.9.2",
    6             "version_normalized": "7.9.2.0",
     5            "version": "7.10.0",
     6            "version_normalized": "7.10.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/guzzle/guzzle.git",
    10                 "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
    15                 "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
     10                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
     15                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
    1616                "shasum": ""
    1717            },
    1818            "require": {
    1919                "ext-json": "*",
    20                 "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
    21                 "guzzlehttp/psr7": "^2.7.0",
     20                "guzzlehttp/promises": "^2.3",
     21                "guzzlehttp/psr7": "^2.8",
    2222                "php": "^7.2.5 || ^8.0",
    2323                "psr/http-client": "^1.0",
     
    4040                "psr/log": "Required for using the Log middleware"
    4141            },
    42             "time": "2024-07-24T11:22:20+00:00",
     42            "time": "2025-08-23T22:36:01+00:00",
    4343            "type": "library",
    4444            "extra": {
     
    112112            "support": {
    113113                "issues": "https://github.com/guzzle/guzzle/issues",
    114                 "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
     114                "source": "https://github.com/guzzle/guzzle/tree/7.10.0"
    115115            },
    116116            "funding": [
     
    132132        {
    133133            "name": "guzzlehttp/promises",
    134             "version": "2.0.4",
    135             "version_normalized": "2.0.4.0",
     134            "version": "2.3.0",
     135            "version_normalized": "2.3.0.0",
    136136            "source": {
    137137                "type": "git",
    138138                "url": "https://github.com/guzzle/promises.git",
    139                 "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
    140             },
    141             "dist": {
    142                 "type": "zip",
    143                 "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
    144                 "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
     139                "reference": "481557b130ef3790cf82b713667b43030dc9c957"
     140            },
     141            "dist": {
     142                "type": "zip",
     143                "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957",
     144                "reference": "481557b130ef3790cf82b713667b43030dc9c957",
    145145                "shasum": ""
    146146            },
     
    150150            "require-dev": {
    151151                "bamarni/composer-bin-plugin": "^1.8.2",
    152                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
    153             },
    154             "time": "2024-10-17T10:06:22+00:00",
     152                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
     153            },
     154            "time": "2025-08-22T14:34:08+00:00",
    155155            "type": "library",
    156156            "extra": {
     
    198198            "support": {
    199199                "issues": "https://github.com/guzzle/promises/issues",
    200                 "source": "https://github.com/guzzle/promises/tree/2.0.4"
     200                "source": "https://github.com/guzzle/promises/tree/2.3.0"
    201201            },
    202202            "funding": [
     
    218218        {
    219219            "name": "guzzlehttp/psr7",
    220             "version": "2.7.0",
    221             "version_normalized": "2.7.0.0",
     220            "version": "2.8.0",
     221            "version_normalized": "2.8.0.0",
    222222            "source": {
    223223                "type": "git",
    224224                "url": "https://github.com/guzzle/psr7.git",
    225                 "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
    226             },
    227             "dist": {
    228                 "type": "zip",
    229                 "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
    230                 "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
     225                "reference": "21dc724a0583619cd1652f673303492272778051"
     226            },
     227            "dist": {
     228                "type": "zip",
     229                "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051",
     230                "reference": "21dc724a0583619cd1652f673303492272778051",
    231231                "shasum": ""
    232232            },
     
    244244                "bamarni/composer-bin-plugin": "^1.8.2",
    245245                "http-interop/http-factory-tests": "0.9.0",
    246                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     246                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    247247            },
    248248            "suggest": {
    249249                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
    250250            },
    251             "time": "2024-07-18T11:15:46+00:00",
     251            "time": "2025-08-23T21:21:41+00:00",
    252252            "type": "library",
    253253            "extra": {
     
    317317            "support": {
    318318                "issues": "https://github.com/guzzle/psr7/issues",
    319                 "source": "https://github.com/guzzle/psr7/tree/2.7.0"
     319                "source": "https://github.com/guzzle/psr7/tree/2.8.0"
    320320            },
    321321            "funding": [
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/installed.php

    r3214598 r3369397  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => 'v1.4.1',
    5         'version' => '1.4.1.0',
    6         'reference' => '7159428a1d70b2aded4ddfcc856abee3267e0a5c',
     4        'pretty_version' => 'v1.4.2',
     5        'version' => '1.4.2.0',
     6        'reference' => 'd0cfeb435a9113df0a92abf4b722675a6822835e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => 'v1.4.1',
    15             'version' => '1.4.1.0',
    16             'reference' => '7159428a1d70b2aded4ddfcc856abee3267e0a5c',
     14            'pretty_version' => 'v1.4.2',
     15            'version' => '1.4.2.0',
     16            'reference' => 'd0cfeb435a9113df0a92abf4b722675a6822835e',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'guzzlehttp/guzzle' => array(
    23             'pretty_version' => '7.9.2',
    24             'version' => '7.9.2.0',
    25             'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b',
     23            'pretty_version' => '7.10.0',
     24            'version' => '7.10.0.0',
     25            'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
     
    3030        ),
    3131        'guzzlehttp/promises' => array(
    32             'pretty_version' => '2.0.4',
    33             'version' => '2.0.4.0',
    34             'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455',
     32            'pretty_version' => '2.3.0',
     33            'version' => '2.3.0.0',
     34            'reference' => '481557b130ef3790cf82b713667b43030dc9c957',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../guzzlehttp/promises',
     
    3939        ),
    4040        'guzzlehttp/psr7' => array(
    41             'pretty_version' => '2.7.0',
    42             'version' => '2.7.0.0',
    43             'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
     41            'pretty_version' => '2.8.0',
     42            'version' => '2.8.0.0',
     43            'reference' => '21dc724a0583619cd1652f673303492272778051',
    4444            'type' => 'library',
    4545            'install_path' => __DIR__ . '/../guzzlehttp/psr7',
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/composer/platform_check.php

    r3201267 r3369397  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/CHANGELOG.md

    r3201267 r3369397  
    22
    33Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
     4
     5## 7.10.0 - 2025-08-23
     6
     7### Added
     8
     9- Support for PHP 8.5
     10
     11### Changed
     12
     13- Adjusted `guzzlehttp/promises` version constraint to `^2.3`
     14- Adjusted `guzzlehttp/psr7` version constraint to `^2.8`
     15
     16
     17## 7.9.3 - 2025-03-27
     18
     19### Changed
     20
     21- Remove explicit content-length header for GET requests
     22- Improve compatibility with bad servers for boolean cookie values
    423
    524
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/composer.json

    r3201267 r3369397  
    8282        "php": "^7.2.5 || ^8.0",
    8383        "ext-json": "*",
    84         "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
    85         "guzzlehttp/psr7": "^2.7.0",
     84        "guzzlehttp/promises": "^2.3",
     85        "guzzlehttp/psr7": "^2.8",
    8686        "psr/http-client": "^1.0",
    8787        "symfony/deprecation-contracts": "^2.2 || ^3.0"
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

    r3201267 r3369397  
    6363                                $data[$search] = (int) $value;
    6464                            }
     65                        } elseif ($search === 'Secure' || $search === 'Discard' || $search === 'HttpOnly') {
     66                            if ($value) {
     67                                $data[$search] = true;
     68                            }
    6569                        } else {
    6670                            $data[$search] = $value;
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

    r3201267 r3369397  
    126126
    127127        if (\count($this->handles) >= $this->maxHandles) {
    128             \curl_close($resource);
     128            if (PHP_VERSION_ID < 80000) {
     129                \curl_close($resource);
     130            }
    129131        } else {
    130132            // Remove all callback functions as they can hold onto references
     
    730732    {
    731733        foreach ($this->handles as $id => $handle) {
    732             \curl_close($handle);
     734            if (PHP_VERSION_ID < 80000) {
     735                \curl_close($handle);
     736            }
     737
    733738            unset($this->handles[$id]);
    734739        }
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

    r3201267 r3369397  
    241241        unset($this->delays[$id], $this->handles[$id]);
    242242        \curl_multi_remove_handle($this->_mh, $handle);
    243         \curl_close($handle);
     243
     244        if (PHP_VERSION_ID < 80000) {
     245            \curl_close($handle);
     246        }
    244247
    245248        return true;
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php

    r3201267 r3369397  
    1818     * requests to another handler.
    1919     *
    20      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
    21      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $sync    Handler used for synchronous responses.
     20     * @param callable(RequestInterface, array): PromiseInterface $default Handler used for normal responses
     21     * @param callable(RequestInterface, array): PromiseInterface $sync    Handler used for synchronous responses.
    2222     *
    23      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
     23     * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
    2424     */
    2525    public static function wrapSync(callable $default, callable $sync): callable
     
    3838     * through the StreamHandler.
    3939     *
    40      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default   Handler used for non-streaming responses
    41      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
     40     * @param callable(RequestInterface, array): PromiseInterface $default   Handler used for non-streaming responses
     41     * @param callable(RequestInterface, array): PromiseInterface $streaming Handler used for streaming responses
    4242     *
    43      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
     43     * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
    4444     */
    4545    public static function wrapStreaming(callable $default, callable $streaming): callable
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

    r3201267 r3369397  
    5454
    5555            // Append a content-length header if body size is zero to match
    56             // cURL's behavior.
    57             if (0 === $request->getBody()->getSize()) {
     56            // the behavior of `CurlHandler`
     57            if (
     58                (
     59                    0 === \strcasecmp('PUT', $request->getMethod())
     60                    || 0 === \strcasecmp('POST', $request->getMethod())
     61                )
     62                && 0 === $request->getBody()->getSize()
     63            ) {
    5864                $request = $request->withHeader('Content-Length', '0');
    5965            }
     
    328334
    329335        return $this->createResource(
    330             function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
     336            function () use ($uri, $contextResource, $context, $options, $request) {
    331337                $resource = @\fopen((string) $uri, 'r', false, $contextResource);
     338
     339                // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable
     340                if (function_exists('http_get_last_response_headers')) {
     341                    /** @var array|null */
     342                    $http_response_header = \http_get_last_response_headers();
     343                }
     344
    332345                $this->lastHeaders = $http_response_header ?? [];
    333346
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Middleware.php

    r3201267 r3369397  
    188188     * formatter.
    189189     *
    190      * @phpstan-param \Psr\Log\LogLevel::* $logLevel  Level at which to log requests.
    191      *
    192190     * @param LoggerInterface                            $logger    Logs messages.
    193191     * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
    194192     * @param string                                     $logLevel  Level at which to log requests.
     193     *
     194     * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
    195195     *
    196196     * @return callable Returns a function that accepts the next handler.
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Pool.php

    r3201267 r3369397  
    8787     * @param array|\Iterator $requests Requests to send concurrently.
    8888     * @param array           $options  Passes through the options available in
    89      *                                  {@see \GuzzleHttp\Pool::__construct}
     89     *                                  {@see Pool::__construct}
    9090     *
    9191     * @return array Returns an array containing the response or an exception
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/Utils.php

    r3201267 r3369397  
    8080     * The returned handler is not wrapped by any default middlewares.
    8181     *
    82      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
     82     * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system.
    8383     *
    8484     * @throws \RuntimeException if no viable Handler is available.
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/guzzle/src/functions.php

    r3201267 r3369397  
    5151 * The returned handler is not wrapped by any default middlewares.
    5252 *
    53  * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
     53 * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system.
    5454 *
    5555 * @throws \RuntimeException if no viable Handler is available.
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/promises/CHANGELOG.md

    r3201267 r3369397  
    11# CHANGELOG
     2
     3
     4## 2.3.0 - 2025-08-22
     5
     6### Added
     7
     8- PHP 8.5 support
     9
     10
     11## 2.2.0 - 2025-03-27
     12
     13### Fixed
     14
     15- Revert "Allow an empty EachPromise to be resolved by running the queue"
     16
     17
     18## 2.1.0 - 2025-03-27
     19
     20### Added
     21
     22- Allow an empty EachPromise to be resolved by running the queue
    223
    324
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/promises/README.md

    r3201267 r3369397  
    4242|---------|---------------------|--------------|
    4343| 1.x     | Security fixes only | >=5.5,<8.3   |
    44 | 2.x     | Latest              | >=7.2.5,<8.5 |
     44| 2.x     | Latest              | >=7.2.5,<8.6 |
    4545
    4646
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/promises/composer.json

    r3201267 r3369397  
    3131    "require-dev": {
    3232        "bamarni/composer-bin-plugin": "^1.8.2",
    33         "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     33        "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    3434    },
    3535    "autoload": {
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/CHANGELOG.md

    r3201267 r3369397  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## 2.8.0 - 2025-08-23
     9
     10### Added
     11
     12- Allow empty lists as header values
     13
     14### Changed
     15
     16- PHP 8.5 support
     17
     18## 2.7.1 - 2025-03-27
     19
     20### Fixed
     21
     22- Fixed uppercase IPv6 addresses in URI
     23
     24### Changed
     25
     26- Improve uploaded file error message
    727
    828## 2.7.0 - 2024-07-18
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/README.md

    r3201267 r3369397  
    2626|---------|---------------------|--------------|
    2727| 1.x     | EOL (2024-06-30)    | >=5.4,<8.2   |
    28 | 2.x     | Latest              | >=7.2.5,<8.5 |
     28| 2.x     | Latest              | >=7.2.5,<8.6 |
    2929
    3030
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/composer.json

    r3201267 r3369397  
    6363        "bamarni/composer-bin-plugin": "^1.8.2",
    6464        "http-interop/http-factory-tests": "0.9.0",
    65         "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     65        "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    6666    },
    6767    "suggest": {
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/src/MessageTrait.php

    r3201267 r3369397  
    173173        if (!is_array($value)) {
    174174            return $this->trimAndValidateHeaderValues([$value]);
    175         }
    176 
    177         if (count($value) === 0) {
    178             throw new \InvalidArgumentException('Header value can not be an empty array.');
    179175        }
    180176
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/src/UploadedFile.php

    r3201267 r3369397  
    1212class UploadedFile implements UploadedFileInterface
    1313{
    14     private const ERRORS = [
    15         UPLOAD_ERR_OK,
    16         UPLOAD_ERR_INI_SIZE,
    17         UPLOAD_ERR_FORM_SIZE,
    18         UPLOAD_ERR_PARTIAL,
    19         UPLOAD_ERR_NO_FILE,
    20         UPLOAD_ERR_NO_TMP_DIR,
    21         UPLOAD_ERR_CANT_WRITE,
    22         UPLOAD_ERR_EXTENSION,
     14    private const ERROR_MAP = [
     15        UPLOAD_ERR_OK => 'UPLOAD_ERR_OK',
     16        UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE',
     17        UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE',
     18        UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL',
     19        UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE',
     20        UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR',
     21        UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE',
     22        UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION',
    2323    ];
    2424
     
    105105    private function setError(int $error): void
    106106    {
    107         if (false === in_array($error, UploadedFile::ERRORS, true)) {
     107        if (!isset(UploadedFile::ERROR_MAP[$error])) {
    108108            throw new InvalidArgumentException(
    109109                'Invalid error status for UploadedFile'
     
    138138    {
    139139        if (false === $this->isOk()) {
    140             throw new RuntimeException('Cannot retrieve stream due to upload error');
     140            throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error]));
    141141        }
    142142
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/src/Uri.php

    r3201267 r3369397  
    108108        // If IPv6
    109109        $prefix = '';
    110         if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
     110        if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) {
    111111            /** @var array{0:string, 1:string, 2:string} $matches */
    112112            $prefix = $matches[1];
  • obs-huaweicloud/tags/1.4.2/sdk/vendor/guzzlehttp/psr7/src/Utils.php

    r3201267 r3369397  
    398398
    399399        if ($ex) {
    400             /** @var $ex \RuntimeException */
     400            /** @var \RuntimeException $ex */
    401401            throw $ex;
    402402        }
     
    445445
    446446        if ($ex) {
    447             /** @var $ex \RuntimeException */
     447            /** @var \RuntimeException $ex */
    448448            throw $ex;
    449449        }
  • obs-huaweicloud/trunk/huaweicloud-obs-wordpress.php

    r3214598 r3369397  
    44Plugin URI: https://github.com/sy-records/huaweicloud-obs-wordpress
    55Description: 使用华为云对象存储服务 OBS 作为附件存储空间。(This is a plugin that uses HuaWei Cloud Object Storage Service for attachments remote saving.)
    6 Version: 1.4.1
     6Version: 1.4.2
    77Author: 沈唁
    88Author URI: https://qq52o.me
     
    1515use Obs\ObsException;
    1616
    17 define('OBS_VERSION', '1.4.1');
     17define('OBS_VERSION', '1.4.2');
    1818define('OBS_BASEFOLDER', plugin_basename(dirname(__FILE__)));
    1919
     
    136136    $bucket = obs_get_bucket_name();
    137137    $obsClient = obs_get_client();
    138     $obsClient->deleteObject(array('Bucket' => $bucket, 'Key' => $file));
     138    $obsClient->deleteObject(['Bucket' => $bucket, 'Key' => $file]);
    139139}
    140140
     
    153153    $bucket = obs_get_bucket_name();
    154154    $obsClient = obs_get_client();
    155     $obsClient->deleteObjects(array('Bucket' => $bucket, 'Objects' => $deleteObjects, 'Quiet' => false));
     155    $obsClient->deleteObjects(['Bucket' => $bucket, 'Objects' => $deleteObjects, 'Quiet' => false]);
    156156}
    157157
     
    308308
    309309// 当upload_path为根目录时,需要移除URL中出现的“绝对路径”
    310 function obs_modefiy_img_url($url, $post_id)
     310function obs_modify_img_url($url, $post_id)
    311311{
    312312    // 移除 ./ 和 项目根路径
    313     $url = str_replace(['./', get_home_path()], '', $url);
    314     return $url;
     313    return str_replace(['./', get_home_path()], '', $url);
    315314}
    316315
    317316if (get_option('upload_path') == '.') {
    318     add_filter('wp_get_attachment_url', 'obs_modefiy_img_url', 30, 2);
     317    add_filter('wp_get_attachment_url', 'obs_modify_img_url', 30, 2);
    319318}
    320319
     
    332331}
    333332add_filter('sanitize_file_name', 'obs_sanitize_file_name', 10, 1);
    334 
    335 function obs_function_each(&$array)
    336 {
    337     $res = [];
    338     $key = key($array);
    339     if ($key !== null) {
    340         next($array);
    341         $res[1] = $res['value'] = $array[$key];
    342         $res[0] = $res['key'] = $key;
    343     } else {
    344         $res = false;
    345     }
    346     return $res;
    347 }
    348333
    349334/**
     
    439424        wp_die('Insufficient privileges!');
    440425    }
     426    if (!empty($_POST) && !empty($_POST['type'])) {
     427        $nonce = $_POST["{$_POST['type']}-nonce"] ?? '';
     428        if (empty($nonce) || !wp_verify_nonce($nonce, $_POST['type'])) {
     429            wp_die('Illegal requests!');
     430        }
     431    }
    441432    $options = [];
    442     if (!empty($_POST) && $_POST['type'] == 'obs_set') {
     433    if (!empty($_POST) && $_POST['type'] == 'huaweicloud_obs_set') {
    443434        $options['bucket'] = isset($_POST['bucket']) ? sanitize_text_field($_POST['bucket']) : '';
    444435        $options['regional'] = isset($_POST['regional']) ? sanitize_text_field($_POST['regional']) : '';
     
    447438        $options['nothumb'] = isset($_POST['nothumb']) ? 'true' : 'false';
    448439        $options['nolocalsaving'] = isset($_POST['nolocalsaving']) ? 'true' : 'false';
    449         //仅用于插件卸载时比较使用
    450440        $options['upload_url_path'] = isset($_POST['upload_url_path']) ? sanitize_text_field(stripslashes($_POST['upload_url_path'])) : '';
    451441        $options['update_file_name'] = isset($_POST['update_file_name']) ? sanitize_text_field($_POST['update_file_name']) : 'false';
     
    465455        $new_url = esc_url_raw($_POST['new_url']);
    466456
    467         if (!empty($old_url) && !empty($new_url)) {
     457        if (!empty($old_url)) {
    468458            global $wpdb;
    469459            // 文章内容
     
    511501
    512502    $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';
    513     ?>
     503?>
    514504    <div class="wrap" style="margin: 10px;">
    515505        <h1>华为云 OBS 设置 <span style="font-size: 13px;">当前版本:<?php echo OBS_VERSION; ?></span></h1>
    516506        <p>如果觉得此插件对你有所帮助,不妨到 <a href="https://github.com/sy-records/huaweicloud-obs-wordpress" target="_blank">GitHub</a> 上点个<code>Star</code>,<code>Watch</code>关注更新;<a href="https://go.qq52o.me/qm/ccs" target="_blank">欢迎加入云存储插件交流群,QQ群号:887595381</a>;</p>
    517507        <hr/>
    518         <form name="form1" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     508        <form method="post">
    519509            <table class="form-table">
    520510                <tr>
     
    523513                    </th>
    524514                    <td>
    525                         <input type="text" name="bucket" value="<?php echo $obs_bucket; ?>" size="50" placeholder="请填写桶名称"/>
     515                        <input type="text" name="bucket" required value="<?php echo $obs_bucket; ?>" size="50" placeholder="请填写桶名称"/>
    526516
    527517                        <p>请先访问 <a href="https://storage.huaweicloud.com/obs/?region=cn-east-3#/obs/create" target="_blank">华为云控制台</a> 创建<code>桶</code>,再填写以上内容。</p>
     
    541531                        <legend>key</legend>
    542532                    </th>
    543                     <td><input type="text" name="key" value="<?php echo $obs_key; ?>" size="50" placeholder="key"/></td>
     533                    <td><input type="text" name="key" required value="<?php echo $obs_key; ?>" size="50" placeholder="key"/></td>
    544534                </tr>
    545535                <tr>
     
    548538                    </th>
    549539                    <td>
    550                         <input type="text" name="secret" value="<?php echo $obs_secret; ?>" size="50" placeholder="secret"/>
     540                        <input type="text" name="secret" required value="<?php echo $obs_secret; ?>" size="50" placeholder="secret"/>
    551541                    </td>
    552542                </tr>
     
    586576                    </th>
    587577                    <td>
    588                         <input type="text" name="upload_path" value="<?php echo $upload_path; ?>" size="50" placeholder="请输入上传文件夹"/>
     578                        <input type="text" name="upload_path" required value="<?php echo $upload_path; ?>" size="50" placeholder="请输入上传文件夹"/>
    589579                        <p>附件在服务器上的存储位置,例如: <code>wp-content/uploads</code> (注意不要以“/”开头和结尾),根目录请输入<code>.</code>。</p>
    590580                    </td>
     
    595585                    </th>
    596586                    <td>
    597                         <input type="text" name="upload_url_path" value="<?php echo $upload_url_path; ?>" size="50" placeholder="请输入URL前缀"/>
     587                        <input type="text" name="upload_url_path" required value="<?php echo $upload_url_path; ?>" size="50" placeholder="请输入URL前缀"/>
    598588
    599589                        <p><b>注意:</b></p>
     
    608598                <tr>
    609599                    <th><legend>保存/更新选项</legend></th>
    610                     <td><input type="submit" name="submit" class="button button-primary" value="保存更改"/></td>
     600                    <td><input type="submit" class="button button-primary" value="保存更改"/></td>
    611601                </tr>
    612602            </table>
    613             <input type="hidden" name="type" value="obs_set">
     603            <input type="hidden" name="type" value="huaweicloud_obs_set">
     604            <?php wp_nonce_field('huaweicloud_obs_set', 'huaweicloud_obs_set-nonce'); ?>
    614605        </form>
    615         <form name="form2" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     606        <form method="post">
    616607            <table class="form-table">
    617608                <tr>
     
    620611                    </th>
    621612                    <input type="hidden" name="type" value="huaweicloud_obs_all">
    622                     <td>
    623                         <input type="submit" name="submit" class="button button-secondary" value="开始同步"/>
     613                    <?php wp_nonce_field('huaweicloud_obs_all', 'huaweicloud_obs_all-nonce'); ?>
     614                    <td>
     615                        <input type="submit" class="button button-secondary" value="开始同步"/>
    624616                        <p><b>注意:如果是首次同步,执行时间将会十分十分长(根据你的历史附件数量),有可能会因执行时间过长,页面显示超时或者报错。<br> 所以,建议那些几千上万附件的大神们,考虑官方的 <a target="_blank" rel="nofollow" href="https://support.huaweicloud.com/utiltg-obs/obs_11_0001.html">同步工具</a></b></p>
    625617                    </td>
     
    628620        </form>
    629621        <hr>
    630         <form name="form3" method="post" action="<?php echo wp_nonce_url('./options-general.php?page=' . OBS_BASEFOLDER . '/huaweicloud-obs-wordpress.php'); ?>">
     622        <form method="post">
    631623            <table class="form-table">
    632624                <tr>
     
    651643                    </th>
    652644                    <input type="hidden" name="type" value="huaweicloud_obs_replace">
    653                     <td>
    654                         <input type="submit" name="submit"  class="button button-secondary" value="开始替换"/>
     645                    <?php wp_nonce_field('huaweicloud_obs_replace', 'huaweicloud_obs_replace-nonce'); ?>
     646                    <td>
     647                        <input type="submit" class="button button-secondary" value="开始替换"/>
    655648                        <p><b>注意:如果是首次替换,请注意备份!此功能会替换文章以及设置的特色图片(题图)等使用的资源链接</b></p>
    656649                    </td>
  • obs-huaweicloud/trunk/sdk/vendor/autoload.php

    r3201267 r3369397  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • obs-huaweicloud/trunk/sdk/vendor/composer/InstalledVersions.php

    r3214598 r3369397  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    326355
    327356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    328358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    329360                if (isset(self::$installedByVendor[$vendorDir])) {
    330361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334365                    self::$installedByVendor[$vendorDir] = $required;
    335366                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337368                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     369                        self::$installedIsLocalDir = true;
    339370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    340374                }
    341375            }
  • obs-huaweicloud/trunk/sdk/vendor/composer/autoload_psr4.php

    r3214598 r3369397  
    88return array(
    99    'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
    10     'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
     10    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
    1111    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
    1212    'Obs\\' => array($vendorDir . '/obs/esdk-obs-php/Obs'),
  • obs-huaweicloud/trunk/sdk/vendor/composer/autoload_static.php

    r3214598 r3369397  
    4343        'Psr\\Http\\Message\\' =>
    4444        array (
    45             0 => __DIR__ . '/..' . '/psr/http-message/src',
    46             1 => __DIR__ . '/..' . '/psr/http-factory/src',
     45            0 => __DIR__ . '/..' . '/psr/http-factory/src',
     46            1 => __DIR__ . '/..' . '/psr/http-message/src',
    4747        ),
    4848        'Psr\\Http\\Client\\' =>
  • obs-huaweicloud/trunk/sdk/vendor/composer/installed.json

    r3214598 r3369397  
    33        {
    44            "name": "guzzlehttp/guzzle",
    5             "version": "7.9.2",
    6             "version_normalized": "7.9.2.0",
     5            "version": "7.10.0",
     6            "version_normalized": "7.10.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/guzzle/guzzle.git",
    10                 "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
    15                 "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
     10                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
     15                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
    1616                "shasum": ""
    1717            },
    1818            "require": {
    1919                "ext-json": "*",
    20                 "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
    21                 "guzzlehttp/psr7": "^2.7.0",
     20                "guzzlehttp/promises": "^2.3",
     21                "guzzlehttp/psr7": "^2.8",
    2222                "php": "^7.2.5 || ^8.0",
    2323                "psr/http-client": "^1.0",
     
    4040                "psr/log": "Required for using the Log middleware"
    4141            },
    42             "time": "2024-07-24T11:22:20+00:00",
     42            "time": "2025-08-23T22:36:01+00:00",
    4343            "type": "library",
    4444            "extra": {
     
    112112            "support": {
    113113                "issues": "https://github.com/guzzle/guzzle/issues",
    114                 "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
     114                "source": "https://github.com/guzzle/guzzle/tree/7.10.0"
    115115            },
    116116            "funding": [
     
    132132        {
    133133            "name": "guzzlehttp/promises",
    134             "version": "2.0.4",
    135             "version_normalized": "2.0.4.0",
     134            "version": "2.3.0",
     135            "version_normalized": "2.3.0.0",
    136136            "source": {
    137137                "type": "git",
    138138                "url": "https://github.com/guzzle/promises.git",
    139                 "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
    140             },
    141             "dist": {
    142                 "type": "zip",
    143                 "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
    144                 "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
     139                "reference": "481557b130ef3790cf82b713667b43030dc9c957"
     140            },
     141            "dist": {
     142                "type": "zip",
     143                "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957",
     144                "reference": "481557b130ef3790cf82b713667b43030dc9c957",
    145145                "shasum": ""
    146146            },
     
    150150            "require-dev": {
    151151                "bamarni/composer-bin-plugin": "^1.8.2",
    152                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
    153             },
    154             "time": "2024-10-17T10:06:22+00:00",
     152                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
     153            },
     154            "time": "2025-08-22T14:34:08+00:00",
    155155            "type": "library",
    156156            "extra": {
     
    198198            "support": {
    199199                "issues": "https://github.com/guzzle/promises/issues",
    200                 "source": "https://github.com/guzzle/promises/tree/2.0.4"
     200                "source": "https://github.com/guzzle/promises/tree/2.3.0"
    201201            },
    202202            "funding": [
     
    218218        {
    219219            "name": "guzzlehttp/psr7",
    220             "version": "2.7.0",
    221             "version_normalized": "2.7.0.0",
     220            "version": "2.8.0",
     221            "version_normalized": "2.8.0.0",
    222222            "source": {
    223223                "type": "git",
    224224                "url": "https://github.com/guzzle/psr7.git",
    225                 "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
    226             },
    227             "dist": {
    228                 "type": "zip",
    229                 "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
    230                 "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
     225                "reference": "21dc724a0583619cd1652f673303492272778051"
     226            },
     227            "dist": {
     228                "type": "zip",
     229                "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051",
     230                "reference": "21dc724a0583619cd1652f673303492272778051",
    231231                "shasum": ""
    232232            },
     
    244244                "bamarni/composer-bin-plugin": "^1.8.2",
    245245                "http-interop/http-factory-tests": "0.9.0",
    246                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     246                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    247247            },
    248248            "suggest": {
    249249                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
    250250            },
    251             "time": "2024-07-18T11:15:46+00:00",
     251            "time": "2025-08-23T21:21:41+00:00",
    252252            "type": "library",
    253253            "extra": {
     
    317317            "support": {
    318318                "issues": "https://github.com/guzzle/psr7/issues",
    319                 "source": "https://github.com/guzzle/psr7/tree/2.7.0"
     319                "source": "https://github.com/guzzle/psr7/tree/2.8.0"
    320320            },
    321321            "funding": [
  • obs-huaweicloud/trunk/sdk/vendor/composer/installed.php

    r3214598 r3369397  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => 'v1.4.1',
    5         'version' => '1.4.1.0',
    6         'reference' => '7159428a1d70b2aded4ddfcc856abee3267e0a5c',
     4        'pretty_version' => 'v1.4.2',
     5        'version' => '1.4.2.0',
     6        'reference' => 'd0cfeb435a9113df0a92abf4b722675a6822835e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => 'v1.4.1',
    15             'version' => '1.4.1.0',
    16             'reference' => '7159428a1d70b2aded4ddfcc856abee3267e0a5c',
     14            'pretty_version' => 'v1.4.2',
     15            'version' => '1.4.2.0',
     16            'reference' => 'd0cfeb435a9113df0a92abf4b722675a6822835e',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'guzzlehttp/guzzle' => array(
    23             'pretty_version' => '7.9.2',
    24             'version' => '7.9.2.0',
    25             'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b',
     23            'pretty_version' => '7.10.0',
     24            'version' => '7.10.0.0',
     25            'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
     
    3030        ),
    3131        'guzzlehttp/promises' => array(
    32             'pretty_version' => '2.0.4',
    33             'version' => '2.0.4.0',
    34             'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455',
     32            'pretty_version' => '2.3.0',
     33            'version' => '2.3.0.0',
     34            'reference' => '481557b130ef3790cf82b713667b43030dc9c957',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../guzzlehttp/promises',
     
    3939        ),
    4040        'guzzlehttp/psr7' => array(
    41             'pretty_version' => '2.7.0',
    42             'version' => '2.7.0.0',
    43             'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
     41            'pretty_version' => '2.8.0',
     42            'version' => '2.8.0.0',
     43            'reference' => '21dc724a0583619cd1652f673303492272778051',
    4444            'type' => 'library',
    4545            'install_path' => __DIR__ . '/../guzzlehttp/psr7',
  • obs-huaweicloud/trunk/sdk/vendor/composer/platform_check.php

    r3201267 r3369397  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/CHANGELOG.md

    r3201267 r3369397  
    22
    33Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
     4
     5## 7.10.0 - 2025-08-23
     6
     7### Added
     8
     9- Support for PHP 8.5
     10
     11### Changed
     12
     13- Adjusted `guzzlehttp/promises` version constraint to `^2.3`
     14- Adjusted `guzzlehttp/psr7` version constraint to `^2.8`
     15
     16
     17## 7.9.3 - 2025-03-27
     18
     19### Changed
     20
     21- Remove explicit content-length header for GET requests
     22- Improve compatibility with bad servers for boolean cookie values
    423
    524
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/composer.json

    r3201267 r3369397  
    8282        "php": "^7.2.5 || ^8.0",
    8383        "ext-json": "*",
    84         "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
    85         "guzzlehttp/psr7": "^2.7.0",
     84        "guzzlehttp/promises": "^2.3",
     85        "guzzlehttp/psr7": "^2.8",
    8686        "psr/http-client": "^1.0",
    8787        "symfony/deprecation-contracts": "^2.2 || ^3.0"
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

    r3201267 r3369397  
    6363                                $data[$search] = (int) $value;
    6464                            }
     65                        } elseif ($search === 'Secure' || $search === 'Discard' || $search === 'HttpOnly') {
     66                            if ($value) {
     67                                $data[$search] = true;
     68                            }
    6569                        } else {
    6670                            $data[$search] = $value;
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

    r3201267 r3369397  
    126126
    127127        if (\count($this->handles) >= $this->maxHandles) {
    128             \curl_close($resource);
     128            if (PHP_VERSION_ID < 80000) {
     129                \curl_close($resource);
     130            }
    129131        } else {
    130132            // Remove all callback functions as they can hold onto references
     
    730732    {
    731733        foreach ($this->handles as $id => $handle) {
    732             \curl_close($handle);
     734            if (PHP_VERSION_ID < 80000) {
     735                \curl_close($handle);
     736            }
     737
    733738            unset($this->handles[$id]);
    734739        }
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

    r3201267 r3369397  
    241241        unset($this->delays[$id], $this->handles[$id]);
    242242        \curl_multi_remove_handle($this->_mh, $handle);
    243         \curl_close($handle);
     243
     244        if (PHP_VERSION_ID < 80000) {
     245            \curl_close($handle);
     246        }
    244247
    245248        return true;
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php

    r3201267 r3369397  
    1818     * requests to another handler.
    1919     *
    20      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
    21      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $sync    Handler used for synchronous responses.
     20     * @param callable(RequestInterface, array): PromiseInterface $default Handler used for normal responses
     21     * @param callable(RequestInterface, array): PromiseInterface $sync    Handler used for synchronous responses.
    2222     *
    23      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
     23     * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
    2424     */
    2525    public static function wrapSync(callable $default, callable $sync): callable
     
    3838     * through the StreamHandler.
    3939     *
    40      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default   Handler used for non-streaming responses
    41      * @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
     40     * @param callable(RequestInterface, array): PromiseInterface $default   Handler used for non-streaming responses
     41     * @param callable(RequestInterface, array): PromiseInterface $streaming Handler used for streaming responses
    4242     *
    43      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
     43     * @return callable(RequestInterface, array): PromiseInterface Returns the composed handler.
    4444     */
    4545    public static function wrapStreaming(callable $default, callable $streaming): callable
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

    r3201267 r3369397  
    5454
    5555            // Append a content-length header if body size is zero to match
    56             // cURL's behavior.
    57             if (0 === $request->getBody()->getSize()) {
     56            // the behavior of `CurlHandler`
     57            if (
     58                (
     59                    0 === \strcasecmp('PUT', $request->getMethod())
     60                    || 0 === \strcasecmp('POST', $request->getMethod())
     61                )
     62                && 0 === $request->getBody()->getSize()
     63            ) {
    5864                $request = $request->withHeader('Content-Length', '0');
    5965            }
     
    328334
    329335        return $this->createResource(
    330             function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
     336            function () use ($uri, $contextResource, $context, $options, $request) {
    331337                $resource = @\fopen((string) $uri, 'r', false, $contextResource);
     338
     339                // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable
     340                if (function_exists('http_get_last_response_headers')) {
     341                    /** @var array|null */
     342                    $http_response_header = \http_get_last_response_headers();
     343                }
     344
    332345                $this->lastHeaders = $http_response_header ?? [];
    333346
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Middleware.php

    r3201267 r3369397  
    188188     * formatter.
    189189     *
    190      * @phpstan-param \Psr\Log\LogLevel::* $logLevel  Level at which to log requests.
    191      *
    192190     * @param LoggerInterface                            $logger    Logs messages.
    193191     * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
    194192     * @param string                                     $logLevel  Level at which to log requests.
     193     *
     194     * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
    195195     *
    196196     * @return callable Returns a function that accepts the next handler.
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Pool.php

    r3201267 r3369397  
    8787     * @param array|\Iterator $requests Requests to send concurrently.
    8888     * @param array           $options  Passes through the options available in
    89      *                                  {@see \GuzzleHttp\Pool::__construct}
     89     *                                  {@see Pool::__construct}
    9090     *
    9191     * @return array Returns an array containing the response or an exception
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/Utils.php

    r3201267 r3369397  
    8080     * The returned handler is not wrapped by any default middlewares.
    8181     *
    82      * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
     82     * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system.
    8383     *
    8484     * @throws \RuntimeException if no viable Handler is available.
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/guzzle/src/functions.php

    r3201267 r3369397  
    5151 * The returned handler is not wrapped by any default middlewares.
    5252 *
    53  * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
     53 * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system.
    5454 *
    5555 * @throws \RuntimeException if no viable Handler is available.
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/promises/CHANGELOG.md

    r3201267 r3369397  
    11# CHANGELOG
     2
     3
     4## 2.3.0 - 2025-08-22
     5
     6### Added
     7
     8- PHP 8.5 support
     9
     10
     11## 2.2.0 - 2025-03-27
     12
     13### Fixed
     14
     15- Revert "Allow an empty EachPromise to be resolved by running the queue"
     16
     17
     18## 2.1.0 - 2025-03-27
     19
     20### Added
     21
     22- Allow an empty EachPromise to be resolved by running the queue
    223
    324
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/promises/README.md

    r3201267 r3369397  
    4242|---------|---------------------|--------------|
    4343| 1.x     | Security fixes only | >=5.5,<8.3   |
    44 | 2.x     | Latest              | >=7.2.5,<8.5 |
     44| 2.x     | Latest              | >=7.2.5,<8.6 |
    4545
    4646
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/promises/composer.json

    r3201267 r3369397  
    3131    "require-dev": {
    3232        "bamarni/composer-bin-plugin": "^1.8.2",
    33         "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     33        "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    3434    },
    3535    "autoload": {
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/CHANGELOG.md

    r3201267 r3369397  
    55The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    66and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
     7
     8## 2.8.0 - 2025-08-23
     9
     10### Added
     11
     12- Allow empty lists as header values
     13
     14### Changed
     15
     16- PHP 8.5 support
     17
     18## 2.7.1 - 2025-03-27
     19
     20### Fixed
     21
     22- Fixed uppercase IPv6 addresses in URI
     23
     24### Changed
     25
     26- Improve uploaded file error message
    727
    828## 2.7.0 - 2024-07-18
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/README.md

    r3201267 r3369397  
    2626|---------|---------------------|--------------|
    2727| 1.x     | EOL (2024-06-30)    | >=5.4,<8.2   |
    28 | 2.x     | Latest              | >=7.2.5,<8.5 |
     28| 2.x     | Latest              | >=7.2.5,<8.6 |
    2929
    3030
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/composer.json

    r3201267 r3369397  
    6363        "bamarni/composer-bin-plugin": "^1.8.2",
    6464        "http-interop/http-factory-tests": "0.9.0",
    65         "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     65        "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    6666    },
    6767    "suggest": {
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/src/MessageTrait.php

    r3201267 r3369397  
    173173        if (!is_array($value)) {
    174174            return $this->trimAndValidateHeaderValues([$value]);
    175         }
    176 
    177         if (count($value) === 0) {
    178             throw new \InvalidArgumentException('Header value can not be an empty array.');
    179175        }
    180176
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/src/UploadedFile.php

    r3201267 r3369397  
    1212class UploadedFile implements UploadedFileInterface
    1313{
    14     private const ERRORS = [
    15         UPLOAD_ERR_OK,
    16         UPLOAD_ERR_INI_SIZE,
    17         UPLOAD_ERR_FORM_SIZE,
    18         UPLOAD_ERR_PARTIAL,
    19         UPLOAD_ERR_NO_FILE,
    20         UPLOAD_ERR_NO_TMP_DIR,
    21         UPLOAD_ERR_CANT_WRITE,
    22         UPLOAD_ERR_EXTENSION,
     14    private const ERROR_MAP = [
     15        UPLOAD_ERR_OK => 'UPLOAD_ERR_OK',
     16        UPLOAD_ERR_INI_SIZE => 'UPLOAD_ERR_INI_SIZE',
     17        UPLOAD_ERR_FORM_SIZE => 'UPLOAD_ERR_FORM_SIZE',
     18        UPLOAD_ERR_PARTIAL => 'UPLOAD_ERR_PARTIAL',
     19        UPLOAD_ERR_NO_FILE => 'UPLOAD_ERR_NO_FILE',
     20        UPLOAD_ERR_NO_TMP_DIR => 'UPLOAD_ERR_NO_TMP_DIR',
     21        UPLOAD_ERR_CANT_WRITE => 'UPLOAD_ERR_CANT_WRITE',
     22        UPLOAD_ERR_EXTENSION => 'UPLOAD_ERR_EXTENSION',
    2323    ];
    2424
     
    105105    private function setError(int $error): void
    106106    {
    107         if (false === in_array($error, UploadedFile::ERRORS, true)) {
     107        if (!isset(UploadedFile::ERROR_MAP[$error])) {
    108108            throw new InvalidArgumentException(
    109109                'Invalid error status for UploadedFile'
     
    138138    {
    139139        if (false === $this->isOk()) {
    140             throw new RuntimeException('Cannot retrieve stream due to upload error');
     140            throw new RuntimeException(\sprintf('Cannot retrieve stream due to upload error (%s)', self::ERROR_MAP[$this->error]));
    141141        }
    142142
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/src/Uri.php

    r3201267 r3369397  
    108108        // If IPv6
    109109        $prefix = '';
    110         if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
     110        if (preg_match('%^(.*://\[[0-9:a-fA-F]+\])(.*?)$%', $url, $matches)) {
    111111            /** @var array{0:string, 1:string, 2:string} $matches */
    112112            $prefix = $matches[1];
  • obs-huaweicloud/trunk/sdk/vendor/guzzlehttp/psr7/src/Utils.php

    r3201267 r3369397  
    398398
    399399        if ($ex) {
    400             /** @var $ex \RuntimeException */
     400            /** @var \RuntimeException $ex */
    401401            throw $ex;
    402402        }
     
    445445
    446446        if ($ex) {
    447             /** @var $ex \RuntimeException */
     447            /** @var \RuntimeException $ex */
    448448            throw $ex;
    449449        }
Note: See TracChangeset for help on using the changeset viewer.