PHP ERROR: Type: 1
-
https://redmine.pfsense.org/issues/15907
Applied in changeset 64075a4359d070c300e09a94c2cf1f4854ce649b
-
@stephenw10 we have a custom html captive portal uploaded on pfsense machine,
-
@Luca-De-Andreis so we will wait for the update?, thats a weird bug, thank god the captive portal still works fine.
-
@DavcoreTech
Apply patch 64075a4359d070c300e09a94c2cf1f4854ce649b solves the problem. -
@Luca-De-Andreis said in PHP ERROR: Type: 1:
https://redmine.pfsense.org/issues/15907
Yup you can just apply the fix as a patch using the System Patches package.
-
@DavcoreTech said in PHP ERROR: Type: 1:
#3 /usr/local/captiveportal/index.php(60): portal_reply_page()
The error start here : on line 60.
reply_pages() is called, because the test "empty($cpcfg))" failed.
This test fails if a portal user types in manually a http(s) URL to access the login page.
This should never be needed, and if done, the URL has to be corecly 'formatted', that is, it should contain a parameter like "https://portal.your-domaine.tld:8003/index.php?zone=cpzone1" where cpzone1 must be valid : it must exist in the config.xml as a portal settings block.When "https://portal.your-domaine.tld:8003" is used, there is no $cpzone parameter.
Thus the test in index.php "empty($cpcfg)" fails. And then "reply_pages()" (line 60) is called which needs a valid $cpzone, as it is using it without prior testing.
Result : Booomm (PHP error).Again : normally, this error can't really happen, as who is entering a wrong portal access URL anyway ? Nobody should need to do this. But, apparently, people do it anyway (can some one tell me why ??)
I don't fully understand the patch :
as in this context, $cpzone is undefined ....
The real ? better ? solution would be :
Btw : see also here - as discovered a while ago.
-
@Gertjan same i dont know how to add the patch, is there a tutprial?
-
Install it :
Then: here it is : System > Patches
Go for teh
button.
As you have the patch ID : here :
use that, and enter a useful patch description, so you'll know later on where you got it from :
and then the big bleu Save button at the bottom.
Now you see this :
Do what is proposd : fetch the patch ! ( Click on the bleu Fetch ).
Now you should be able to see a bleu Apply button.
I don't have that button, as I solved this issue using another method.There is also the manual method, and for this you need a text editor.
As the actual change is : change [] for "" on line 1746 in the fiel /etc/inc/captiveportal.incI'm not sure if this actually resolves the issue - see above for my motivation.
And again, : normally, this PHP error isn't actually a bug, but also a feature, as it shows something is wrong with the (your) portal usage.
Nobody should enter the captive portal login manually. It's like email addresses and phone number : don't enter them manually as chances are great you do it wrong.
I'm using the portal for more then a decade now, never had to enter the URL 'by hand'. -
@Gertjan thank you, already apply the patch hopefully if will be solve,
-
Sorry, I use the custom patch for...
https://redmine.pfsense.org/issues/15907
.. and seems works fine.But is not included in patch 2.2.20 ?
For now I use 2.2.20 and the custom patch... 2.2.20 has release few days ago but non included this patch.
-
@Luca-De-Andreis said in PHP ERROR: Type: 1:
But is not included in patch 2.2.20 ?
Look at the list below :
You can believe your iwn eyes : if it isn't there ... it isn't there
A little bit to late to be included in 2.2.20, or it isn't an an 'important' patch as this issue can't happen, as humans shouldn't enter the portal URL manually. And if they do, they shouldn't make errors when typing it in (I know, they will make errors).
Portal user have to enter the URL them selves on your portal ?