Changeset 60703
- Timestamp:
- 09/03/2025 12:16:17 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
src/wp-admin/includes/image-edit.php (modified) (3 diffs)
-
src/wp-admin/link-parse-opml.php (modified) (1 diff)
-
src/wp-includes/IXR/class-IXR-message.php (modified) (2 diffs)
-
src/wp-includes/atomlib.php (modified) (1 diff)
-
src/wp-includes/class-wp-http-curl.php (modified) (3 diffs)
-
src/wp-includes/class-wp-image-editor-gd.php (modified) (6 diffs)
-
src/wp-includes/feed.php (modified) (1 diff)
-
src/wp-includes/functions.php (modified) (2 diffs)
-
src/wp-includes/rss.php (modified) (1 diff)
-
tests/phpunit/includes/utils.php (modified) (1 diff)
-
tests/phpunit/tests/image/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image-edit.php
r60640 r60703 546 546 547 547 if ( is_gd_image( $rotated ) ) { 548 imagedestroy( $img ); 548 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 549 imagedestroy( $img ); 550 } 551 549 552 $img = $rotated; 550 553 } … … 581 584 582 585 if ( imagecopyresampled( $dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) { 583 imagedestroy( $img ); 586 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 587 imagedestroy( $img ); 588 } 589 584 590 $img = $dst; 585 591 } … … 607 613 if ( is_gd_image( $dst ) ) { 608 614 if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) { 609 imagedestroy( $img ); 615 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 616 imagedestroy( $img ); 617 } 618 610 619 $img = $dst; 611 620 } -
trunk/src/wp-admin/link-parse-opml.php
r58409 r60703 97 97 } 98 98 99 // Free up memory used by the XML parser. 100 xml_parser_free( $xml_parser ); 99 if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0. 100 // Free up memory used by the XML parser. 101 xml_parser_free( $xml_parser ); 102 } 103 101 104 unset( $xml_parser ); -
trunk/src/wp-includes/IXR/class-IXR-message.php
r60659 r60703 120 120 121 121 if (!xml_parse($this->_parser, $part, $final)) { 122 xml_parser_free($this->_parser); 122 if (PHP_VERSION_ID < 80000) { // xml_parser_free() has no effect as of PHP 8.0. 123 xml_parser_free($this->_parser); 124 } 125 123 126 unset($this->_parser); 124 127 return false; … … 130 133 } while (true); 131 134 132 xml_parser_free($this->_parser); 135 if (PHP_VERSION_ID < 80000) { // xml_parser_free() has no effect as of PHP 8.0. 136 xml_parser_free($this->_parser); 137 } 138 133 139 unset($this->_parser); 134 140 -
trunk/src/wp-includes/atomlib.php
r59062 r60703 185 185 fclose($fp); 186 186 187 xml_parser_free($parser); 187 if (PHP_VERSION_ID < 80000) { // xml_parser_free() has no effect as of PHP 8.0. 188 xml_parser_free($parser); 189 } 190 188 191 unset($parser); 189 192 -
trunk/src/wp-includes/class-wp-http-curl.php
r56655 r60703 241 241 242 242 $curl_error = curl_error( $handle ); 243 243 244 if ( $curl_error ) { 245 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 246 curl_close( $handle ); 247 } 248 249 return new WP_Error( 'http_request_failed', $curl_error ); 250 } 251 252 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) { 253 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 254 curl_close( $handle ); 255 } 256 257 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 258 } 259 260 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 244 261 curl_close( $handle ); 245 return new WP_Error( 'http_request_failed', $curl_error ); 246 } 247 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) { 248 curl_close( $handle ); 249 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 250 } 251 252 curl_close( $handle ); 262 } 263 253 264 return array( 254 265 'headers' => array(), … … 279 290 if ( ! $this->max_body_length || $this->max_body_length !== $bytes_written_total ) { 280 291 if ( $parsed_args['stream'] ) { 281 curl_close( $handle ); 292 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 293 curl_close( $handle ); 294 } 295 282 296 fclose( $this->stream_handle ); 297 283 298 return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) ); 284 299 } else { 285 curl_close( $handle ); 300 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 301 curl_close( $handle ); 302 } 303 286 304 return new WP_Error( 'http_request_failed', curl_error( $handle ) ); 287 305 } … … 289 307 } else { 290 308 $curl_error = curl_error( $handle ); 309 291 310 if ( $curl_error ) { 311 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 312 curl_close( $handle ); 313 } 314 315 return new WP_Error( 'http_request_failed', $curl_error ); 316 } 317 } 318 319 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) { 320 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 292 321 curl_close( $handle ); 293 return new WP_Error( 'http_request_failed', $curl_error ); 294 } 295 } 296 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ), true ) ) { 297 curl_close( $handle ); 322 } 323 298 324 return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 299 325 } 300 326 } 301 327 302 curl_close( $handle ); 328 if ( PHP_VERSION_ID < 80000 ) { // curl_close() has no effect as of PHP 8.0. 329 curl_close( $handle ); 330 } 303 331 304 332 if ( $parsed_args['stream'] ) { -
trunk/src/wp-includes/class-wp-image-editor-gd.php
r59473 r60703 24 24 public function __destruct() { 25 25 if ( $this->image ) { 26 // We don't need the original in memory anymore. 27 imagedestroy( $this->image ); 26 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 27 // We don't need the original in memory anymore. 28 imagedestroy( $this->image ); 29 } 28 30 } 29 31 } … … 189 191 190 192 if ( is_gd_image( $resized ) ) { 191 imagedestroy( $this->image ); 193 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 194 imagedestroy( $this->image ); 195 } 196 192 197 $this->image = $resized; 198 193 199 return true; 194 200 … … 325 331 } else { 326 332 $saved = $this->_save( $resized ); 327 imagedestroy( $resized ); 333 334 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 335 imagedestroy( $resized ); 336 } 328 337 } 329 338 … … 383 392 384 393 if ( is_gd_image( $dst ) ) { 385 imagedestroy( $this->image ); 394 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 395 imagedestroy( $this->image ); 396 } 397 386 398 $this->image = $dst; 387 399 $this->update_size(); 400 388 401 return true; 389 402 } … … 409 422 imagealphablending( $rotated, true ); 410 423 imagesavealpha( $rotated, true ); 411 imagedestroy( $this->image ); 424 425 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 426 imagedestroy( $this->image ); 427 } 428 412 429 $this->image = $rotated; 413 430 $this->update_size(); 431 414 432 return true; 415 433 } … … 440 458 441 459 if ( imagecopyresampled( $dst, $this->image, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) { 442 imagedestroy( $this->image ); 460 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 461 imagedestroy( $this->image ); 462 } 463 443 464 $this->image = $dst; 465 444 466 return true; 445 467 } -
trunk/src/wp-includes/feed.php
r59382 r60703 600 600 xml_parse( $parser, '<div>' . $data . '</div>', true ); 601 601 $code = xml_get_error_code( $parser ); 602 xml_parser_free( $parser ); 602 603 if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0. 604 xml_parser_free( $parser ); 605 } 606 603 607 unset( $parser ); 604 608 -
trunk/src/wp-includes/functions.php
r60696 r60703 3173 3173 $finfo = finfo_open( FILEINFO_MIME_TYPE ); 3174 3174 $real_mime = finfo_file( $finfo, $file ); 3175 finfo_close( $finfo ); 3175 3176 if ( PHP_VERSION_ID < 80100 ) { // finfo_close() has no effect as of PHP 8.1. 3177 finfo_close( $finfo ); 3178 } 3176 3179 3177 3180 $google_docs_types = array( … … 3402 3405 $fileinfo = finfo_open( FILEINFO_MIME_TYPE ); 3403 3406 $mime_type = finfo_file( $fileinfo, $file ); 3404 finfo_close( $fileinfo ); 3407 3408 if ( PHP_VERSION_ID < 80100 ) { // finfo_close() has no effect as of PHP 8.1. 3409 finfo_close( $fileinfo ); 3410 } 3405 3411 3406 3412 if ( wp_is_heic_image_mime_type( $mime_type ) ) { -
trunk/src/wp-includes/rss.php
r59063 r60703 94 94 } 95 95 96 xml_parser_free( $this->parser ); 96 if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0. 97 xml_parser_free( $this->parser ); 98 } 99 97 100 unset( $this->parser ); 98 101 -
trunk/tests/phpunit/includes/utils.php
r59109 r60703 312 312 ) 313 313 ); 314 xml_parser_free( $this->xml ); 314 315 if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0. 316 xml_parser_free( $this->xml ); 317 } 315 318 } 316 319 return true; -
trunk/tests/phpunit/tests/image/functions.php
r58849 r60703 361 361 $ret = wp_save_image_file( $file, $img, 'image/jpeg', 1 ); 362 362 363 imagedestroy( $img ); 363 if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. 364 imagedestroy( $img ); 365 } 366 364 367 unlink( $file ); 365 368
Note: See TracChangeset
for help on using the changeset viewer.