Ok. I have a solution, but I do not know if it breaks csrf attack protection.
The referer
$_SERVER['HTTP_REFERER'] normally has the following form:
httƿ://www•example•com/subdirectory/ and the variable
$_SERVER['SERVER_NAME'] has the corresponding value
www•example•comHowever under the circumstances I mentioned in my last post (even if I do not know which setting exactly is responsable for this misbehaviour) the variable
$_SERVER['SERVER_NAME'] has the value
example•com and therefore causes a mismatch
I replaced lines 553 and 554
if($checkCsrf || (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'http://' . $_SERVER['SERVER_NAME']) !== 0
&& strpos($_SERVER['HTTP_REFERER'], 'https://' . $_SERVER['SERVER_NAME']) !== 0)) {
with the following lines
if($checkCsrf || (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'http://' . $_SERVER['SERVER_NAME']) !== 0
&& strpos($_SERVER['HTTP_REFERER'], 'http://www.' . $_SERVER['SERVER_NAME']) !== 0
&& strpos($_SERVER['HTTP_REFERER'], 'https://www.' . $_SERVER['SERVER_NAME']) !== 0
&& strpos($_SERVER['HTTP_REFERER'], 'https://' . $_SERVER['SERVER_NAME']) !== 0)) {