Cyr-To-Lat - Version 4.6.2

Version Description

(11.02.2021) = * Fix bug with non-existing function PLL().

Download this release

Release Info

Developer mihdan
Plugin Icon 128x128 Cyr-To-Lat
Version 4.6.2
Comparing to
See all releases

Code changes from version 4.6.1 to 4.6.2

classes/class-main.php CHANGED
@@ -400,37 +400,81 @@ class Main {
400
  return $this->pll_locale;
401
  }
402
 
403
- if ( defined( 'REST_REQUEST' ) && constant( 'REST_REQUEST' ) ) {
404
- $rest_server = rest_get_server();
405
- $data = json_decode( $rest_server::get_raw_data(), false );
406
- if ( isset( $data->lang ) ) {
407
- $this->pll_locale = $data->lang;
408
-
409
- return $this->pll_locale;
410
- }
411
-
412
  return $locale;
413
  }
 
 
 
 
 
414
 
415
  if ( ! is_admin() ) {
416
  return $locale;
417
  }
418
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  $pll_get_post_language = false;
420
 
421
  // phpcs:disable WordPress.Security.NonceVerification.Missing
422
  // phpcs:disable WordPress.Security.NonceVerification.Recommended
423
- if ( isset( $_POST['post_ID'] ) && function_exists( 'pll_get_post_language' ) ) {
424
  $pll_get_post_language = pll_get_post_language(
425
  (int) filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_STRING )
426
  );
427
  }
428
- if ( isset( $_POST['pll_post_id'] ) && function_exists( 'pll_get_post_language' ) ) {
429
  $pll_get_post_language = pll_get_post_language(
430
  (int) filter_input( INPUT_POST, 'pll_post_id', FILTER_SANITIZE_STRING )
431
  );
432
  }
433
- if ( isset( $_GET['post'] ) && function_exists( 'pll_get_post_language' ) ) {
434
  $pll_get_post_language = pll_get_post_language(
435
  (int) filter_input( INPUT_GET, 'post', FILTER_SANITIZE_STRING )
436
  );
@@ -438,10 +482,17 @@ class Main {
438
  // phpcs:enable WordPress.Security.NonceVerification.Recommended
439
  // phpcs:enable WordPress.Security.NonceVerification.Missing
440
 
441
- if ( false !== $pll_get_post_language ) {
442
- $this->pll_locale = $pll_get_post_language;
443
 
444
- return $this->pll_locale;
 
 
 
 
 
 
 
445
  }
446
 
447
  $pll_get_term_language = false;
@@ -458,13 +509,7 @@ class Main {
458
  }
459
  // phpcs:enable WordPress.Security.NonceVerification.Missing
460
 
461
- if ( false !== $pll_get_term_language ) {
462
- $this->pll_locale = $pll_get_term_language;
463
-
464
- return $this->pll_locale;
465
- }
466
-
467
- return $locale;
468
  }
469
 
470
  /**
400
  return $this->pll_locale;
401
  }
402
 
403
+ $rest_locale = $this->pll_locale_filter_with_rest();
404
+ if ( false === $rest_locale ) {
 
 
 
 
 
 
 
405
  return $locale;
406
  }
407
+ if ( $rest_locale ) {
408
+ $this->pll_locale = $rest_locale;
409
+
410
+ return $this->pll_locale;
411
+ }
412
 
413
  if ( ! is_admin() ) {
414
  return $locale;
415
  }
416
 
417
+ $pll_get_post_language = $this->pll_locale_filter_with_classic_editor();
418
+ if ( $pll_get_post_language ) {
419
+ $this->pll_locale = $pll_get_post_language;
420
+
421
+ return $this->pll_locale;
422
+ }
423
+
424
+ $pll_get_term_language = $this->pll_locale_filter_with_term();
425
+ if ( $pll_get_term_language ) {
426
+ $this->pll_locale = $pll_get_term_language;
427
+
428
+ return $this->pll_locale;
429
+ }
430
+
431
+ return $locale;
432
+ }
433
+
434
+ /**
435
+ * Locale filter for Polylang with REST request.
436
+ *
437
+ * @return false|null|string
438
+ */
439
+ private function pll_locale_filter_with_rest() {
440
+ if ( ! defined( 'REST_REQUEST' ) || ! constant( 'REST_REQUEST' ) ) {
441
+ return null;
442
+ }
443
+
444
+ $rest_server = rest_get_server();
445
+ $data = json_decode( $rest_server::get_raw_data(), false );
446
+ if ( isset( $data->lang ) ) {
447
+ return $data->lang;
448
+ }
449
+
450
+ return false;
451
+ }
452
+
453
+ /**
454
+ * Locale filter for Polylang with classic editor.
455
+ *
456
+ * @return bool|string
457
+ */
458
+ private function pll_locale_filter_with_classic_editor() {
459
+ if ( ! function_exists( 'pll_get_post_language' ) ) {
460
+ return false;
461
+ }
462
+
463
  $pll_get_post_language = false;
464
 
465
  // phpcs:disable WordPress.Security.NonceVerification.Missing
466
  // phpcs:disable WordPress.Security.NonceVerification.Recommended
467
+ if ( isset( $_POST['post_ID'] ) ) {
468
  $pll_get_post_language = pll_get_post_language(
469
  (int) filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_STRING )
470
  );
471
  }
472
+ if ( isset( $_POST['pll_post_id'] ) ) {
473
  $pll_get_post_language = pll_get_post_language(
474
  (int) filter_input( INPUT_POST, 'pll_post_id', FILTER_SANITIZE_STRING )
475
  );
476
  }
477
+ if ( isset( $_GET['post'] ) ) {
478
  $pll_get_post_language = pll_get_post_language(
479
  (int) filter_input( INPUT_GET, 'post', FILTER_SANITIZE_STRING )
480
  );
482
  // phpcs:enable WordPress.Security.NonceVerification.Recommended
483
  // phpcs:enable WordPress.Security.NonceVerification.Missing
484
 
485
+ return $pll_get_post_language;
486
+ }
487
 
488
+ /**
489
+ * Locale filter for Polylang with term.
490
+ *
491
+ * @return false|string
492
+ */
493
+ private function pll_locale_filter_with_term() {
494
+ if ( ! function_exists( 'PLL' ) ) {
495
+ return false;
496
  }
497
 
498
  $pll_get_term_language = false;
509
  }
510
  // phpcs:enable WordPress.Security.NonceVerification.Missing
511
 
512
+ return $pll_get_term_language;
 
 
 
 
 
 
513
  }
