[1.7.6] WriteTags() function should validate tag_data field

Think you found a bug in getID3()? Post here with details.
Post Reply
gokusandwich
User
Posts: 16
Joined: Wed Jan 26, 2005 12:53 am

[1.7.6] WriteTags() function should validate tag_data field

Post by gokusandwich » Mon May 01, 2006 2:27 am

getid3 version: 1.7.6
my email: cw264701 at ohiou dot edu

Probably not need for much explanation. Here is a patch:

Code: Select all

--- write.php	2006-04-30 22:17:45.000000000 -0400
+++ write.php	2006-04-30 22:17:41.000000000 -0400
@@ -85,6 +85,24 @@
 			return false;
 		}
 
+		$tag_data_field_invalid = false;
+		if (is_array($this->tag_data)) {
+			foreach ($this->tag_data as $t) {
+				if (!is_array($t)) {
+					$tag_data_field_invalid = true;
+				}
+			}
+		}
+		else {
+			$tag_data_field_invalid = true;
+		}
+
+		if ($tag_data_field_invalid) {
+			$this->errors[] = 'tag_data must be a 2-dimensional array in getid3_writetags';
+			return false;
+		}
+		
+
 		$TagFormatsToRemove = array();
 		if (filesize($this->filename) == 0) {


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest