[1.7.6] WriteTags() function should validate tag_data field
Posted: 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:
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) {