Follow us on Facebook and Twitter!

Problem with ä,ö,ü,ß..
#11
Hi kooler,

I'm not very familiar with IDNs so I don't know whether the following solution will help. I haven't tested it.

If you have PHP 5.3 (or above) and the intl PHP extension loaded, you might be able to make use of the idn_to_ascii function.

Open /comments/includes/functions/processor.php and add the part in red:

Quote:function cmtx_validate_email ($email) { //checks whether email address was valid

$email = idn_to_ascii($email);

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
cmtx_error(CMTX_ERROR_MESSAGE_INVALID_EMAIL); //reject user for invalid email address
}

} //end of validate-email function
Have you completed the interview?
Reply
#12
It works well.

I have furthermore added the part in red:

Quote:function cmtx_validate_website ($website) { //checks whether website was valid

$website_valid = true; //initialise flag as true

$website = idn_to_ascii($website);

if (!filter_var($website, FILTER_VALIDATE_URL)) {
$website_valid = false; //set flag as false
}

if (cmtx_setting('validate_website_ping')) { //if website should be pinged

$headers = @get_headers($website);

if ($headers[0] == "HTTP/1.1 404 Not Found") {
$website_valid = false; //set flag as false
}

} //end of if-website-should-be-pinged

if (!$website_valid) { //if invalid website was entered
cmtx_error(CMTX_ERROR_MESSAGE_INVALID_WEBSITE); //reject user for invalid website address
}

} //end of validate-website function

And it works well, too.

Thank you once again.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Data base problem Ron Wood 3 532 23-Nov-2017, 09:09 PM
Last Post: Steven
  Problem with utf-8 and ä ö ü ß Steve 5 7,348 20-Jul-2013, 02:22 PM
Last Post: Steven
  Recent Comments: Url Maxlength redirect problem donovanes 2 2,496 31-May-2013, 05:57 PM
Last Post: donovanes
  Logging In Problem NathanApplewhite 1 2,723 19-Mar-2013, 03:37 PM
Last Post: Steven
  Lower case url problem llamadave 1 1,597 02-Jul-2012, 09:19 PM
Last Post: Steven
  Strange problem when editing comments PepperoniPizza 3 2,952 12-Dec-2011, 07:45 PM
Last Post: Steven
  problem  geese10 7 10,510 16-Nov-2011, 01:02 PM
Last Post: geese10
  Problem with table prefixes Harlquinth 10 5,365 09-Oct-2011, 04:15 AM
Last Post: marcus33cz

Forum Jump:


Users browsing this thread: 1 Guest(s)