ZF-2258: Undefined variable in YouTube code, demo

Issue Type: Bug Created: 2007-12-03T15:30:55.000+0000 Last Updated: 2008-02-26T12:55:59.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Bill Karwin (bkarwin) Assignee: Ryan Boyd (rboyd) Tags: - Zend_Gdata

Related issues: Attachments:


Testing revision 7026 with PHP 5.2.4 on Windows XP.

Found an undefined variable in Zend/Gdata/YouTube/VideoEntry.php.

The following diffs seems to resolve the issues. You can review and apply these fixes at your discretion.

<pre class="highlight">
$ svn diff library/Zend/Gdata/YouTube
Index: library/Zend/Gdata/YouTube/VideoEntry.php
--- library/Zend/Gdata/YouTube/VideoEntry.php   (revision 7026)
+++ library/Zend/Gdata/YouTube/VideoEntry.php   (working copy)
@@ -410,7 +410,7 @@
         $fullId = $this->getId();
         $position = strrpos($fullId, '/');
-        if ($pos === false) {
+        if ($position === false) {
             require_once 'Zend/Gdata/App/Exception.php';
             throw new Zend_Gdata_App_Exception('Slash not found in atom:id');
         } else {

<pre class="highlight">
$ svn diff demos
Index: demos/Zend/Gdata/YouTubeVideoBrowser/index.php
--- demos/Zend/Gdata/YouTubeVideoBrowser/index.php      (revision 7026)
+++ demos/Zend/Gdata/YouTubeVideoBrowser/index.php      (working copy)
@@ -206,7 +206,7 @@
  * The main controller logic of the YouTube video browser demonstration app.
-$queryType = $_POST['queryType'];
+$queryType = isset($_POST['queryType']) ? $_POST['queryType'] : null;

 if ($queryType === null) {
     /* display the entire interface */


Posted by Ryan Boyd (rboyd) on 2007-12-03T19:48:08.000+0000

Hi Bill,

Thanks very much for the report. I fixed and added test cases for the issue in the core library, and fixed the issue with the demo app. Can you please review the code submitted in rev 7030 and 7031?

Thanks! -Ryan

Posted by Bill Karwin (bkarwin) on 2007-12-03T20:24:16.000+0000

Yep! When I run the unit test with code-coverage reporting, I see that the getVideoId() method is now tested.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.