Opened 11 months ago

Closed 2 months ago

#13368 closed Patch - Bug Fix (Fixed)

Fix PHP warning and compilation error in mythweb search

Reported by: k-ross Owned by: Stuart Auchterlonie
Priority: minor Milestone: 30.1
Component: Plugin - MythWeb Version: v30-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I believe this started happening since upgrading PHP to 7.3.

First, it fixes the following warning: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Secondly, it fixes a regular expression compilation error: Warning at /usr/share/mythtv/mythweb/modules/tv/search.php, line 464: !NoTrans: preg_replace(): Compilation failed: invalid range in character class at offset 3!!

This was caused by using "-" inside square brackets "[]". If you want to search explicitly for "-", you need to have the "-" at the beginning or end, not in the middle, otherwise it thinks you're trying to do a range, like "a-z".

Attachments (1)

mythweb.patch (1.3 KB) - added by k-ross 11 months ago.

Download all attachments as: .zip

Change History (5)

Changed 11 months ago by k-ross

Attachment: mythweb.patch added

comment:1 Changed 10 months ago by ijc

FWIW I have tried this patch and it resolves the issue for me.

I also had to bump memory_limit in /etc/mythtv/mythweb.conf from 64M to 128M, but I think that's independent of the changes here (and perhaps system specific).

comment:2 Changed 10 months ago by Stuart Auchterlonie

Milestone: needs_triage30.1
Version: Unspecifiedv30-fixes

comment:3 Changed 6 months ago by mymatenige

This issue is evident in Fedora 30 (which includes PHP 7.3.4 by default), therefore expect reports of this to increase as people upgrade. If the patch is acceptable it might be good to push it into v30-fixes as soon as possible.

comment:4 Changed 2 months ago by David Hampton

Resolution: Fixed
Status: newclosed

I hadn't seen this bug report, and ended up fixing the issues independently. Fixed in the master branch by commit e3a1fc78.

Note: See TracTickets for help on using tickets.