Changeset 60905 for trunk/src/wp-includes/sodium_compat/src/File.php
- Timestamp:
- 10/06/2025 03:46:40 PM (13 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/sodium_compat/src/File.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/File.php
r58752 r60905 126 126 } 127 127 128 if (!file_exists($inputFile)) { 129 throw new SodiumException('Input file does not exist'); 130 } 128 131 /** @var int $size */ 129 132 $size = filesize($inputFile); … … 139 142 140 143 /** @var resource $ofp */ 141 $ofp = fopen($outputFile, 'wb');144 $ofp = @fopen($outputFile, 'wb'); 142 145 if (!is_resource($ofp)) { 143 146 fclose($ifp); … … 194 197 } 195 198 199 if (!file_exists($inputFile)) { 200 throw new SodiumException('Input file does not exist'); 201 } 196 202 /** @var int $size */ 197 203 $size = filesize($inputFile); … … 207 213 208 214 /** @var resource $ofp */ 209 $ofp = fopen($outputFile, 'wb');215 $ofp = @fopen($outputFile, 'wb'); 210 216 if (!is_resource($ofp)) { 211 217 fclose($ifp); … … 304 310 $publicKey = ParagonIE_Sodium_Compat::crypto_box_publickey($ecdhKeypair); 305 311 312 if (!file_exists($inputFile)) { 313 throw new SodiumException('Input file does not exist'); 314 } 306 315 /** @var int $size */ 307 316 $size = filesize($inputFile); … … 317 326 318 327 /** @var resource $ofp */ 319 $ofp = fopen($outputFile, 'wb');328 $ofp = @fopen($outputFile, 'wb'); 320 329 if (!is_resource($ofp)) { 321 330 fclose($ifp); … … 409 418 } 410 419 420 if (!file_exists($filePath)) { 421 throw new SodiumException('File does not exist'); 422 } 411 423 /** @var int $size */ 412 424 $size = filesize($filePath); … … 480 492 } 481 493 494 if (!file_exists($inputFile)) { 495 throw new SodiumException('Input file does not exist'); 496 } 482 497 /** @var int $size */ 483 498 $size = filesize($inputFile); … … 487 502 488 503 /** @var resource $ifp */ 489 $ifp = fopen($inputFile, 'rb');504 $ifp = @fopen($inputFile, 'rb'); 490 505 if (!is_resource($ifp)) { 491 506 throw new SodiumException('Could not open input file for reading'); … … 544 559 /* Input validation: */ 545 560 if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) { 546 throw new TypeError('Argument 4must be CRYPTO_SECRETBOX_NONCEBYTES bytes');561 throw new TypeError('Argument 3 must be CRYPTO_SECRETBOX_NONCEBYTES bytes'); 547 562 } 548 563 if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) { 549 throw new TypeError('Argument 4 must be CRYPTO_SECRETBOXBOX_KEYBYTES bytes'); 550 } 551 564 throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_KEYBYTES bytes'); 565 } 566 567 if (!file_exists($inputFile)) { 568 throw new SodiumException('Input file does not exist'); 569 } 552 570 /** @var int $size */ 553 571 $size = filesize($inputFile); … … 563 581 564 582 /** @var resource $ofp */ 565 $ofp = fopen($outputFile, 'wb');583 $ofp = @fopen($outputFile, 'wb'); 566 584 if (!is_resource($ofp)) { 567 585 fclose($ifp); … … 614 632 } 615 633 634 if (!file_exists($filePath)) { 635 throw new SodiumException('File does not exist'); 636 } 616 637 /** @var int $size */ 617 638 $size = filesize($filePath); … … 745 766 } 746 767 768 if (!file_exists($filePath)) { 769 throw new SodiumException('File does not exist'); 770 } 747 771 /** @var int $size */ 748 772 $size = filesize($filePath);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)