From 10faa26ccb1ce55da08e8a577887fe922effa06b Mon Sep 17 00:00:00 2001 From: Zohar Babin Date: Mon, 12 Sep 2011 21:26:54 -0400 Subject: [PATCH] added uri encoding for video details on the upload functions --- .../zoharbabin/youtube/YouTubeDirectUpload.as | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/com/zoharbabin/youtube/YouTubeDirectUpload.as b/src/com/zoharbabin/youtube/YouTubeDirectUpload.as index e0ab41e..907f9f8 100644 --- a/src/com/zoharbabin/youtube/YouTubeDirectUpload.as +++ b/src/com/zoharbabin/youtube/YouTubeDirectUpload.as @@ -312,11 +312,11 @@ package com.zoharbabin.youtube loader.dataFormat = URLLoaderDataFormat.BINARY; req = new URLRequest(gatewayUrlUpload + "?email="+youTubeUserEmail + "&pass="+youTubePassword + - "&title="+ytVideoName + - "&desc="+ytVideoDescription + - "&tags="+ytKeywords + - "&cat="+ytVideoCategory + - "&devtags="+developerTag ); + "&title="+encodeURIComponent(ytVideoName) + + "&desc="+encodeURIComponent(ytVideoDescription) + + "&tags="+encodeURIComponent(ytKeywords) + + "&cat="+encodeURIComponent(ytVideoCategory) + + "&devtags="+encodeURIComponent(developerTag) ); req.method = URLRequestMethod.POST; req.contentType = 'application/octet-stream'; req.data = videoBytes; @@ -350,12 +350,12 @@ package com.zoharbabin.youtube // Obviously, this shouldn't be hardcoded in a real application! var atom:String = ''; atom += ''; - atom += ''+ytVideoName+''; - atom += ''+ytVideoDescription+''; - atom += ''+ytVideoCategory+''; + atom += ''+encodeURIComponent(ytVideoName)+''; + atom += ''+encodeURIComponent(ytVideoDescription)+''; + atom += ''+encodeURIComponent(ytVideoCategory)+''; // Developer tags are not user-visible and provide an easy way for you to find videos uploaded with your developer key. - atom += ''+developerTag+''; - atom += ''+ytKeywords+''; + atom += ''+encodeURIComponent(developerTag)+''; + atom += ''+encodeURIComponent(ytKeywords)+''; var client:HttpClient = new HttpClient(); var uri:URI = new URI(uploadMethodUrl);