Changeset 2595353
- Timestamp:
- 09/07/2021 10:13:07 PM (5 years ago)
- Location:
- megaoptim-image-optimizer/trunk
- Files:
-
- 3 edited
-
includes/functions/webp.php (modified) (7 diffs)
-
megaoptim.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
megaoptim-image-optimizer/trunk/includes/functions/webp.php
r2432752 r2595353 288 288 * Returns the image dir if it's local. Otherwise it returns false. 289 289 * 290 * @param $src - Url of the image290 * @param $src - Url of the image 291 291 * 292 292 * @return bool|mixed|string … … 350 350 351 351 if ( $src_host[0] === $base_url_host[0] && $src_host[1] === $base_url_host[1] && ( strlen( $src_host[1] ) > 3 || isset( $src_host[2] ) && $src_host[2] == $base_url_host[2] ) ) { 352 $baseurl = str_replace( $base_parsed['scheme'] . '://' . $base_parsed['host'], $url_parsed['scheme'] . '://' . $url_parsed['host'], $base_url ); 352 $baseurl = str_replace( $base_parsed['scheme'] . '://' . $base_parsed['host'], 353 $url_parsed['scheme'] . '://' . $url_parsed['host'], $base_url ); 353 354 $base_img_src = str_replace( $baseurl, $base_dir, $src ); 354 355 } … … 367 368 * Returns the parameter needed out of array of parameters for specific html img tag. 368 369 * 369 * @param array$attribute_array370 * @param array $attribute_array 370 371 * @param $type 371 372 * … … 431 432 } else { 432 433 $dom = new \DOMDocument; 433 $dom->loadHTML( $content ); 434 foreach ( $dom->getElementsByTagName( $element ) as $tag ) { 434 @$dom->loadHTML( $content ); 435 $items = $dom->getElementsByTagName( $element ); 436 foreach ( $items as $tag ) { 437 if ( ! is_object( $tag ) ) { 438 continue; 439 } 435 440 foreach ( $tag->attributes as $attribName => $attribNodeVal ) { 436 441 $attr[ $attribName ] = $tag->getAttribute( $attribName ); … … 474 479 include( $htaccess_path ); 475 480 $htaccess_contents = ob_get_clean(); 476 $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', $htaccess_contents ) ); 481 $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', 482 $htaccess_contents ) ); 477 483 } 478 484 … … 499 505 <IfModule mod_mime.c> 500 506 AddType image/webp .webp 501 </IfModule> 502 # END MegaOptimIO 507 </IfModule># END MegaOptimIO 503 508 504 509 <?php … … 527 532 include( $htaccess_path ); 528 533 $htaccess_contents = ob_get_clean(); 529 $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', $htaccess_contents ) ); 534 $htaccess_contents = trim( megaoptim_remove_between( '# BEGIN MegaOptimIO', '# END MegaOptimIO', 535 $htaccess_contents ) ); 530 536 megaoptim_write( $htaccess_path, $htaccess_contents, 'w' ); 531 537 -
megaoptim-image-optimizer/trunk/megaoptim.php
r2552367 r2595353 6 6 Author: MegaOptim 7 7 Author URI: https://megaoptim.com 8 Version: 1.4.1 68 Version: 1.4.17 9 9 Text Domain: megaoptim-image-optimizer 10 10 Domain Path: /languages … … 15 15 } 16 16 17 define( 'WP_MEGAOPTIM_VER', '1.4.1 6' );17 define( 'WP_MEGAOPTIM_VER', '1.4.17' ); 18 18 define( 'WP_MEGAOPTIM_PATH', plugin_dir_path( __FILE__ ) ); 19 19 define( 'WP_MEGAOPTIM_URL', plugin_dir_url( __FILE__ ) ); -
megaoptim-image-optimizer/trunk/readme.txt
r2552367 r2595353 3 3 Tags: convert webp, webp, optimize images, optimize, images, compress 4 4 Requires at least: 3.6 5 Tested up to: 5. 75 Tested up to: 5.8 6 6 Requires PHP: 5.3 7 Stable tag: 1.4.1 67 Stable tag: 1.4.17 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 138 138 == Changelog == 139 139 140 = 1.4.17 = 141 - Fix PHP warnings related to the WebP features 142 140 143 = 1.4.16 = 141 144 - Fix url encoding for attachments that contain weird characters
Note: See TracChangeset
for help on using the changeset viewer.