E_DEPRECATED: strstr(): error

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 7, 2019   (RSS)

Hi All,

I've got an error that I’m not sure how to fix.

Any thoughts?

Here’s the error:

#1883 - E_DEPRECATED: strstr(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
/home2/nawaflco/public_html/nawafl/newslettersdetail.php (line 408)
https://nawafl.org/newslettersdetail.php


And here’s the offending code:
<?php foreach ($newsletter_announcementsRecords as $record): ?>
<?php $availabledates3 = join(', ', $record['newsletter_date:values']) ?>
<?php if (strstr($availabledates3, $newsletter_templateRecord['newsletter_date'])): ?>
<table align="center">
<tr>
<td colspan="3" align="left" valign="top" ><hr color="#<?php echo $nawa_colorsRecord['menu_background_color'] ?>" width="300" />
<div style="background-color:#<?php echo $newsletter_templateRecord['announcements_title_box_background_color'] ?>; padding:10px;" <?php if($newsletter_templateRecord['announcements_rounded_corners']==1):?>class="round-corner-3" <?php endif ?>>
<div align="center" style="background-color:#<?php echo $newsletter_templateRecord['announcements_title_background_color'] ?>; padding:10px;" <?php if($newsletter_templateRecord['announcements_rounded_corners']==1):?>class="round-corner-3" <?php endif ?>> <span class="heading_font"><?php echo $newsletter_templateRecord['announcements_main_title'] ?></span></div>
</div></td>
</tr>
</table>
<?php break ?>
<?php endif ?>
<?php endforeach; ?>

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By daniel - August 6, 2019

Hi Jerry,

If the page is functioning as expected other than throwing the error, I think the following should clear it up:

<?php if (strstr($availabledates3, (string)$newsletter_templateRecord['newsletter_date'])): ?>

Let me know if that works out!

Thanks,

Daniel
Technical Lead
interactivetools.com

Thanks Daniel,

That seems to work perfectly.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php