Send to phone link created for all node views

Created on 29 August 2018, about 7 years ago
Updated 10 December 2024, 10 months ago

The "Send to phone" link is being generated for all nodes, not just the ones configured on the admin page. The problem is located in sms_sendtophone.module at line 467. The current code reads "if (in_array($node->type, $types)) {".

The array $types has one named element for each possible content type with the value either being the content type name or 0. the test always passes as $node->type is a string and when compared to a zero value the test succeeds. This is documented in the PHP manual.

To eliminate the problem, we need to code the third parameter to in_array to force a strict compare (value and type) so the patched line should read "if (in_array($node->type, $types, TRUE)) {". After this is done, the module works as expected.

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

SMS Send to Phone

Created by

πŸ‡ΊπŸ‡ΈUnited States abcto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024