In views_slideshow_cycle.theme.inc, lines 22 through 27 look like this:


  foreach ($settings as $key => $value) {
    if (is_string($value)) {
      if (stristr($value, "\n")) {
        $value = str_replace("\n", ' ', $value);
      }
      $value = trim($value);

The if statement checking value against '\n' isn't needed if you're just doing a replace on the value. Just run the replacement.

Also, the check for '\n' is case insensitive, where as the replace is case sensitive. It should be changed to use stri_replace instead if you want to match the implied logic of the if statement.

It should look more like this:

  foreach ($settings as $key => $value) {
    if (is_string($value)) {
      $value = stri_replace("\n", ' ', $value);
      $value = trim($value);

Unless I'm missing something in having that if statement present.

Thanks,

Comments

minorOffense’s picture

Status: Active » Needs review
minorOffense’s picture

Sorry, that should read

  foreach ($settings as $key => $value) {
    if (is_string($value)) {
      $value = str_ireplace("\n", ' ', $value);
      $value = trim($value);
redndahead’s picture

Status: Needs review » Fixed

A patch was committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.