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 @@ is_album() ? "g-album" : "g-photo" ?>
  • - thumb_img() ?> -

    + thumb_img(array("class" => "g-thumbnail")) ?> +

    title, 32, "…")) ?> -

    +

    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 @@
  • thumb_img(array("class" => "g-thumbnail")) ?> -

    +

    + title, 32, "…")) ?> -

    -
    +

    +
    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('
    '+fileName+" ("+k+l+')
    ')}});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
    ');swfobject.embedSWF(settings.uploader,settings.id+'Uploader',settings.width,settings.height,'9.0.24',settings.expressInstall,data,{'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});if(settings.queueID==false){jQuery("#"+jQuery(this).attr('id')+"Uploader").after('
    ');}} +if(typeof(settings.onOpen)=='function'){jQuery(this).bind("uploadifyOpen",settings.onOpen);} +jQuery(this).bind("uploadifySelect",{'action':settings.onSelect,'queueID':settings.queueID},function(event,ID,fileObj){if(event.data.action(event,ID,fileObj)!==false){var byteSize=Math.round(fileObj.size/1024*100)*.01;var suffix='KB';if(byteSize>1000){byteSize=Math.round(byteSize*.001*100)*.01;suffix='MB';} +var sizeParts=byteSize.toString().split('.');if(sizeParts.length>1){byteSize=sizeParts[0]+'.'+sizeParts[1].substr(0,2);}else{byteSize=sizeParts[0];} +if(fileObj.name.length>20){fileName=fileObj.name.substr(0,20)+'...';}else{fileName=fileObj.name;} +queue='#'+jQuery(this).attr('id')+'Queue';if(event.data.queueID){queue='#'+event.data.queueID;} +jQuery(queue).append('
    \ +
    \ + \ +
    \ + \ +
    \ +
    \ +
    \ +
    ');jQuery('div#'+jQuery(this).attr('id')+ID+' span.fileName').text(fileName+' ('+byteSize+suffix+')');}});if(typeof(settings.onSelectOnce)=='function'){jQuery(this).bind("uploadifySelectOnce",settings.onSelectOnce);} +jQuery(this).bind("uploadifyQueueFull",{'action':settings.onQueueFull},function(event,queueSizeLimit){if(event.data.action(event,queueSizeLimit)!==false){alert('The queue is full. The max size is '+queueSizeLimit+'.');}});jQuery(this).bind("uploadifyCheckExist",{'action':settings.onCheck},function(event,checkScript,fileQueueObj,folder,single){var postData=new Object();postData=fileQueueObj;postData.folder=pagePath+folder;if(single){for(var ID in fileQueueObj){var singleFileID=ID;}} +jQuery.post(checkScript,postData,function(data){for(var key in data){if(event.data.action(event,checkScript,fileQueueObj,folder,single)!==false){var replaceFile=confirm("Do you want to replace the file "+data[key]+"?");if(!replaceFile){document.getElementById(jQuery(event.target).attr('id')+'Uploader').cancelFileUpload(key,true,true);}}} +if(single){document.getElementById(jQuery(event.target).attr('id')+'Uploader').startFileUpload(singleFileID,true);}else{document.getElementById(jQuery(event.target).attr('id')+'Uploader').startFileUpload(null,true);}},"json");});jQuery(this).bind("uploadifyCancel",{'action':settings.onCancel},function(event,ID,fileObj,data,clearFast){if(event.data.action(event,ID,fileObj,data,clearFast)!==false){var fadeSpeed=(clearFast==true)?0:250;jQuery("#"+jQuery(this).attr('id')+ID).fadeOut(fadeSpeed,function(){jQuery(this).remove()});}});if(typeof(settings.onClearQueue)=='function'){jQuery(this).bind("uploadifyClearQueue",settings.onClearQueue);} +var errorArray=[];jQuery(this).bind("uploadifyError",{'action':settings.onError},function(event,ID,fileObj,errorObj){if(event.data.action(event,ID,fileObj,errorObj)!==false){var fileArray=new Array(ID,fileObj,errorObj);errorArray.push(fileArray);jQuery("#"+jQuery(this).attr('id')+ID+" .percentage").text(" - "+errorObj.type+" Error");jQuery("#"+jQuery(this).attr('id')+ID).addClass('uploadifyError');}});jQuery(this).bind("uploadifyProgress",{'action':settings.onProgress,'toDisplay':settings.displayData},function(event,ID,fileObj,data){if(event.data.action(event,ID,fileObj,data)!==false){jQuery("#"+jQuery(this).attr('id')+ID+"ProgressBar").css('width',data.percentage+'%');if(event.data.toDisplay=='percentage')displayData=' - '+data.percentage+'%';if(event.data.toDisplay=='speed')displayData=' - '+data.speed+'KB/s';if(event.data.toDisplay==null)displayData=' ';jQuery("#"+jQuery(this).attr('id')+ID+" .percentage").text(displayData);}});jQuery(this).bind("uploadifyComplete",{'action':settings.onComplete},function(event,ID,fileObj,response,data){if(event.data.action(event,ID,fileObj,unescape(response),data)!==false){jQuery("#"+jQuery(this).attr('id')+ID+" .percentage").text(' - Completed');jQuery("#"+jQuery(this).attr('id')+ID).fadeOut(250,function(){jQuery(this).remove()});}});if(typeof(settings.onAllComplete)=='function'){jQuery(this).bind("uploadifyAllComplete",{'action':settings.onAllComplete},function(event,uploadObj){if(event.data.action(event,uploadObj)!==false){errorArray=[];}});}});},uploadifySettings:function(settingName,settingValue,resetObject){var returnValue=false;jQuery(this).each(function(){if(settingName=='scriptData'&&settingValue!=null){if(resetObject){var scriptData=settingValue;}else{var scriptData=jQuery.extend(settings.scriptData,settingValue);} +var scriptDataString='';for(var name in scriptData){scriptDataString+='&'+name+'='+escape(scriptData[name]);} +settingValue=scriptDataString.substr(1);} +returnValue=document.getElementById(jQuery(this).attr('id')+'Uploader').updateSettings(settingName,settingValue);});if(settingValue==null){if(settingName=='scriptData'){var returnSplit=unescape(returnValue).split('&');var returnObj=new Object();for(var i=0;i" + fileObj.name + " - " + + "
  • - " + for_js() ?> + "
  • "); + $("#g-add-photos-status li#q" + queueID + " span").text(fileObj.name); setTimeout(function() { $("#q" + queueID).slideUp("slow").remove() }, 5000); success_count++; update_status(); @@ -92,7 +93,8 @@ error_msg + ""; $("#g-add-photos-status ul").append( - "
  • " + fileObj.name + msg + "
  • "); + "
  • " + msg + "
  • "); + $("#g-add-photos-status li#q" + queueID + " span").text(fileObj.name); $("#g-uploadify").uploadifyCancel(queueID); error_count++; update_status(); -- cgit v1.2.3 From b7074ee59588b74ff4ebb77dd1281941a3c99778 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 5 Jun 2012 20:50:08 -0700 Subject: Clean file paths in Kohana_Exception::debug_path(). Fixes #1880. --- modules/gallery/libraries/MY_Kohana_Exception.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/gallery/libraries/MY_Kohana_Exception.php b/modules/gallery/libraries/MY_Kohana_Exception.php index dd04b25f..b74c80b1 100644 --- a/modules/gallery/libraries/MY_Kohana_Exception.php +++ b/modules/gallery/libraries/MY_Kohana_Exception.php @@ -94,4 +94,8 @@ class Kohana_Exception extends Kohana_Exception_Core { } return $result; } + + public static function debug_path($file) { + return html::clean(parent::debug_path($file)); + } } \ No newline at end of file -- cgit v1.2.3 From b416d7e3d58d8d1510e12bbbe5363218c41ee902 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 5 Jun 2012 21:15:21 -0700 Subject: Follow on to a9be0691d9efd84cbf5a9f05236caf4df23bcfdb for #1872. --- modules/g2_import/controllers/admin_g2_import.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index 5edd2a1b..2e435321 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -104,6 +104,7 @@ class Admin_g2_import_Controller extends Admin_Controller { $path_prefix = Input::instance()->get("q"); foreach (glob("{$path_prefix}*") as $file) { if (is_dir($file) && !is_link($file)) { + $file = html::clean($file); $directories[] = $file; // If we find an embed.php, include it as well -- cgit v1.2.3 From 03d55d25307054547378db123e30c59bebb6944f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 5 Jun 2012 21:25:56 -0700 Subject: Encode urls in 404 log entries. Fixes #1882. --- modules/gallery/libraries/MY_Kohana_Exception.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/libraries/MY_Kohana_Exception.php b/modules/gallery/libraries/MY_Kohana_Exception.php index b74c80b1..0c07ea5e 100644 --- a/modules/gallery/libraries/MY_Kohana_Exception.php +++ b/modules/gallery/libraries/MY_Kohana_Exception.php @@ -23,7 +23,7 @@ class Kohana_Exception extends Kohana_Exception_Core { */ public static function text($e) { if ($e instanceof Kohana_404_Exception) { - return "File not found: " . Router::$complete_uri; + return "File not found: " . rawurlencode(Router::$complete_uri); } else { return sprintf( "%s [ %s ]: %s\n%s [ %s ]\n%s", -- cgit v1.2.3 From edb17db8cf6c747e89b3139aec738bb39a7999dc Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Jun 2012 12:47:44 -0700 Subject: Added access check - not really necesssary because we're only doing a redirect, but it's nice to be consistent. Follow-on for #1837. --- modules/image_block/controllers/image_block.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/image_block/controllers/image_block.php b/modules/image_block/controllers/image_block.php index 94024b3b..4956c08d 100644 --- a/modules/image_block/controllers/image_block.php +++ b/modules/image_block/controllers/image_block.php @@ -20,6 +20,7 @@ class Image_Block_Controller extends Controller { public function random($item_id) { $item = ORM::factory("item", $item_id); + access::required("view", $item); item::set_display_context_callback("Albums_Controller::get_display_context"); url::redirect($item->abs_url()); } -- cgit v1.2.3 From 37a0e9a710254602ab7f0f3bc29cdfb7ba6f130e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Jun 2012 13:47:00 -0700 Subject: Follow-on to 3caf3cc323cd25b002aa8e44d871d4677da7a029 for #1866 - harden one more place and update the test. --- modules/gallery/libraries/MY_Database.php | 2 +- modules/gallery/tests/Database_Test.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/gallery/libraries/MY_Database.php b/modules/gallery/libraries/MY_Database.php index fb54bfcd..4fbd62fd 100644 --- a/modules/gallery/libraries/MY_Database.php +++ b/modules/gallery/libraries/MY_Database.php @@ -58,7 +58,7 @@ abstract class Database extends Database_Core { $open_brace = strpos($sql, "{") + 1; $close_brace = strpos($sql, "}", $open_brace); $name = substr($sql, $open_brace, $close_brace - $open_brace); - $this->_table_names["{{$name}}"] = "{$prefix}$name"; + $this->_table_names["{{$name}}"] = "`{$prefix}$name`"; } else if (strpos($sql, "RENAME TABLE") === 0) { // Renaming a table; add it to the table cache. // You must use the form "TO {new_table_name}" exactly for this to work. diff --git a/modules/gallery/tests/Database_Test.php b/modules/gallery/tests/Database_Test.php index 55006abc..fa9e5370 100644 --- a/modules/gallery/tests/Database_Test.php +++ b/modules/gallery/tests/Database_Test.php @@ -106,7 +106,7 @@ class Database_Test extends Gallery_Unit_Test_Case { PRIMARY KEY (`id`), UNIQUE KEY(`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8"); - $expected = "CREATE TABLE IF NOT EXISTS g_test ( + $expected = "CREATE TABLE IF NOT EXISTS `g_test` ( `id` int(9) NOT NULL auto_increment, `name` varchar(32) NOT NULL, PRIMARY KEY (`id`), @@ -121,9 +121,9 @@ class Database_Test extends Gallery_Unit_Test_Case { " AND `right_ptr` <= 6)"; $sql = $db->add_table_prefixes($sql); - $expected = "UPDATE g_test SET `name` = '{test string}' " . + $expected = "UPDATE `g_test` SET `name` = '{test string}' " . "WHERE `item_id` IN " . - " (SELECT `id` FROM g_test " . + " (SELECT `id` FROM `g_test` " . " WHERE `left_ptr` >= 1 " . " AND `right_ptr` <= 6)"; @@ -133,7 +133,7 @@ class Database_Test extends Gallery_Unit_Test_Case { function prefix_replacement_for_rename_table_test() { $db = Database::instance("mock"); $this->assert_same( - "RENAME TABLE g_test TO g_new_test", + "RENAME TABLE `g_test` TO `g_new_test`", $db->add_table_prefixes("RENAME TABLE {test} TO {new_test}")); } -- cgit v1.2.3 From 8e74750dc22ea959261db5b424c8e5ab157c39e8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Jun 2012 13:54:33 -0700 Subject: Checkpoint XSS golden file --- modules/gallery/tests/xss_data.txt | 187 ++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 95 deletions(-) (limited to 'modules') diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 38042f85..2bfacb47 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -134,52 +134,51 @@ modules/gallery/views/admin_themes_buttonset.html.php 26 DIRTY_JS $info[ modules/gallery/views/admin_themes_buttonset.html.php 39 DIRTY_JS $info['discuss_url'] modules/gallery/views/admin_themes_preview.html.php 8 DIRTY_ATTR $url modules/gallery/views/error_404.html.php 14 DIRTY $login_form -modules/gallery/views/error_admin.html.php 178 DIRTY @gallery_block::get("platform_info") -modules/gallery/views/error_admin.html.php 179 DIRTY @gallery_block::get("stats") -modules/gallery/views/error_admin.html.php 184 DIRTY $type -modules/gallery/views/error_admin.html.php 184 DIRTY $code -modules/gallery/views/error_admin.html.php 187 DIRTY $message -modules/gallery/views/error_admin.html.php 190 DIRTY_ATTR $error_id -modules/gallery/views/error_admin.html.php 195 DIRTY Kohana_Exception::debug_path($file) -modules/gallery/views/error_admin.html.php 195 DIRTY $line -modules/gallery/views/error_admin.html.php 200 DIRTY_ATTR ($num==$line)?"highlight":"" -modules/gallery/views/error_admin.html.php 200 DIRTY $num -modules/gallery/views/error_admin.html.php 200 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) -modules/gallery/views/error_admin.html.php 212 DIRTY_ATTR $source_id -modules/gallery/views/error_admin.html.php 212 DIRTY_JS $source_id -modules/gallery/views/error_admin.html.php 212 DIRTY Kohana_Exception::debug_path($step["file"]) -modules/gallery/views/error_admin.html.php 212 DIRTY $step["line"] -modules/gallery/views/error_admin.html.php 214 DIRTY Kohana_Exception::debug_path($step["file"]) -modules/gallery/views/error_admin.html.php 214 DIRTY $step["line"] -modules/gallery/views/error_admin.html.php 221 DIRTY $step["function"] -modules/gallery/views/error_admin.html.php 222 DIRTY_ATTR $args_id -modules/gallery/views/error_admin.html.php 222 DIRTY_JS $args_id -modules/gallery/views/error_admin.html.php 226 DIRTY_ATTR $args_id -modules/gallery/views/error_admin.html.php 231 DIRTY $name -modules/gallery/views/error_admin.html.php 234 DIRTY Kohana_Exception::safe_dump($arg,$name) -modules/gallery/views/error_admin.html.php 242 DIRTY_ATTR $source_id -modules/gallery/views/error_admin.html.php 242 DIRTY_ATTR ($num==$step["line"])?"highlight":"" -modules/gallery/views/error_admin.html.php 242 DIRTY $num -modules/gallery/views/error_admin.html.php 242 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) -modules/gallery/views/error_admin.html.php 252 DIRTY_ATTR $env_id=$error_id."environment" -modules/gallery/views/error_admin.html.php 252 DIRTY_JS $env_id -modules/gallery/views/error_admin.html.php 254 DIRTY_ATTR $env_id -modules/gallery/views/error_admin.html.php 256 DIRTY_ATTR $env_id=$error_id."environment_included" -modules/gallery/views/error_admin.html.php 256 DIRTY_JS $env_id -modules/gallery/views/error_admin.html.php 256 DIRTY count($included) -modules/gallery/views/error_admin.html.php 257 DIRTY_ATTR $env_id -modules/gallery/views/error_admin.html.php 262 DIRTY Kohana_Exception::debug_path($file) -modules/gallery/views/error_admin.html.php 269 DIRTY_ATTR $env_id=$error_id."environment_loaded" -modules/gallery/views/error_admin.html.php 269 DIRTY_JS $env_id -modules/gallery/views/error_admin.html.php 269 DIRTY count($included) -modules/gallery/views/error_admin.html.php 270 DIRTY_ATTR $env_id -modules/gallery/views/error_admin.html.php 275 DIRTY Kohana_Exception::debug_path($file) -modules/gallery/views/error_admin.html.php 283 DIRTY_ATTR $env_id="$error_id.environment".strtolower($var) -modules/gallery/views/error_admin.html.php 284 DIRTY_JS $env_id -modules/gallery/views/error_admin.html.php 284 DIRTY $var -modules/gallery/views/error_admin.html.php 285 DIRTY_ATTR $env_id -modules/gallery/views/error_admin.html.php 291 DIRTY $key -modules/gallery/views/error_admin.html.php 295 DIRTY Kohana_Exception::safe_dump($value,$key) +modules/gallery/views/error_admin.html.php 179 DIRTY @gallery_block::get("platform_info") +modules/gallery/views/error_admin.html.php 180 DIRTY @gallery_block::get("stats") +modules/gallery/views/error_admin.html.php 185 DIRTY $type +modules/gallery/views/error_admin.html.php 185 DIRTY $code +modules/gallery/views/error_admin.html.php 191 DIRTY_ATTR $error_id +modules/gallery/views/error_admin.html.php 196 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 196 DIRTY $line +modules/gallery/views/error_admin.html.php 201 DIRTY_ATTR ($num==$line)?"highlight":"" +modules/gallery/views/error_admin.html.php 201 DIRTY $num +modules/gallery/views/error_admin.html.php 201 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) +modules/gallery/views/error_admin.html.php 213 DIRTY_ATTR $source_id +modules/gallery/views/error_admin.html.php 213 DIRTY_JS $source_id +modules/gallery/views/error_admin.html.php 213 DIRTY Kohana_Exception::debug_path($step["file"]) +modules/gallery/views/error_admin.html.php 213 DIRTY $step["line"] +modules/gallery/views/error_admin.html.php 215 DIRTY Kohana_Exception::debug_path($step["file"]) +modules/gallery/views/error_admin.html.php 215 DIRTY $step["line"] +modules/gallery/views/error_admin.html.php 222 DIRTY $step["function"] +modules/gallery/views/error_admin.html.php 223 DIRTY_ATTR $args_id +modules/gallery/views/error_admin.html.php 223 DIRTY_JS $args_id +modules/gallery/views/error_admin.html.php 227 DIRTY_ATTR $args_id +modules/gallery/views/error_admin.html.php 232 DIRTY $name +modules/gallery/views/error_admin.html.php 235 DIRTY Kohana_Exception::safe_dump($arg,$name) +modules/gallery/views/error_admin.html.php 243 DIRTY_ATTR $source_id +modules/gallery/views/error_admin.html.php 243 DIRTY_ATTR ($num==$step["line"])?"highlight":"" +modules/gallery/views/error_admin.html.php 243 DIRTY $num +modules/gallery/views/error_admin.html.php 243 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) +modules/gallery/views/error_admin.html.php 253 DIRTY_ATTR $env_id=$error_id."environment" +modules/gallery/views/error_admin.html.php 253 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 255 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 257 DIRTY_ATTR $env_id=$error_id."environment_included" +modules/gallery/views/error_admin.html.php 257 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 257 DIRTY count($included) +modules/gallery/views/error_admin.html.php 258 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 263 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 270 DIRTY_ATTR $env_id=$error_id."environment_loaded" +modules/gallery/views/error_admin.html.php 270 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 270 DIRTY count($included) +modules/gallery/views/error_admin.html.php 271 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 276 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 284 DIRTY_ATTR $env_id="$error_id.environment".strtolower($var) +modules/gallery/views/error_admin.html.php 285 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 285 DIRTY $var +modules/gallery/views/error_admin.html.php 286 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 292 DIRTY $key +modules/gallery/views/error_admin.html.php 296 DIRTY Kohana_Exception::safe_dump($value,$key) modules/gallery/views/form_uploadify.html.php 16 DIRTY_JS url::site("uploader/status/_S/_E") modules/gallery/views/form_uploadify.html.php 24 DIRTY_JS $flash_minimum_version modules/gallery/views/form_uploadify.html.php 28 DIRTY_JS url::file("lib/uploadify/uploadify.swf") @@ -188,7 +187,7 @@ modules/gallery/views/form_uploadify.html.php 31 DIRTY_JS implod modules/gallery/views/form_uploadify.html.php 33 DIRTY_JS url::file("lib/uploadify/cancel.png") modules/gallery/views/form_uploadify.html.php 34 DIRTY_JS $simultaneous_upload_limit modules/gallery/views/form_uploadify.html.php 35 DIRTY_JS $size_limit_bytes -modules/gallery/views/form_uploadify.html.php 162 DIRTY_ATTR request::protocol() +modules/gallery/views/form_uploadify.html.php 164 DIRTY_ATTR request::protocol() modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form")) modules/gallery/views/in_place_edit.html.php 3 DIRTY access::csrf_form_field() modules/gallery/views/in_place_edit.html.php 6 DIRTY form::input("input",$form["input"]," class=\"textbox\"") @@ -275,7 +274,6 @@ modules/gallery/views/upgrader.html.php 123 DIRTY_ATTR $don modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected) modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true)) modules/gallery/views/user_profile.html.php 43 DIRTY $info->view -modules/image_block/views/image_block_block.html.php 4 DIRTY_JS $item->url() modules/image_block/views/image_block_block.html.php 5 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) modules/info/views/info_block.html.php 5 DIRTY $info["label"] modules/info/views/info_block.html.php 5 DIRTY $info["value"] @@ -290,7 +288,7 @@ modules/notification/views/item_updated.html.php 20 DIRTY $item- modules/notification/views/user_profile_notification.html.php 5 DIRTY_ATTR $subscription->id modules/notification/views/user_profile_notification.html.php 6 DIRTY_JS $subscription->url modules/organize/views/organize_dialog.html.php 8 DIRTY_JS url::site("items/__ID__") -modules/organize/views/organize_dialog.html.php 14 DIRTY_JS $album->title +modules/organize/views/organize_dialog.html.php 14 DIRTY_JS html::clean($album->title) modules/organize/views/organize_frame.html.php 12 DIRTY_JS url::file("modules/organize/vendor/ext/images/default/s.gif") modules/organize/views/organize_frame.html.php 56 DIRTY_JS url::site("organize/album_info/__ID__") modules/organize/views/organize_frame.html.php 94 DIRTY_JS access::csrf_token() @@ -304,7 +302,7 @@ modules/organize/views/organize_frame.html.php 410 DIRTY_JS url::s modules/organize/views/organize_frame.html.php 468 DIRTY_JS url::site("organize/reparent") modules/organize/views/organize_frame.html.php 491 DIRTY_JS access::csrf_token() modules/organize/views/organize_frame.html.php 507 DIRTY_JS access::can("edit",item::root()) -modules/organize/views/organize_frame.html.php 509 DIRTY_JS item::root()->title +modules/organize/views/organize_frame.html.php 509 DIRTY_JS html::clean(item::root()->title) modules/organize/views/organize_frame.html.php 511 DIRTY_JS item::root()->id modules/organize/views/organize_frame.html.php 519 DIRTY_JS $album->id modules/organize/views/organize_frame.html.php 520 DIRTY_JS $album->id @@ -319,7 +317,7 @@ modules/rss/views/feed.mrss.php 16 DIRTY_JS $feed- modules/rss/views/feed.mrss.php 19 DIRTY_JS $feed->next_page_uri modules/rss/views/feed.mrss.php 21 DIRTY $pub_date modules/rss/views/feed.mrss.php 22 DIRTY $pub_date -modules/rss/views/feed.mrss.php 28 DIRTY date("D, d M Y H:i:s T",$item->created); +modules/rss/views/feed.mrss.php 28 DIRTY date("D, d M Y H:i:s O",$item->created); modules/rss/views/feed.mrss.php 35 DIRTY_ATTR $item->resize_url(true) modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $item->resize_height modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $item->resize_width @@ -342,8 +340,9 @@ modules/rss/views/feed.mrss.php 69 DIRTY_ATTR $ite modules/rss/views/rss_block.html.php 6 DIRTY_JS rss::url($url) modules/search/views/search.html.php 27 DIRTY_ATTR $item_class modules/search/views/search.html.php 28 DIRTY_JS $item->url() -modules/search/views/search.html.php 29 DIRTY $item->thumb_img() -modules/search/views/search.html.php 40 DIRTY $theme->paginator() +modules/search/views/search.html.php 29 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) +modules/search/views/search.html.php 31 DIRTY_ATTR $item_class +modules/search/views/search.html.php 41 DIRTY $theme->paginator() modules/server_add/views/admin_server_add.html.php 8 DIRTY_JS url::site("__ARGS__") modules/server_add/views/admin_server_add.html.php 19 DIRTY $form modules/server_add/views/admin_server_add.html.php 30 DIRTY_ATTR $id @@ -379,22 +378,22 @@ modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url -themes/admin_wind/views/admin.html.php 4 DIRTY $theme->html_attributes() -themes/admin_wind/views/admin.html.php 34 DIRTY $theme->admin_head() -themes/admin_wind/views/admin.html.php 46 DIRTY_JS $theme->url() -themes/admin_wind/views/admin.html.php 51 DIRTY $theme->get_combined("css") -themes/admin_wind/views/admin.html.php 54 DIRTY $theme->get_combined("script") -themes/admin_wind/views/admin.html.php 58 DIRTY $theme->admin_page_top() -themes/admin_wind/views/admin.html.php 66 DIRTY $theme->admin_header_top() -themes/admin_wind/views/admin.html.php 67 DIRTY_JS item::root()->url() -themes/admin_wind/views/admin.html.php 70 DIRTY $theme->user_menu() -themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_menu() -themes/admin_wind/views/admin.html.php 76 DIRTY $theme->admin_header_bottom() -themes/admin_wind/views/admin.html.php 83 DIRTY $content -themes/admin_wind/views/admin.html.php 89 DIRTY $sidebar -themes/admin_wind/views/admin.html.php 94 DIRTY $theme->admin_footer() -themes/admin_wind/views/admin.html.php 97 DIRTY $theme->admin_credits() -themes/admin_wind/views/admin.html.php 102 DIRTY $theme->admin_page_bottom() +themes/admin_wind/views/admin.html.php 5 DIRTY $theme->html_attributes() +themes/admin_wind/views/admin.html.php 35 DIRTY $theme->admin_head() +themes/admin_wind/views/admin.html.php 47 DIRTY_JS $theme->url() +themes/admin_wind/views/admin.html.php 52 DIRTY $theme->get_combined("css") +themes/admin_wind/views/admin.html.php 55 DIRTY $theme->get_combined("script") +themes/admin_wind/views/admin.html.php 59 DIRTY $theme->admin_page_top() +themes/admin_wind/views/admin.html.php 67 DIRTY $theme->admin_header_top() +themes/admin_wind/views/admin.html.php 68 DIRTY_JS item::root()->url() +themes/admin_wind/views/admin.html.php 71 DIRTY $theme->user_menu() +themes/admin_wind/views/admin.html.php 74 DIRTY $theme->admin_menu() +themes/admin_wind/views/admin.html.php 77 DIRTY $theme->admin_header_bottom() +themes/admin_wind/views/admin.html.php 84 DIRTY $content +themes/admin_wind/views/admin.html.php 90 DIRTY $sidebar +themes/admin_wind/views/admin.html.php 95 DIRTY $theme->admin_footer() +themes/admin_wind/views/admin.html.php 98 DIRTY $theme->admin_credits() +themes/admin_wind/views/admin.html.php 103 DIRTY $theme->admin_page_bottom() themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/admin_wind/views/block.html.php 5 DIRTY $id themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id @@ -404,13 +403,13 @@ themes/admin_wind/views/paginator.html.php 35 DIRTY_JS $first themes/admin_wind/views/paginator.html.php 44 DIRTY_JS $previous_page_url themes/admin_wind/views/paginator.html.php 70 DIRTY_JS $next_page_url themes/admin_wind/views/paginator.html.php 79 DIRTY_JS $last_page_url -themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id -themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class -themes/wind/views/album.html.php 18 DIRTY_JS $child->url() -themes/wind/views/album.html.php 20 DIRTY $child->thumb_img(array("class"=>"g-thumbnail")) -themes/wind/views/album.html.php 25 DIRTY_ATTR $item_class -themes/wind/views/album.html.php 26 DIRTY_JS $child->url() -themes/wind/views/album.html.php 44 DIRTY $theme->paginator() +themes/wind/views/album.html.php 19 DIRTY_ATTR $child->id +themes/wind/views/album.html.php 19 DIRTY_ATTR $item_class +themes/wind/views/album.html.php 21 DIRTY_JS $child->url() +themes/wind/views/album.html.php 23 DIRTY $child->thumb_img(array("class"=>"g-thumbnail")) +themes/wind/views/album.html.php 28 DIRTY_ATTR $item_class +themes/wind/views/album.html.php 29 DIRTY_JS $child->url() +themes/wind/views/album.html.php 47 DIRTY $theme->paginator() themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id themes/wind/views/block.html.php 6 DIRTY $title @@ -424,25 +423,23 @@ themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $chi themes/wind/views/dynamic.html.php 29 DIRTY $theme->paginator() themes/wind/views/movie.html.php 5 DIRTY $theme->paginator() themes/wind/views/movie.html.php 9 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) -themes/wind/views/page.html.php 4 DIRTY $theme->html_attributes() -themes/wind/views/page.html.php 10 DIRTY $page_title -themes/wind/views/page.html.php 13 DIRTY $theme->item()->title -themes/wind/views/page.html.php 17 DIRTY item::root()->title -themes/wind/views/page.html.php 32 DIRTY $new_width -themes/wind/views/page.html.php 33 DIRTY $new_height -themes/wind/views/page.html.php 34 DIRTY $thumb_proportion -themes/wind/views/page.html.php 74 DIRTY_JS $theme->url() -themes/wind/views/page.html.php 79 DIRTY $theme->get_combined("css") -themes/wind/views/page.html.php 82 DIRTY $theme->get_combined("script") -themes/wind/views/page.html.php 92 DIRTY $header_text -themes/wind/views/page.html.php 94 DIRTY_JS item::root()->url() -themes/wind/views/page.html.php 98 DIRTY $theme->user_menu() -themes/wind/views/page.html.php 113 DIRTY_ATTR $breadcrumb->last?"g-active":"" -themes/wind/views/page.html.php 114 DIRTY_ATTR $breadcrumb->first?"g-first":"" -themes/wind/views/page.html.php 115 DIRTY_JS $breadcrumb->url -themes/wind/views/page.html.php 128 DIRTY $content -themes/wind/views/page.html.php 134 DIRTY newView("sidebar.html") -themes/wind/views/page.html.php 141 DIRTY $footer_text +themes/wind/views/page.html.php 5 DIRTY $theme->html_attributes() +themes/wind/views/page.html.php 11 DIRTY $page_title +themes/wind/views/page.html.php 33 DIRTY $new_width +themes/wind/views/page.html.php 34 DIRTY $new_height +themes/wind/views/page.html.php 35 DIRTY $thumb_proportion +themes/wind/views/page.html.php 75 DIRTY_JS $theme->url() +themes/wind/views/page.html.php 80 DIRTY $theme->get_combined("css") +themes/wind/views/page.html.php 83 DIRTY $theme->get_combined("script") +themes/wind/views/page.html.php 93 DIRTY $header_text +themes/wind/views/page.html.php 95 DIRTY_JS item::root()->url() +themes/wind/views/page.html.php 99 DIRTY $theme->user_menu() +themes/wind/views/page.html.php 114 DIRTY_ATTR $breadcrumb->last?"g-active":"" +themes/wind/views/page.html.php 115 DIRTY_ATTR $breadcrumb->first?"g-first":"" +themes/wind/views/page.html.php 116 DIRTY_JS $breadcrumb->url +themes/wind/views/page.html.php 129 DIRTY $content +themes/wind/views/page.html.php 135 DIRTY newView("sidebar.html") +themes/wind/views/page.html.php 142 DIRTY $footer_text themes/wind/views/paginator.html.php 33 DIRTY_JS $first_page_url themes/wind/views/paginator.html.php 42 DIRTY_JS $previous_page_url themes/wind/views/paginator.html.php 70 DIRTY_JS $next_page_url -- cgit v1.2.3 From e4daa4283035197136850ae2c409dffc79fa8459 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 11 Jun 2012 14:02:23 -0700 Subject: Rename the comparator to something that makes more sense (to me), and make it static. Follow-on to 5d9e71741754809ebe5f543eb874634e6fc8cc9d for #1859. --- modules/gallery/helpers/module.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 7292b106..e4f41d3d 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -110,16 +110,20 @@ class module_Core { $identity_module = module::get_var("gallery", "identity_provider", "user"); $modules->$identity_module->locked = true; - function natural_name_sort($a, $b) { - return strnatcasecmp($a->name, $b->name); - } - $modules->uasort('natural_name_sort'); + $modules->uasort(array("module", "module_comparator")); self::$available = $modules; } return self::$available; } + /** + * Natural name sort comparator + */ + static function module_comparator($a, $b) { + return strnatcasecmp($a->name, $b->name); + } + /** * Return a list of all the active modules in no particular order. */ -- cgit v1.2.3