Commit 3fe4c4e1 authored by Dries's avatar Dries

- Patch #352880 by dereine, Dave Reid: replace strstre with strpos.

parent 7138a5d5
......@@ -2221,7 +2221,7 @@ function comment_unpublish_by_keyword_action_submit($form, $form_state) {
*/
function comment_unpublish_by_keyword_action($comment, $context) {
foreach ($context['keywords'] as $keyword) {
if (strstr($comment->comment, $keyword) || strstr($comment->subject, $keyword)) {
if (strpos($comment->comment, $keyword) !== FALSE || strpos($comment->subject, $keyword) !== FALSE) {
db_update('comment')
->fields(array('status' => COMMENT_NOT_PUBLISHED,))
->condition('cid', $comment->cid)
......
......@@ -24,7 +24,7 @@ function filter_admin_overview() {
$roles = array();
foreach (user_roles() as $rid => $name) {
// Prepare a roles array with roles that may access the filter.
if (strstr($format->roles, ",$rid,")) {
if (strpos($format->roles, ",$rid,") !== FALSE) {
$roles[] = $name;
}
}
......@@ -132,7 +132,7 @@ function filter_admin_format_form(&$form_state, $format) {
);
foreach (user_roles() as $rid => $name) {
$checked = strstr($format->roles, ",$rid,");
$checked = strpos($format->roles, ",$rid,") !== FALSE;
$form['roles'][$rid] = array('#type' => 'checkbox',
'#title' => $name,
'#default_value' => ($default || $checked),
......
......@@ -2011,7 +2011,7 @@ function node_feed($nids = FALSE, $channel = array()) {
$item->body = $content;
unset($item->teaser);
}
// Allow modules to modify the fully-built node.
node_invoke_node($item, 'alter', $teaser, FALSE);
}
......@@ -3188,7 +3188,7 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) {
*/
function node_unpublish_by_keyword_action($node, $context) {
foreach ($context['keywords'] as $keyword) {
if (strstr(drupal_render(node_build(clone $node)), $keyword) || strstr($node->title, $keyword)) {
if (strpos(drupal_render(node_build(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
$node->status = 0;
watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
break;
......
......@@ -462,7 +462,7 @@ function hook_link($type, $object, $teaser = FALSE) {
*/
function hook_link_alter(array &$links, $node) {
foreach ($links as $module => $link) {
if (strstr($module, 'taxonomy_term')) {
if (strpos($module, 'taxonomy_term') !== FALSE) {
// Link back to the forum and not the taxonomy term page
$links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment