T
T
Timur2019-06-04 09:48:14
opencart
Timur, 2019-06-04 09:48:14

I can't understand why Mixed content?

On the main page, the connection is protected, but when you go to the registration section, the connection is not completely protected, an error in the console
5cf6142c0d1db932202172.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur, 2019-06-04
@idtimurkolomeets

Fixed add-on for Opencart code format .xml
install via admin panel add-on
installation section

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>FIX HTTPS</name>
    <version>2.3.8</version>
    <author>[email protected] | forum.opencart.pro/profile/185-yoda/</author>
    <code>fix_https</code>
    <link>http://opencartadmin.com</link>
    <file path="system/library/response.php" error="skip">
    <operation error="skip">
        <search><![CDATA[echo $output;]]></search>
        <add position="before"><![CDATA[
      if ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == '1' || $_SERVER['HTTPS'])) || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') || (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on'))) {
        $output = str_replace(HTTP_SERVER, HTTPS_SERVER, $output);
      } else {
        $output = str_replace(HTTPS_SERVER, HTTP_SERVER, $output);
      }
    ]]></add>
    </operation>
    </file>
    <file path="system/library/cache.php" error="skip">
    <operation error="skip">
        <search><![CDATA[class Cache {]]></search>
        <add position="after"><![CDATA[
private $ssl_protocol = 'http_';
    ]]></add>
    </operation>
    <operation error="skip">
        <search regex="true"><![CDATA[~public function __construct(.*?)\{~]]></search>
        <add position="replace"><![CDATA[
        public function __construct$1{
    if ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == '1' || $_SERVER['HTTPS'])) || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') || (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on'))) {
      $this->ssl_protocol = 'https_';
    }

    ]]></add>
    </operation>
    <operation error="skip">
        <search><![CDATA[return]]></search>
        <add position="before"><![CDATA[
    $key = $this->ssl_protocol.$key;
    ]]></add>
    </operation>
    </file>
</modification>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question