Bug #39683

wrong character class in valueCheck for "alphanum_x"

Added by Stefan Froemken over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2012-08-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.2
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Have a look here:
http://www.php.net/manual/de/regexp.reference.character-classes.php

Within character classes \, -, ^ are special characters, so you have to excape them.

But in method: checkValue_input_Eval you have following:

case 'alphanum_x':
    $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value);
break;

it should be:

case 'alphanum_x':
    $value = preg_replace('/[^a-zA-Z0-9_\-]/', '', $value);
break;

Stefan


Files

39683-45.patch (913 Bytes) 39683-45.patch Jochen Weiland, 2012-09-01 13:36
39683-46.patch (927 Bytes) 39683-46.patch Jochen Weiland, 2012-09-01 13:36
39683-47.patch (927 Bytes) 39683-47.patch Jochen Weiland, 2012-09-01 13:36
39683-60b1.patch (921 Bytes) 39683-60b1.patch Jochen Weiland, 2012-09-01 13:36
#1

Updated by Jochen Weiland over 8 years ago

Patch files attached for versions 4.5, 4.6, 4.7 and 6.0beta1

#2

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14286

#3

Updated by Alexander Opitz over 7 years ago

  • Status changed from Under Review to Needs Feedback

What's the state of this issue?

#4

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/14286

#5

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/14286

#6

Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/14286

#7

Updated by Stefan Froemken over 7 years ago

Hello Alexander,

the problem is, that I have added a too simple solution to the core and the meaning of the core is: We want to keep your credits on this issue. So if someone of the core solves this issue my credits get lost. It was a kind of honor to try it again. But I'm not Mr perfect in writing UnitTest so it needs over an hour to add this additional "feature".

Stefan

#8

Updated by Alexander Opitz over 7 years ago

Hi Stefan,

but you tried and it seems a good solution. So you invested your time into learning something. And with the review you get a response how good you've learned. :-)

#9

Updated by Stefan Froemken over 7 years ago

I don't understand this issue anymore. All samples work with and without backslash. Maybe it was a problem by PHP-Version. Don't know. But for now you can close this ticket.

Stefan

#10

Updated by Wouter Wolters over 7 years ago

  • Status changed from Under Review to Closed
  • Is Regression set to No

Also available in: Atom PDF