there are some places in drupal where it would be better(faster) to use strpos than strstr

8124 passes, 0 fails, and 0 exceptions

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Needs review » Needs work

You will need to strictly compare the result with FALSE, like this:

if (strpos($comment->comment, $keyword) !== FALSE || strpos($comment->subject, $keyword) !== FALSE)

... because strpos() can return 0.

dawehner’s picture

FileSize
4.09 KB

thx

here is the new patch

8124 passes, 0 fails, and 0 exceptions

dawehner’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

catch’s picture

Status: Needs work » Needs review
catch’s picture

Category: feature » task
Status: Needs review » Needs work

Doesn't apply any longer.

dawehner’s picture

FileSize
3.49 KB

i rerolled this patch

dawehner’s picture

Status: Needs work » Needs review
Dave Reid’s picture

Status: Needs review » Needs work

Looks like we're missing the same !== FALSE on $checked = strpos($format->roles, ",$rid,");.

dawehner’s picture

FileSize
3.68 KB

oh thx, for the review

next patch

dawehner’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

dawehner’s picture

Status: Needs work » Needs review

rerole

dawehner’s picture

FileSize
3.51 KB

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

dawehner’s picture

Status: Needs work » Needs review
Dave Reid’s picture

Re-rolled and re-posted to catch the testing bot again.

c960657’s picture

Looks good to me.

chx’s picture

Status: Needs review » Reviewed & tested by the community

I like it too and so does the bot.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.