News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Just upgraded and no mods installed but still getting errors

Started by Robin1989, February 28, 2011, 10:28:11 PM

Previous topic - Next topic

Robin1989

hi i just upgraded and havnt installed any mods and im still getting errors.  the only modification right now is the theme and thats entirely CSS as its based on the curve theme. theres a few more of the same error every couple of minutes. any help would be appreciated





Arantor

...and what version of SMF so I can go look at the code?

Robin1989

its version 2.0 rc5

load.php
437               $custom_field_errors[] = array('custom_field_not_number', array($row['field_name']));
438            elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
439               $custom_field_errors[] = array('custom_field_inproper_format', array($row['field_name']));



profile-modify.php

1306            }
1307            elseif (substr($row['mask'], 0, 5) == 'regex' && preg_match(substr($row['mask'], 5), $value) === 0)
1308               $value = '';



thanks for any help

Arantor

Well done, you managed to ignore the question I asked you, I didn't ask for that, I actually asked for the version. Doesn't matter, I know what the problem is.


You added some custom fields to registration and set a regular expression to validate them. What is the regular expression you used? (Because it's invalid.)

Robin1989

thanks found the expression. its for a wii friends code. here it is

@([0-9][]{4})\ ([0-9][]{4})\ ([0-9][]{4})\ ([0-9][]{4})@

Arantor

Yes, that's not valid. What's the sort of format supposed to be, exactly?

Robin1989

its 4 banks of 4 numbers

like these

3432 6018 9835 6521
2849 8591 2505 5137
6651 9738 5710 7933
6295 7951 3848 2125
8859 8155 8648 4106
7435 5793 6596 0627
8725 6193 6685 8253
0869 3007 5671 3338
4747 6147 5180 5361
2849 8591 2505 9319
2066 9769 4907 9815
7223 7422 8442 7158

Arantor

@^[0-9]{4}\ [0-9]{4}\ [0-9]{4}\ [0-9]{4}$@

This should do it. [] doesn't mean anything in regexp, it's a character class without any valid characters, and is the source of your troubles - the blocks of four become [0-9]{4} followed by a space - and since it's done with preg_match without any matches pass-back, you don't need the brackets either.

You do however need the ^ and $ to indicate the start and end of the string.

Robin1989

thankyou for all your help arantor its much appreciated

Advertisement: