From c37288f0b24c19813405096c087ab0c7c171c358 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 14 Apr 2013 00:21:47 -0400 Subject: Sanitize all key values. --- modules/gallery/views/error_admin.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/error_admin.html.php b/modules/gallery/views/error_admin.html.php index cd1bd569..036e2049 100644 --- a/modules/gallery/views/error_admin.html.php +++ b/modules/gallery/views/error_admin.html.php @@ -289,7 +289,7 @@ - + -- cgit v1.2.3 From 27b009e66513b9b50eb2bec1de24126a3f98e717 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 13 Apr 2013 21:22:47 -0700 Subject: Automated update of .build_number to 404 for branch master Last update: 1eab94f6062b5f54ea5d9db01d968e7195f3de9d (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index dcf521e5..42f23b2e 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=403 +build_number=404 -- cgit v1.2.3 From 9b1c6ab14f8a7c6024795d213f55ea31ac77c480 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 14 Apr 2013 00:28:29 -0400 Subject: Golden file update follow-on for c37288f0b24c19813405096c087ab0c7c171c358 --- modules/gallery/tests/xss_data.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 2152858a..d3d96878 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -177,7 +177,6 @@ modules/gallery/views/error_admin.html.php 284 DIRTY_ATTR $env 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 -- cgit v1.2.3 From 0b307a40dec7e9f430c2dea6fcf8593598d90b15 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 13 Apr 2013 21:28:55 -0700 Subject: Automated update of .build_number to 405 for branch master Last update: 27b009e66513b9b50eb2bec1de24126a3f98e717 (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 42f23b2e..56d97fd3 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=404 +build_number=405 -- cgit v1.2.3 From 0f28d4cee460dfada48bd6c81470db62e48b16d0 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 20 Apr 2013 10:09:03 +0200 Subject: Ensure that movie titles are purified upon display. --- modules/gallery/controllers/movies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php index ca332f67..56075710 100644 --- a/modules/gallery/controllers/movies.php +++ b/modules/gallery/controllers/movies.php @@ -67,7 +67,7 @@ class Movies_Controller extends Items_Controller { log::success("content", "Updated movie", "url()}\">view"); message::success( - t("Saved movie %movie_title", array("movie_title" => $movie->title))); + t("Saved movie %movie_title", array("movie_title" => html::purify($movie->title)))); if ($form->from_id->value == $movie->id) { // Use the new url; it might have changed. -- cgit v1.2.3 From 269927b27c7ea25193c4da29db17539eb3d92d50 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Thu, 2 May 2013 21:37:34 -0700 Subject: Automated update of .build_number to 406 for branch master Last update: 0b307a40dec7e9f430c2dea6fcf8593598d90b15 (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 56d97fd3..6a09d60a 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=405 +build_number=406 -- cgit v1.2.3 From ce97f5ff264aa34e74a98bae3ff23678a1ddde75 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 5 May 2013 08:42:48 -0700 Subject: There is no $g2_album_id here I assume this should be $g2_album->getId() instead --- modules/g2_import/helpers/g2_import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index b155a88a..82850e85 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -498,7 +498,7 @@ class g2_import_Core { $album->description = self::_decode_html_special_chars(self::extract_description($g2_album)); $album->owner_id = self::map($g2_album->getOwnerId()); try { - $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id)); + $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album->getId())); } catch (Exception $e) { // @todo log $album->view_count = 0; -- cgit v1.2.3 From f2def7778df20041d1d94a6eda40074f77c54872 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 5 May 2013 08:46:46 -0700 Subject: valid::url() only takes 1 arg --- system/helpers/remote.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/remote.php b/system/helpers/remote.php index d34899ec..e6edb9c5 100644 --- a/system/helpers/remote.php +++ b/system/helpers/remote.php @@ -11,7 +11,7 @@ class remote_Core { public static function status($url) { - if ( ! valid::url($url, 'http')) + if ( ! valid::url($url)) return FALSE; // Get the hostname and path -- cgit v1.2.3 From 0c2d2b25fa7eb738d0a7491a793b2539a2dc4721 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 5 May 2013 08:49:44 -0700 Subject: How did this ever work? :) --- system/libraries/drivers/Cache/Xcache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/libraries/drivers/Cache/Xcache.php b/system/libraries/drivers/Cache/Xcache.php index 4c08405e..67619833 100644 --- a/system/libraries/drivers/Cache/Xcache.php +++ b/system/libraries/drivers/Cache/Xcache.php @@ -48,9 +48,9 @@ class Cache_Xcache_Driver extends Cache_Driver { foreach ($keys as $key) { - if (xcache_isset($id)) + if (xcache_isset($key)) { - $items[$key] = xcache_get($id); + $items[$key] = xcache_get($key); } else { -- cgit v1.2.3 From 90528d9c83b74518c0a2293802b93fa03da40345 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 7 May 2013 18:46:43 +0200 Subject: #2065 - Fix problems with double-ajaxifying of dialogs. Change all jQuery-ui widget _init() functions to _create() functions. --- lib/gallery.ajax.js | 2 +- lib/gallery.dialog.js | 2 +- lib/gallery.in_place_edit.js | 2 +- lib/gallery.panel.js | 2 +- modules/server_add/js/server_add.js | 2 +- modules/user/js/password_strength.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/gallery.ajax.js b/lib/gallery.ajax.js index 08f1fede..898bbd79 100644 --- a/lib/gallery.ajax.js +++ b/lib/gallery.ajax.js @@ -1,6 +1,6 @@ (function($) { $.widget("ui.gallery_ajax", { - _init: function() { + _create: function() { this.element.click(function(event) { eval("var ajax_handler = " + $(event.currentTarget).attr("data-ajax-handler")); $.get($(event.currentTarget).attr("href"), function(data) { diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 1c810171..6b4cd68d 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -7,7 +7,7 @@ resizable: false, position: "center" }, - _init: function() { + _create: function() { var self = this; if (!self.options.immediate) { this.element.click(function(event) { diff --git a/lib/gallery.in_place_edit.js b/lib/gallery.in_place_edit.js index 86a58856..560f86fa 100644 --- a/lib/gallery.in_place_edit.js +++ b/lib/gallery.in_place_edit.js @@ -2,7 +2,7 @@ $.widget("ui.gallery_in_place_edit", { options: {}, - _init: function() { + _create: function() { var self = this; this.element.click(function(event) { event.preventDefault(); diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 877faf64..7b2460a4 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -1,6 +1,6 @@ (function($) { $.widget("ui.gallery_panel", { - _init: function() { + _create: function() { var self = this; this.element.click(function(event) { event.preventDefault(); diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index a2499896..59901734 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -1,6 +1,6 @@ (function($) { $.widget("ui.gallery_server_add", { - _init: function() { + _create: function() { var self = this; $("#g-server-add-add-button", this.element).click(function(event) { event.preventDefault(); diff --git a/modules/user/js/password_strength.js b/modules/user/js/password_strength.js index c5fccc68..742db0ca 100644 --- a/modules/user/js/password_strength.js +++ b/modules/user/js/password_strength.js @@ -9,7 +9,7 @@ 'g-password-strength100'] }, - _init: function() { + _create: function() { var self = this; $(this.element).on("input keyup", function() { var strength = self.calculateStrength(this.value); -- cgit v1.2.3 From 9f8435c7f5665f153407c2b1476dadc0a3ba34a1 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Tue, 7 May 2013 10:46:17 -0700 Subject: Automated update of .build_number to 407 for branch master Last update: 269927b27c7ea25193c4da29db17539eb3d92d50 (2 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 6a09d60a..eb8d5b69 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=406 +build_number=407 -- cgit v1.2.3 From 80bb0f2222dd99ed2ce59e804b833bab63cc376a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 May 2013 01:40:46 -0400 Subject: Strip URL fragments off of direct requests to uploadify SWF files. Fixes #2068. --- lib/uploadify/jquery.uploadify.min.js | 64 ++++++++++++++++++++-------------- lib/uploadify/uploadify.allglyphs.php | 27 ++++++++++++++ lib/uploadify/uploadify.allglyphs.swf | Bin 239838 -> 0 bytes lib/uploadify/uploadify.php | 27 ++++++++++++++ lib/uploadify/uploadify.swf | Bin 23118 -> 0 bytes 5 files changed, 91 insertions(+), 27 deletions(-) create mode 100644 lib/uploadify/uploadify.allglyphs.php delete mode 100644 lib/uploadify/uploadify.allglyphs.swf create mode 100644 lib/uploadify/uploadify.php delete mode 100644 lib/uploadify/uploadify.swf diff --git a/lib/uploadify/jquery.uploadify.min.js b/lib/uploadify/jquery.uploadify.min.js index 17127a71..c7edbeb1 100644 --- a/lib/uploadify/jquery.uploadify.min.js +++ b/lib/uploadify/jquery.uploadify.min.js @@ -1,27 +1,37 @@ - -if(jQuery)(function(jQuery){jQuery.extend(jQuery.fn,{uploadify:function(options){jQuery(this).each(function(){settings=jQuery.extend({id:jQuery(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(){}},options);var pagePath=location.pathname;pagePath=pagePath.split('/');pagePath.pop();pagePath=pagePath.join('/')+'/';var data={};data.uploadifyID=settings.id;data.pagepath=pagePath;if(settings.buttonImg)data.buttonImg=escape(settings.buttonImg);if(settings.buttonText)data.buttonText=escape(settings.buttonText);if(settings.rollover)data.rollover=true;data.script=settings.script;data.folder=escape(settings.folder);if(settings.scriptData){var scriptDataString='';for(var name in settings.scriptData){scriptDataString+='&'+name+'='+settings.scriptData[name];} -data.scriptData=escape(scriptDataString.substr(1));} -data.width=settings.width;data.height=settings.height;data.wmode=settings.wmode;data.method=settings.method;data.queueSizeLimit=settings.queueSizeLimit;data.simUploadLimit=settings.simUploadLimit;if(settings.hideButton)data.hideButton=true;if(settings.fileDesc)data.fileDesc=settings.fileDesc;if(settings.fileExt)data.fileExt=settings.fileExt;if(settings.multi)data.multi=true;if(settings.auto)data.auto=true;if(settings.sizeLimit)data.sizeLimit=settings.sizeLimit;if(settings.checkScript)data.checkScript=settings.checkScript;if(settings.fileDataName)data.fileDataName=settings.fileDataName;if(settings.queueID)data.queueID=settings.queueID;if(settings.onInit()!==false){jQuery(this).css('display','none');jQuery(this).after('
');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'),swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,b,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess}),!1==settings.queueID&&a("#"+a(this).attr("id")+ +"Uploader").after('
'));"function"==typeof settings.onOpen&&a(this).bind("uploadifyOpen",settings.onOpen);a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(k,d,b){if(!1!==k.data.action(k,d,b)){var c=0.01*Math.round(100*(b.size/1024)),h="KB";1E3\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\x3c!--Progress Bar--\x3e
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t');a("div#"+a(this).attr("id")+d+" span.fileName").text(fileName+" ("+c+h+")")}});"function"==typeof settings.onSelectOnce&&a(this).bind("uploadifySelectOnce",settings.onSelectOnce);a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(a,b){!1!==a.data.action(a,b)&&alert("The queue is full. The max size is "+b+".")});a(this).bind("uploadifyCheckExist", +{action:settings.onCheck},function(b,d,m,c,h){var e={},e=m;e.folder=f+c;if(h)for(var g in m)var j=g;a.post(d,e,function(f){for(var e in f)!1!==b.data.action(b,d,m,c,h)&&(confirm("Do you want to replace the file "+f[e]+"?")||document.getElementById(a(b.target).attr("id")+"Uploader").cancelFileUpload(e,!0,!0));h?document.getElementById(a(b.target).attr("id")+"Uploader").startFileUpload(j,!0):document.getElementById(a(b.target).attr("id")+"Uploader").startFileUpload(null,!0)},"json")});a(this).bind("uploadifyCancel", +{action:settings.onCancel},function(b,d,f,c,e){!1!==b.data.action(b,d,f,c,e)&&a("#"+a(this).attr("id")+d).fadeOut(!0==e?0:250,function(){a(this).remove()})});"function"==typeof settings.onClearQueue&&a(this).bind("uploadifyClearQueue",settings.onClearQueue);var l=[];a(this).bind("uploadifyError",{action:settings.onError},function(b,d,e,c){!1!==b.data.action(b,d,e,c)&&(l.push([d,e,c]),a("#"+a(this).attr("id")+d+" .percentage").text(" - "+c.type+" Error"),a("#"+a(this).attr("id")+d).addClass("uploadifyError"))}); +a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(b,d,e,c){!1!==b.data.action(b,d,e,c)&&(a("#"+a(this).attr("id")+d+"ProgressBar").css("width",c.percentage+"%"),"percentage"==b.data.toDisplay&&(displayData=" - "+c.percentage+"%"),"speed"==b.data.toDisplay&&(displayData=" - "+c.speed+"KB/s"),null==b.data.toDisplay&&(displayData=" "),a("#"+a(this).attr("id")+d+" .percentage").text(displayData))});a(this).bind("uploadifyComplete",{action:settings.onComplete}, +function(b,d,e,c,f){!1!==b.data.action(b,d,e,unescape(c),f)&&(a("#"+a(this).attr("id")+d+" .percentage").text(" - Completed"),a("#"+a(this).attr("id")+d).fadeOut(250,function(){a(this).remove()}))});"function"==typeof settings.onAllComplete&&a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(a,b){!1!==a.data.action(a,b)&&(l=[])})})},uploadifySettings:function(e,f,b){var g=!1;a(this).each(function(){if("scriptData"==e&&null!=f){var d=b?f:a.extend(settings.scriptData,f),c= +"",h;for(h in d)c+="&"+h+"="+escape(d[h]);f=c.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(e,f)});if(null==f){if("scriptData"==e){for(var j=unescape(g).split("&"),l={},k=0;k Date: Wed, 8 May 2013 22:41:26 -0700 Subject: Automated update of .build_number to 408 for branch master Last update: 9f8435c7f5665f153407c2b1476dadc0a3ba34a1 (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index eb8d5b69..8e697f6d 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=407 +build_number=408 -- cgit v1.2.3 From 5a85bbaf182c08a7b186b3c0fa931fb833454dee Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 May 2013 15:35:17 -0400 Subject: Follow-on: put at least one byte in the fragment so that it doesn't get discarded by browsers. --- lib/uploadify/uploadify.allglyphs.php | 2 +- lib/uploadify/uploadify.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uploadify/uploadify.allglyphs.php b/lib/uploadify/uploadify.allglyphs.php index b9bd2713..68db0dcc 100644 --- a/lib/uploadify/uploadify.allglyphs.php +++ b/lib/uploadify/uploadify.allglyphs.php @@ -5,7 +5,7 @@ if (empty($_GET["token"])) { // We have not yet redirected $rand = rand(); setcookie("uploadify_token", $rand); - header("Location: uploadify.allglyphs.php?token=$rand#"); + header("Location: uploadify.allglyphs.php?token=$rand#."); exit; } diff --git a/lib/uploadify/uploadify.php b/lib/uploadify/uploadify.php index eac15d3a..8ea78d81 100644 --- a/lib/uploadify/uploadify.php +++ b/lib/uploadify/uploadify.php @@ -5,7 +5,7 @@ if (empty($_GET["token"])) { // We have not yet redirected $rand = rand(); setcookie("uploadify_token", $rand); - header("Location: uploadify.php?token=$rand#"); + header("Location: uploadify.php?token=$rand#."); exit; } -- cgit v1.2.3 From d5fbd672954ec287bf5ecf080011d876d5238bfc Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Thu, 9 May 2013 12:38:11 -0700 Subject: Automated update of .build_number to 409 for branch master Last update: 9f8435c7f5665f153407c2b1476dadc0a3ba34a1 (3 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 8e697f6d..6cd3b968 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=408 +build_number=409 -- cgit v1.2.3 From c9627210165e7fc0ff9a2bf00c435d50a013e13f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 May 2013 16:01:57 -0400 Subject: Add the proper Gallery preamble. --- lib/uploadify/uploadify.allglyphs.php | 21 ++++++++++++++++++++- lib/uploadify/uploadify.php | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/lib/uploadify/uploadify.allglyphs.php b/lib/uploadify/uploadify.allglyphs.php index 68db0dcc..e784b9b0 100644 --- a/lib/uploadify/uploadify.allglyphs.php +++ b/lib/uploadify/uploadify.allglyphs.php @@ -1,4 +1,23 @@ - Date: Thu, 9 May 2013 13:04:39 -0700 Subject: Automated update of .build_number to 410 for branch master Last update: 9f8435c7f5665f153407c2b1476dadc0a3ba34a1 (5 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 6cd3b968..8c783309 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=409 +build_number=410 -- cgit v1.2.3 From e4a3abdd207cce37c4f71ed87d0c420ec8539775 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 May 2013 20:04:01 -0400 Subject: Change upload code to use new uploadify urls. --- modules/gallery/tests/xss_data.txt | 2 +- modules/gallery/views/form_uploadify.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index d3d96878..8504de3a 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -180,7 +180,7 @@ modules/gallery/views/error_admin.html.php 286 DIRTY_ATTR $env 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") +modules/gallery/views/form_uploadify.html.php 28 DIRTY_JS url::file("lib/uploadify/uploadify.php") modules/gallery/views/form_uploadify.html.php 29 DIRTY_JS url::site("uploader/add_photo/{$album->id}") modules/gallery/views/form_uploadify.html.php 31 DIRTY_JS implode(";",$extensions) modules/gallery/views/form_uploadify.html.php 33 DIRTY_JS url::file("lib/uploadify/cancel.png") diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index c13e3418..4963d185 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -25,7 +25,7 @@ $("#g-uploadify").uploadify({ width: 298, height: 32, - uploader: "", + uploader: "", script: "id}") ?>", scriptData: , fileExt: "", -- cgit v1.2.3 From 07af91e05d8d48209facec4cc3fe54c92e2f463e Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Thu, 9 May 2013 17:04:54 -0700 Subject: Automated update of .build_number to 411 for branch master Last update: 9f8435c7f5665f153407c2b1476dadc0a3ba34a1 (7 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 8c783309..86e2c250 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=410 +build_number=411 -- cgit v1.2.3 From b6ad4157d1aae5849ad5608b90c62f1acf22e1a9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 9 May 2013 20:09:15 -0400 Subject: Get rid of the security preamble - we intend for these files to be directly accessible. --- lib/uploadify/uploadify.allglyphs.php | 2 +- lib/uploadify/uploadify.php | 2 +- modules/gallery/tests/File_Structure_Test.php | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/uploadify/uploadify.allglyphs.php b/lib/uploadify/uploadify.allglyphs.php index e784b9b0..18b75a50 100644 --- a/lib/uploadify/uploadify.allglyphs.php +++ b/lib/uploadify/uploadify.allglyphs.php @@ -1,4 +1,4 @@ - Date: Thu, 9 May 2013 17:10:21 -0700 Subject: Automated update of .build_number to 412 for branch master Last update: 07af91e05d8d48209facec4cc3fe54c92e2f463e (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 86e2c250..c75e229d 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=411 +build_number=412 -- cgit v1.2.3 From 2ebe38b148da8830f2b4064bb738633c511c97cc Mon Sep 17 00:00:00 2001 From: shadlaws Date: Tue, 14 May 2013 13:35:09 +0200 Subject: #2069 - Change "Fix your Gallery" task go faster and be more comprehensive. - optimize MPTT pointer rebuilding for leaf nodes (i.e. non-albums). - reverse order_by to try and preserve existing tree ordering. - reset item level while we're here. - use "$stack[] = 123" instead of array_push($stack, 123) since it's faster. --HG-- extra : source : 297e4c0eccc5a7940224ff8e908b366e83017354 --- modules/gallery/helpers/gallery_task.php | 50 ++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index a79cb2d5..ac98831b 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -398,42 +398,60 @@ class gallery_task_Core { switch ($state) { case self::FIX_STATE_START_MPTT: $task->set("ptr", $ptr = 1); - $task->set("stack", item::root()->id . ":L"); + $task->set("stack", item::root()->id . ":album:1:L"); $state = self::FIX_STATE_RUN_MPTT; break; case self::FIX_STATE_RUN_MPTT: $ptr = $task->get("ptr"); $stack = explode(" ", $task->get("stack")); - list ($id, $ptr_mode) = explode(":", array_pop($stack)); + list ($id, $type, $level, $ptr_mode) = explode(":", array_pop($stack)); if ($ptr_mode == "L") { - $stack[] = "$id:R"; - db::build() - ->update("items") - ->set("left_ptr", $ptr++) - ->where("id", "=", $id) - ->execute(); + if ($type == "album") { + // Albums could be parent nodes. + $stack[] = "$id:$type:$level:R"; + db::build() + ->update("items") + ->set("left_ptr", $ptr++) + ->where("id", "=", $id) + ->execute(); - foreach (db::build() - ->select(array("id")) - ->from("items") - ->where("parent_id", "=", $id) - ->order_by("left_ptr", "ASC") - ->execute() as $child) { - array_push($stack, "{$child->id}:L"); + $level++; + foreach (db::build() + ->select(array("id", "type")) + ->from("items") + ->where("parent_id", "=", $id) + ->order_by("left_ptr", "DESC") // DESC since array_pop effectively reverses them + ->execute() as $child) { + $stack[] = "{$child->id}:{$child->type}:$level:L"; + } + $completed++; + } else { + // Non-albums must be leaf nodes. + db::build() + ->update("items") + ->set("left_ptr", $ptr++) + ->set("right_ptr", $ptr++) + ->set("level", $level) + ->set("relative_path_cache", null) + ->set("relative_url_cache", null) + ->where("id", "=", $id) + ->execute(); + $completed += 2; // we updated two pointers } } else if ($ptr_mode == "R") { db::build() ->update("items") ->set("right_ptr", $ptr++) + ->set("level", $level) ->set("relative_path_cache", null) ->set("relative_url_cache", null) ->where("id", "=", $id) ->execute(); + $completed++; } $task->set("ptr", $ptr); $task->set("stack", implode(" ", $stack)); - $completed++; if (empty($stack)) { $state = self::FIX_STATE_START_DUPE_SLUGS; -- cgit v1.2.3 From 666f3a30e2e7ad620d50740d76364eac1c23053b Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Tue, 14 May 2013 04:48:37 -0700 Subject: Automated update of .build_number to 413 for branch master Last update: 4d8fbd1b9d61463ed255b3a73e6e6b3574d97923 (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index c75e229d..252bfbf7 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=412 +build_number=413 -- cgit v1.2.3 From 6f922ca427ff94937904979d02e6fba063effd77 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Wed, 15 May 2013 11:16:46 +0200 Subject: Follow-on to #2069 - Decrease stack size of MPTT rebuild task. This reduces the likelihood that we'll hit a limit with gargantuan galleries. --HG-- extra : source : c4a118d43145a2a4ec9b934d3aebe8f9458bcf07 --- modules/gallery/helpers/gallery_task.php | 70 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index ac98831b..618cf8fd 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -398,48 +398,50 @@ class gallery_task_Core { switch ($state) { case self::FIX_STATE_START_MPTT: $task->set("ptr", $ptr = 1); - $task->set("stack", item::root()->id . ":album:1:L"); + $task->set("stack", item::root()->id . "L1"); $state = self::FIX_STATE_RUN_MPTT; break; case self::FIX_STATE_RUN_MPTT: $ptr = $task->get("ptr"); $stack = explode(" ", $task->get("stack")); - list ($id, $type, $level, $ptr_mode) = explode(":", array_pop($stack)); - if ($ptr_mode == "L") { - if ($type == "album") { - // Albums could be parent nodes. - $stack[] = "$id:$type:$level:R"; - db::build() - ->update("items") - ->set("left_ptr", $ptr++) - ->where("id", "=", $id) - ->execute(); + preg_match("/([0-9]+)([A-Z])([0-9]+)/", array_pop($stack), $matches); // e.g. "12345L10" + list ( , $id, $ptr_mode, $level) = $matches; // Skip the 0th entry of matches. + switch ($ptr_mode) { + case "L": + // Albums could be parent nodes. + $stack[] = "{$id}R{$level}"; + db::build() + ->update("items") + ->set("left_ptr", $ptr++) + ->where("id", "=", $id) + ->execute(); - $level++; - foreach (db::build() - ->select(array("id", "type")) - ->from("items") - ->where("parent_id", "=", $id) - ->order_by("left_ptr", "DESC") // DESC since array_pop effectively reverses them - ->execute() as $child) { - $stack[] = "{$child->id}:{$child->type}:$level:L"; - } - $completed++; - } else { - // Non-albums must be leaf nodes. - db::build() - ->update("items") - ->set("left_ptr", $ptr++) - ->set("right_ptr", $ptr++) - ->set("level", $level) - ->set("relative_path_cache", null) - ->set("relative_url_cache", null) - ->where("id", "=", $id) - ->execute(); - $completed += 2; // we updated two pointers + $level++; + foreach (db::build() + ->select(array("id", "type")) + ->from("items") + ->where("parent_id", "=", $id) + ->order_by("left_ptr", "DESC") // DESC since array_pop effectively reverses them + ->execute() as $child) { + $stack[] = ($child->type == "album") ? "{$child->id}L{$level}" : "{$child->id}B{$level}"; } - } else if ($ptr_mode == "R") { + $completed++; + break; + case "B": + // Non-albums must be leaf nodes. + db::build() + ->update("items") + ->set("left_ptr", $ptr++) + ->set("right_ptr", $ptr++) + ->set("level", $level) + ->set("relative_path_cache", null) + ->set("relative_url_cache", null) + ->where("id", "=", $id) + ->execute(); + $completed += 2; // we updated two pointers + break; + case "R": db::build() ->update("items") ->set("right_ptr", $ptr++) -- cgit v1.2.3 From b7177cfb2dcfb8b057a15757943c5e733d6c8917 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Wed, 15 May 2013 11:11:47 -0700 Subject: Automated update of .build_number to 414 for branch master Last update: 666f3a30e2e7ad620d50740d76364eac1c23053b (1 commits ago) [ci skip] --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 252bfbf7..f827e69b 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=413 +build_number=414 -- cgit v1.2.3