514
 
515
  /**
cyr-to-lat.php CHANGED
@@ -9,8 +9,8 @@
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.6
12
- * Version: 4.6.1
13
- * Stable tag: 4.6.1
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
@@ -34,7 +34,7 @@ if ( defined( 'CYR_TO_LAT_VERSION' ) ) {
34
  /**
35
  * Plugin version.
36
  */
37
- define( 'CYR_TO_LAT_VERSION', '4.6.1' );
38
 
39
  /**
40
  * Path to the plugin dir.
9
  * Author URI: https://profiles.wordpress.org/sergeybiryukov/
10
  * Requires at least: 5.1
11
  * Tested up to: 5.6
12
+ * Version: 4.6.2
13
+ * Stable tag: 4.6.2
14
  *
15
  * Text Domain: cyr2lat
16
  * Domain Path: /languages/
34
  /**
35
  * Plugin version.
36
  */
37
+ define( 'CYR_TO_LAT_VERSION', '4.6.2' );
38
 
39
  /**
40
  * Path to the plugin dir.
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: SergeyBiryukov, mihdan, karevn, webvitaly, kaggdesign
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
  Tested up to: 5.6
6
- Stable tag: 4.6.1
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
@@ -99,6 +99,9 @@ Yes you can!
99
 
100
  == Changelog ==
101
 
 
 
 
102
  = 4.6.1 (10.02.2021) =
103
  * Fix bug with Polylang
104
 
3
  Tags: cyrillic, belorussian, ukrainian, bulgarian, macedonian, georgian, kazakh, latin, l10n, russian, cyr-to-lat, cyr2lat, rustolat, slugs, translations, transliteration
4
  Requires at least: 5.1
5
  Tested up to: 5.6
6
+ Stable tag: 4.6.2
7
  Requires PHP: 5.6.20
8
 
9
  Converts Cyrillic characters in post, page and term slugs to Latin characters.
99
 
100
  == Changelog ==
101
 
102
+ = 4.6.2 (11.02.2021) =
103
+ * Fix bug with non-existing function PLL().
104
+
105
  = 4.6.1 (10.02.2021) =
106
  * Fix bug with Polylang
107
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit437e2a96121c77eb6fbabee43b9db9ba::getLoader();
vendor/composer/InstalledVersions.php CHANGED
@@ -25,12 +25,12 @@ class InstalledVersions
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
- 'pretty_version' => '4.6.1',
29
- 'version' => '4.6.1.0',
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => '56ac73b6279d3d1580a35e41eee83fced7779e26',
34
  'name' => 'mihdan/cyr2lat',
35
  ),
36
  'versions' =>
@@ -46,12 +46,12 @@ private static $installed = array (
46
  ),
47
  'mihdan/cyr2lat' =>
48
  array (
49
- 'pretty_version' => '4.6.1',
50
- 'version' => '4.6.1.0',
51
  'aliases' =>
52
  array (
53
  ),
54
- 'reference' => '56ac73b6279d3d1580a35e41eee83fced7779e26',
55
  ),
56
  'roundcube/plugin-installer' =>
57
  array (
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
+ 'pretty_version' => '4.6.2',
29
+ 'version' => '4.6.2.0',
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => '28bd82bae12ac9fc57b3c31cf2677a79f5f28fa9',
34
  'name' => 'mihdan/cyr2lat',
35
  ),
36
  'versions' =>
46
  ),
47
  'mihdan/cyr2lat' =>
48
  array (
49
+ 'pretty_version' => '4.6.2',
50
+ 'version' => '4.6.2.0',
51
  'aliases' =>
52
  array (
53
  ),
54
+ 'reference' => '28bd82bae12ac9fc57b3c31cf2677a79f5f28fa9',
55
  ),
56
  'roundcube/plugin-installer' =>
57
  array (
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitc29dc99eeb73bc6cf5cbe2626f7c6213
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequirec29dc99eeb73bc6cf5cbe2626f7c6213($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequirec29dc99eeb73bc6cf5cbe2626f7c6213($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit437e2a96121c77eb6fbabee43b9db9ba
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit437e2a96121c77eb6fbabee43b9db9ba', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit437e2a96121c77eb6fbabee43b9db9ba', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire437e2a96121c77eb6fbabee43b9db9ba($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire437e2a96121c77eb6fbabee43b9db9ba($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213
8
  {
9
  public static $files = array (
10
  '344a0f93a05b8ca362c22e39586db500' => __DIR__ . '/../..' . '/lib/polyfill-mbstring/bootstrap.php',
@@ -45,9 +45,9 @@ class ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
- $loader->prefixLengthsPsr4 = ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213::$prefixLengthsPsr4;
49
- $loader->prefixDirsPsr4 = ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213::$prefixDirsPsr4;
50
- $loader->classMap = ComposerStaticInitc29dc99eeb73bc6cf5cbe2626f7c6213::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba
8
  {
9
  public static $files = array (
10
  '344a0f93a05b8ca362c22e39586db500' => __DIR__ . '/../..' . '/lib/polyfill-mbstring/bootstrap.php',
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
+ $loader->prefixLengthsPsr4 = ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba::$prefixLengthsPsr4;
49
+ $loader->prefixDirsPsr4 = ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba::$prefixDirsPsr4;
50
+ $loader->classMap = ComposerStaticInit437e2a96121c77eb6fbabee43b9db9ba::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }
vendor/composer/installed.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php return array (
2
  'root' =>
3
  array (
4
- 'pretty_version' => '4.6.1',
5
- 'version' => '4.6.1.0',
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '56ac73b6279d3d1580a35e41eee83fced7779e26',
10
  'name' => 'mihdan/cyr2lat',
11
  ),
12
  'versions' =>
@@ -22,12 +22,12 @@
22
  ),
23
  'mihdan/cyr2lat' =>
24
  array (
25
- 'pretty_version' => '4.6.1',
26
- 'version' => '4.6.1.0',
27
  'aliases' =>
28
  array (
29
  ),
30
- 'reference' => '56ac73b6279d3d1580a35e41eee83fced7779e26',
31
  ),
32
  'roundcube/plugin-installer' =>
33
  array (
1
  <?php return array (
2
  'root' =>
3
  array (
4
+ 'pretty_version' => '4.6.2',
5
+ 'version' => '4.6.2.0',
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => '28bd82bae12ac9fc57b3c31cf2677a79f5f28fa9',
10
  'name' => 'mihdan/cyr2lat',
11
  ),
12
  'versions' =>
22
  ),
23
  'mihdan/cyr2lat' =>
24
  array (
25
+ 'pretty_version' => '4.6.2',
26
+ 'version' => '4.6.2.0',
27
  'aliases' =>
28
  array (
29
  ),
30
+ 'reference' => '28bd82bae12ac9fc57b3c31cf2677a79f5f28fa9',
31
  ),
32
  'roundcube/plugin-installer' =>
33
  array (