You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably my most favorite bug that I've come across.
array_search($string, $METASTRINGS_CACHE); will return the index to an element in $METASTRINGS_CACHE that is zero (the number) for any $string. This causes some really interesting behavior that is difficult to debug. This happens, of course, because "string" == 0 returns true but you generally are not thinking about that when you use array_search(). The solution is to set strict to true so that the comparison is done with ===.
The text was updated successfully, but these errors were encountered:
Original ticket http://trac.elgg.org/ticket/1227 on 39685194-12-25 by cash, assigned to unknown.
Elgg version: 1.6
This is probably my most favorite bug that I've come across.
array_search($string, $METASTRINGS_CACHE); will return the index to an element in $METASTRINGS_CACHE that is zero (the number) for any $string. This causes some really interesting behavior that is difficult to debug. This happens, of course, because "string" == 0 returns true but you generally are not thinking about that when you use array_search(). The solution is to set strict to true so that the comparison is done with ===.
The text was updated successfully, but these errors were encountered: