Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #52397, comment 3


Ignore:
Timestamp:
01/30/2021 11:05:29 AM (4 years ago)
Author:
giuse
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #52397, comment 3

    initial v1  
    1 I opened this thread because W3 Total Cache was giving problem to my plugin that uses this function.
     1I've opened this thread because W3 Total Cache was giving a problem with my plugin that uses this function.
    22
    3 If you save the option related to the User Agent of W3 Total Cache, it sanitizes it and it is saved "mobile" instead of "Mobile". I know this is something that W3 Total Cache should solve, but my question is: What's the problem in adding a strtolower? The performance would be the same, and you would prevent issues with other plugins. Moreover, you never know if a certain browser uses "mobile" instead of "Mobile". This function would be more robust and prevent issues if it wasn't case sensitive.
     3If you save the option related to the User Agent of W3 Total Cache, it saves "mobile" instead of "Mobile". I know this is something that W3 Total Cache should solve, but what's the problem in adding a strtolower? The performance would be the same, and you would prevent issues with other plugins. Moreover, you never know if a certain browser uses "mobile" instead of "Mobile". This function would be more robust and prevent issues if it wasn't case sensitive.
    44
    55
    6 I think it would be faster and easier adding strtolower than going ahead commenting on this function, we are not speaking about something that is a risk for performance or security, but if you don't add strtolower I will replace this function with another one in my plugin, so if you don't want to add strtolower, I suggest closing this thread.
     6I think it would be faster and easier adding strtolower than going ahead commenting on this function, we are not speaking about something that is a risk for performance or security. If you don't add strtolower I will replace this function with another one in my plugin, so if you don't want to add strtolower, I suggest closing this thread.
    77
    88Consider that also other plugins may replace this function, this would be not good for the WP ecosystem if the reason is only a missing strtolower.