From 3fbe07078fa57abe82b9584e11075a83ce15265a Mon Sep 17 00:00:00 2001
From: Bharat Mediratta 
Date: Mon, 4 Jun 2012 19:54:01 -0700
Subject: Second attempt to fix #1821 - first attempt caused an infinite loop
 in some cases when zlib.output_compression is enabled.
---
 modules/gallery/controllers/file_proxy.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'modules')
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 36c6bc2a..47def436 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -128,7 +128,12 @@ class File_Proxy_Controller extends Controller {
     // going to buffer up whatever file we're proxying (and it may be very large).  This may
     // affect embedding or systems with PHP's output_buffering enabled.
     while (ob_get_level()) {
-      ob_end_clean();
+      Kohana_Log::add("error","".print_r(ob_get_level(),1));
+      if (!@ob_end_clean()) {
+        // ob_end_clean() can return false if the buffer can't be removed for some reason
+        // (zlib output compression buffers sometimes cause problems).
+        break;
+      }
     }
 
     readfile($file);
-- 
cgit v1.2.3
From 6fbea19b352f880a6241dd359336ace5a4f26d22 Mon Sep 17 00:00:00 2001
From: Tony Fung 
Date: Tue, 5 Jun 2012 11:16:37 +0800
Subject: Force Turn off the compress as most image file already compressed.
---
 modules/gallery/controllers/file_proxy.php | 6 ++++++
 1 file changed, 6 insertions(+)
(limited to 'modules')
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 47def436..6c5419e8 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -29,6 +29,12 @@
 class File_Proxy_Controller extends Controller {
   const ALLOW_PRIVATE_GALLERY = true;
   public function __call($function, $args) {
+    
+    // Force Turn off the compress as most image file already compressed.
+    // And the compress will slow down the response.
+    if(ini_get('zlib.output_compression'))
+      ini_set('zlib.output_compression', 'Off');
+    
     // request_uri: gallery3/var/albums/foo/bar.jpg?m=1234
     $request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));
 
-- 
cgit v1.2.3
From 3fd5f4cc87603d7de773bb44f498d5d8ffa94986 Mon Sep 17 00:00:00 2001
From: Tony Fung 
Date: Tue, 5 Jun 2012 11:20:31 +0800
Subject: CSS Style Update to match with other view
---
 modules/search/views/search.html.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'modules')
diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php
index 3436a00c..db672da2 100644
--- a/modules/search/views/search.html.php
+++ b/modules/search/views/search.html.php
@@ -26,10 +26,10 @@
      $item_class = $item->is_album() ? "g-album" : "g-photo" ?>
     
       
-        = $item->thumb_img() ?>
-        
+        = $item->thumb_img(array("class" => "g-thumbnail")) ?>
+        
           = html::purify(text::limit_chars($item->title, 32, "…")) ?>
-         
+         
          
           = nl2br(html::purify(text::limit_chars($item->description, 64, "…"))) ?>
         
-- 
cgit v1.2.3
From 32862713760406ffdf534583cbe35b3844e1dce7 Mon Sep 17 00:00:00 2001
From: Tony Fung 
Date: Tue, 5 Jun 2012 11:24:13 +0800
Subject: Show "Movie info" on movie page
---
 modules/info/helpers/info_block.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'modules')
diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php
index 3dcfa338..d62c900d 100644
--- a/modules/info/helpers/info_block.php
+++ b/modules/info/helpers/info_block.php
@@ -29,7 +29,8 @@ class info_block_Core {
       if ($theme->item()) {
         $block = new Block();
         $block->css_id = "g-metadata";
-        $block->title = $theme->item()->is_album() ? t("Album info") : t("Photo info");
+        $block->title = $theme->item()->is_album() ? t("Album info") : 
+          ($theme->item()->is_movie() ? t("Movie info") : t("Photo info"));
         $block->content = new View("info_block.html");
         if ($theme->item->title && module::get_var("info", "show_title")) {
           $info["title"] = array(
-- 
cgit v1.2.3
From 44d5f22d8d85285c9a43b8182da73c051594cf02 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta 
Date: Tue, 5 Jun 2012 13:57:45 -0700
Subject: Remove  added in last commit, it's unclear why that's necessary. 
 The last commit had the wrong ticket #, this actually resolves 1878.
---
 modules/search/views/search.html.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'modules')
diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php
index db672da2..4279cbab 100644
--- a/modules/search/views/search.html.php
+++ b/modules/search/views/search.html.php
@@ -27,10 +27,11 @@
     
       
         = $item->thumb_img(array("class" => "g-thumbnail")) ?>
-        
+        
+          
           = html::purify(text::limit_chars($item->title, 32, "…")) ?>
-         
-         
+        
+        
           = nl2br(html::purify(text::limit_chars($item->description, 64, "…"))) ?>
         
       
-- 
cgit v1.2.3
From 9e1f975e7bdd68d80492d418ad908d1367923aaa Mon Sep 17 00:00:00 2001
From: Bharat Mediratta 
Date: Tue, 5 Jun 2012 14:08:15 -0700
Subject: Fix up syntax in the last change.  Follow-on for #1879.
---
 modules/gallery/controllers/file_proxy.php | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
(limited to 'modules')
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 6c5419e8..49aa9c5a 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -29,12 +29,13 @@
 class File_Proxy_Controller extends Controller {
   const ALLOW_PRIVATE_GALLERY = true;
   public function __call($function, $args) {
-    
-    // Force Turn off the compress as most image file already compressed.
-    // And the compress will slow down the response.
-    if(ini_get('zlib.output_compression'))
-      ini_set('zlib.output_compression', 'Off');
-    
+
+    // Force zlib compression off.  Image and movie files are already compressed and
+    // recompressing them is CPU intensive.
+    if (ini_get("zlib.output_compression")) {
+      ini_set("zlib.output_compression", "Off");
+    }
+
     // request_uri: gallery3/var/albums/foo/bar.jpg?m=1234
     $request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));
 
-- 
cgit v1.2.3
From 713a06f234837f7f79977ca08f3514ef763f572f Mon Sep 17 00:00:00 2001
From: Bharat Mediratta 
Date: Tue, 5 Jun 2012 20:20:21 -0700
Subject: Do a better job of escaping filenames when uploading.  Fixes #1881.
---
 lib/uploadify/jquery.uploadify.min.js         | 51 ++++++++++++++-------------
 modules/gallery/views/form_uploadify.html.php |  6 ++--
 2 files changed, 30 insertions(+), 27 deletions(-)
(limited to 'modules')
diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js
index 43053119..17127a71 100644
--- a/lib/uploadify/jquery.uploadify.min.js
+++ b/lib/uploadify/jquery.uploadify.min.js
@@ -1,26 +1,27 @@
-/*
-Uploadify v2.1.0
-Release Date: August 24, 2009
 
-Copyright (c) 2009 Ronnie Garcia, Travis Nickels
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d\
+        
\
+         

\
+        
\
+        
\
+        
\
+