summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-02 00:28:37 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-02 00:28:37 +0000
commite9133f9825735a072bb3ce54daac1d85edb3a806 (patch)
treef4f01cd7f846e465c1cb1a142f3a3b6ecab0326c
parent00d74cac5a20c26017554b5e6eaef624b48f886e (diff)
downloadampache-e9133f9825735a072bb3ce54daac1d85edb3a806.tar.gz
ampache-e9133f9825735a072bb3ce54daac1d85edb3a806.tar.bz2
ampache-e9133f9825735a072bb3ce54daac1d85edb3a806.zip
fixed mpd logic error and post max size
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--lib/debug.lib.php5
-rw-r--r--lib/init.php6
-rw-r--r--modules/localplay/mpd.controller.php7
4 files changed, 17 insertions, 4 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 17625f55..4852ffd6 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,9 @@
--------------------------------------------------------------------------
v.3.3.3-Alpha2
+ - Foced a sane Post Size had some people with 32 byte post sizes
+ which will not work with Ampache.
+ - Fixed a logic error with the MPD controller.
- Fixed a problem were invalid bitrates below the set downsample
bitrate could cause lame to crash as they weren't
validated.
diff --git a/lib/debug.lib.php b/lib/debug.lib.php
index 5320e019..08cf7d6d 100644
--- a/lib/debug.lib.php
+++ b/lib/debug.lib.php
@@ -356,6 +356,11 @@ function check_putenv() {
return false;
}
+ /* Check and see if we can up the post limit */
+ if (!ini_set(post_max_size,'8M')) {
+ return false;
+ }
+
/* Check if safe mode is on */
if (ini_get('safe_mode')) {
return false;
diff --git a/lib/init.php b/lib/init.php
index d54706b7..3cd54d46 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -195,6 +195,12 @@ $old_error_handler = set_error_handler("ampache_error_handler");
vauth_init($results);
/* Check their PHP Vars to make sure we're cool here */
+$post_size = @ini_get('post_max_size');
+if (substr($post_size,strlen($post_size)-1,strlen($post_size)) != 'M') {
+ /* Sane value time */
+ ini_set('post_max_size','8M');
+}
+
if ($results['memory_limit'] < 16) {
$results['memory_limit'] = 16;
}
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index 3501b60e..a88e28aa 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -318,6 +318,9 @@ class AmpacheMpd {
/* Parse out the song ID and then create the song object */
preg_match("/song=(\d+)\&/",$entry['file'],$matches);
+
+ /* Attempt to build the new song */
+ $song = new Song($matches['1']);
/* If we don't know it, look up by filename */
if (!$song->title) {
@@ -328,13 +331,9 @@ class AmpacheMpd {
$song = new Song($results['id']);
}
else {
- $song = new Song();
$song->title = _('Unknown');
}
}
- else {
- $song = new Song($matches['1']);
- }
/* Make the name pretty */
$song->format_song();