Skip to content

Commit 237c407

Browse files
committed
Merge branch 'develop'.
2 parents 41efef2 + c4bf862 commit 237c407

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

bc-mapi.php

+24-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Brightcove PHP MAPI Wrapper 2.0.3 (14 FEBRUARY 2011)
4+
* Brightcove PHP MAPI Wrapper 2.0.4 (18 FEBRUARY 2011)
55
* (Formerly known as Echove)
66
*
77
* REFERENCES:
@@ -463,7 +463,7 @@ public function createMedia($type = 'video', $file = NULL, $meta, $options = NUL
463463
}
464464
}
465465

466-
if($options['create_multiple_renditions'] === TRUE && $options['H264NoProcessing'] === TRUE)
466+
if((isset($options['create_multiple_renditions']) && $options['create_multiple_renditions'] === TRUE) && (isset($options['H264NoProcessing']) && $options['H264NoProcessing'] === TRUE))
467467
{
468468
unset($options['H264NoProcessing']);
469469

@@ -1116,17 +1116,24 @@ public function convertTags($tags, $implode = FALSE)
11161116
public function tagsFilter($assets, $tags)
11171117
{
11181118
$filtered = array();
1119+
$array = explode(',', strtolower($tags));
11191120

11201121
foreach($assets as $asset)
11211122
{
11221123
foreach($asset->tags as $k => $v)
11231124
{
1124-
$asset->tags[$k] = strtolower($v);
1125+
if(isset($asset->tags))
1126+
{
1127+
$asset->tags[$k] = strtolower($v);
1128+
}
11251129
}
11261130

1127-
if(count(array_intersect(explode(',', strtolower($tags)), $asset->tags)) > 0)
1131+
if(isset($asset->tags))
11281132
{
1129-
$filtered[] = $asset;
1133+
if(count(array_intersect($array, $asset->tags)) > 0)
1134+
{
1135+
$filtered[] = $asset;
1136+
}
11301137
}
11311138
}
11321139

@@ -1409,29 +1416,29 @@ private function validType($type)
14091416

14101417
/**
14111418
* Dummy method for backwards compatability
1412-
* @todo Deprecate in > 2.0.5
1419+
* @todo Deprecate in > 2.1.0
14131420
*/
14141421
public function filter($assets, $tags)
14151422
{
1416-
return tagsFilter($assets, $tags);
1423+
return $this->tagsFilter($assets, $tags);
14171424
}
14181425

14191426
/**
14201427
* Dummy method for backwards compatability
1421-
* @todo Deprecate in > 2.0.5
1428+
* @todo Deprecate in > 2.1.0
14221429
*/
14231430
public function tags($tags, $implode = FALSE)
14241431
{
1425-
return convertTags($tags, $implode);
1432+
return $this->convertTags($tags, $implode);
14261433
}
14271434

14281435
/**
14291436
* Dummy method for backwards compatability
1430-
* @todo Deprecate in > 2.0.5
1437+
* @todo Deprecate in > 2.1.0
14311438
*/
14321439
public function time($ms, $seconds = FALSE)
14331440
{
1434-
return convertTime($ms, $seconds);
1441+
return $this->convertTime($ms, $seconds);
14351442
}
14361443

14371444
/**
@@ -1521,8 +1528,13 @@ public function __construct(BCMAPI $obj, $error_code, $raw_error = NULL)
15211528

15221529
if(isset($raw_error))
15231530
{
1531+
if(isset($raw_error->error) && isset($raw_error->error->message) && isset($raw_error->error->code))
1532+
{
1533+
$raw_error = $raw_error->error;
1534+
}
1535+
15241536
$error .= "'\n";
1525-
$error .= isset($raw_error->error) ? '== ' . $raw_error->error . ' (' . $raw_error->code . ') ==' . "\n" : '';
1537+
$error .= (isset($raw_error->message) && isset($raw_error->code)) ? '== ' . $raw_error->message . ' (' . $raw_error->code . ') ==' . "\n" : '';
15261538
$error .= isset($raw_error->errors[0]) ? '== ' . $raw_error->errors[0]->error . ' (' . $raw_error->errors[0]->code . ') ==' . "\n" : '';
15271539
}
15281540

0 commit comments

Comments
 (0)