Welcome Guest, Not a member yet? Register   Sign In
Call to undefined function is_https()
#1

Dear Fellow Coders,
I would be grateful if someone could help resolve a 'Fatal error: Call to undefined function is_https()' issue which is occurring when my colleague attempts to use an SSL certificate.
The version of CodeIgniter being used is 2.2.0 and the error message indicates that the 'is_https' function is undefined within 'framework\_system\core\Security.php on line 269'.
I am relatively new to CodeIgniter and I am unable to locate this function throughout the framework and I would appreciate some guidance on how to resolve this issue.
Many thanks in advance.
Reply
#2

Excuse me, are you a real human?

Why don't you use CodeIgniter 4.3?
Reply
#3

(This post was last modified: 08-18-2023, 01:59 AM by Mark Hathaway.)

Hello Kenjis,

Thank you for your response to my help for assistance with this issue.

I inherited the web site which was first developed using CodeIgniter v2.2 and it is used by many people on a daily basis, which means I am kept very busy with maintaining or adding new functionality to the web site.

Many of todays commercial web sites were built using older versions of CodeIgniter and as an Administrator you should know that it is not straight forward to upgrade from one version to another and can be quite time consuming.

Until such a time that I get the opportunity to upgrade CodeIgniter, the issue of the undefined is_https function will still need to be resolved.
Reply
#4

It seems there is no is_https() function in CI 2.
https://www.codeigniter.com/userguide2/g...tions.html

And CI2 is not maintained and probably has vulnerabilities.
I don't recommend the unmaintained framework.
Reply
#5

(08-17-2023, 03:15 AM)Mark Hathaway Wrote: Dear Fellow Coders,
I would be grateful if someone could help resolve a 'Fatal error: Call to undefined function is_https()' issue which is occurring when my colleague attempts to use an SSL certificate.
The version of CodeIgniter being used is 2.2.0 and the error message indicates that the 'is_https' function is undefined within 'framework\_system\core\Security.php on line 269'.
I am relatively new to CodeIgniter and I am unable to locate this function throughout the framework and I would appreciate some guidance on how to resolve this issue.
Many thanks in advance.

Use CodeIgniter 4.3
Reply
#6

PHP Code:
<?php

/**
 * checking if $_SERVER['HTTPS'] is set or not
 * i.e. if it is set that mean value is '1' or 'on'
 * and page is called from HTTPS.
 *
 * NOTE: Add your own security checks for this!
 */
/**
 *  is_https ()
 * -----------------------------------------------------------------------
 */
if ( ! function_exists('is_https'))
{
    /**
    * is_https ()
    * -------------------------------------------------------------------
    *
    * @return string
    */
    if (isset($_SERVER['HTTPS'])) {
        echo "Page is called from HTTPS and connection is secured.";
    }
else
    {
        // if $_SERVER['HTTPS'] is not set mean value is '0' or 'off'
        echo "Warning : Connection is not secured, Page is called from HTTP";
    }

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB