commit 646ee72762341e5087dc46595c49d827319fbdd5
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Wed Oct 19 17:44:40 2016 -0500
Update to latest fixes.
ChangeLog | 54 ++++++++++++++++++++
mythweb-0.28-fixes.patch | 130 ++++++++++++++++++++++++++++++++++++++++++++---
mythweb.spec | 16 +++---
3 files changed, 184 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 30d5874..fa269bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,57 @@
+commit 3fa642f00da9529674ea93110396d036da1d43ff
+Author: Stuart Auchterlonie <stuarta(a)mythtv.org>
+Date: Mon Oct 10 14:40:18 2016 -0400
+
+ Add mythweb dir to @INC.
+
+ Fixes #12895
+
+ Signed-off-by: Peter Bennett <pbennett(a)mythtv.org>
+ (cherry picked from commit e902c9788b1d405b0facfabd5b80ca49aaa83add)
+
+commit 1b75720192fc4c76a03d2b81e40f4d44cb339cd0
+Author: Michael T. Dean <mdean(a)mythtv.org>
+Date: Mon Oct 10 14:16:15 2016 -0400
+
+ Set the SQL mode when connecting to the database.
+
+ Fixes #12811
+
+ Signed-off-by: Peter Bennett <pbennett(a)mythtv.org>
+ (cherry picked from commit f02e5e264f61c1fcac3ead2e4cb86d9592e7d1ef)
+
+commit 32147cf4ce6ea55946c11135ebc81552d71c919c
+Author: Stuart Auchterlonie <stuarta(a)mythtv.org>
+Date: Thu Sep 15 15:55:08 2016 +0100
+
+ Fixes #12878. Use mythtv time, not unixtime to 'activate' a recording
+
+ (cherry picked from commit 07441af9ee7bd5371323309b32456f510b7106ec)
+
+commit 291d3308f074a8e0918fbac529fb9e1014f9ad8c
+Author: Stuart Auchterlonie <stuarta(a)mythtv.org>
+Date: Thu Sep 15 14:18:56 2016 +0100
+
+ Fixes #12868. inetref cannot be NULL
+
+ (cherry picked from commit 7b469b2fa6408f178e19726f67a5797e58b244c8)
+
+commit f80f8db0c03eb83d1313f3ff2ac2a6e19af65d2d
+Author: Ian Campbell <ijc(a)hellion.org.uk>
+Date: Wed Jul 20 10:35:39 2016 +0100
+
+ Refs #12752 - [mythweb] Avoid double quoting sql
+
+ $db->escape already wraps the result in 's so there is no need to do it in
the
+ caller.
+
+ This is a little complicated in searchMusic since the %'s need to be inside the
+ quoting but we do not want them to be escaped themselves. Concat them with the
+ search term using a SQL CONCAT().
+
+ Signed-off-by: Stuart Auchterlonie <stuarta(a)mythtv.org>
+ (cherry picked from commit d2469d2e3978a1288f79157990cf015d421d95d4)
+
commit a1f2cdf03978427eaa9e35fa18162a0ba6be829d
Author: Karl Dietz <dekarl(a)mythtv.org>
Date: Thu Apr 28 07:52:51 2016 +0200
diff --git a/mythweb-0.28-fixes.patch b/mythweb-0.28-fixes.patch
index 1be4307..3247b72 100644
--- a/mythweb-0.28-fixes.patch
+++ b/mythweb-0.28-fixes.patch
@@ -1,10 +1,101 @@
- modules/tv/classes/Channel.php | 8 +++----
- modules/tv/classes/Program.php | 50 +++++++++++++++-------------------------
- modules/tv/classes/Schedule.php | 6 ++---
- modules/tv/includes/programs.php | 17 +++++++-------
- modules/tv/set_channels.php | 2 +-
- 5 files changed, 35 insertions(+), 48 deletions(-)
+ classes/Database.php | 2 ++
+ modules/music/mp3act_functions.php | 16 ++++++------
+ modules/tv/classes/Channel.php | 8 +++---
+ modules/tv/classes/Program.php | 52 ++++++++++++++------------------------
+ modules/tv/classes/Schedule.php | 6 ++---
+ modules/tv/includes/programs.php | 17 +++++++------
+ modules/tv/set_channels.php | 2 +-
+ mythweb.pl | 3 +++
+ 8 files changed, 49 insertions(+), 57 deletions(-)
+diff --git a/classes/Database.php b/classes/Database.php
+index 92aa7b0..82da9d8 100644
+--- a/classes/Database.php
++++ b/classes/Database.php
+@@ -120,6 +120,8 @@ class Database {
+ $class = "Database_$engine";
+ $dbh = new $class($db_name, $login, $password, $server, $port, $options);
+ }
++ // Set SQL mode
++ $dbh->query('SET SESSION sql_mode = "";');
+ // Set database connection to utf8
+ $dbh->query('SET NAMES utf8;');
+ // Make sure UNIX_TIMESTAMP AND FROM_UNIXTIME do the right things
+diff --git a/modules/music/mp3act_functions.php b/modules/music/mp3act_functions.php
+index b6fc7e0..9d2780c 100644
+--- a/modules/music/mp3act_functions.php
++++ b/modules/music/mp3act_functions.php
+@@ -33,7 +33,7 @@ function GarbageCollector()
+ if (0 == mt_rand(0, 30))
+ {
+ $query = 'DELETE FROM music_playlists '.
+- "WHERE playlist_name='".$db->escape('MythWeb Temporary
Playlist')."'".
++ "WHERE playlist_name=".$db->escape('MythWeb Temporary
Playlist').
+ ' AND (NOW() - last_accessed) >
('.MYTH_PLAYLIST_SAVE_TIME.');';
+ $sh = $db->query($query);
+ $sh->finish();
+@@ -217,7 +217,7 @@ function buildBreadcrumb($page, $parent, $parentitem, $child,
$childitem)
+ function musicLookup($type, $itemid)
+ {
+ global $db;
+- $sql_itemid = "'".$db->escape($itemid)."'";
++ $sql_itemid = $db->escape($itemid);
+ switch($type)
+ {
+ case 'browse':
+@@ -279,7 +279,7 @@ function musicLookup($type, $itemid)
+ "FROM music_artists " .
+ "GROUP BY artist_name_sort " .
+ "HAVING artist_name_sort " .
+- "LIKE '" . $db->escape($itemid.'%') .
"' " .
++ "LIKE " . $db->escape($itemid.'%') . "
" .
+ "ORDER BY artist_name_sort";
+ }
+ $sh = $db->query($query);
+@@ -1008,7 +1008,7 @@ function getRandItems($type)
+ function searchMusic($terms, $option)
+ {
+ global $db;
+- $sql_terms = "'%".$db->escape($terms)."%'";
++ $sql_terms = "CONCAT('%', ".$db->escape($terms).",
'%')";
+ $query = 'SELECT ms.song_id, ma.album_name, ms.track, mt.artist_name, ms.name,
ms.rating, '.
+ 'SEC_TO_TIME(ms.length/1000) AS length, genre '.
+ 'FROM music_songs AS ms '.
+@@ -1111,14 +1111,14 @@ function internalUpdatePlaylist($songs, $count, $length)
+ $songlist = implode(',', $songs);
+
+ $query = 'music_playlists SET'.
+- " playlist_songs='".$db->escape($songlist)."'".
++ " playlist_songs=".$db->escape($songlist).
+ ',length='.$db->escape($length).
+ ',songcount='.$db->escape($count);
+
+ if (empty($plId))
+ {
+ $query = 'INSERT INTO '.$query.
+-
",hostname='".$db->escape('mythweb-'.$_SERVER['SERVER_NAME'])."'".
++
",hostname=".$db->escape('mythweb-'.$_SERVER['SERVER_NAME']).
+ ",playlist_name='".MYTH_WEB_PLAYLIST_NAME."'";
+ }
+ else
+@@ -1252,7 +1252,7 @@ function savePlaylist($pl_name, $newpl)
+ else
+ {
+ $query = 'UPDATE music_playlists SET'.
+- ' playlist_name=\''.$db->escape($pl_name).'\''.
++ ' playlist_name='.$db->escape($pl_name).
+ ",hostname='' ".
+ 'WHERE playlist_id='.$db->escape($pl['playlist_id']);
+
+@@ -1360,7 +1360,7 @@ function playlist_move($item1,$item2)
+ $songs[$idx2] = $tmp;
+
+ $query = 'UPDATE music_playlists SET'.
+- ' playlist_songs=\''.$db->escape(implode(',',
$songs)).'\' '.
++ ' playlist_songs='.$db->escape(implode(',', $songs)).'
'.
+ 'WHERE
playlist_id='.$db->escape($pl['playlist_id']).';';
+ $db->query($query);
+ }
diff --git a/modules/tv/classes/Channel.php b/modules/tv/classes/Channel.php
index 8fac90a..a435028 100644
--- a/modules/tv/classes/Channel.php
@@ -46,7 +137,7 @@ index 8fac90a..a435028 100644
$sh = $db->query($sql);
$callsign_list = array();
diff --git a/modules/tv/classes/Program.php b/modules/tv/classes/Program.php
-index 57ce447..53f404d 100644
+index 57ce447..1de5c77 100644
--- a/modules/tv/classes/Program.php
+++ b/modules/tv/classes/Program.php
@@ -629,21 +629,25 @@ class Program extends MythBase {
@@ -66,7 +157,7 @@ index 57ce447..53f404d 100644
.escape($this->category)
.','
.escape($this->seriesid)
.','
.escape($this->programid)
.','
-+ .escape($this->inetref)
.','
++ .escape(isset($this->inetref) ? $this->inetref :
'') .','
.escape(isset($this->recordid) ? $this->recordid :
0) .','
.escape($this->channel->callsign)
.','
.escape(isset($this->rectype) ? $this->rectype :
0) .','
@@ -77,6 +168,15 @@ index 57ce447..53f404d 100644
or trigger_error('SQL Error: '.$db->error, FATAL);
$sh->finish();
// Notify the backend of the changes
+@@ -697,7 +701,7 @@ class Program extends MythBase {
+ SET oldrecorded.reactivate = 1
+ WHERE oldrecorded.starttime = ?
+ AND oldrecorded.chanid = ?',
+- $this->starttime,
++ unix2mythtime($this->starttime),
+ $this->chanid
+ );
+ $this->rec_override(rectype_override);
@@ -770,40 +774,22 @@ class Program extends MythBase {
public function getAspect() {
@@ -202,3 +302,17 @@ index 7bdd4fb..9534b21 100644
$query_params[] = $data['videofilters'];
$query_params[] = $data['brightness'];
$query_params[] = $data['contrast'];
+diff --git a/mythweb.pl b/mythweb.pl
+index 252ecf4..4f36a33 100755
+--- a/mythweb.pl
++++ b/mythweb.pl
+@@ -10,6 +10,9 @@
+ use Cwd 'abs_path';
+ use File::Basename;
+
++# Add mythweb dir to @INC
++ use lib dirname(abs_path($ENV{'SCRIPT_FILENAME'} or $0));
++
+ # pwd is / when running under mod_rewrite, so we should chdir to the script
+ # directory for consistency
+ chdir dirname(abs_path($ENV{'SCRIPT_FILENAME'} or $0));
diff --git a/mythweb.spec b/mythweb.spec
index e714b55..49ea7b6 100644
--- a/mythweb.spec
+++ b/mythweb.spec
@@ -1,11 +1,11 @@
-%global vers_string v0.28-8-ga1f2cdf
+%global vers_string v0.28-13-g3fa642f
Name: mythweb
Summary: The web interface to MythTV
URL:
http://www.mythtv.org/
Version: 0.28
-Release: 2%{?dist}
+Release: 4%{?dist}
License: GPLv2 and LGPLv2 and MIT
@@ -102,13 +102,13 @@ fi
%changelog
+* Wed Oct 19 2016 Richard Shaw <hobbes1069(a)gmail.com> - 0.28-4
+- Update to latest fixes.
+
* Thu Sep 08 2016 Sérgio Basto <sergio(a)serjux.com> - 0.28-2
- v0.28-rc1 already support mysqli,
https://code.mythtv.org/trac/ticket/12588
- Requires php-mysqli, because in php7, "php-mysql" package and
"mysql.so"
- extension have been removed.
-
-* Tue May 3 2016 Richard Shaw <hobbes1069(a)gmail.com> - 0.28-2
-- Update to latest fixes.
+- Requires php-mysqli, because in php7, "php-mysql" package and
"mysql.so"
+- extension have been removed.
* Tue Apr 19 2016 Richard Shaw <hobbes1069(a)gmail.com> - 0.28-1
- Update to latest fixes.
@@ -147,7 +147,7 @@ fi
* Fri Aug 23 2013 Richard Shaw <hobbes1069(a)gmail.com> - 0.26.1-1
- Update to latest upstream version.
-* Tue Aug 13 2013 Richard Shaw <hobbes1069(a)gmail.com> - 0.26.0-5
+* Mon Aug 13 2013 Richard Shaw <hobbes1069(a)gmail.com> - 0.26.0-5
- Update to latest fixes.
- Patch for NoTrans issue with php in Fedora 19 and up. (Fixes #2856)