Thx brian
that worked as always.
as for the second problem.. it really exists and I found a workaround myself..
its not very elegant.. but it works.. which for me is the main thing..
to reproduce the warning:
you create a required customfield with 5 options.. in each option 3 to 4 words of text.
at upload.. you upload 2 pictures and select the checkboxex of 2 of the options (any of the options). you get the warning when you get to the editpage where you can change some parameters for each picture...
-------------------------------
First it is not an error, but a warning... which means i could turn it off in php...
maybe it is not seen when warnings are switched off in php..
but i wanted to get rid of it and so i did some reading.. code and php.net..
the problem with the line of code above.. is, that in the case of custom fields being multiple checkboxes with longer descriptions, the variable
$_POST["field$customfield[fieldid]"] is neither an integer nor a string... but it is an Array. You get that warning when you use htmlspecialchars() on an Array...
One solution would be to just take out the htmlspecialchars() but then.. if you use quotes or other signs in you optionfields it wouldnt be to good...
the solution i found is just to check if
$_POST["field$customfield[fieldid]"] is an array.. if yes.. i htmlspecialchars() the elements of the array.. if it is not an array.. i just use the normal htmlspecialchars() function.
so what I did:
i found in
upload.php:
Code:
Content visible to verified customers only.
and replaced it with
Code:
Content visible to verified customers only.
I hope there is no security drawback... but i do not think so...
And yes I know the ifs-else could be cut down in a nested shorthandcode with "..? ..:..; but this way its clearer to understand..
the function is not in the functionsfile because it is only used here...
Luciano