Polylang - Version 2.0.2

Version Description

(2016-08-03) =

  • Avoid fatal error when a 3rd party theme or plugin has a malformed wpml-config.xml file: the malformed wpml-config.xml file is simply ignored
Download this release

Release Info

Developer Chouby
Plugin Icon 128x128 Polylang
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

Files changed (3) hide show
  1. modules/wpml/wpml-config.php +8 -8
  2. polylang.php +2 -2
  3. readme.txt +5 -1
modules/wpml/wpml-config.php CHANGED
@@ -45,13 +45,13 @@ class PLL_WPML_Config {
45
  $this->xmls = array();
46
 
47
  // Theme
48
- if ( file_exists( $file = ( $template = get_template_directory() ) . '/wpml-config.xml' ) ) {
49
- $this->xmls[ get_template() ] = simplexml_load_file( $file );
50
  }
51
 
52
  // Child theme
53
- if ( ( $stylesheet = get_stylesheet_directory() ) !== $template && file_exists( $file = $stylesheet . '/wpml-config.xml' ) ) {
54
- $this->xmls[ get_stylesheet() ] = simplexml_load_file( $file );
55
  }
56
 
57
  // Plugins
@@ -60,14 +60,14 @@ class PLL_WPML_Config {
60
  $plugins = array_merge( $plugins, get_option( 'active_plugins' ) );
61
 
62
  foreach ( $plugins as $plugin ) {
63
- if ( file_exists( $file = WP_PLUGIN_DIR . '/' . dirname( $plugin ) . '/wpml-config.xml' ) ) {
64
- $this->xmls[ dirname( $plugin ) ] = simplexml_load_file( $file );
65
  }
66
  }
67
 
68
  // Custom
69
- if ( file_exists( $file = PLL_LOCAL_DIR . '/wpml-config.xml' ) ) {
70
- $this->xmls['Polylang'] = simplexml_load_file( $file );
71
  }
72
 
73
  if ( ! empty( $this->xmls ) ) {
45
  $this->xmls = array();
46
 
47
  // Theme
48
+ if ( file_exists( $file = ( $template = get_template_directory() ) . '/wpml-config.xml' ) && false !== $xml = simplexml_load_file( $file ) ) {
49
+ $this->xmls[ get_template() ] = $xml;
50
  }
51
 
52
  // Child theme
53
+ if ( ( $stylesheet = get_stylesheet_directory() ) !== $template && file_exists( $file = $stylesheet . '/wpml-config.xml' ) && false !== $xml = simplexml_load_file( $file ) ) {
54
+ $this->xmls[ get_stylesheet() ] = $xml;
55
  }
56
 
57
  // Plugins
60
  $plugins = array_merge( $plugins, get_option( 'active_plugins' ) );
61
 
62
  foreach ( $plugins as $plugin ) {
63
+ if ( file_exists( $file = WP_PLUGIN_DIR . '/' . dirname( $plugin ) . '/wpml-config.xml' ) && false !== $xml = simplexml_load_file( $file ) ) {
64
+ $this->xmls[ dirname( $plugin ) ] = $xml;
65
  }
66
  }
67
 
68
  // Custom
69
+ if ( file_exists( $file = PLL_LOCAL_DIR . '/wpml-config.xml' ) && false !== $xml = simplexml_load_file( $file ) ) {
70
+ $this->xmls['Polylang'] = $xml;
71
  }
72
 
73
  if ( ! empty( $this->xmls ) ) {
polylang.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Polylang
5
  Plugin URI: https://polylang.pro
6
- Version: 2.0.1
7
  Author: Frédéric Demarle
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  exit; // don't access directly
36
  };
37
 
38
- define( 'POLYLANG_VERSION', '2.0.1' );
39
  define( 'PLL_MIN_WP_VERSION', '4.0' );
40
 
41
  define( 'POLYLANG_FILE', __FILE__ ); // this file
3
  /*
4
  Plugin Name: Polylang
5
  Plugin URI: https://polylang.pro
6
+ Version: 2.0.2
7
  Author: Frédéric Demarle
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
35
  exit; // don't access directly
36
  };
37
 
38
+ define( 'POLYLANG_VERSION', '2.0.2' );
39
  define( 'PLL_MIN_WP_VERSION', '4.0' );
40
 
41
  define( 'POLYLANG_FILE', __FILE__ ); // this file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://polylang.pro
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
- Stable tag: 2.0.1
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
@@ -77,6 +77,10 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-
77
 
78
  == Changelog ==
79
 
 
 
 
 
80
  = 2.0.1 (2016-08-02) =
81
 
82
  * Fix fatal error on PHP < 5.4 (introduced in 2.0)
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
+ Stable tag: 2.0.2
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
77
 
78
  == Changelog ==
79
 
80
+ = 2.0.2 (2016-08-03) =
81
+
82
+ * Avoid fatal error when a 3rd party theme or plugin has a malformed wpml-config.xml file: the malformed wpml-config.xml file is simply ignored
83
+
84
  = 2.0.1 (2016-08-02) =
85
 
86
  * Fix fatal error on PHP < 5.4 (introduced in 2.0)