• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

PHP Fatal error: Uncaught TypeError in /etc/inc/captiveportal.inc

Scheduled Pinned Locked Moved Captive Portal
5 Posts 4 Posters 698 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    GeorgeCZ58
    last edited by Feb 3, 2025, 2:58 PM

    Never had such issue before. Can somebody explain why that happen? And is that some bug? How to mitigate the issue?

    Crash report begins. Anonymous machine information:

    amd64
    15.0-CURRENT
    FreeBSD 15.0-CURRENT #0 plus-RELENG_24_11-cxcxcxcxcxcx: Fri Nov 22 05:08:46 UTC 2024 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-24_11-main/obj/amd64/AKWlAIiM/var/jenkins/workspace/pfSense-Plus-snapshots-24_11-main/sources/FreeBS

    Crash report details:

    PHP Errors:
    [03-Feb-2025 15:10:01 Europe/Paris] PHP Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /etc/inc/captiveportal.inc:1746
    Stack trace:
    #0 /etc/inc/captiveportal.inc(1746): explode()
    #1 /etc/inc/captiveportal.inc(1802): portal_ip_from_client_ip()
    #2 /etc/inc/captiveportal.inc(1823): portal_hostname_from_client_ip()
    #3 /usr/local/captiveportal/index.php(60): portal_reply_page()
    #4 {main}
    thrown in /etc/inc/captiveportal.inc on line 1746

    G 1 Reply Last reply Feb 4, 2025, 2:28 PM Reply Quote 0
    • M
      marcosm Netgate
      last edited by marcosm Feb 3, 2025, 10:19 PM Feb 3, 2025, 8:06 PM

      It's been fixed, see https://redmine.pfsense.org/issues/15907

      You may manually apply the fix using the System Patches package, see: https://docs.netgate.com/pfsense/en/latest/development/system-patches.html

      G 1 Reply Last reply Feb 3, 2025, 9:09 PM Reply Quote 0
      • G
        GeorgeCZ58 @marcosm
        last edited by Feb 3, 2025, 9:09 PM

        @marcosm said in PHP Fatal error: Uncaught TypeError in /etc/inc/captiveportal.inc:

        https://redmine.pfsense.org/issues/15907

        All patches are already applied. But this seems is not fixed in any patch.. ?

        P 1 Reply Last reply Feb 4, 2025, 6:02 AM Reply Quote 0
        • P
          patient0 @GeorgeCZ58
          last edited by Feb 4, 2025, 6:02 AM

          @GeorgeCZ58 said in PHP Fatal error: Uncaught TypeError in /etc/inc/captiveportal.inc:

          https://redmine.pfsense.org/issues/15907

          If you check the issue you see an "Associated revisions" tab (direct link: https://redmine.pfsense.org/issues/15907?tab=changesets) below the yellow bug description.

          There you'll find the revision, in this case 64075a4359d070c300e09a94c2cf1f4854ce649b.

          Then follow the "Adding a Custom Patch" documentation linked above by @marcosm.

          1 Reply Last reply Reply Quote 0
          • G
            Gertjan @GeorgeCZ58
            last edited by Feb 4, 2025, 2:28 PM

            @GeorgeCZ58 said in PHP Fatal error: Uncaught TypeError in /etc/inc/captiveportal.inc:

            Can somebody explain why that happen?

            Are you sure ? 😊

            A portal user entered (with the keyboard) the URL manually, and forgot to add a mandatory paramter.
            He/she was using an URL like
            https://your-portal.your-hostname.tld:8003/
            which would work, as /index.php would be tried by the browser.
            Or
            https://your-portal.your-hostname.tld:8003/index.php
            Better, but it will fail as
            https://your-portal.your-hostname.tld:8003/index.php?zone=CPZONE1
            The zone paramter has to be present, with a valid ID so 'pfSense' knows what portal instance is accessed.
            A valid ID is this :

            efdc8fa7-cefc-4e7b-a920-6d332d9ff8fd-image.png

            without it, the PHP triggers.
            The thing is, the fact that it is wrong or absent is detected. The portal user will receives a html page telling that an error happened. But to make this html page, the zone paramter is used, ..... and it was not there. => bug.

            Again, normally, this can't happen.
            Nobody has to or should type in manually the rather cryptic login URL ......

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 1
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received