Plugin Directory

Changeset 3402971


Ignore:
Timestamp:
11/26/2025 03:36:33 AM (4 months ago)
Author:
linguise
Message:

Updating to version 2.2.6

Location:
linguise
Files:
32 edited
1 copied

Legend:

Unmodified
Added
Removed
  • linguise/tags/2.2.6/linguise.php

    r3397694 r3402971  
    55 * Plugin URI: https://www.linguise.com/
    66 * Description: Linguise translation plugin
    7  * Version:2.2.5
     7 * Version:2.2.6
    88 * Text Domain: linguise
    99 * Domain Path: /languages
  • linguise/tags/2.2.6/readme.txt

    r3397694 r3402971  
    44Requires at least: 4.0
    55Tested up to: 6.8
    6 Stable tag: 2.2.5
     6Stable tag: 2.2.6
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    107107
    108108== Changelog ==
     109= 2.2.6 =
     110- Fix: Search translation toggle reverted when enabled in admin page
     111
    109112= 2.2.5 =
    110113- Fix: Issues with fragment i18n is not getting translated because of CDATA
  • linguise/tags/2.2.6/src/constants.php

    r3397694 r3402971  
    11<?php
    22if (!defined('LINGUISE_SCRIPT_TRANSLATION_VERSION')) {
    3     define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.5');
     3    define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.6');
    44}
    55
    66if (!defined('LINGUISE_VERSION')) {
    7     define('LINGUISE_VERSION', '2.2.5');
     7    define('LINGUISE_VERSION', '2.2.6');
    88}
  • linguise/tags/2.2.6/src/switcher.php

    r3362901 r3402971  
    7878            $trailing_slashes = $matches[1];
    7979        } else {
     80            // @codeCoverageIgnoreStart
    8081            $trailing_slashes = '';
     82            // @codeCoverageIgnoreEnd
    8183        }
    8284
     
    368370                }
    369371
    370                 if ($this->config['flag_display_type'] === 'side_by_side') {
    371                     $item->classes[] = 'linguise_parent_menu_item_side_by_side';
    372                 }
    373 
    374372                $new_items[] = $item;
    375373                $is_found = true;
  • linguise/tags/2.2.6/vendor/autoload.php

    r3393999 r3402971  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f::getLoader();
     25return ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8::getLoader();
  • linguise/tags/2.2.6/vendor/composer/autoload_real.php

    r3393999 r3402971  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f
     5class ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::getInitializer($loader));
    3131
    3232        $loader->register(true);
    3333
    34         $filesToLoad = \Composer\Autoload\ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$files;
     34        $filesToLoad = \Composer\Autoload\ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$files;
    3535        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3636            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • linguise/tags/2.2.6/vendor/composer/autoload_static.php

    r3393999 r3402971  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f
     7class ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8
    88{
    99    public static $files = array (
     
    156156    {
    157157        return \Closure::bind(function () use ($loader) {
    158             $loader->prefixLengthsPsr4 = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$prefixLengthsPsr4;
    159             $loader->prefixDirsPsr4 = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$prefixDirsPsr4;
    160             $loader->classMap = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$classMap;
     158            $loader->prefixLengthsPsr4 = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$prefixLengthsPsr4;
     159            $loader->prefixDirsPsr4 = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$prefixDirsPsr4;
     160            $loader->classMap = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$classMap;
    161161
    162162        }, null, ClassLoader::class);
  • linguise/tags/2.2.6/vendor/composer/installed.json

    r3397694 r3402971  
    5757        {
    5858            "name": "linguise/script-php",
    59             "version": "v1.3.41",
    60             "version_normalized": "1.3.41.0",
     59            "version": "v1.3.43",
     60            "version_normalized": "1.3.43.0",
    6161            "source": {
    6262                "type": "git",
    6363                "url": "git@bitbucket.org:linguise/script-php.git",
    64                 "reference": "dd11ab02f87a02c275f1621254068f795f7046fb"
     64                "reference": "6db57d8b5179ea31f2858d72442862166b8cabe7"
    6565            },
    6666            "require": {
     
    7575                "vlucas/phpdotenv": "^5.6"
    7676            },
    77             "time": "2025-11-18T03:16:07+00:00",
     77            "time": "2025-11-26T03:08:27+00:00",
    7878            "type": "library",
    7979            "installation-source": "source",
  • linguise/tags/2.2.6/vendor/composer/installed.php

    r3397694 r3402971  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '8bdaaf1d32585b5280a4c2cc6ab9b9722d0e8b00',
     6        'reference' => '0da894d35554640f8b5d735c9311132bce48fb5e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linguise/script-php' => array(
    23             'pretty_version' => 'v1.3.41',
    24             'version' => '1.3.41.0',
    25             'reference' => 'dd11ab02f87a02c275f1621254068f795f7046fb',
     23            'pretty_version' => 'v1.3.43',
     24            'version' => '1.3.43.0',
     25            'reference' => '6db57d8b5179ea31f2858d72442862166b8cabe7',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../linguise/script-php',
     
    3232            'pretty_version' => 'dev-master',
    3333            'version' => 'dev-master',
    34             'reference' => '8bdaaf1d32585b5280a4c2cc6ab9b9722d0e8b00',
     34            'reference' => '0da894d35554640f8b5d735c9311132bce48fb5e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../../',
  • linguise/tags/2.2.6/vendor/linguise/script-php/.version

    r3397694 r3402971  
    1 1.3.41
     11.3.43
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/CmsDetect.php

    r3316163 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    77class CmsDetect {
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/CurlRequest.php

    r3316163 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    77class CurlRequest
     
    1414     * @return array|null|false Decoded JSON, null if no JSON, false if fail to read
    1515     */
    16     private function readJSONInput()
     16    protected function readJSONInput()
    1717    {
    1818        if (isset($_SERVER['HTTP_CONTENT_TYPE']) && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'application/json') === 0) {
    19             $stream = fopen('php://input', 'r');
     19            $stream = $this->openJsonInputStream();
     20            if ($stream === false) {
     21                return false;
     22            }
    2023
    2124            // Check if it's seeked already.
     
    2629                if ($memory === false) {
    2730                    // fail to read
     31                    // @codeCoverageIgnoreStart
    2832                    fclose($stream);
    2933                    return false;
     34                    // @codeCoverageIgnoreEnd
    3035                }
    3136
     
    3742                if ($success !== 0) {
    3843                    // fail to seek
    39                     return false;
     44                    return false; // @codeCoverageIgnore
    4045                }
    4146
     
    4348                if ($memory === false) {
    4449                    // fail to read, seek back to original $pos
     50                    // @codeCoverageIgnoreStart
    4551                    fseek($stream, $pos);
    4652                    fclose($stream);
    4753                    return false;
     54                    // @codeCoverageIgnoreEnd
    4855                }
    4956
     
    6067            return null;
    6168        }
     69    }
     70
     71    /**
     72     * Opens the input stream for reading JSON data.
     73     *
     74     * @codeCoverageIgnore
     75     *
     76     * @return resource|false
     77     */
     78    protected function openJsonInputStream()
     79    {
     80        return fopen('php://input', 'r');
    6281    }
    6382
     
    87106            if (isset($_SERVER['CONTENT_TYPE']) && !isset($_SERVER['HTTP_CONTENT_TYPE']) && !empty($content_type)) {
    88107                // Set HTTP_CONTENT_TYPE
    89                 $_SERVER['HTTP_CONTENT_TYPE'] = $content_type;
     108                $_SERVER['HTTP_CONTENT_TYPE'] = $content_type; // @codeCoverageIgnore
    90109            }
    91110
     
    111130                                foreach ($file_value['name'] as $index => $file_name_value) {
    112131                                    if (!$file_value['tmp_name'][$index]) {
    113                                         continue;
     132                                        continue; // @codeCoverageIgnore
    114133                                    }
    115134
     
    123142                            } else {
    124143                                if (!$file_value['tmp_name']) {
    125                                     continue;
     144                                    continue; // @codeCoverageIgnore
    126145                                }
    127146
     
    207226        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    208227        if (Configuration::getInstance()->get('dl_certificates') === true) {
    209             curl_setopt($ch, CURLOPT_CAINFO, Certificates::getInstance()->getPath());
     228            curl_setopt($ch, CURLOPT_CAINFO, Certificates::getInstance()->getPath()); // @codeCoverageIgnore
    210229        }
    211230
     
    245264
    246265            if (count($header_parts) !== 2) {
    247                 continue;
     266                continue; // @codeCoverageIgnore
    248267            }
    249268
     
    260279                Debug::log('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    261280                Debug::saveError('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    262                 $response->end();
     281                return $response->end();
    263282            }
    264283
     
    278297                Debug::log('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    279298                Debug::saveError('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    280                 $response->end();
     299                return $response->end();
    281300            }
    282301        }
     
    291310            // So in Configuration[Local] we can modify JSON response if we want.
    292311            Hook::trigger('onJsonResponse');
    293             $response->end();
     312            return $response->end();
    294313        }
    295314
     
    298317            Debug::log('Content type not translatable ' . $content_type);
    299318            Debug::saveError('Content type not translatable ' . $content_type);
    300             $response->end();
     319            return $response->end();
    301320        }
    302321
     
    320339            $response->end();
    321340        }
    322 
    323341    }
    324342}
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/Database.php

    r3316163 r3402971  
    66use Linguise\Vendor\Linguise\Script\Core\Databases\Sqlite;
    77
    8 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     8defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    99
    1010class Database
     
    167167                            $config->multisite = true;
    168168                        } else {
    169                             $config->multisite = false;
     169                            $config->multisite = false; // @codeCoverageIgnore
    170170                        }
    171171                        break;
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/SetCookie.php

    r3316163 r3402971  
    77namespace Linguise\Vendor\Linguise\Script\Core;
    88
    9 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     9defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    1010
    1111/**
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/Url.php

    r2650802 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    7 class Url
    8 {
    9 
     7class Url {
    108    public static function translateUrl($redirect_url)
    119    {
  • linguise/tags/2.2.6/vendor/linguise/script-php/src/templates/tpl/advanced.php

    r3321566 r3402971  
    133133        <div class="flex flex-col mt-4 gap-2 linguise-inner-options">
    134134            <label class="linguise-slider-checkbox">
    135                 <input type="checkbox" class="slider-input" name="linguise_options[search_translation]" value="1" <?php echo isset($options['search_translation']) ? (AdminHelper::checked($options['search_translation'], 1)) : (''); ?> />
     135                <input type="checkbox" class="slider-input" name="linguise_options[search_translation]" value="1" <?php echo isset($options['search_translations']) ? (AdminHelper::checked($options['search_translations'], 1)) : (''); ?> />
    136136                <span class="slider"></span>
    137137                <span class="slider-label font-semibold">
  • linguise/trunk/linguise.php

    r3397694 r3402971  
    55 * Plugin URI: https://www.linguise.com/
    66 * Description: Linguise translation plugin
    7  * Version:2.2.5
     7 * Version:2.2.6
    88 * Text Domain: linguise
    99 * Domain Path: /languages
  • linguise/trunk/readme.txt

    r3397694 r3402971  
    44Requires at least: 4.0
    55Tested up to: 6.8
    6 Stable tag: 2.2.5
     6Stable tag: 2.2.6
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    107107
    108108== Changelog ==
     109= 2.2.6 =
     110- Fix: Search translation toggle reverted when enabled in admin page
     111
    109112= 2.2.5 =
    110113- Fix: Issues with fragment i18n is not getting translated because of CDATA
  • linguise/trunk/src/constants.php

    r3397694 r3402971  
    11<?php
    22if (!defined('LINGUISE_SCRIPT_TRANSLATION_VERSION')) {
    3     define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.5');
     3    define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.6');
    44}
    55
    66if (!defined('LINGUISE_VERSION')) {
    7     define('LINGUISE_VERSION', '2.2.5');
     7    define('LINGUISE_VERSION', '2.2.6');
    88}
  • linguise/trunk/src/switcher.php

    r3362901 r3402971  
    7878            $trailing_slashes = $matches[1];
    7979        } else {
     80            // @codeCoverageIgnoreStart
    8081            $trailing_slashes = '';
     82            // @codeCoverageIgnoreEnd
    8183        }
    8284
     
    368370                }
    369371
    370                 if ($this->config['flag_display_type'] === 'side_by_side') {
    371                     $item->classes[] = 'linguise_parent_menu_item_side_by_side';
    372                 }
    373 
    374372                $new_items[] = $item;
    375373                $is_found = true;
  • linguise/trunk/vendor/autoload.php

    r3393999 r3402971  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f::getLoader();
     25return ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8::getLoader();
  • linguise/trunk/vendor/composer/autoload_real.php

    r3393999 r3402971  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f
     5class ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInit5f08ba9b0f3be0f76f56dfd143f0289f', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInit464a2998e9c988ac7d584a14e1604ea8', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::getInitializer($loader));
    3131
    3232        $loader->register(true);
    3333
    34         $filesToLoad = \Composer\Autoload\ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$files;
     34        $filesToLoad = \Composer\Autoload\ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$files;
    3535        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3636            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • linguise/trunk/vendor/composer/autoload_static.php

    r3393999 r3402971  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f
     7class ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8
    88{
    99    public static $files = array (
     
    156156    {
    157157        return \Closure::bind(function () use ($loader) {
    158             $loader->prefixLengthsPsr4 = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$prefixLengthsPsr4;
    159             $loader->prefixDirsPsr4 = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$prefixDirsPsr4;
    160             $loader->classMap = ComposerStaticInit5f08ba9b0f3be0f76f56dfd143f0289f::$classMap;
     158            $loader->prefixLengthsPsr4 = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$prefixLengthsPsr4;
     159            $loader->prefixDirsPsr4 = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$prefixDirsPsr4;
     160            $loader->classMap = ComposerStaticInit464a2998e9c988ac7d584a14e1604ea8::$classMap;
    161161
    162162        }, null, ClassLoader::class);
  • linguise/trunk/vendor/composer/installed.json

    r3397694 r3402971  
    5757        {
    5858            "name": "linguise/script-php",
    59             "version": "v1.3.41",
    60             "version_normalized": "1.3.41.0",
     59            "version": "v1.3.43",
     60            "version_normalized": "1.3.43.0",
    6161            "source": {
    6262                "type": "git",
    6363                "url": "git@bitbucket.org:linguise/script-php.git",
    64                 "reference": "dd11ab02f87a02c275f1621254068f795f7046fb"
     64                "reference": "6db57d8b5179ea31f2858d72442862166b8cabe7"
    6565            },
    6666            "require": {
     
    7575                "vlucas/phpdotenv": "^5.6"
    7676            },
    77             "time": "2025-11-18T03:16:07+00:00",
     77            "time": "2025-11-26T03:08:27+00:00",
    7878            "type": "library",
    7979            "installation-source": "source",
  • linguise/trunk/vendor/composer/installed.php

    r3397694 r3402971  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '8bdaaf1d32585b5280a4c2cc6ab9b9722d0e8b00',
     6        'reference' => '0da894d35554640f8b5d735c9311132bce48fb5e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linguise/script-php' => array(
    23             'pretty_version' => 'v1.3.41',
    24             'version' => '1.3.41.0',
    25             'reference' => 'dd11ab02f87a02c275f1621254068f795f7046fb',
     23            'pretty_version' => 'v1.3.43',
     24            'version' => '1.3.43.0',
     25            'reference' => '6db57d8b5179ea31f2858d72442862166b8cabe7',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../linguise/script-php',
     
    3232            'pretty_version' => 'dev-master',
    3333            'version' => 'dev-master',
    34             'reference' => '8bdaaf1d32585b5280a4c2cc6ab9b9722d0e8b00',
     34            'reference' => '0da894d35554640f8b5d735c9311132bce48fb5e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../../',
  • linguise/trunk/vendor/linguise/script-php/.version

    r3397694 r3402971  
    1 1.3.41
     11.3.43
  • linguise/trunk/vendor/linguise/script-php/src/CmsDetect.php

    r3316163 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    77class CmsDetect {
  • linguise/trunk/vendor/linguise/script-php/src/CurlRequest.php

    r3316163 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    77class CurlRequest
     
    1414     * @return array|null|false Decoded JSON, null if no JSON, false if fail to read
    1515     */
    16     private function readJSONInput()
     16    protected function readJSONInput()
    1717    {
    1818        if (isset($_SERVER['HTTP_CONTENT_TYPE']) && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'application/json') === 0) {
    19             $stream = fopen('php://input', 'r');
     19            $stream = $this->openJsonInputStream();
     20            if ($stream === false) {
     21                return false;
     22            }
    2023
    2124            // Check if it's seeked already.
     
    2629                if ($memory === false) {
    2730                    // fail to read
     31                    // @codeCoverageIgnoreStart
    2832                    fclose($stream);
    2933                    return false;
     34                    // @codeCoverageIgnoreEnd
    3035                }
    3136
     
    3742                if ($success !== 0) {
    3843                    // fail to seek
    39                     return false;
     44                    return false; // @codeCoverageIgnore
    4045                }
    4146
     
    4348                if ($memory === false) {
    4449                    // fail to read, seek back to original $pos
     50                    // @codeCoverageIgnoreStart
    4551                    fseek($stream, $pos);
    4652                    fclose($stream);
    4753                    return false;
     54                    // @codeCoverageIgnoreEnd
    4855                }
    4956
     
    6067            return null;
    6168        }
     69    }
     70
     71    /**
     72     * Opens the input stream for reading JSON data.
     73     *
     74     * @codeCoverageIgnore
     75     *
     76     * @return resource|false
     77     */
     78    protected function openJsonInputStream()
     79    {
     80        return fopen('php://input', 'r');
    6281    }
    6382
     
    87106            if (isset($_SERVER['CONTENT_TYPE']) && !isset($_SERVER['HTTP_CONTENT_TYPE']) && !empty($content_type)) {
    88107                // Set HTTP_CONTENT_TYPE
    89                 $_SERVER['HTTP_CONTENT_TYPE'] = $content_type;
     108                $_SERVER['HTTP_CONTENT_TYPE'] = $content_type; // @codeCoverageIgnore
    90109            }
    91110
     
    111130                                foreach ($file_value['name'] as $index => $file_name_value) {
    112131                                    if (!$file_value['tmp_name'][$index]) {
    113                                         continue;
     132                                        continue; // @codeCoverageIgnore
    114133                                    }
    115134
     
    123142                            } else {
    124143                                if (!$file_value['tmp_name']) {
    125                                     continue;
     144                                    continue; // @codeCoverageIgnore
    126145                                }
    127146
     
    207226        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    208227        if (Configuration::getInstance()->get('dl_certificates') === true) {
    209             curl_setopt($ch, CURLOPT_CAINFO, Certificates::getInstance()->getPath());
     228            curl_setopt($ch, CURLOPT_CAINFO, Certificates::getInstance()->getPath()); // @codeCoverageIgnore
    210229        }
    211230
     
    245264
    246265            if (count($header_parts) !== 2) {
    247                 continue;
     266                continue; // @codeCoverageIgnore
    248267            }
    249268
     
    260279                Debug::log('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    261280                Debug::saveError('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    262                 $response->end();
     281                return $response->end();
    263282            }
    264283
     
    278297                Debug::log('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    279298                Debug::saveError('Failed to retrieve content, cannot determine content type. Response code: ' . $response_code);
    280                 $response->end();
     299                return $response->end();
    281300            }
    282301        }
     
    291310            // So in Configuration[Local] we can modify JSON response if we want.
    292311            Hook::trigger('onJsonResponse');
    293             $response->end();
     312            return $response->end();
    294313        }
    295314
     
    298317            Debug::log('Content type not translatable ' . $content_type);
    299318            Debug::saveError('Content type not translatable ' . $content_type);
    300             $response->end();
     319            return $response->end();
    301320        }
    302321
     
    320339            $response->end();
    321340        }
    322 
    323341    }
    324342}
  • linguise/trunk/vendor/linguise/script-php/src/Database.php

    r3316163 r3402971  
    66use Linguise\Vendor\Linguise\Script\Core\Databases\Sqlite;
    77
    8 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     8defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    99
    1010class Database
     
    167167                            $config->multisite = true;
    168168                        } else {
    169                             $config->multisite = false;
     169                            $config->multisite = false; // @codeCoverageIgnore
    170170                        }
    171171                        break;
  • linguise/trunk/vendor/linguise/script-php/src/SetCookie.php

    r3316163 r3402971  
    77namespace Linguise\Vendor\Linguise\Script\Core;
    88
    9 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     9defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    1010
    1111/**
  • linguise/trunk/vendor/linguise/script-php/src/Url.php

    r2650802 r3402971  
    33namespace Linguise\Vendor\Linguise\Script\Core;
    44
    5 defined('LINGUISE_SCRIPT_TRANSLATION') or die();
     5defined('LINGUISE_SCRIPT_TRANSLATION') or die(); // @codeCoverageIgnore
    66
    7 class Url
    8 {
    9 
     7class Url {
    108    public static function translateUrl($redirect_url)
    119    {
  • linguise/trunk/vendor/linguise/script-php/src/templates/tpl/advanced.php

    r3321566 r3402971  
    133133        <div class="flex flex-col mt-4 gap-2 linguise-inner-options">
    134134            <label class="linguise-slider-checkbox">
    135                 <input type="checkbox" class="slider-input" name="linguise_options[search_translation]" value="1" <?php echo isset($options['search_translation']) ? (AdminHelper::checked($options['search_translation'], 1)) : (''); ?> />
     135                <input type="checkbox" class="slider-input" name="linguise_options[search_translation]" value="1" <?php echo isset($options['search_translations']) ? (AdminHelper::checked($options['search_translations'], 1)) : (''); ?> />
    136136                <span class="slider"></span>
    137137                <span class="slider-label font-semibold">
Note: See TracChangeset for help on using the changeset viewer.