Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
there are some places in drupal where it would be better(faster) to use strpos than strstr
8124 passes, 0 fails, and 0 exceptions
Comment | File | Size | Author |
---|---|---|---|
#20 | 352880-replace-strstr-with-strpos-D7.patch | 3.78 KB | Dave Reid |
#15 | strstr_to_strpos.patch | 3.51 KB | dawehner |
#10 | strstr_to_strpos_4.patch | 3.68 KB | dawehner |
#7 | strstr_to_strpos_3.patch | 3.49 KB | dawehner |
#2 | strstr_to_strpos_2.patch | 4.09 KB | dawehner |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedYou will need to strictly compare the result with FALSE, like this:
... because strpos() can return 0.
Comment #2
dawehnerthx
here is the new patch
8124 passes, 0 fails, and 0 exceptions
Comment #3
dawehnerComment #5
catchComment #6
catchDoesn't apply any longer.
Comment #7
dawehneri rerolled this patch
Comment #8
dawehnerComment #9
Dave ReidLooks like we're missing the same !== FALSE on
$checked = strpos($format->roles, ",$rid,");
.Comment #10
dawehneroh thx, for the review
next patch
Comment #11
dawehnerComment #14
dawehnerrerole
Comment #15
dawehnerComment #17
Dave ReidComment #19
dawehnerComment #20
Dave ReidRe-rolled and re-posted to catch the testing bot again.
Comment #21
c960657 CreditAttribution: c960657 commentedLooks good to me.
Comment #22
chx CreditAttribution: chx commentedI like it too and so does the bot.
Comment #23
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.