diff options
179 files changed, 1408 insertions, 969 deletions
diff --git a/.gitignore b/.gitignore index 18f598cf67..de503c10ad 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,13 @@ /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* +/phpBB/images/ranks/* +/phpBB/language/* +!/phpBB/language/en /phpBB/store/* +/phpBB/styles/* +!/phpBB/styles/prosilver +!/phpBB/styles/subsilver2 /phpBB/vendor /tests/phpbb_unit_tests.sqlite* /tests/test_config*.php diff --git a/build/build.xml b/build/build.xml index ec94cf3ea6..510e7d0955 100644 --- a/build/build.xml +++ b/build/build.xml @@ -78,22 +78,22 @@ -s --extensions=php --standard=build/code_sniffer/ruleset-php-strict.xml - --ignore=phpBB/phpbb/db/migration/data/v30x/* + --ignore=${project.basedir}/phpBB/phpbb/db/migration/data/v30x/* phpBB/phpbb" dir="." returnProperty="retval-php-strict" passthru="true" /> <exec command="phpBB/vendor/bin/phpcs -s --extensions=php --standard=build/code_sniffer/ruleset-php-legacy.xml - --ignore=phpBB/cache/* - --ignore=phpBB/develop/* - --ignore=phpBB/includes/diff/*.php - --ignore=phpBB/includes/sphinxapi.php - --ignore=phpBB/includes/utf/data/* - --ignore=phpBB/install/data/* - --ignore=phpBB/install/database_update.php - --ignore=phpBB/phpbb/* - --ignore=phpBB/vendor/* + --ignore=${project.basedir}/phpBB/cache/* + --ignore=${project.basedir}/phpBB/develop/* + --ignore=${project.basedir}/phpBB/includes/diff/*.php + --ignore=${project.basedir}/phpBB/includes/sphinxapi.php + --ignore=${project.basedir}/phpBB/includes/utf/data/* + --ignore=${project.basedir}/phpBB/install/data/* + --ignore=${project.basedir}/phpBB/install/database_update.php + --ignore=${project.basedir}/phpBB/phpbb/* + --ignore=${project.basedir}/phpBB/vendor/* phpBB" dir="." returnProperty="retval-php-legacy" passthru="true" /> <if> diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml index 65eb0a8622..b0110e8b12 100644 --- a/build/code_sniffer/ruleset-php-legacy.xml +++ b/build/code_sniffer/ruleset-php-legacy.xml @@ -20,6 +20,16 @@ <!-- Call-time pass-by-reference MUST not be used. --> <rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" /> + <!-- Filenames MUST be lowercase. --> + <rule ref="Generic.Files.LowercasedFilename" /> + + <!-- The function brace MUST be on the line following the function declaration + and MUST be indented to the same column as the start of the function declaration. --> + <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman" /> + + <!-- There MUST be exactly one space after a cast. --> + <rule ref="Generic.Formatting.SpaceAfterCast" /> + <!-- Class constants MUST be declared in all upper case with underscore separators. --> <rule ref="Generic.NamingConventions.UpperCaseConstantName" /> @@ -32,6 +42,20 @@ <!-- Each file MUST end with exactly one newline character --> <rule ref="PSR2.Files.EndFileNewline" /> + <!-- When referencing arrays there MUST NOT be any whitespace around the opening bracket + or before the closing bracket. --> + <rule ref="Squiz.Arrays.ArrayBracketSpacing" /> + + <!-- The "else if" statement MUST be written with a space between the words else and if. --> + <rule ref="Squiz.ControlStructures.ElseIfDeclaration" /> + + <!-- There MUST be a space between each element of a foreach loop. --> + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" /> + + <!-- In a for loop declaration, there MUST be no space inside the brackets + and there MUST be 0 spaces before and 1 space after semicolons. --> + <rule ref="Squiz.ControlStructures.ForLoopDeclaration" /> + <!-- In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma. --> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> @@ -41,6 +65,12 @@ </rule> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" /> + <!-- All built-in PHP functions MUST be called lowercased. --> + <rule ref="Squiz.Functions.LowercaseFunctionKeywords" /> + + <!-- The eval() function MUST NOT be used. --> + <rule ref="Squiz.PHP.Eval" /> + <!-- There MUST NOT be trailing whitespace at the end of lines. --> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" /> diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml index f2d5b86dd1..c722f7851c 100644 --- a/build/code_sniffer/ruleset-php-strict.xml +++ b/build/code_sniffer/ruleset-php-strict.xml @@ -22,6 +22,9 @@ <!-- PHP keywords MUST be in lower case. --> <rule ref="Generic.PHP.LowerCaseKeyword" /> + <!-- Constructors MUST be called __construct() instead of after the class. --> + <rule ref="Generic.NamingConventions.ConstructorName" /> + <!-- Classes etc. MUST be namespaced --> <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" /> diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index b156d276df..136606252c 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -191,12 +191,12 @@ do err=$ERR_HEADER; echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] .+$" result=$? - if ! echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] [A-Z].+$" + if ! echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] [a-zA-Z].+$" then # Don't be too strict. # Commits may be temporary, intended to be squashed later. # Just issue a warning here. - complain "$severity: heading should be a sentence beginning with a capital letter." 1>&2 + complain "$severity: heading should be a sentence beginning with a letter." 1>&2 complain "You entered:" 1>&2 complain "$line" 1>&2 fi diff --git a/phpBB/adm/style/pagination.html b/phpBB/adm/style/pagination.html index 7158f83fbc..5e755723e8 100644 --- a/phpBB/adm/style/pagination.html +++ b/phpBB/adm/style/pagination.html @@ -1,5 +1,5 @@ - <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{PAGE_NUMBER}</a> • <ul> <!-- BEGIN pagination --> <!-- IF pagination.S_IS_PREV --><li><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a></li> diff --git a/phpBB/assets/plupload/plupload.full.min.js b/phpBB/assets/plupload/plupload.full.min.js index caa9728156..ca6cdf82de 100644 --- a/phpBB/assets/plupload/plupload.full.min.js +++ b/phpBB/assets/plupload/plupload.full.min.js @@ -25,4 +25,4 @@ * * Date: 2014-05-14 */ -;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t<n.length;t+=2)e=e.replace(n[t],n[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,""),e},buildUrl:function(e,t){var n="";return o.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n<f.length;n++)!e&&f[n].status==o.QUEUED?(e=f[n],this.trigger("BeforeUpload",e)&&(e.status=o.UPLOADING,this.trigger("UploadFile",e))):t++;t==f.length&&(this.state!==o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",f))}}function y(e){e.percent=e.size>0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e<f.length;e++)t=f[e],t.size!==n?(d.size+=t.origSize,d.loaded+=t.loaded*t.origSize/t.size):d.size=n,t.status==o.DONE?d.uploaded++:t.status==o.FAILED?d.failed++:d.queued++;d.size===n?d.percent=f.length>0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y<c.size?(d.destroy(),f+=y,n.loaded=Math.min(f,c.size),e.trigger("ChunkUploaded",n,{offset:n.loaded,total:c.size,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}),t.Env.browser==="Android Browser"&&e.trigger("UploadProgress",n)):n.loaded=n.size,d=v=null,!f||f>=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function l(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function c(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!a)return!1;e.ruid=a,e.connectRuntime(a)}c(new o.File(e))}else e instanceof t.Blob?(c(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){l(e,function(n){n||(f.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?c(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,c):i==="array"&&(n=null,t.each(e,c))}var s=this,u=[],a;a=w(),c(e),u.length&&t.inSeries(u,function(){f.length&&s.trigger("FilesAdded",f)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie);
\ No newline at end of file +;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t<n.length;t+=2)e=e.replace(n[t],n[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,""),e},buildUrl:function(e,t){var n="";return o.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n<f.length;n++)!e&&f[n].status==o.QUEUED?(e=f[n],this.trigger("BeforeUpload",e)&&(e.status=o.UPLOADING,this.trigger("UploadFile",e))):t++;t==f.length&&(this.state!==o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",f))}}function y(e){e.percent=e.size>0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e<f.length;e++)t=f[e],t.size!==n?(d.size+=t.origSize,d.loaded+=t.loaded*t.origSize/t.size):d.size=n,t.status==o.DONE?d.uploaded++:t.status==o.FAILED?d.failed++:d.queued++;d.size===n?d.percent=f.length>0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y<c.size?(d.destroy(),f+=y,n.loaded=Math.min(f,c.size),e.trigger("ChunkUploaded",n,{offset:n.loaded,total:c.size,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}),t.Env.browser==="Android Browser"&&e.trigger("UploadProgress",n)):n.loaded=n.size,d=v=null,!f||f>=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie);
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 3d3cfb7f16..b2a6820461 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -527,7 +527,7 @@ class acp_extensions $version_helper = new \phpbb\version_helper($this->cache, $this->config, $this->user); $version_helper->set_current_version($meta['version']); - $version_helper->set_file_location($version_check ['host'], $version_check ['directory'], $version_check ['filename']); + $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']); $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index 5b88035fa4..8d2e9d41a3 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -47,13 +47,13 @@ class acp_jabber $this->tpl_name = 'acp_jabber'; $this->page_title = 'ACP_JABBER_SETTINGS'; - $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']); - $jab_host = request_var('jab_host', (string) $config['jab_host']); - $jab_port = request_var('jab_port', (int) $config['jab_port']); - $jab_username = request_var('jab_username', (string) $config['jab_username']); - $jab_password = request_var('jab_password', (string) $config['jab_password']); - $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']); - $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']); + $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']); + $jab_host = request_var('jab_host', (string) $config['jab_host']); + $jab_port = request_var('jab_port', (int) $config['jab_port']); + $jab_username = request_var('jab_username', (string) $config['jab_username']); + $jab_password = request_var('jab_password', (string) $config['jab_password']); + $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']); + $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']); $form_name = 'acp_jabber'; add_form_key($form_name); diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index b11a083923..6540173433 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -331,14 +331,6 @@ class acp_permissions } } - // Setting permissions screen - $s_hidden_fields = build_hidden_fields(array( - 'user_id' => $user_id, - 'group_id' => $group_id, - 'forum_id' => $forum_id, - 'type' => $permission_type) - ); - // Go through the screens/options needed and present them in correct order foreach ($permission_victim as $victim) { @@ -471,6 +463,14 @@ class acp_permissions // If there are more than 5 forums selected the admin is not able to select all users/groups too. // We need to see if the number of forums can be increased or need to be decreased. + // Setting permissions screen + $s_hidden_fields = build_hidden_fields(array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + )); + $template->assign_vars(array( 'U_ACTION' => $this->u_action, 'ANONYMOUS_USER_ID' => ANONYMOUS, @@ -507,6 +507,14 @@ class acp_permissions return; } + // Setting permissions screen + $s_hidden_fields = build_hidden_fields(array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + )); + // Do not allow forum_ids being set and no other setting defined (will bog down the server too much) if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id)) { diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 8fa9dba57b..7bb8e824d6 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -835,7 +835,7 @@ class auth_admin extends \phpbb\auth\auth } // Remove current auth options... - $auth_option_ids = array((int)$any_option_id); + $auth_option_ids = array((int) $any_option_id); foreach ($auth as $auth_option => $auth_setting) { $auth_option_ids[] = (int) $this->acl_options['id'][$auth_option]; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3238f66e96..3d0a4761f3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -5031,6 +5031,72 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } /** +* Check and display the SQL report if requested. +* +* @param \phpbb\request\request_interface $request Request object +* @param \phpbb\auth\auth $auth Auth object +* @param \phpbb\db\driver\driver_interface $db Database connection +*/ +function phpbb_check_and_display_sql_report(\phpbb\request\request_interface $request, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db) +{ + if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG')) + { + $db->sql_report('display'); + } +} + +/** +* Generate the debug output string +* +* @param \phpbb\db\driver\driver_interface $db Database connection +* @param \phpbb\config\config $config Config object +* @param \phpbb\auth\auth $auth Auth object +* @param \phpbb\user $user User object +* @return string +*/ +function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\user $user) +{ + $debug_info = array(); + + // Output page creation time + if (defined('PHPBB_DISPLAY_LOAD_TIME')) + { + if (isset($GLOBALS['starttime'])) + { + $totaltime = microtime(true) - $GLOBALS['starttime']; + $debug_info[] = sprintf('Time: %.3fs', $totaltime); + } + + $debug_info[] = $db->sql_num_queries() . ' Queries (' . $db->sql_num_queries(true) . ' cached)'; + + $memory_usage = memory_get_peak_usage(); + if ($memory_usage) + { + $memory_usage = get_formatted_filesize($memory_usage); + + $debug_info[] = 'Peak Memory Usage: ' . $memory_usage; + } + } + + if (defined('DEBUG')) + { + $debug_info[] = 'GZIP: ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off'); + + if ($user->load) + { + $debug_info[] = 'Load: ' . $user->load; + } + + if ($auth->acl_get('a_')) + { + $debug_info[] = '<a href="' . build_url() . '&explain=1">SQL Explain</a>'; + } + } + + return implode(' | ', $debug_info); +} + +/** * Generate page footer * * @param bool $run_cron Whether or not to run the cron @@ -5062,37 +5128,10 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler = return; } - // Output page creation time - if (defined('DEBUG')) - { - $mtime = explode(' ', microtime()); - $totaltime = $mtime[0] + $mtime[1] - $starttime; - - if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG') && method_exists($db, 'sql_report')) - { - $db->sql_report('display'); - } - - $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); - - if ($auth->acl_get('a_') && defined('DEBUG')) - { - if (function_exists('memory_get_peak_usage')) - { - if ($memory_usage = memory_get_peak_usage()) - { - $memory_usage = get_formatted_filesize($memory_usage); - - $debug_output .= ' | Peak Memory Usage: ' . $memory_usage; - } - } - - $debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>'; - } - } + phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( - 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user), 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'), @@ -5272,7 +5311,7 @@ function phpbb_convert_30_dbms_to_31($dbms) // true for mysqli class. // However, per the docblock any valid 3.1 driver name should be // recognized by this function, and have priority over 3.0 dbms. - if (class_exists('phpbb\db\driver\\' . $dbms)) + if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms)) { return 'phpbb\db\driver\\' . $dbms; } diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 373eb57934..8453da6e6e 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -146,37 +146,10 @@ function adm_page_footer($copyright_html = true) return; } - // Output page creation time - if (defined('DEBUG')) - { - $mtime = explode(' ', microtime()); - $totaltime = $mtime[0] + $mtime[1] - $starttime; - - if ($request->variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG') && method_exists($db, 'sql_report')) - { - $db->sql_report('display'); - } - - $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); - - if ($auth->acl_get('a_') && defined('DEBUG')) - { - if (function_exists('memory_get_peak_usage')) - { - if ($memory_usage = memory_get_peak_usage()) - { - $memory_usage = get_formatted_filesize($memory_usage); - - $debug_output .= ' | Peak Memory Usage: ' . $memory_usage; - } - } - - $debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>'; - } - } + phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( - 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', + 'DEBUG_OUTPUT' => phpbb_generate_debug_output($db, $config, $auth, $user), 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'S_COPYRIGHT_HTML' => $copyright_html, 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'), diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 72fca905e0..74b3e0c70f 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -773,44 +773,47 @@ function make_clickable($text, $server_url = false, $class = 'postlink') static $static_class; static $magic_url_match_args; - if (!is_array($magic_url_match_args) || $static_class != $class) + if (!isset($magic_url_match_args[$server_url]) || $static_class != $class) { $static_class = $class; $class = ($static_class) ? ' class="' . $static_class . '"' : ''; $local_class = ($static_class) ? ' class="' . $static_class . '-local"' : ''; - $magic_url_match_args = array(); + if (!is_array($magic_url_match_args)) + { + $magic_url_match_args = array(); + } // relative urls for this board - $magic_url_match_args[] = array( + $magic_url_match_args[$server_url][] = array( '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#i', MAGIC_URL_LOCAL, $local_class, ); // matches a xxxx://aaaaa.bbb.cccc. ... - $magic_url_match_args[] = array( + $magic_url_match_args[$server_url][] = array( '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#i', MAGIC_URL_FULL, $class, ); // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing - $magic_url_match_args[] = array( + $magic_url_match_args[$server_url][] = array( '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#i', MAGIC_URL_WWW, $class, ); // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. - $magic_url_match_args[] = array( + $magic_url_match_args[$server_url][] = array( '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/i', MAGIC_URL_EMAIL, '', ); } - foreach ($magic_url_match_args as $magic_args) + foreach ($magic_url_match_args[$server_url] as $magic_args) { if (preg_match($magic_args[0], $text, $matches)) { diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index e68e770b3a..9005c57c8a 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1007,8 +1007,8 @@ function get_remote_avatar_dim($src, $axis) { $bigger = ($remote_avatar_cache[$src][0] > $remote_avatar_cache[$src][1]) ? 0 : 1; $ratio = $default[$bigger] / $remote_avatar_cache[$src][$bigger]; - $remote_avatar_cache[$src][0] = (int)($remote_avatar_cache[$src][0] * $ratio); - $remote_avatar_cache[$src][1] = (int)($remote_avatar_cache[$src][1] * $ratio); + $remote_avatar_cache[$src][0] = (int) ($remote_avatar_cache[$src][0] * $ratio); + $remote_avatar_cache[$src][1] = (int) ($remote_avatar_cache[$src][1] * $ratio); } } @@ -1287,7 +1287,9 @@ function restore_config($schema) { $var = (empty($m[2]) || empty($convert_config[$m[2]])) ? "''" : "'" . addslashes($convert_config[$m[2]]) . "'"; $exec = '$config_value = ' . $m[1] . '(' . $var . ');'; + // @codingStandardsIgnoreStart eval($exec); + // @codingStandardsIgnoreEnd } else { @@ -2295,7 +2297,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals $message = preg_replace('#\[size=([0-9]+)\](.*?)\[/size\]#i', '[size=\1]\2[/size]', $message); $message = preg_replace('#\[size=[0-9]{2,}\](.*?)\[/size\]#i', '[size=29]\1[/size]', $message); - for ($i = sizeof($size); $i; ) + for ($i = sizeof($size); $i;) { $i--; $message = str_replace('[size=' . $i . ']', '[size=' . $size[$i] . ']', $message); diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 51284af233..b7615e923b 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -456,7 +456,9 @@ class p_master ); $is_auth = false; + // @codingStandardsIgnoreStart eval('$is_auth = (int) (' . $module_auth . ');'); + // @codingStandardsIgnoreEnd return $is_auth; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d728ed7d78..5a10f9f411 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -755,7 +755,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas else { $ban_other = explode('-', $ban_len_other); - if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) && + if (sizeof($ban_other) == 3 && ((int) $ban_other[0] < 9999) && (strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2)) { $ban_end = max($current_time, $user->create_datetime() @@ -2086,7 +2086,7 @@ function avatar_delete($mode, $row, $clean_db = false) // Check if the users avatar is actually *not* a group avatar if ($mode == 'user') { - if (strpos($row['user_avatar'], 'g') === 0 || (((int)$row['user_avatar'] !== 0) && ((int)$row['user_avatar'] !== (int)$row['user_id']))) + if (strpos($row['user_avatar'], 'g') === 0 || (((int) $row['user_avatar'] !== 0) && ((int) $row['user_avatar'] !== (int) $row['user_id']))) { return false; } @@ -2419,7 +2419,7 @@ function group_correct_avatar($group_id, $old_entry) { global $config, $db, $phpbb_root_path; - $group_id = (int)$group_id; + $group_id = (int) $group_id; $ext = substr(strrchr($old_entry, '.'), 1); $old_filename = get_avatar_filename($old_entry); $new_filename = $config['avatar_salt'] . "_g$group_id.$ext"; @@ -2844,7 +2844,7 @@ function remove_default_avatar($group_id, $user_ids) $sql = 'SELECT * FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . (int)$group_id; + WHERE group_id = ' . (int) $group_id; $result = $db->sql_query($sql); if (!$row = $db->sql_fetchrow($result)) { @@ -2885,7 +2885,7 @@ function remove_default_rank($group_id, $user_ids) $sql = 'SELECT * FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . (int)$group_id; + WHERE group_id = ' . (int) $group_id; $result = $db->sql_query($sql); if (!$row = $db->sql_fetchrow($result)) { @@ -2896,9 +2896,9 @@ function remove_default_rank($group_id, $user_ids) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_rank = 0 - WHERE group_id = ' . (int)$group_id . ' + WHERE group_id = ' . (int) $group_id . ' AND user_rank <> 0 - AND user_rank = ' . (int)$row['group_rank'] . ' + AND user_rank = ' . (int) $row['group_rank'] . ' AND ' . $db->sql_in_set('user_id', $user_ids); $db->sql_query($sql); } diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 9d1afb7dc5..84097327bd 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -496,11 +496,11 @@ function mcp_move_topic($topic_ids) { $topics_moved++; } - elseif ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE) + else if ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE) { $topics_moved_unapproved++; } - elseif ($topic_info['topic_visibility'] == ITEM_DELETED) + else if ($topic_info['topic_visibility'] == ITEM_DELETED) { $topics_moved_softdeleted++; } @@ -567,7 +567,7 @@ function mcp_move_topic($topic_ids) 'topic_last_poster_id' => (int) $row['topic_last_poster_id'], 'topic_last_poster_colour'=>(string) $row['topic_last_poster_colour'], 'topic_last_poster_name'=> (string) $row['topic_last_poster_name'], - 'topic_last_post_subject'=> (string) $row['topic_last_post_subject'], + 'topic_last_post_subject'=> (string) $row['topic_last_post_subject'], 'topic_last_post_time' => (int) $row['topic_last_post_time'], 'topic_last_view_time' => (int) $row['topic_last_view_time'], 'topic_moved_id' => (int) $row['topic_id'], diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index f045fd018f..b0148356ce 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -489,7 +489,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) { $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); } - elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) + else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) { $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); } diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 958291fa06..e60a40a195 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -534,7 +534,7 @@ else return ''; } - $lx = (int)((-$length) / 65535); + $lx = (int) ((-$length) / 65535); $ly = (-$length) % 65535; // negative length requires ... capture everything diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index ff20154d03..a2bfabd2fd 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -223,7 +223,7 @@ function phpbb_insert_forums() 'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), - 'enable_prune' => ($prune_enabled) ? (int)$row['prune_enable'] : 0, + 'enable_prune' => ($prune_enabled) ? (int) $row['prune_enable'] : 0, 'prune_next' => (int) null_to_zero($row['prune_next']), 'prune_days' => (int) null_to_zero($row['prune_days']), 'prune_viewed' => 0, diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 43970029cb..bff7b75b18 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -752,12 +752,16 @@ class module break; case 'select': + // @codingStandardsIgnoreStart eval('$s_options = ' . str_replace('{VALUE}', $value, $options) . ';'); + // @codingStandardsIgnoreEnd $tpl = '<select id="' . $name . '" name="' . $name . '">' . $s_options . '</select>'; break; case 'custom': + // @codingStandardsIgnoreStart eval('$tpl = ' . str_replace('{VALUE}', $value, $options) . ';'); + // @codingStandardsIgnoreEnd break; default: diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 674a1f7dd3..4d6aff154c 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -1021,7 +1021,9 @@ class install_convert extends module // Now process queries and execute functions that have to be executed prior to the conversion if (!empty($convert->convertor['execute_first'])) { + // @codingStandardsIgnoreStart eval($convert->convertor['execute_first']); + // @codingStandardsIgnoreEnd } if (!empty($convert->convertor['query_first'])) @@ -1091,7 +1093,9 @@ class install_convert extends module // process execute_first and query_first for this table... if (!empty($schema['execute_first'])) { + // @codingStandardsIgnoreStart eval($schema['execute_first']); + // @codingStandardsIgnoreEnd } if (!empty($schema['query_first'])) @@ -1156,7 +1160,9 @@ class install_convert extends module // it gets split because of time restrictions if (!empty($schema['execute_always'])) { + // @codingStandardsIgnoreStart eval($schema['execute_always']); + // @codingStandardsIgnoreEnd } // @@ -1667,13 +1673,17 @@ class install_convert extends module { if (!is_array($convert->convertor['execute_last'])) { + // @codingStandardsIgnoreStart eval($convert->convertor['execute_last']); + // @codingStandardsIgnoreEnd } else { while ($last_statement < sizeof($convert->convertor['execute_last'])) { + // @codingStandardsIgnoreStart eval($convert->convertor['execute_last'][$last_statement]); + // @codingStandardsIgnoreEnd $template->assign_block_vars('checks', array( 'TITLE' => $convert->convertor['execute_last'][$last_statement], @@ -2035,7 +2045,9 @@ class install_convert extends module $execution = str_replace('{RESULT}', '$value', $execution); $execution = str_replace('{VALUE}', '$value', $execution); + // @codingStandardsIgnoreStart eval($execution); + // @codingStandardsIgnoreEnd } } } @@ -2082,7 +2094,9 @@ class install_convert extends module $execution = str_replace('{RESULT}', '$value', $execution); $execution = str_replace('{VALUE}', '$value', $execution); + // @codingStandardsIgnoreStart eval($execution); + // @codingStandardsIgnoreEnd } } } diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php index 2f37fc3237..d5874dac83 100644 --- a/phpBB/install/install_main.php +++ b/phpBB/install/install_main.php @@ -56,7 +56,7 @@ class install_main extends module case 'license' : $title = $lang['GPL']; - $body = implode("<br/>\n", file('../docs/COPYING')); + $body = implode("<br/>\n", file(__DIR__ . '/../docs/LICENSE.txt')); break; case 'support' : diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 8ab7be2abd..638e9907ac 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -414,7 +414,7 @@ $lang = array_merge($lang, array( 'AUTH_METHOD' => 'Select an authentication method', 'AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING' => 'Both the key and secret of each enabled OAuth service provider must be provided. Only one was provided for an OAuth service provider.', - 'AUTH_PROVIDER_OAUTH_EXPLAIN' => 'Each OAuth provider requires a unique secret and key in order to authenticate with the external server.<br />These should be supplied by the OAuth service when you register your website with them and should be entered exactly as provided to you.<br />Any service that does not have both a key and a secret entered here will not be available for use by the forum users.', + 'AUTH_PROVIDER_OAUTH_EXPLAIN' => 'Each OAuth provider requires a unique secret and key in order to authenticate with the external server. These should be supplied by the OAuth service when you register your website with them and should be entered exactly as provided to you.<br />Any service that does not have both a key and a secret entered here will not be available for use by the forum users. Also note, that user can still register and login using the DB authentication plug-in.', 'AUTH_PROVIDER_OAUTH_KEY' => 'Key', 'AUTH_PROVIDER_OAUTH_TITLE' => 'OAuth', 'AUTH_PROVIDER_OAUTH_SECRET' => 'Secret', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 91be876514..9a44337294 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -341,7 +341,8 @@ $lang = array_merge($lang, array( 'JOINED' => 'Joined', 'JUMP_PAGE' => 'Enter the page number you wish to go to', 'JUMP_TO' => 'Jump to', - 'JUMP_TO_PAGE' => 'Click to jump to page…', + 'JUMP_TO_PAGE' => 'Jump to page', + 'JUMP_TO_PAGE_CLICK' => 'Click to jump to page…', 'KB' => 'KB', 'KIB' => 'KiB', diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 07430bb42a..7b71e3c844 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -14,7 +14,6 @@ namespace phpbb\auth\provider\oauth; use OAuth\Common\Consumer\Credentials; -use OAuth\Common\Http\Uri\Uri; /** * OAuth authentication provider for phpBB3 @@ -224,7 +223,7 @@ class oauth extends \phpbb\auth\provider\base if (!$row) { - throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY'); + throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_ENTRY'); } // Update token storage to store the user_id @@ -278,9 +277,10 @@ class oauth extends \phpbb\auth\provider\base * @param array $service_credentials {@see \phpbb\auth\provider\oauth\oauth::get_service_credentials} * @param string $query The query string of the * current_uri used in redirection - * @param array $scope The scope of the request against + * @param array $scopes The scope of the request against * the api. * @return \OAuth\Common\Service\ServiceInterface + * @throws \Exception */ protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, $query, array $scopes = array()) { @@ -298,7 +298,7 @@ class oauth extends \phpbb\auth\provider\base if (!$service) { - throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED'); + throw new \Exception('AUTH_PROVIDER_OAUTH_ERROR_SERVICE_NOT_CREATED'); } return $service; @@ -617,7 +617,5 @@ class oauth extends \phpbb\auth\provider\base $service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']); $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); $storage->clearToken($service_name); - - return; } } diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php index 31060c4ac4..bb98835e07 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/facebook.php +++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php @@ -21,22 +21,22 @@ class facebook extends base /** * phpBB config * - * @var phpbb\config\config + * @var \phpbb\config\config */ protected $config; /** * phpBB request * - * @var phpbb\request\request_interface + * @var \phpbb\request\request_interface */ protected $request; /** * Constructor * - * @param phpbb\config\config $config - * @param phpbb\request\request_interface $request + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request */ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { diff --git a/phpBB/phpbb/auth/provider/oauth/service/google.php b/phpBB/phpbb/auth/provider/oauth/service/google.php index c2d9e1f798..cb9f83a94f 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/google.php +++ b/phpBB/phpbb/auth/provider/oauth/service/google.php @@ -21,22 +21,22 @@ class google extends base /** * phpBB config * - * @var phpbb\config\config + * @var \phpbb\config\config */ protected $config; /** * phpBB request * - * @var phpbb\request\request_interface + * @var \phpbb\request\request_interface */ protected $request; /** * Constructor * - * @param phpbb\config\config $config - * @param phpbb\request\request_interface $request + * @param \phpbb\config\config $config + * @param \phpbb\request\request_interface $request */ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request) { diff --git a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php index 3744582b95..e84eb247b6 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php +++ b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php @@ -67,7 +67,7 @@ interface service_interface /** * Sets the external library service provider * - * @param \OAuth\Common\Service\ServiceInterface $service + * @param \OAuth\Common\Service\ServiceInterface $service_provider */ public function set_external_service_provider(\OAuth\Common\Service\ServiceInterface $service_provider); } diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index b7d32bf246..fe1a376cfe 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -17,7 +17,6 @@ namespace phpbb\auth\provider\oauth; use OAuth\OAuth1\Token\StdOAuth1Token; use OAuth\Common\Token\TokenInterface; use OAuth\Common\Storage\TokenStorageInterface; -use OAuth\Common\Storage\Exception\StorageException; use OAuth\Common\Storage\Exception\TokenNotFoundException; /** @@ -198,6 +197,7 @@ class token_storage implements TokenStorageInterface /** * Checks to see if an access token exists solely by the session_id of the user * + * @param string $service The name of the OAuth service * @return bool true if they have token, false if they don't */ public function has_access_token_by_session($service) @@ -250,6 +250,7 @@ class token_storage implements TokenStorageInterface * * @param array $data * @return mixed + * @throws \OAuth\Common\Storage\Exception\TokenNotFoundException */ protected function _retrieve_access_token($data) { diff --git a/phpBB/phpbb/auth/provider/provider_interface.php b/phpBB/phpbb/auth/provider/provider_interface.php index 140353c88b..613297cefc 100644 --- a/phpBB/phpbb/auth/provider/provider_interface.php +++ b/phpBB/phpbb/auth/provider/provider_interface.php @@ -148,7 +148,7 @@ interface provider_interface * user_id of an account needed to successfully link an external account to * a forum account. * - * @param array $link_data Any data needed to link a phpBB account to + * @param array $login_link_data Any data needed to link a phpBB account to * an external account. * @return string|null Returns a string with a language constant if there * is data missing or null if there is no error. diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php index 27a3f24564..fe32a34e12 100644 --- a/phpBB/phpbb/auth/provider_collection.php +++ b/phpBB/phpbb/auth/provider_collection.php @@ -53,7 +53,7 @@ class provider_collection extends \phpbb\di\service_collection return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method']))); } // Revert to db auth provider if selected method does not exist - elseif ($this->offsetExists('auth.provider.db')) + else if ($this->offsetExists('auth.provider.db')) { return $this->offsetGet('auth.provider.db'); } diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index 9c769071d4..b3ced7edf7 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -73,10 +73,9 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface * Construct a driver object * * @param \phpbb\config\config $config phpBB configuration - * @param \phpbb\request\request $request Request object * @param string $phpbb_root_path Path to the phpBB root * @param string $php_ext PHP file extension - * @param \phpbb_path_helper $path_helper phpBB path helper + * @param \phpbb\path_helper $path_helper phpBB path helper * @param \phpbb\cache\driver\driver_interface $cache Cache driver */ public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null) @@ -89,7 +88,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_custom_html($user, $row, $alt = '') { @@ -97,7 +96,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form_acp($user) { @@ -105,7 +104,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function delete($row) { @@ -113,7 +112,7 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_name() { diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php index c4344ee6e8..4aa7445d20 100644 --- a/phpBB/phpbb/avatar/driver/gravatar.php +++ b/phpBB/phpbb/avatar/driver/gravatar.php @@ -24,7 +24,7 @@ class gravatar extends \phpbb\avatar\driver\driver const GRAVATAR_URL = '//secure.gravatar.com/avatar/'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_data($row) { @@ -36,7 +36,7 @@ class gravatar extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function get_custom_html($user, $row, $alt = '') { @@ -47,7 +47,7 @@ class gravatar extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form($request, $template, $user, $row, &$error) { @@ -61,7 +61,7 @@ class gravatar extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function process_form($request, $template, $user, $row, &$error) { @@ -151,7 +151,7 @@ class gravatar extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_name() { @@ -161,6 +161,8 @@ class gravatar extends \phpbb\avatar\driver\driver /** * Build gravatar URL for output on page * + * @param array $row User data or group data that has been cleaned with + * \phpbb\avatar\manager::clean_row * @return string Gravatar URL */ protected function get_gravatar_url($row) diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index f3acf7cb2c..ff1996854b 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -19,7 +19,7 @@ namespace phpbb\avatar\driver; class local extends \phpbb\avatar\driver\driver { /** - * @inheritdoc + * {@inheritdoc} */ public function get_data($row) { @@ -31,7 +31,7 @@ class local extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form($request, $template, $user, $row, &$error) { @@ -99,7 +99,7 @@ class local extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form_acp($user) { @@ -109,7 +109,7 @@ class local extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function process_form($request, $template, $user, $row, &$error) { @@ -138,7 +138,7 @@ class local extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_name() { diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index d97093ae24..455ddebf62 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -19,7 +19,7 @@ namespace phpbb\avatar\driver; class remote extends \phpbb\avatar\driver\driver { /** - * @inheritdoc + * {@inheritdoc} */ public function get_data($row) { @@ -31,7 +31,7 @@ class remote extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form($request, $template, $user, $row, &$error) { @@ -45,7 +45,7 @@ class remote extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function process_form($request, $template, $user, $row, &$error) { @@ -191,7 +191,7 @@ class remote extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_name() { diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index bef75d61c1..c43004f340 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -19,7 +19,7 @@ namespace phpbb\avatar\driver; class upload extends \phpbb\avatar\driver\driver { /** - * @inheritdoc + * {@inheritdoc} */ public function get_data($row, $ignore_config = false) { @@ -31,7 +31,7 @@ class upload extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form($request, $template, $user, $row, &$error) { @@ -49,7 +49,7 @@ class upload extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function process_form($request, $template, $user, $row, &$error) { @@ -72,7 +72,7 @@ class upload extends \phpbb\avatar\driver\driver { $file = $upload->form_upload('avatar_upload_file'); } - elseif (!empty($this->config['allow_avatar_remote_upload']) && !empty($url)) + else if (!empty($this->config['allow_avatar_remote_upload']) && !empty($url)) { if (!preg_match('#^(http|https|ftp)://#i', $url)) { @@ -143,7 +143,7 @@ class upload extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function prepare_form_acp($user) { @@ -155,7 +155,7 @@ class upload extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function delete($row) { @@ -171,7 +171,7 @@ class upload extends \phpbb\avatar\driver\driver } /** - * @inheritdoc + * {@inheritdoc} */ public function get_template_name() { diff --git a/phpBB/phpbb/cache/driver/driver_interface.php b/phpBB/phpbb/cache/driver/driver_interface.php index 7d08362ed8..9ac9ca0c59 100644 --- a/phpBB/phpbb/cache/driver/driver_interface.php +++ b/phpBB/phpbb/cache/driver/driver_interface.php @@ -142,7 +142,7 @@ interface driver_interface * Fetch a field from the current row of a cached database result (database) * * @param int $query_id - * @param $field The name of the column. + * @param string $field The name of the column. * @return string|bool The field of the query result if found in the cache, * otherwise false. */ diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index 57890cc3a2..b32af32d25 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -28,6 +28,8 @@ class file extends \phpbb\cache\driver\base /** * Set cache path + * + * @param string $cache_dir Define the path to the cache directory (default: $phpbb_root_path . 'cache/') */ function __construct($cache_dir = null) { @@ -222,7 +224,7 @@ class file extends \phpbb\cache\driver\base { $this->remove_dir($fileInfo->getPathname()); } - elseif (strpos($filename, 'container_') === 0 || + else if (strpos($filename, 'container_') === 0 || strpos($filename, 'url_matcher') === 0 || strpos($filename, 'sql_') === 0 || strpos($filename, 'data_') === 0) diff --git a/phpBB/phpbb/config/db_text.php b/phpBB/phpbb/config/db_text.php index fb8588334e..b1e3ef5da4 100644 --- a/phpBB/phpbb/config/db_text.php +++ b/phpBB/phpbb/config/db_text.php @@ -105,8 +105,8 @@ class db_text if (!$this->db->sql_affectedrows($result)) { $sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array( - 'config_name' => $key, - 'config_value' => $value, + 'config_name' => (string) $key, + 'config_value' => (string) $value, )); $this->db->sql_query($sql); } diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 50953185a4..379d2aa1ca 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -35,6 +35,16 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\config\config */ protected $config; + /** + * Constructor + * + * @param \phpbb\cache\driver\driver_interface $cache Cache instance + * @param \phpbb\db\driver\driver_interface $db Database connection + * @param \phpbb\auth\auth $auth Auth instance + * @param \phpbb\log\log $log Logger instance + * @param \phpbb\user $user User instance + * @param \phpbb\config\config $config Config instance + */ public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config) { $this->cache = $cache; @@ -46,6 +56,9 @@ class purge extends \phpbb\console\command\command parent::__construct(); } + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -54,6 +67,16 @@ class purge extends \phpbb\console\command\command ; } + /** + * Executes the command cache:purge. + * + * Purge the cache (including permissions) and increment the asset_version number + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + */ protected function execute(InputInterface $input, OutputInterface $output) { $this->config->increment('assets_version', 1); diff --git a/phpBB/phpbb/console/command/config/delete.php b/phpBB/phpbb/console/command/config/delete.php index e29afdbf82..1310bb18b4 100644 --- a/phpBB/phpbb/console/command/config/delete.php +++ b/phpBB/phpbb/console/command/config/delete.php @@ -14,11 +14,13 @@ namespace phpbb\console\command\config; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class delete extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -32,6 +34,17 @@ class delete extends command ; } + /** + * Executes the command config:delete. + * + * Removes a configuration option + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::delete() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); diff --git a/phpBB/phpbb/console/command/config/get.php b/phpBB/phpbb/console/command/config/get.php index 0ed2a12608..ee8c65110e 100644 --- a/phpBB/phpbb/console/command/config/get.php +++ b/phpBB/phpbb/console/command/config/get.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Output\OutputInterface; class get extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -38,6 +41,17 @@ class get extends command ; } + /** + * Executes the command config:get. + * + * Retrieves a configuration value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::offsetGet() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); @@ -46,7 +60,7 @@ class get extends command { $output->write($this->config[$key]); } - elseif (isset($this->config[$key])) + else if (isset($this->config[$key])) { $output->writeln($this->config[$key]); } diff --git a/phpBB/phpbb/console/command/config/increment.php b/phpBB/phpbb/console/command/config/increment.php index 64b5d42b9d..21f0660e61 100644 --- a/phpBB/phpbb/console/command/config/increment.php +++ b/phpBB/phpbb/console/command/config/increment.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Output\OutputInterface; class increment extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -43,6 +46,17 @@ class increment extends command ; } + /** + * Executes the command config:increment. + * + * Increments an integer configuration value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::increment() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); diff --git a/phpBB/phpbb/console/command/config/set.php b/phpBB/phpbb/console/command/config/set.php index fce1edb93e..587b7fb0de 100644 --- a/phpBB/phpbb/console/command/config/set.php +++ b/phpBB/phpbb/console/command/config/set.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Output\OutputInterface; class set extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -43,6 +46,17 @@ class set extends command ; } + /** + * Executes the command config:set. + * + * Sets a configuration option's value. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + * @see \phpbb\config\config::set() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); diff --git a/phpBB/phpbb/console/command/config/set_atomic.php b/phpBB/phpbb/console/command/config/set_atomic.php index 4df2d90722..a7a52155f9 100644 --- a/phpBB/phpbb/console/command/config/set_atomic.php +++ b/phpBB/phpbb/console/command/config/set_atomic.php @@ -19,6 +19,9 @@ use Symfony\Component\Console\Output\OutputInterface; class set_atomic extends command { + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -48,6 +51,18 @@ class set_atomic extends command ; } + /** + * Executes the command config:set-atomic. + * + * Sets a configuration option's value only if the old_value matches the + * current configuration value or the configuration value does not exist yet. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return bool True if the value was changed, false otherwise. + * @see \phpbb\config\config::set_atomic() + */ protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); diff --git a/phpBB/phpbb/console/command/cron/cron_list.php b/phpBB/phpbb/console/command/cron/cron_list.php index 9db6a23947..4f4228d9b3 100644 --- a/phpBB/phpbb/console/command/cron/cron_list.php +++ b/phpBB/phpbb/console/command/cron/cron_list.php @@ -23,6 +23,12 @@ class cron_list extends \phpbb\console\command\command /** @var \phpbb\user */ protected $user; + /** + * Constructor + * + * @param \phpbb\cron\manager $cron_manager Cron manager + * @param \phpbb\user $user User instance + */ public function __construct(\phpbb\cron\manager $cron_manager, \phpbb\user $user) { $this->cron_manager = $cron_manager; @@ -30,6 +36,9 @@ class cron_list extends \phpbb\console\command\command parent::__construct(); } + /** + * {@inheritdoc} + */ protected function configure() { $this @@ -38,6 +47,16 @@ class cron_list extends \phpbb\console\command\command ; } + /** + * Executes the command cron:list. + * + * Prints a list of ready and unready cron jobs. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * + * @return null + */ protected function execute(InputInterface $input, OutputInterface $output) { $tasks = $this->cron_manager->get_tasks(); @@ -80,6 +99,12 @@ class cron_list extends \phpbb\console\command\command } } + /** + * Print a list of cron jobs + * + * @param array $tasks A list of task to display + * @param OutputInterface $output An OutputInterface instance + */ protected function print_tasks_names(array $tasks, OutputInterface $output) { foreach ($tasks as $task) diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index 1029a2e085..32774bebe4 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -15,7 +15,6 @@ namespace phpbb\console\command\cron; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class run extends \phpbb\console\command\command @@ -35,7 +34,7 @@ class run extends \phpbb\console\command\command * @param \phpbb\cron\manager $cron_manager The cron manager containing * the cron tasks to be executed. * @param \phpbb\lock\db $lock_db The lock for accessing database. - * @param \phobb\user $user The user object (used to get language information) + * @param \phpbb\user $user The user object (used to get language information) */ public function __construct(\phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db, \phpbb\user $user) { @@ -102,7 +101,7 @@ class run extends \phpbb\console\command\command } } - /* + /** * Executes all ready cron tasks. * * If verbose mode is set, an info message will be printed if there is no task to @@ -140,7 +139,7 @@ class run extends \phpbb\console\command\command return 0; } - /* + /** * Executes a given cron task, if it is ready. * * If there is a task whose name matches $task_name, it is run and 0 is returned. diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index 380a479e4a..1f50032f26 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -54,10 +54,13 @@ class content_visibility * * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\db\driver\driver_interface $db Database object - * @param \phpbb\user $user User object + * @param \phpbb\user $user User object * @param string $phpbb_root_path Root path * @param string $php_ext PHP Extension - * @return null + * @param string $forums_table Forums table name + * @param string $posts_table Posts table name + * @param string $topics_table Topics table name + * @param string $users_table Users table name */ public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table) { diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 7b232294f0..930bc42a98 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -101,7 +101,7 @@ class helper * @param string $route Name of the route to travel * @param array $params String or array of additional url parameters * @param bool $is_amp Is url using & (true) or & (false) - * @param string $session_id Possibility to use a custom session id instead of the global one + * @param string|bool $session_id Possibility to use a custom session id instead of the global one * @return string The URL already passed through append_sid() */ public function route($route, array $params = array(), $is_amp = true, $session_id = false) @@ -139,8 +139,8 @@ class helper * Output an error, effectively the same thing as trigger_error * * @param string $message The error message - * @param string $code The error code (e.g. 404, 500, 503, etc.) - * @return Response A Reponse instance + * @param int $code The error code (e.g. 404, 500, 503, etc.) + * @return Response A Response instance */ public function error($message, $code = 500) { diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php index bd85385a41..fffd4f0428 100644 --- a/phpBB/phpbb/controller/provider.php +++ b/phpBB/phpbb/controller/provider.php @@ -37,7 +37,7 @@ class provider /** * Construct method * - * @param array() $routing_files Array of strings containing paths + * @param array $routing_files Array of strings containing paths * to YAML files holding route information */ public function __construct($routing_files = array()) @@ -46,6 +46,8 @@ class provider } /** + * Find the list of routing files + * * @param \phpbb\finder $finder * @return null */ @@ -61,10 +63,10 @@ class provider } /** - * Find a list of controllers and return it + * Find a list of controllers * * @param string $base_path Base path to prepend to file paths - * @return null + * @return provider */ public function find($base_path = '') { diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index 77532767fc..efab34b701 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -122,7 +122,7 @@ class resolver implements ControllerResolverInterface * * @param \Symfony\Component\HttpFoundation\Request $request Symfony Request object * @param mixed $controller A callable (controller class, method) - * @return bool False + * @return array An array of arguments to pass to the controller * @throws \phpbb\controller\exception */ public function getArguments(Request $request, $controller) diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index f04f063228..b0601e641a 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -34,7 +34,7 @@ class manager /** * Constructor. Loads all available tasks. * - * @param array|Traversable $tasks Provides an iterable set of task names + * @param array|\Traversable $tasks Provides an iterable set of task names */ public function __construct($tasks, $phpbb_root_path, $php_ext) { @@ -48,7 +48,7 @@ class manager * Loads tasks given by name, wraps them * and puts them into $this->tasks. * - * @param array|Traversable $tasks Array of instances of \phpbb\cron\task\task + * @param array|\Traversable $tasks Array of instances of \phpbb\cron\task\task * * @return null */ diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php index ca5044343f..381483c798 100644 --- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php +++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php @@ -164,6 +164,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t * @param int $forum_id Forum ID of forum that should be pruned * @param string $prune_mode Prune mode * @param int $prune_flags Prune flags + * @param int $prune_days Prune date in days * @param int $prune_freq Prune frequency * @return null */ diff --git a/phpBB/phpbb/datetime.php b/phpBB/phpbb/datetime.php index 47f742f802..9c9292a8e4 100644 --- a/phpBB/phpbb/datetime.php +++ b/phpBB/phpbb/datetime.php @@ -39,8 +39,8 @@ class datetime extends \DateTime * the user context and modify the timezone to the users selected timezone if one is not set. * * @param string $time String in a format accepted by strtotime(). - * @param DateTimeZone $timezone Time zone of the time. - * @param user User object for context. + * @param \DateTimeZone $timezone Time zone of the time. + * @param user $user object for context. */ public function __construct($user, $time = 'now', \DateTimeZone $timezone = null) { @@ -120,7 +120,7 @@ class datetime extends \DateTime /** * Magic method to convert DateTime object to string * - * @return Formatted date time, according to the users default settings. + * @return string Formatted date time, according to the users default settings. */ public function __toString() { diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index 9639bfa988..a7f93c8feb 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -319,10 +319,10 @@ class mssqlnative extends \phpbb\db\driver\mssql_base { foreach ($errors as $error) { - $error_message .= "SQLSTATE: " . $error[ 'SQLSTATE'] . "\n"; - $error_message .= "code: " . $error[ 'code'] . "\n"; + $error_message .= "SQLSTATE: " . $error['SQLSTATE'] . "\n"; + $error_message .= "code: " . $error['code'] . "\n"; $code = $error['code']; - $error_message .= "message: " . $error[ 'message'] . "\n"; + $error_message .= "message: " . $error['message'] . "\n"; } $this->last_error_result = $error_message; $error = $this->last_error_result; diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php index 004d94d8bd..aad8e44681 100644 --- a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php @@ -42,7 +42,6 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration $sql = 'SELECT user_password, user_id FROM ' . $this->table_prefix . 'users WHERE user_pass_convert = 1 - GROUP BY user_id ORDER BY user_id'; $result = $this->db->sql_query_limit($sql, $limit, $start); diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 818e27a362..91d8307d91 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -217,7 +217,7 @@ class schema_generator * Check if one of the migrations files' dependencies can't be resolved * by the supplied list of migrations * - * @throws UnexpectedValueException If a dependency can't be resolved + * @throws \UnexpectedValueException If a dependency can't be resolved */ protected function check_dependencies() { diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 1027b425ff..f93e7118c4 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -66,6 +66,7 @@ class config implements \phpbb\db\migration\tool\tool_interface * like to update * @param mixed $config_value The value of the config setting * @return null + * @throws \phpbb\db\migration\exception */ public function update($config_name, $config_value) { @@ -87,6 +88,7 @@ class config implements \phpbb\db\migration\tool\tool_interface * like to update * @param mixed $config_value The value of the config setting * @return null + * @throws \phpbb\db\migration\exception */ public function update_if_equals($compare, $config_name, $config_value) { diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 17deb1b19c..db43046a95 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -167,6 +167,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * modules in that info file. * path, specify that here * @return null + * @throws \phpbb\db\migration\exception */ public function add($class, $parent = 0, $data = array()) { @@ -331,6 +332,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param int|string $module The module id|module_langname * specify that here * @return null + * @throws \phpbb\db\migration\exception */ public function remove($class, $parent = 0, $module = '') { @@ -466,6 +468,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param string $class Module Class * @param string $basename Module Basename * @return array Module Information + * @throws \phpbb\db\migration\exception */ protected function get_module_info($class, $basename) { diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index ba856fbeda..d2df27613a 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -283,6 +283,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * @param string $old_role_name The old role name * @param string $new_role_name The new role name * @return null + * @throws \phpbb\db\migration\exception */ public function role_update($old_role_name, $new_role_name) { @@ -345,6 +346,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * @param bool $has_permission True if you want to give them permission, * false if you want to deny them permission * @return null + * @throws \phpbb\db\migration\exception */ public function permission_set($name, $auth_option, $type = 'role', $has_permission = true) { @@ -490,6 +492,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * auth_options you would like to set * @param string $type The type (role|group) * @return null + * @throws \phpbb\db\migration\exception */ public function permission_unset($name, $auth_option, $type = 'role') { diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 5255c73c1c..c2f7b5ab23 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -167,8 +167,9 @@ class migrator /** * Attempts to apply a step of the given migration or one of its dependencies * - * @param string The class name of the migration + * @param string $name The class name of the migration * @return bool Whether any update step was successfully run + * @throws \phpbb\db\migration\exception */ protected function try_apply($name) { @@ -302,7 +303,7 @@ class migrator /** * Attempts to revert a step of the given migration or one of its dependencies * - * @param string The class name of the migration + * @param string $name The class name of the migration * @return bool Whether any update step was successfully run */ protected function try_revert($name) @@ -368,6 +369,7 @@ class migrator * @param bool|string $state Current state of the migration * @param bool $revert true to revert a data step * @return bool|string migration state. True if completed, serialized array if not finished + * @throws \phpbb\db\migration\exception */ protected function process_data_step($steps, $state, $revert = false) { @@ -464,6 +466,7 @@ class migrator * @param mixed $last_result Result to pass to the callable (only for 'custom' method) * @param bool $reverse False to install, True to attempt uninstallation by reversing the call * @return array Array with parameters for call_user_func_array(), 0 is the callable, 1 is parameters + * @throws \phpbb\db\migration\exception */ protected function get_callable_from_step(array $step, $last_result = 0, $reverse = false) { @@ -722,6 +725,7 @@ class migrator * to prevent errors (if including multiple directories, check * with the last call to prevent throwing errors unnecessarily). * @return array Array of migration names + * @throws \phpbb\db\migration\exception */ public function load_migrations(\phpbb\finder $finder, $path, $check_fulfillable = true) { diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 3d065ede8e..2ee842eace 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1996,7 +1996,7 @@ class tools $columns = implode(',', $column_list); - $new_table_cols = trim(preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols)); + $new_table_cols = trim(preg_replace('/' . $column_name . '\b[^,]+(?:,|$)/m', '', $new_table_cols)); if (substr($new_table_cols, -1) === ',') { // Remove the comma from the last entry again @@ -2561,7 +2561,18 @@ class tools foreach ($old_table_cols as $key => $declaration) { - $entities = preg_split('#\s+#', trim($declaration)); + $declaration = trim($declaration); + + // Check for the beginning of the constraint section and stop + if (preg_match('/[^\(]*\s*PRIMARY KEY\s+\(/', $declaration) || + preg_match('/[^\(]*\s*UNIQUE\s+\(/', $declaration) || + preg_match('/[^\(]*\s*FOREIGN KEY\s+\(/', $declaration) || + preg_match('/[^\(]*\s*CHECK\s+\(/', $declaration)) + { + break; + } + + $entities = preg_split('#\s+#', $declaration); $column_list[] = $entities[0]; if ($entities[0] == $column_name) { diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php index 403c9d50e7..a7d7284f85 100644 --- a/phpBB/phpbb/di/extension/config.php +++ b/phpBB/phpbb/di/extension/config.php @@ -15,8 +15,6 @@ namespace phpbb\di\extension; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\DependencyInjection\Extension; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\Config\FileLocator; /** * Container config extension @@ -34,7 +32,7 @@ class config extends Extension * @param array $config An array of configuration values * @param ContainerBuilder $container A ContainerBuilder instance * - * @throws InvalidArgumentException When provided tag is not defined in this extension + * @throws \InvalidArgumentException When provided tag is not defined in this extension */ public function load(array $config, ContainerBuilder $container) { @@ -68,7 +66,7 @@ class config extends Extension * Convert 3.0 ACM type to 3.1 cache driver class name * * @param string $acm_type ACM type - * @return cache driver class + * @return string cache driver class */ protected function convert_30_acm_type($acm_type) { diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index 72026f3b54..ca4fa5c082 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -45,7 +45,7 @@ class core extends Extension * @param array $config An array of configuration values * @param ContainerBuilder $container A ContainerBuilder instance * - * @throws InvalidArgumentException When provided tag is not defined in this extension + * @throws \InvalidArgumentException When provided tag is not defined in this extension */ public function load(array $config, ContainerBuilder $container) { diff --git a/phpBB/phpbb/di/extension/ext.php b/phpBB/phpbb/di/extension/ext.php index 1205dffb53..718c992d2e 100644 --- a/phpBB/phpbb/di/extension/ext.php +++ b/phpBB/phpbb/di/extension/ext.php @@ -39,7 +39,7 @@ class ext extends Extension * @param array $config An array of configuration values * @param ContainerBuilder $container A ContainerBuilder instance * - * @throws InvalidArgumentException When provided tag is not defined in this extension + * @throws \InvalidArgumentException When provided tag is not defined in this extension */ public function load(array $config, ContainerBuilder $container) { diff --git a/phpBB/phpbb/di/pass/kernel_pass.php b/phpBB/phpbb/di/pass/kernel_pass.php index 44d4fcd07f..c154c7532d 100644 --- a/phpBB/phpbb/di/pass/kernel_pass.php +++ b/phpBB/phpbb/di/pass/kernel_pass.php @@ -23,6 +23,7 @@ class kernel_pass implements CompilerPassInterface * * @param ContainerBuilder $container ContainerBuilder object * @return null + * @throws \InvalidArgumentException */ public function process(ContainerBuilder $container) { diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php index 3a18644891..82ca9bf679 100644 --- a/phpBB/phpbb/di/service_collection.php +++ b/phpBB/phpbb/di/service_collection.php @@ -21,6 +21,11 @@ use Symfony\Component\DependencyInjection\ContainerInterface; class service_collection extends \ArrayObject { /** + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $container; + + /** * Constructor * * @param ContainerInterface $container Container object @@ -31,6 +36,37 @@ class service_collection extends \ArrayObject } /** + * {@inheritdoc} + */ + public function getIterator() + { + return new service_collection_iterator($this); + } + + // Because of a PHP issue we have to redefine offsetExists + // (even with a call to the parent): + // https://bugs.php.net/bug.php?id=66834 + // https://bugs.php.net/bug.php?id=67067 + // But it triggers a sniffer issue that we have to skip + // @codingStandardsIgnoreStart + /** + * {@inheritdoc} + */ + public function offsetExists($index) + { + return parent::offsetExists($index); + } + // @codingStandardsIgnoreEnd + + /** + * {@inheritdoc} + */ + public function offsetGet($index) + { + return $this->container->get($index); + } + + /** * Add a service to the collection * * @param string $name The service name @@ -38,8 +74,6 @@ class service_collection extends \ArrayObject */ public function add($name) { - $task = $this->container->get($name); - - $this->offsetSet($name, $task); + $this->offsetSet($name, null); } } diff --git a/phpBB/phpbb/di/service_collection_iterator.php b/phpBB/phpbb/di/service_collection_iterator.php new file mode 100644 index 0000000000..0d031ab52d --- /dev/null +++ b/phpBB/phpbb/di/service_collection_iterator.php @@ -0,0 +1,46 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\di; + +/** +* Iterator which loads the services when they are requested +*/ +class service_collection_iterator extends \ArrayIterator +{ + /** + * @var \phpbb\di\service_collection + */ + protected $collection; + + /** + * Construct an ArrayIterator for service_collection + * + * @param \phpbb\di\service_collection $collection The collection to iterate over + * @param int $flags Flags to control the behaviour of the ArrayObject object. + * @see ArrayObject::setFlags() + */ + public function __construct(service_collection $collection, $flags = 0) + { + parent::__construct($collection, $flags); + $this->collection = $collection; + } + + /** + * {@inheritdoc} + */ + public function current() + { + return $this->collection->offsetGet($this->key()); + } +} diff --git a/phpBB/phpbb/event/recursive_event_filter_iterator.php b/phpBB/phpbb/event/recursive_event_filter_iterator.php index f65feff448..64e2e56f6a 100644 --- a/phpBB/phpbb/event/recursive_event_filter_iterator.php +++ b/phpBB/phpbb/event/recursive_event_filter_iterator.php @@ -39,7 +39,8 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator * * @return recursive_event_filter_iterator */ - public function getChildren() { + public function getChildren() + { return new self($this->getInnerIterator()->getChildren(), $this->root_path); } diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index b83bb1b189..52d9395c82 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -148,7 +148,7 @@ class manager * Instantiates the metadata manager for the extension with the given name * * @param string $name The extension name - * @param string $template The template manager + * @param \phpbb\template\template $template The template manager * @return \phpbb\extension\metadata_manager Instance of the metadata manager */ public function create_extension_metadata_manager($name, \phpbb\template\template $template) diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index 5c4e8fbf00..014d8c79c7 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -90,11 +90,11 @@ class metadata_manager } /** - * Processes and gets the metadata requested - * - * @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term. - * @return array Contains all of the requested metadata, throws an exception on failure - */ + * Processes and gets the metadata requested + * + * @param string $element All for all metadata that it has and is valid, otherwise specify which section you want by its shorthand term. + * @return array Contains all of the requested metadata, throws an exception on failure + */ public function get_metadata($element = 'all') { $this->set_metadata_file(); @@ -136,10 +136,10 @@ class metadata_manager } /** - * Sets the filepath of the metadata file - * - * @return boolean Set to true if it exists, throws an exception on failure - */ + * Sets the filepath of the metadata file + * + * @throws \phpbb\extension\exception + */ private function set_metadata_file() { $ext_filepath = $this->extension_manager->get_extension_path($this->ext_name); @@ -154,10 +154,11 @@ class metadata_manager } /** - * Gets the contents of the composer.json file - * - * @return bool True if success, throws an exception on failure - */ + * Gets the contents of the composer.json file + * + * @return bool True if success, throws an exception on failure + * @throws \phpbb\extension\exception + */ private function fetch_metadata() { if (!file_exists($this->metadata_file)) @@ -183,10 +184,10 @@ class metadata_manager } /** - * This array handles the cleaning of the array - * - * @return array Contains the cleaned metadata array - */ + * This array handles the cleaning of the array + * + * @return array Contains the cleaned metadata array + */ private function clean_metadata_array() { return $this->metadata; @@ -199,6 +200,7 @@ class metadata_manager * "display" for name, type, and authors * "name", "type") * @return Bool True if valid, throws an exception if invalid + * @throws \phpbb\extension\exception */ public function validate($name = 'display') { @@ -247,10 +249,11 @@ class metadata_manager } /** - * Validates the contents of the authors field - * - * @return boolean True when passes validation, throws exception if invalid - */ + * Validates the contents of the authors field + * + * @return boolean True when passes validation, throws exception if invalid + * @throws \phpbb\extension\exception + */ public function validate_authors() { if (empty($this->metadata['authors'])) @@ -270,10 +273,10 @@ class metadata_manager } /** - * This array handles the verification that this extension can be enabled on this board - * - * @return bool True if validation succeeded, False if failed - */ + * This array handles the verification that this extension can be enabled on this board + * + * @return bool True if validation succeeded, False if failed + */ public function validate_enable() { // Check for valid directory & phpBB, PHP versions @@ -286,10 +289,10 @@ class metadata_manager } /** - * Validates the most basic directory structure to ensure it follows <vendor>/<ext> convention. - * - * @return boolean True when passes validation - */ + * Validates the most basic directory structure to ensure it follows <vendor>/<ext> convention. + * + * @return boolean True when passes validation + */ public function validate_dir() { return (substr_count($this->ext_name, '/') === 1 && $this->ext_name == $this->get_metadata('name')); @@ -297,10 +300,10 @@ class metadata_manager /** - * Validates the contents of the phpbb requirement field - * - * @return boolean True when passes validation - */ + * Validates the contents of the phpbb requirement field + * + * @return boolean True when passes validation + */ public function validate_require_phpbb() { if (!isset($this->metadata['require']['phpbb/phpbb'])) @@ -312,10 +315,10 @@ class metadata_manager } /** - * Validates the contents of the php requirement field - * - * @return boolean True when passes validation - */ + * Validates the contents of the php requirement field + * + * @return boolean True when passes validation + */ public function validate_require_php() { if (!isset($this->metadata['require']['php'])) @@ -348,10 +351,10 @@ class metadata_manager } /** - * Outputs the metadata into the template - * - * @return null - */ + * Outputs the metadata into the template + * + * @return null + */ public function output_template_data() { $this->template->assign_vars(array( diff --git a/phpBB/phpbb/extension/provider.php b/phpBB/phpbb/extension/provider.php index e1d854df64..1c42cf7b5e 100644 --- a/phpBB/phpbb/extension/provider.php +++ b/phpBB/phpbb/extension/provider.php @@ -58,7 +58,7 @@ abstract class provider implements \IteratorAggregate /** * Retrieve an iterator over all items * - * @return ArrayIterator An iterator for the array of template paths + * @return \ArrayIterator An iterator for the array of template paths */ public function getIterator() { diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php index 36ecbbcc2e..e31854160a 100644 --- a/phpBB/phpbb/feed/base.php +++ b/phpBB/phpbb/feed/base.php @@ -70,15 +70,14 @@ abstract class base /** * Constructor * - * @param \phpbb\feed\helper $helper Feed helper - * @param \phpbb\config\config $config Config object + * @param \phpbb\feed\helper $helper Feed helper + * @param \phpbb\config\config $config Config object * @param \phpbb\db\driver\driver_interface $db Database connection - * @param \phpbb\cache\driver\driver_interface $cache Cache object - * @param \phpbb\user $user User object - * @param \phpbb\auth\auth $auth Auth object - * @param \phpbb\content_visibility $content_visibility Auth object - * @param string $phpEx php file extension - * @return null + * @param \phpbb\cache\driver\driver_interface $cache Cache object + * @param \phpbb\user $user User object + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\content_visibility $content_visibility Auth object + * @param string $phpEx php file extension */ function __construct(\phpbb\feed\helper $helper, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, $phpEx) { @@ -133,6 +132,9 @@ abstract class base /** * Set key + * + * @param string $key Key + * @param mixed $value Value */ function set($key, $value) { @@ -141,6 +143,9 @@ abstract class base /** * Get key + * + * @param string $key Key + * @return mixed */ function get($key) { diff --git a/phpBB/phpbb/feed/factory.php b/phpBB/phpbb/feed/factory.php index 84b4d5d560..f364f06d03 100644 --- a/phpBB/phpbb/feed/factory.php +++ b/phpBB/phpbb/feed/factory.php @@ -13,6 +13,8 @@ namespace phpbb\feed; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Factory class to return correct object */ @@ -20,7 +22,7 @@ class factory { /** * Service container object - * @var object + * @var ContainerInterface */ protected $container; @@ -33,12 +35,11 @@ class factory /** * Constructor * - * @param objec $container Container object - * @param \phpbb\config\config $config Config object + * @param ContainerInterface $container Container object + * @param \phpbb\config\config $config Config object * @param \phpbb\db\driver\driver_interface $db Database connection - * @return null */ - public function __construct($container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) + public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) { $this->container = $container; $this->config = $config; diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index ed78f4893e..9741b752af 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -36,7 +36,7 @@ class helper * @param \phpbb\config\config $config Config object * @param \phpbb\user $user User object * @param string $phpbb_root_path Root path - * @return null + * @param string $phpEx PHP extension */ public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $phpEx) { diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index fe11fd2a79..011775b6af 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -48,8 +48,8 @@ abstract class post_base extends \phpbb\feed\attachments_base { $item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')]) - . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '') - . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : ''); + . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '') + . (($this->is_moderator_approve_forum($row['forum_id']) && (int) $row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : ''); } } } diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php index 4fbb498272..f9ff368cba 100644 --- a/phpBB/phpbb/feed/topic_base.php +++ b/phpBB/phpbb/feed/topic_base.php @@ -52,11 +52,11 @@ abstract class topic_base extends \phpbb\feed\attachments_base if ($this->is_moderator_approve_forum($row['forum_id'])) { - if ( (int)$row['topic_visibility'] === ITEM_DELETED) + if ((int) $row['topic_visibility'] === ITEM_DELETED) { $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_DELETED']; } - else if ((int)$row['topic_visibility'] === ITEM_UNAPPROVED) + else if ((int) $row['topic_visibility'] === ITEM_UNAPPROVED) { $item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_UNAPPROVED']; } diff --git a/phpBB/phpbb/groupposition/legend.php b/phpBB/phpbb/groupposition/legend.php index af903e363e..efea3389d4 100644 --- a/phpBB/phpbb/groupposition/legend.php +++ b/phpBB/phpbb/groupposition/legend.php @@ -53,7 +53,9 @@ class legend implements \phpbb\groupposition\groupposition_interface /** * Returns the group_legend for a given group, if the group exists. * - * {@inheritDoc} + * @param int $group_id group_id of the group to be selected + * @return int position of the group + * @throws \phpbb\groupposition\exception */ public function get_group_value($group_id) { @@ -76,7 +78,7 @@ class legend implements \phpbb\groupposition\groupposition_interface /** * Get number of groups, displayed on the legend * - * {@inheritDoc} + * @return int value of the last item displayed */ public function get_group_count() { @@ -91,8 +93,6 @@ class legend implements \phpbb\groupposition\groupposition_interface } /** - * Adds a group by group_id - * * {@inheritDoc} */ public function add_group($group_id) @@ -118,7 +118,9 @@ class legend implements \phpbb\groupposition\groupposition_interface /** * Deletes a group by setting the field to self::GROUP_DISABLED and closing the gap in the list. * - * {@inheritDoc} + * @param int $group_id group_id of the group to be deleted + * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. + * @return bool True if the group was deleted successfully */ public function delete_group($group_id, $skip_group = false) { @@ -150,8 +152,6 @@ class legend implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group up by group_id - * * {@inheritDoc} */ public function move_up($group_id) @@ -160,8 +160,6 @@ class legend implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group down by group_id - * * {@inheritDoc} */ public function move_down($group_id) @@ -170,8 +168,6 @@ class legend implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group up/down - * * {@inheritDoc} */ public function move($group_id, $delta) diff --git a/phpBB/phpbb/groupposition/teampage.php b/phpBB/phpbb/groupposition/teampage.php index 3e675549bf..2985c51525 100644 --- a/phpBB/phpbb/groupposition/teampage.php +++ b/phpBB/phpbb/groupposition/teampage.php @@ -65,7 +65,9 @@ class teampage implements \phpbb\groupposition\groupposition_interface /** * Returns the teampage position for a given group, if the group exists. * - * {@inheritDoc} + * @param int $group_id group_id of the group to be selected + * @return int position of the group + * @throws \phpbb\groupposition\exception */ public function get_group_value($group_id) { @@ -93,6 +95,7 @@ class teampage implements \phpbb\groupposition\groupposition_interface * * @param int $group_id group_id of the group to be selected * @return array Data row of the group + * @throws \phpbb\groupposition\exception */ public function get_group_values($group_id) { @@ -120,6 +123,7 @@ class teampage implements \phpbb\groupposition\groupposition_interface * * @param int $teampage_id Teampage_id of the selected item * @return int Teampage position of the item + * @throws \phpbb\groupposition\exception */ public function get_teampage_value($teampage_id) { @@ -144,6 +148,7 @@ class teampage implements \phpbb\groupposition\groupposition_interface * * @param int $teampage_id Teampage_id of the selected item * @return array Teampage row of the item + * @throws \phpbb\groupposition\exception */ public function get_teampage_values($teampage_id) { @@ -165,8 +170,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface /** - * Get number of items displayed - * * {@inheritDoc} */ public function get_group_count() @@ -182,8 +185,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface } /** - * Adds a group by group_id - * * {@inheritDoc} */ public function add_group($group_id) @@ -288,7 +289,9 @@ class teampage implements \phpbb\groupposition\groupposition_interface /** * Deletes a group from the list and closes the gap in the position list. * - * {@inheritDoc} + * @param int $group_id group_id of the group to be deleted + * @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway. + * @return bool True if the group was deleted successfully */ public function delete_group($group_id, $skip_group = false) { @@ -347,8 +350,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group up by group_id - * * {@inheritDoc} */ public function move_up($group_id) @@ -359,7 +360,7 @@ class teampage implements \phpbb\groupposition\groupposition_interface /** * Moves an item up by teampage_id * - * @param int $group_id group_id of the group to be moved + * @param int $teampage_id teampage_id of the item to be move * @return bool True if the group was moved successfully */ public function move_up_teampage($teampage_id) @@ -368,8 +369,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group down by group_id - * * {@inheritDoc} */ public function move_down($group_id) @@ -378,9 +377,9 @@ class teampage implements \phpbb\groupposition\groupposition_interface } /** - * Movesan item down by teampage_id + * Moves an item down by teampage_id * - * @param int $group_id group_id of the group to be moved + * @param int $teampage_id teampage_id of the item to be moved * @return bool True if the group was moved successfully */ public function move_down_teampage($teampage_id) @@ -389,8 +388,6 @@ class teampage implements \phpbb\groupposition\groupposition_interface } /** - * Moves a group up/down - * * {@inheritDoc} */ public function move($group_id, $delta) diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index e3c7e97792..85ba9a7aa3 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -54,8 +54,8 @@ class db * * You have to call acquire() to actually create the lock. * - * @param string $config_name A config variable to be used for locking - * @param array $config The phpBB configuration + * @param string $config_name A config variable to be used for locking + * @param \phpbb\config\config $config The phpBB configuration * @param \phpbb\db\driver\driver_interface $db A database connection */ public function __construct($config_name, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db) diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 10efe5fd1c..bf0bfe0ae1 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -70,7 +70,7 @@ class log implements \phpbb\log\log_interface /** * Event dispatcher object - * @var phpbb_dispatcher + * @var \phpbb\event\dispatcher */ protected $dispatcher; @@ -103,7 +103,6 @@ class log implements \phpbb\log\log_interface * @param string $relative_admin_path Relative admin root path * @param string $php_ext PHP Extension * @param string $log_table Name of the table we use to store our logs - * @return null */ public function __construct($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, $relative_admin_path, $php_ext, $log_table) { @@ -159,8 +158,6 @@ class log implements \phpbb\log\log_interface } /** - * This function returns the state of the log system. - * * {@inheritDoc} */ public function is_enabled($type = '') @@ -173,12 +170,6 @@ class log implements \phpbb\log\log_interface } /** - * Disable log - * - * This function allows disabling the log system or parts of it, for this - * page call. When add_log is called and the type is disabled, - * the log will not be added to the database. - * * {@inheritDoc} */ public function disable($type = '') @@ -201,10 +192,6 @@ class log implements \phpbb\log\log_interface } /** - * Enable log - * - * This function allows re-enabling the log system. - * * {@inheritDoc} */ public function enable($type = '') @@ -227,8 +214,6 @@ class log implements \phpbb\log\log_interface } /** - * Adds a log to the database - * * {@inheritDoc} */ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()) @@ -425,8 +410,6 @@ class log implements \phpbb\log\log_interface } /** - * Grab the logs from the database - * * {@inheritDoc} */ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '') @@ -863,8 +846,6 @@ class log implements \phpbb\log\log_interface } /** - * Get total log count - * * {@inheritDoc} */ public function get_log_count() @@ -873,8 +854,6 @@ class log implements \phpbb\log\log_interface } /** - * Get offset of the last valid log page - * * {@inheritDoc} */ public function get_valid_offset() diff --git a/phpBB/phpbb/message/message.php b/phpBB/phpbb/message/message.php index 182995ba21..7ba2b2f32d 100644 --- a/phpBB/phpbb/message/message.php +++ b/phpBB/phpbb/message/message.php @@ -106,7 +106,7 @@ class message /** * Add a recipient from \phpbb\user * - * @param \phpbb\user $user + * @param array $user * @return null */ public function add_recipient_from_user_row(array $user) @@ -231,7 +231,7 @@ class message * Send the email * * @param \messenger $messenger - * @param string $phpEx + * @param string $contact * @return null */ public function send(\messenger $messenger, $contact) diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 7c0177b57b..9c83e8dd73 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -16,7 +16,7 @@ namespace phpbb\mimetype; class content_guesser extends guesser_base { /** - * @inheritdoc + * {@inheritdoc} */ public function is_supported() { @@ -24,7 +24,7 @@ class content_guesser extends guesser_base } /** - * @inheritdoc + * {@inheritdoc} */ public function guess($file, $file_name = '') { diff --git a/phpBB/phpbb/mimetype/extension_guesser.php b/phpBB/phpbb/mimetype/extension_guesser.php index 74bfeb97b6..9e36c07f91 100644 --- a/phpBB/phpbb/mimetype/extension_guesser.php +++ b/phpBB/phpbb/mimetype/extension_guesser.php @@ -470,7 +470,7 @@ class extension_guesser extends guesser_base ); /** - * @inheritdoc + * {@inheritdoc} */ public function is_supported() { @@ -478,7 +478,7 @@ class extension_guesser extends guesser_base } /** - * @inheritdoc + * {@inheritdoc} */ public function guess($file, $file_name = '') { diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php index 6eb924b584..87b164b561 100644 --- a/phpBB/phpbb/mimetype/guesser.php +++ b/phpBB/phpbb/mimetype/guesser.php @@ -21,7 +21,7 @@ class guesser const PRIORITY_DEFAULT = 0; /** - * @var mimetype guessers + * @var array guessers */ protected $guessers; diff --git a/phpBB/phpbb/mimetype/guesser_base.php b/phpBB/phpbb/mimetype/guesser_base.php index f26f207aff..225dfd57dc 100644 --- a/phpBB/phpbb/mimetype/guesser_base.php +++ b/phpBB/phpbb/mimetype/guesser_base.php @@ -21,7 +21,7 @@ abstract class guesser_base implements guesser_interface protected $priority; /** - * @inheritdoc + * {@inheritdoc} */ public function get_priority() { @@ -29,7 +29,7 @@ abstract class guesser_base implements guesser_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function set_priority($priority) { diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index c3539e76df..74ef980445 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -13,6 +13,8 @@ namespace phpbb\notification; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Notifications service class */ @@ -24,7 +26,7 @@ class manager /** @var array */ protected $notification_methods; - /** @var ContainerBuilder */ + /** @var ContainerInterface */ protected $phpbb_container; /** @var \phpbb\user_loader */ @@ -62,7 +64,7 @@ class manager * * @param array $notification_types * @param array $notification_methods - * @param ContainerBuilder $phpbb_container + * @param ContainerInterface $phpbb_container * @param \phpbb\user_loader $user_loader * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver_interface $db @@ -74,7 +76,7 @@ class manager * @param string $user_notifications_table * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; @@ -574,6 +576,34 @@ class manager return $subscription_methods; } + + /** + * Get user's notification data + * + * @param int $user_id The user_id of the user to get the notifications for + * + * @return array User's notification + */ + protected function get_user_notifications($user_id) + { + $sql = 'SELECT method, notify, item_type + FROM ' . $this->user_notifications_table . ' + WHERE user_id = ' . (int) $user_id . ' + AND item_id = 0'; + + $result = $this->db->sql_query($sql); + $user_notifications = array(); + + while ($row = $this->db->sql_fetchrow($result)) + { + $user_notifications[$row['item_type']][] = $row; + } + + $this->db->sql_freeresult($result); + + return $user_notifications; + } + /** * Get global subscriptions (item_id = 0) * @@ -587,28 +617,23 @@ class manager $subscriptions = array(); - foreach ($this->get_subscription_types() as $group_name => $types) + $user_notifications = $this->get_user_notifications($user_id); + + foreach ($this->get_subscription_types() as $types) { foreach ($types as $id => $type) { - $sql = 'SELECT method, notify - FROM ' . $this->user_notifications_table . ' - WHERE user_id = ' . (int) $user_id . " - AND item_type = '" . $this->db->sql_escape($id) . "' - AND item_id = 0"; - $result = $this->db->sql_query($sql); - - $row = $this->db->sql_fetchrow($result); - if (!$row) + + if (empty($user_notifications[$id])) { // No rows at all, default to '' $subscriptions[$id] = array(''); } else { - do + foreach ($user_notifications[$id] as $user_notification) { - if (!$row['notify']) + if (!$user_notification['notify']) { continue; } @@ -618,12 +643,9 @@ class manager $subscriptions[$id] = array(); } - $subscriptions[$id][] = $row['method']; + $subscriptions[$id][] = $user_notification['method']; } - while ($row = $this->db->sql_fetchrow($result)); } - - $this->db->sql_freeresult($result); } } @@ -866,6 +888,7 @@ class manager * * @param string $notification_type_name The name * @return int the notification_type_id + * @throws \phpbb\notification\exception */ public function get_notification_type_id($notification_type_name) { diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php index 927d711f4b..8aba41d651 100644 --- a/phpBB/phpbb/pagination.php +++ b/phpBB/phpbb/pagination.php @@ -46,7 +46,7 @@ class pagination * If you use page numbers inside your controller route, start name should be the string * that should be removed for the first page (example: /page/%d) * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce - * @return URL for the requested page + * @return string URL for the requested page */ protected function generate_page_link($base_url, $on_page, $start_name, $per_page) { @@ -126,8 +126,8 @@ class pagination // determine this number. Again at most five pages? Then just display them all. More than // five and we first (min) determine whether we'd end up listing more pages than exist. // We then (max) ensure we're displaying the minimum number of pages. - $start_page = ($total_pages > 5) ? min(max(1, $on_page - 3), $total_pages - 4) : 1; - $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 3), 5) : $total_pages; + $start_page = ($total_pages > 5) ? min(max(1, $on_page - 2), $total_pages - 4) : 1; + $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 2), 5) : $total_pages; } if ($on_page != 1) diff --git a/phpBB/phpbb/passwords/driver/base.php b/phpBB/phpbb/passwords/driver/base.php index 1d47180e55..fd07a61bf4 100644 --- a/phpBB/phpbb/passwords/driver/base.php +++ b/phpBB/phpbb/passwords/driver/base.php @@ -15,10 +15,10 @@ namespace phpbb\passwords\driver; abstract class base implements driver_interface { - /** @var phpbb\config\config */ + /** @var \phpbb\config\config */ protected $config; - /** @var phpbb\passwords\driver\helper */ + /** @var \phpbb\passwords\driver\helper */ protected $helper; /** @var driver name */ @@ -37,7 +37,7 @@ abstract class base implements driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function is_supported() { @@ -45,7 +45,7 @@ abstract class base implements driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -53,7 +53,7 @@ abstract class base implements driver_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_settings_only($hash, $full = false) { diff --git a/phpBB/phpbb/passwords/driver/bcrypt.php b/phpBB/phpbb/passwords/driver/bcrypt.php index de5840c7cf..23add37a56 100644 --- a/phpBB/phpbb/passwords/driver/bcrypt.php +++ b/phpBB/phpbb/passwords/driver/bcrypt.php @@ -18,7 +18,7 @@ class bcrypt extends base const PREFIX = '$2a$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class bcrypt extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $salt = '') { @@ -58,7 +58,7 @@ class bcrypt extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { @@ -86,7 +86,7 @@ class bcrypt extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_settings_only($hash, $full = false) { diff --git a/phpBB/phpbb/passwords/driver/bcrypt_2y.php b/phpBB/phpbb/passwords/driver/bcrypt_2y.php index 8b59037fca..c710e0d04a 100644 --- a/phpBB/phpbb/passwords/driver/bcrypt_2y.php +++ b/phpBB/phpbb/passwords/driver/bcrypt_2y.php @@ -18,7 +18,7 @@ class bcrypt_2y extends bcrypt const PREFIX = '$2y$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class bcrypt_2y extends bcrypt } /** - * @inheritdoc + * {@inheritdoc} */ public function is_supported() { diff --git a/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php index f706c7af69..2d6f897a7b 100644 --- a/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php +++ b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php @@ -20,7 +20,7 @@ class bcrypt_wcf2 extends base /** @var \phpbb\passwords\driver\bcrypt */ protected $bcrypt; - /** @var phpbb\passwords\driver\helper */ + /** @var \phpbb\passwords\driver\helper */ protected $helper; /** @@ -36,7 +36,7 @@ class bcrypt_wcf2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -44,7 +44,7 @@ class bcrypt_wcf2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -52,7 +52,7 @@ class bcrypt_wcf2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -61,7 +61,7 @@ class bcrypt_wcf2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/convert_password.php b/phpBB/phpbb/passwords/driver/convert_password.php index 45d84f45c0..eb70434df2 100644 --- a/phpBB/phpbb/passwords/driver/convert_password.php +++ b/phpBB/phpbb/passwords/driver/convert_password.php @@ -18,7 +18,7 @@ class convert_password extends base const PREFIX = '$CP$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class convert_password extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -34,7 +34,7 @@ class convert_password extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/driver_interface.php b/phpBB/phpbb/passwords/driver/driver_interface.php index a257e71f23..3974484f13 100644 --- a/phpBB/phpbb/passwords/driver/driver_interface.php +++ b/phpBB/phpbb/passwords/driver/driver_interface.php @@ -51,7 +51,7 @@ interface driver_interface * * @param string $password The password to check * @param string $hash The password hash to check against - * @param string $user_row User's row in users table + * @param array $user_row User's row in users table * * @return bool True if password is correct, else false */ diff --git a/phpBB/phpbb/passwords/driver/helper.php b/phpBB/phpbb/passwords/driver/helper.php index 85019bd5c9..2b3ebce53a 100644 --- a/phpBB/phpbb/passwords/driver/helper.php +++ b/phpBB/phpbb/passwords/driver/helper.php @@ -16,7 +16,7 @@ namespace phpbb\passwords\driver; class helper { /** - * @var phpbb\config\config + * @var \phpbb\config\config */ protected $config; @@ -29,7 +29,7 @@ class helper /** * Construct a driver helper object * - * @param phpbb\config\config $config phpBB configuration + * @param \phpbb\config\config $config phpBB configuration */ public function __construct(\phpbb\config\config $config) { diff --git a/phpBB/phpbb/passwords/driver/md5_mybb.php b/phpBB/phpbb/passwords/driver/md5_mybb.php index 0745bceb5e..61ea8dafd8 100644 --- a/phpBB/phpbb/passwords/driver/md5_mybb.php +++ b/phpBB/phpbb/passwords/driver/md5_mybb.php @@ -18,7 +18,7 @@ class md5_mybb extends base const PREFIX = '$md5_mybb$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class md5_mybb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class md5_mybb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -43,7 +43,7 @@ class md5_mybb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/md5_phpbb2.php b/phpBB/phpbb/passwords/driver/md5_phpbb2.php index de1993e8a1..86a4b62ea5 100644 --- a/phpBB/phpbb/passwords/driver/md5_phpbb2.php +++ b/phpBB/phpbb/passwords/driver/md5_phpbb2.php @@ -23,10 +23,10 @@ class md5_phpbb2 extends base /** @var \phpbb\passwords\driver\salted_md5 */ protected $salted_md5; - /** @var phpBB root path */ + /** @var string phpBB root path */ protected $phpbb_root_path; - /** @var php file extension */ + /** @var string php file extension */ protected $php_ext; /** @@ -46,7 +46,7 @@ class md5_phpbb2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -54,7 +54,7 @@ class md5_phpbb2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -62,7 +62,7 @@ class md5_phpbb2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -71,7 +71,7 @@ class md5_phpbb2 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/md5_vb.php b/phpBB/phpbb/passwords/driver/md5_vb.php index 440b9e39e9..c83c32a596 100644 --- a/phpBB/phpbb/passwords/driver/md5_vb.php +++ b/phpBB/phpbb/passwords/driver/md5_vb.php @@ -18,7 +18,7 @@ class md5_vb extends base const PREFIX = '$md5_vb$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class md5_vb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class md5_vb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -43,7 +43,7 @@ class md5_vb extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/phpass.php b/phpBB/phpbb/passwords/driver/phpass.php index 44d9dc8fab..bef8355276 100644 --- a/phpBB/phpbb/passwords/driver/phpass.php +++ b/phpBB/phpbb/passwords/driver/phpass.php @@ -18,7 +18,7 @@ class phpass extends salted_md5 const PREFIX = '$P$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { diff --git a/phpBB/phpbb/passwords/driver/salted_md5.php b/phpBB/phpbb/passwords/driver/salted_md5.php index b5f59754e1..97a2b9154b 100644 --- a/phpBB/phpbb/passwords/driver/salted_md5.php +++ b/phpBB/phpbb/passwords/driver/salted_md5.php @@ -46,7 +46,7 @@ class salted_md5 extends base const PREFIX = '$H$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -54,7 +54,7 @@ class salted_md5 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -62,7 +62,7 @@ class salted_md5 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $setting = '') { @@ -98,7 +98,7 @@ class salted_md5 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { @@ -160,7 +160,7 @@ class salted_md5 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function get_settings_only($hash, $full = false) { diff --git a/phpBB/phpbb/passwords/driver/sha1.php b/phpBB/phpbb/passwords/driver/sha1.php index 5d6c93f6a8..0852fd32fc 100644 --- a/phpBB/phpbb/passwords/driver/sha1.php +++ b/phpBB/phpbb/passwords/driver/sha1.php @@ -18,7 +18,7 @@ class sha1 extends base const PREFIX = '$sha1$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class sha1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class sha1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -43,7 +43,7 @@ class sha1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/sha1_smf.php b/phpBB/phpbb/passwords/driver/sha1_smf.php index 3e3322d77f..ec64bd6afb 100644 --- a/phpBB/phpbb/passwords/driver/sha1_smf.php +++ b/phpBB/phpbb/passwords/driver/sha1_smf.php @@ -18,7 +18,7 @@ class sha1_smf extends base const PREFIX = '$smf$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class sha1_smf extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class sha1_smf extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -42,7 +42,7 @@ class sha1_smf extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/sha1_wcf1.php b/phpBB/phpbb/passwords/driver/sha1_wcf1.php index 04a69705e9..919fa2bb71 100644 --- a/phpBB/phpbb/passwords/driver/sha1_wcf1.php +++ b/phpBB/phpbb/passwords/driver/sha1_wcf1.php @@ -18,7 +18,7 @@ class sha1_wcf1 extends base const PREFIX = '$wcf1$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class sha1_wcf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class sha1_wcf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -43,7 +43,7 @@ class sha1_wcf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/driver/sha_xf1.php b/phpBB/phpbb/passwords/driver/sha_xf1.php index 7ae0b90f51..7a1ea1450a 100644 --- a/phpBB/phpbb/passwords/driver/sha_xf1.php +++ b/phpBB/phpbb/passwords/driver/sha_xf1.php @@ -18,7 +18,7 @@ class sha_xf1 extends base const PREFIX = '$xf1$'; /** - * @inheritdoc + * {@inheritdoc} */ public function get_prefix() { @@ -26,7 +26,7 @@ class sha_xf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function is_legacy() { @@ -34,7 +34,7 @@ class sha_xf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function hash($password, $user_row = '') { @@ -43,7 +43,7 @@ class sha_xf1 extends base } /** - * @inheritdoc + * {@inheritdoc} */ public function check($password, $hash, $user_row = array()) { diff --git a/phpBB/phpbb/passwords/helper.php b/phpBB/phpbb/passwords/helper.php index c6c5fb6d02..c2a49202cd 100644 --- a/phpBB/phpbb/passwords/helper.php +++ b/phpBB/phpbb/passwords/helper.php @@ -60,7 +60,7 @@ class helper $data[$type] .= ($data[$type] !== '$') ? '\\' : ''; $data[$type] .= str_replace('$', '', $value); } - elseif ($type == 'settings') + else if ($type == 'settings') { $data[$type] .= ($data[$type] !== '$') ? '$' : ''; $data[$type] .= $value; diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index 0a349c4a14..fbb49d86a0 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -39,23 +39,23 @@ class manager /** * Passwords helper - * @var phpbb\passwords\helper + * @var \phpbb\passwords\helper */ protected $helper; /** * phpBB configuration - * @var phpbb\config\config + * @var \phpbb\config\config */ protected $config; /** * Construct a passwords object * - * @param phpbb\config\config $config phpBB configuration + * @param \phpbb\config\config $config phpBB configuration * @param array $hashing_algorithms Hashing driver * service collection - * @param phpbb\passwords\helper $helper Passwords helper object + * @param \phpbb\passwords\helper $helper Passwords helper object * @param string $defaults List of default driver types */ public function __construct(\phpbb\config\config $config, $hashing_algorithms, helper $helper, $defaults) @@ -89,7 +89,7 @@ class manager /** * Fill algorithm type map * - * @param phpbb\di\service_collection $hashing_algorithms + * @param \phpbb\di\service_collection $hashing_algorithms */ protected function fill_type_map($hashing_algorithms) { diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index 0d83e7447e..a5314d2ce1 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -317,7 +317,7 @@ class path_helper * * @param string $url URL to append parameters to * @param array $new_params Parameters to add in the form of array(name => value) - * @param string $is_amp Is the parameter separator &. Defaults to true. + * @param bool $is_amp Is the parameter separator &. Defaults to true. * @return string Returns the new URL. */ public function append_url_params($url, $new_params, $is_amp = true) diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index 72d85cb094..3f51016c93 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -32,7 +32,6 @@ class permissions * * @param \phpbb\event\dispatcher $phpbb_dispatcher Event dispatcher * @param \phpbb\user $user User Object - * @return null */ public function __construct(\phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\user $user) { diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 99278d40df..c610d49a63 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -69,8 +69,6 @@ class plupload * @param \phpbb\user $user * @param \phpbb\php\ini $php_ini * @param \phpbb\mimetype\guesser $mimetype_guesser - * - * @return null */ public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini, \phpbb\mimetype\guesser $mimetype_guesser) { diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php index 3ca1274458..c770a0d93c 100644 --- a/phpBB/phpbb/profilefields/type/type_base.php +++ b/phpBB/phpbb/profilefields/type/type_base.php @@ -39,7 +39,6 @@ abstract class type_base implements type_interface * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php index 8d3c0cad93..eb8d3e47d6 100644 --- a/phpBB/phpbb/profilefields/type/type_bool.php +++ b/phpBB/phpbb/profilefields/type/type_bool.php @@ -46,7 +46,6 @@ class type_bool extends type_base * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php index aedd6a56d6..158eec6a0c 100644 --- a/phpBB/phpbb/profilefields/type/type_date.php +++ b/phpBB/phpbb/profilefields/type/type_date.php @@ -39,7 +39,6 @@ class type_date extends type_base * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php index 053a02d593..52c9fcf86a 100644 --- a/phpBB/phpbb/profilefields/type/type_dropdown.php +++ b/phpBB/phpbb/profilefields/type/type_dropdown.php @@ -46,7 +46,6 @@ class type_dropdown extends type_base * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\profilefields\lang_helper $lang_helper, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php index 8cbcf62b8c..78f1c7d2c9 100644 --- a/phpBB/phpbb/profilefields/type/type_int.php +++ b/phpBB/phpbb/profilefields/type/type_int.php @@ -39,7 +39,6 @@ class type_int extends type_base * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php index 7e994d700b..67befc457d 100644 --- a/phpBB/phpbb/profilefields/type/type_string.php +++ b/phpBB/phpbb/profilefields/type/type_string.php @@ -39,7 +39,6 @@ class type_string extends type_string_common * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/profilefields/type/type_text.php b/phpBB/phpbb/profilefields/type/type_text.php index 856573292f..bacf60a213 100644 --- a/phpBB/phpbb/profilefields/type/type_text.php +++ b/phpBB/phpbb/profilefields/type/type_text.php @@ -39,7 +39,6 @@ class type_text extends type_string_common * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object - * @param string $language_table Table where the language strings are stored */ public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) { diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 49d528c8ba..bdb5a86009 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -263,12 +263,12 @@ class fulltext_postgres extends \phpbb\search\base $this->search_query .= $word . ' '; $this->tsearch_query .= '&' . substr($word, 1) . ' '; } - elseif (strpos($word, '-') === 0) + else if (strpos($word, '-') === 0) { $this->search_query .= $word . ' '; $this->tsearch_query .= '&!' . substr($word, 1) . ' '; } - elseif (strpos($word, '|') === 0) + else if (strpos($word, '|') === 0) { $this->search_query .= $word . ' '; $this->tsearch_query .= '|' . substr($word, 1) . ' '; diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index c6c636562e..9008af338b 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -693,7 +693,7 @@ class fulltext_sphinx { if ($mode == 'edit') { - $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int)$post_id => array((int)$forum_id, (int)$poster_id))); + $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int) $post_id => array((int) $forum_id, (int) $poster_id))); } else if ($mode != 'post' && $post_id) { @@ -718,7 +718,7 @@ class fulltext_sphinx $post_time = time(); while ($row = $this->db->sql_fetchrow($result)) { - $post_updates[(int)$row['post_id']] = array($post_time); + $post_updates[(int) $row['post_id']] = array($post_time); } $this->db->sql_freeresult($result); diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php index 62e155aa23..bf9ddec493 100644 --- a/phpBB/phpbb/symfony_request.php +++ b/phpBB/phpbb/symfony_request.php @@ -20,7 +20,7 @@ class symfony_request extends Request /** * Constructor * - * @param phpbb\request\request_interface $phpbb_request + * @param \phpbb\request\request_interface $phpbb_request */ public function __construct(\phpbb\request\request_interface $phpbb_request) { diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 8df6c8b492..0a32879943 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -55,6 +55,7 @@ class context * * @param string $varname Variable name * @param string $varval Value to assign to variable + * @return true */ public function assign_var($varname, $varval) { @@ -70,6 +71,7 @@ class context * * @param string $varname Variable name * @param string $varval Value to append to variable + * @return true */ public function append_var($varname, $varval) { @@ -117,6 +119,7 @@ class context * * @param string $blockname Name of block to assign $vararray to * @param array $vararray A hash of variable name => value pairs + * @return true */ public function assign_block_vars($blockname, array $vararray) { @@ -206,6 +209,7 @@ class context * * @param string $blockname Name of block to assign $block_vars_array to * @param array $block_vars_array An array of hashes of variable name => value pairs + * @return true */ public function assign_block_vars_array($blockname, array $block_vars_array) { @@ -374,6 +378,7 @@ class context * Reset/empty complete block * * @param string $blockname Name of block to destroy + * @return true */ public function destroy_block_vars($blockname) { diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php index 374f9e9359..041ecb12e4 100644 --- a/phpBB/phpbb/template/template.php +++ b/phpBB/phpbb/template/template.php @@ -175,6 +175,7 @@ interface template /** * Get path to template for handle (required for BBCode parser) * + * @param string $handle Handle to retrieve the source file * @return string */ public function get_source_file_for_handle($handle); diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index d71c02967c..8d25153e14 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -40,7 +40,7 @@ class environment extends \Twig_Environment * @param \phpbb\path_helper * @param \phpbb\extension\manager * @param string $phpbb_root_path - * @param Twig_LoaderInterface $loader + * @param \Twig_LoaderInterface $loader * @param array $options Array of options to pass to Twig */ public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array()) @@ -122,7 +122,7 @@ class environment extends \Twig_Environment * Set the namespace look up order to load templates from * * @param array $namespace - * @return Twig_Environment + * @return \Twig_Environment */ public function setNamespaceLookUpOrder($namespace) { @@ -132,12 +132,13 @@ class environment extends \Twig_Environment } /** - * Loads a template by name. - * - * @param string $name The template name - * @param integer $index The index if it is an embedded template - * @return Twig_TemplateInterface A template instance representing the given template name - */ + * Loads a template by name. + * + * @param string $name The template name + * @param integer $index The index if it is an embedded template + * @return \Twig_TemplateInterface A template instance representing the given template name + * @throws \Twig_Error_Loader + */ public function loadTemplate($name, $index = null) { if (strpos($name, '@') === false) @@ -168,11 +169,12 @@ class environment extends \Twig_Environment } /** - * Finds a template by name. - * - * @param string $name The template name - * @return string - */ + * Finds a template by name. + * + * @param string $name The template name + * @return string + * @throws \Twig_Error_Loader + */ public function findTemplate($name) { if (strpos($name, '@') === false) @@ -188,7 +190,7 @@ class environment extends \Twig_Environment return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); } - catch (Twig_Error_Loader $e) + catch (\Twig_Error_Loader $e) { } } diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index a357db30a5..8f523684dd 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -127,7 +127,7 @@ class extension extends \Twig_Extension /** * Grabs a subset of a loop * - * @param Twig_Environment $env A Twig_Environment instance + * @param \Twig_Environment $env A Twig_Environment instance * @param mixed $item A variable * @param integer $start Start of the subset * @param integer $end End of the subset diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index 851eb9ddd0..2f8ffaa776 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -24,7 +24,7 @@ class loader extends \Twig_Loader_Filesystem * Set safe directories * * @param array $directories Array of directories that are safe (empty to clear) - * @return Twig_Loader_Filesystem + * @return \Twig_Loader_Filesystem */ public function setSafeDirectories($directories = array()) { @@ -45,7 +45,7 @@ class loader extends \Twig_Loader_Filesystem * Add safe directory * * @param string $directory Directory that should be added - * @return Twig_Loader_Filesystem + * @return \Twig_Loader_Filesystem */ public function addSafeDirectory($directory) { @@ -110,7 +110,7 @@ class loader extends \Twig_Loader_Filesystem // Try validating the name (which may throw an exception) parent::validateName($name); } - catch (Twig_Error_Loader $e) + catch (\Twig_Error_Loader $e) { if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0) { diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index fe336d4129..695ec4281f 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -23,10 +23,10 @@ class definenode extends \Twig_Node } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index b551d7a75e..8fc4ba4775 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\node; class event extends \Twig_Node { /** - * The subdirectory in which all template listener files must be placed - * @var string - */ + * The subdirectory in which all template listener files must be placed + * @var string + */ protected $listener_directory = 'event/'; - /** @var Twig_Environment */ + /** @var \Twig_Environment */ protected $environment; public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) @@ -33,10 +33,10 @@ class event extends \Twig_Node } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php index c41d4d03f3..15195a226b 100644 --- a/phpBB/phpbb/template/twig/node/includeasset.php +++ b/phpBB/phpbb/template/twig/node/includeasset.php @@ -15,7 +15,7 @@ namespace phpbb\template\twig\node; abstract class includeasset extends \Twig_Node { - /** @var Twig_Environment */ + /** @var \Twig_Environment */ protected $environment; public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) @@ -25,10 +25,10 @@ abstract class includeasset extends \Twig_Node parent::__construct(array('expr' => $expr), array(), $lineno, $tag); } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); @@ -74,7 +74,7 @@ abstract class includeasset extends \Twig_Node /** * Append the output code for the asset * - * @param Twig_Compiler A Twig_Compiler instance + * @param \Twig_Compiler A Twig_Compiler instance * @return null */ abstract protected function append_asset(\Twig_Compiler $compiler); diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 141c9ffe66..42428b6106 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -17,10 +17,10 @@ namespace phpbb\template\twig\node; class includenode extends \Twig_Node_Include { /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index e7df11c74e..826617e8e8 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -17,7 +17,7 @@ namespace phpbb\template\twig\node; class includephp extends \Twig_Node { - /** @var Twig_Environment */ + /** @var \Twig_Environment */ protected $environment; public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) @@ -28,10 +28,10 @@ class includephp extends \Twig_Node } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index de3a8a4af1..3a24513dca 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -16,7 +16,7 @@ namespace phpbb\template\twig\node; class php extends \Twig_Node { - /** @var Twig_Environment */ + /** @var \Twig_Environment */ protected $environment; public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null) @@ -27,10 +27,10 @@ class php extends \Twig_Node } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * Compiles the node to PHP. + * + * @param \Twig_Compiler A Twig_Compiler instance + */ public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 48c4853fe8..cfee84a363 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -18,12 +18,14 @@ namespace phpbb\template\twig\tokenparser; class defineparser extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + * @throws \Twig_Error_Syntax + * @throws \phpbb\template\twig\node\definenode + */ public function parse(\Twig_Token $token) { $lineno = $token->getLine(); @@ -61,10 +63,10 @@ class defineparser extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'DEFINE'; diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 05b963f3e8..4c7c8e07d9 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser; class event extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -34,10 +34,10 @@ class event extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'EVENT'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php index c7d2bb712e..1f30811754 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includecss.php +++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php @@ -16,12 +16,12 @@ namespace phpbb\template\twig\tokenparser; class includecss extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -33,10 +33,10 @@ class includecss extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'INCLUDECSS'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 0c32692209..4156048e42 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser; class includejs extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -34,10 +34,10 @@ class includejs extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'INCLUDEJS'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index e9f4db0890..6ee78e5562 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser; class includeparser extends \Twig_TokenParser_Include { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -34,10 +34,10 @@ class includeparser extends \Twig_TokenParser_Include } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'INCLUDE'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index f745c320c2..38196c5290 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser; class includephp extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -44,10 +44,10 @@ class includephp extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'INCLUDEPHP'; diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index 0546a2d93f..557a70cca1 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser; class php extends \Twig_TokenParser { /** - * Parses a token and returns a node. - * - * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance - */ + * Parses a token and returns a node. + * + * @param \Twig_Token $token A Twig_Token instance + * + * @return \Twig_NodeInterface A Twig_NodeInterface instance + */ public function parse(\Twig_Token $token) { $stream = $this->parser->getStream(); @@ -42,10 +42,10 @@ class php extends \Twig_TokenParser } /** - * Gets the tag name associated with this token parser. - * - * @return string The tag name - */ + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ public function getTag() { return 'PHP'; diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index bf27dd5f20..5e2057f818 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -67,7 +67,7 @@ class twig extends \phpbb\template\base /** * Twig Environment * - * @var Twig_Environment + * @var \Twig_Environment */ protected $twig; @@ -347,9 +347,7 @@ class twig extends \phpbb\template\base } /** - * Get path to template for handle (required for BBCode parser) - * - * @return string + * {@inheritdoc} */ public function get_source_file_for_handle($handle) { diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 7a26c81b0e..57d109652e 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -103,7 +103,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface * * @return bool True if the lock was acquired, false if it has been acquired previously * - * @throws RuntimeException If the lock could not be acquired + * @throws \RuntimeException If the lock could not be acquired */ protected function acquire_lock() { @@ -121,7 +121,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function insert(array $additional_data) { @@ -176,6 +176,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface * * @param int $item_id The item to be deleted * @return array Item ids that have been removed + * @throws \OutOfBoundsException */ protected function remove_item_from_nestedset($item_id) { @@ -199,7 +200,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function delete($item_id) { @@ -214,7 +215,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function move($item_id, $delta) { @@ -332,7 +333,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function move_down($item_id) { @@ -340,7 +341,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function move_up($item_id) { @@ -348,7 +349,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function move_children($current_parent_id, $new_parent_id) { @@ -454,7 +455,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function change_parent($item_id, $new_parent_id) { @@ -553,7 +554,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_path_and_subtree_data($item_id, $order_asc = true, $include_item = true) { @@ -564,7 +565,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_path_data($item_id, $order_asc = true, $include_item = true) { @@ -574,7 +575,7 @@ abstract class nestedset implements \phpbb\tree\tree_interface } /** - * @inheritdoc + * {@inheritdoc} */ public function get_subtree_data($item_id, $order_asc = true, $include_item = true) { diff --git a/phpBB/search.php b/phpBB/search.php index 91ea21909d..f1f02ac766 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1256,7 +1256,7 @@ $s_characters .= '<option value="0">0</option>'; $s_characters .= '<option value="25">25</option>'; $s_characters .= '<option value="50">50</option>'; -for ($i = 100; $i <= 1000 ; $i += 100) +for ($i = 100; $i <= 1000; $i += 100) { $selected = ($i == 300) ? ' selected="selected"' : ''; $s_characters .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index fa838fde19..3d42439c1d 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -25,20 +25,12 @@ function popup(url, width, height, name) { /** * Jump to page */ -function jumpto(item) { - if (!item || !item.length) { - item = $('a.pagination-trigger[data-lang-jump-page]'); - if (!item.length) { - return; - } - } +function pageJump(item) { - var jump_page = item.attr('data-lang-jump-page'), - on_page = item.attr('data-on-page'), + var page = item.val(), per_page = item.attr('data-per-page'), base_url = item.attr('data-base-url'), - start_name = item.attr('data-start-name'), - page = prompt(jump_page, on_page); + start_name = item.attr('data-start-name'); if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { if (base_url.indexOf('?') === -1) { @@ -363,8 +355,26 @@ function parse_document(container) /** * Pagination */ - container.find('a.pagination-trigger').click(function() { - jumpto($(this)); + container.find('.pagination .page-jump-form :button').click(function() { + $input = $(this).siblings('input.inputbox'); + pageJump($input); + }); + + container.find('.pagination .page-jump-form input.inputbox').on('keypress', function(event) { + if (event.which == 13 || event.keyCode == 13) { + event.preventDefault(); + pageJump($(this)); + } + }); + + container.find('.pagination .dropdown-trigger').click(function() { + $dropdown_container = $(this).parent(); + // Wait a little bit to make sure the dropdown has activated + setTimeout(function() { + if ($dropdown_container.hasClass('dropdown-visible')) { + $dropdown_container.find('input.inputbox').focus(); + } + },100); }); /** diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 4a8c4c5de9..c9f81a4099 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -10,18 +10,16 @@ <div class="panel"> <div class="inner"> - <!-- IF .pagination or TOTAL_TOPICS --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> - <!-- IF .pagination --> - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - </ul> - <!-- ENDIF --> + <div class="action-bar top"> + <div class="pagination"> + {TOTAL_TOPICS} + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> + </div> + </div> <!-- IF .topicrow --> <ul class="topiclist<!-- IF S_MERGE_SELECT --> missing-column<!-- ENDIF -->"> @@ -95,8 +93,6 @@ <!-- ENDIF --> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label> @@ -105,18 +101,16 @@ <hr /> - <!-- IF .pagination or TOTAL_TOPICS --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> - <!-- IF .pagination --> - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - </ul> - <!-- ENDIF --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_TOPICS} + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> + </div> + </div> </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index b930bbbcc6..eaa3838f17 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -7,19 +7,17 @@ <div class="panel"> <div class="inner"> - <ul class="linklist"> - <li class="leftside"> - {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> - </li> - <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <div class="action-bar top"> + {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> + <div class="pagination"> + {TOTAL} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> <table class="table1"> <thead> @@ -54,8 +52,6 @@ <!-- IF .log --> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label> @@ -64,16 +60,17 @@ <hr /> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + {S_FORM_TOKEN} </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index 9b6c9b2667..ec317b141a 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -50,19 +50,17 @@ <div class="panel"> <div class="inner"> - <ul class="linklist"> - <li class="leftside"> - {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> - </li> - <li class="rightside pagination"> - <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} • <!-- ENDIF --> + <div class="action-bar top"> + {L_SEARCH_KEYWORDS}{L_COLON} <input type="search" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> + <div class="pagination"> + {TOTAL_REPORTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> <table class="table1"> <thead> @@ -95,8 +93,6 @@ <hr /> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label>{L_DISPLAY_LOG}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> @@ -104,16 +100,16 @@ <hr /> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} • <!-- ENDIF --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_REPORTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index 461d5982db..864b231142 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -16,16 +16,17 @@ <p>{L_EXPLAIN}</p> <!-- IF .postrow --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL --> {TOTAL} • <!-- ENDIF --> + <div class="action-bar top"> + <div class="pagination"> + {TOTAL} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <ul class="topiclist missing-column"> <li class="header"> <dl> @@ -73,8 +74,6 @@ </ul> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF --> @@ -83,16 +82,17 @@ <hr /> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL} • <!-- ENDIF --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <!-- ELSE --> <p class="notopics"><strong> <!-- IF S_RESTORE --> diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index ffa82d5e0e..24c0479f63 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -18,16 +18,17 @@ <p>{L_EXPLAIN}</p> <!-- IF .postrow --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL_REPORTS} • <!-- ENDIF --> + <div class="action-bar top"> + <div class="pagination"> + {TOTAL_REPORTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <ul class="topiclist missing-column"> <li class="header"> <dl> @@ -79,24 +80,24 @@ </ul> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <!-- IF TOPIC_ID --><label><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <strong>{L_ONLY_TOPIC}</strong></label><!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /> </fieldset> + <hr /> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL -->{TOTAL_REPORTS} • <!-- ENDIF --> + + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_REPORTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> <!-- ELSE --> <p><strong>{L_NO_REPORTS}</strong></p> diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 19ee123eba..a83b42dba0 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -150,18 +150,16 @@ <hr /> - <!-- IF .pagination or TOTAL_POSTS --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_POSTS --> {TOTAL_POSTS} • <!-- ENDIF --> - <!-- IF .pagination --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_POSTS} + <!-- IF .pagination --> <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} + <!-- ELSE --> + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> - <!-- ENDIF --> + </div> + </div> </div> </div> diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html index 731c945fe6..d0e80a1479 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_list.html +++ b/phpBB/styles/prosilver/template/mcp_warn_list.html @@ -10,17 +10,17 @@ <p>{L_WARNED_USERS_EXPLAIN}</p> <!-- IF .user --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_USERS -->{TOTAL_USERS} • <!-- ENDIF --> + <div class="action-bar top"> + <div class="pagination"> + {TOTAL_USERS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> - + </div> + </div> + <table class="table1"> <thead> <tr> @@ -48,18 +48,20 @@ <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> </fieldset> + <hr /> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_USERS -->{TOTAL_USERS} • <!-- ENDIF --> + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_USERS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <!-- ELSE --> <p><strong>{L_NO_WARNINGS}</strong></p> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 7623fbe38b..512df7b0a7 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -13,7 +13,6 @@ <!-- ENDIF --> <!-- IF S_SHOW_GROUP --> - <h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2> <p>{GROUP_DESC} {GROUP_TYPE}</p> <p> @@ -21,36 +20,30 @@ <!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --> <!-- IF GROUP_RANK -->{GROUP_RANK}<!-- ENDIF --> </p> - <!-- ELSE --> <h2 class="solo">{PAGE_TITLE}<!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> - <div class="panel"> - <div class="inner"> - - <ul class="linklist wrap"> - <li> + <div class="action-bar top"> + <div class="member-search panel"> <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" id="member_search" data-alt-text="{LA_HIDE_MEMBER_SEARCH}">{L_FIND_USERNAME}</a> • <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" id="member_search" data-alt-text="{LA_FIND_USERNAME}">{L_HIDE_MEMBER_SEARCH}</a> • <!-- ENDIF --> - <strong style="font-size: 0.95em;"> + <strong> <!-- BEGIN first_char --> <a href="{first_char.U_SORT}">{first_char.DESC}</a> <!-- END first_char --> </strong> - </li> - <li class="rightside pagination"> - {TOTAL_USERS} - <!-- IF .pagination --> - • - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - </ul> - + </div> + + <div class="pagination"> + {TOTAL_USERS} + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> </div> </div> <!-- ENDIF --> + <!-- IF S_LEADERS_SET or not S_SHOW_GROUP or not .memberrow --> <div class="forumbg forumbg-table"> <div class="inner"> @@ -140,8 +133,6 @@ <!-- IF S_IN_SEARCH_POPUP and not S_SEARCH_USER --> <fieldset class="display-options"> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <label for="sk">{L_SELECT_SORT_METHOD}{L_COLON} <select name="sk" id="sk">{S_MODE_SELECT}</select></label> <label for="sd">{L_ORDER} <select name="sd" id="sd">{S_ORDER_SELECT}</select></label> <input type="submit" name="sort" value="{L_SUBMIT}" class="button2" /> @@ -150,18 +141,16 @@ </form> -<hr /> - -<ul class="linklist"> - <li class="rightside pagination">{TOTAL_USERS} - <!-- IF .pagination --> - • +<div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_USERS} + <!-- IF .pagination --> <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} + <!-- ELSE --> + • {PAGE_NUMBER} <!-- ENDIF --> - </li> -</ul> + </div> +</div> <!-- IF S_IN_SEARCH_POPUP --> <!-- INCLUDE simple_footer.html --> diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html index e27a90900a..cde183291d 100644 --- a/phpBB/styles/prosilver/template/pagination.html +++ b/phpBB/styles/prosilver/template/pagination.html @@ -1,18 +1,30 @@ - <!-- IF BASE_URL --> - <a href="#" class="pagination-trigger" title="{L_JUMP_TO_PAGE}" data-lang-jump-page="{L_JUMP_PAGE|e('html_attr')}{L_COLON}" data-on-page="{CURRENT_PAGE}" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-base-is-route="{BASE_IS_ROUTE}" data-start-name="{START_NAME}">{PAGE_NUMBER}</a> • - <!-- ELSE --> - {PAGE_NUMBER} • - <!-- ENDIF --> - <ul> - <!-- BEGIN pagination --> - <!-- IF pagination.S_IS_PREV --> - <!-- ELSEIF pagination.S_IS_CURRENT --> - <li class="active"><span>{pagination.PAGE_NUMBER}</span></li> - <!-- ELSEIF pagination.S_IS_ELLIPSIS --> - <li class="ellipsis"><span>{L_ELLIPSIS}</span></li> - <!-- ELSEIF pagination.S_IS_NEXT --> - <!-- ELSE --> - <li><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a></li> - <!-- ENDIF --> - <!-- END pagination --> - </ul> +<ul> +<!-- IF BASE_URL and TOTAL_PAGES > 6 --> + <li class="dropdown-container dropdown-button-control dropdown-page-jump page-jump"> + <a href="#" class="dropdown-trigger" title="{L_JUMP_TO_PAGE_CLICK}" role="button">{PAGE_NUMBER}</a> + <div class="dropdown hidden"> + <div class="pointer"><div class="pointer-inner"></div></div> + <ul class="dropdown-contents"> + <li>{L_JUMP_TO_PAGE}{L_COLON}</li> + <li class="page-jump-form"> + <input type="text" name="page-number" maxlength="6" title="{L_SEARCH_KEYWORDS}" class="inputbox tiny" value="" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" /> + <input class="button2" value="{L_GO}" type="button" /> + </li> + </ul> + </div> + </li> +<!-- ENDIF --> +<!-- BEGIN pagination --> + <!-- IF pagination.S_IS_PREV --> + <li class="previous"><a href="{pagination.PAGE_URL}" rel="prev" role="button">{L_PREVIOUS}</a></li> + <!-- ELSEIF pagination.S_IS_CURRENT --> + <li class="active"><span>{pagination.PAGE_NUMBER}</span></li> + <!-- ELSEIF pagination.S_IS_ELLIPSIS --> + <li class="ellipsis" role="separator"><span>{L_ELLIPSIS}</span></li> + <!-- ELSEIF pagination.S_IS_NEXT --> + <li class="next"><a href="{pagination.PAGE_URL}" rel="next" role="button">{L_NEXT}</a></li> + <!-- ELSE --> + <li><a href="{pagination.PAGE_URL}" role="button">{pagination.PAGE_NUMBER}</a></li> + <!-- ENDIF --> +<!-- END pagination --> +</ul> diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html index c5371b9b6a..3bd51275ec 100644 --- a/phpBB/styles/prosilver/template/posting_smilies.html +++ b/phpBB/styles/prosilver/template/posting_smilies.html @@ -17,11 +17,11 @@ </div> </div> -<div class="pagination"> - <!-- IF .pagination --> +<!-- IF .pagination --> + <div class="pagination"> <!-- INCLUDE pagination.html --> - <!-- ENDIF --> -</div> + </div> +<!-- ENDIF --> <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> <!-- INCLUDE simple_footer.html --> diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 0043da4507..47aa8d85de 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -14,7 +14,7 @@ <!-- IF .pagination or SEARCH_MATCHES or PAGE_NUMBER --> <form method="post" action="{S_SEARCH_ACTION}"> - <div class="topic-actions"> + <div class="action-bar top"> <!-- IF SEARCH_MATCHES --> <div class="search-box"> @@ -25,13 +25,12 @@ </div> <!-- ENDIF --> - <div class="rightside pagination"> + <div class="pagination"> {SEARCH_MATCHES} <!-- IF .pagination --> - • <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> </div> @@ -164,8 +163,6 @@ <form method="post" action="{S_SEARCH_ACTION}"> <fieldset class="display-options"> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --> <label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}<!-- ENDIF --></label> @@ -179,17 +176,16 @@ <!-- ENDIF --> <!-- IF .pagination or .searchresults or PAGE_NUMBER --> - <ul class="linklist"> - <li class="rightside pagination"> - {SEARCH_MATCHES} - <!-- IF .pagination --> - • - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - </ul> +<div class="action-bar bottom"> + <div class="pagination"> + {SEARCH_MATCHES} + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> + </div> +</div> <!-- ENDIF --> <!-- INCLUDE jumpbox.html --> diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 4731683a80..ddbf892dee 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -10,16 +10,16 @@ <p>{L_ATTACHMENTS_EXPLAIN}</p> <!-- IF .attachrow --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE} • <!-- ENDIF --> + <div class="action-bar top"> + <div class="pagination"> + {TOTAL_ATTACHMENTS} {L_TITLE} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> <ul class="topiclist"> <li class="header"> @@ -51,8 +51,6 @@ </ul> <fieldset class="display-options"> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> <label for="sk">{L_SORT_BY}{L_COLON} <select name="sk" id="sk">{S_SORT_OPTIONS}</select></label> <label><select name="sd" id="sd">{S_ORDER_SELECT}</select></label> <input class="button2" type="submit" name="sort" value="{L_SORT}" /> @@ -60,17 +58,18 @@ </fieldset> <hr /> - - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_ATTACHMENTS -->{TOTAL_ATTACHMENTS} {L_TITLE} • <!-- ENDIF --> + + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_ATTACHMENTS} {L_TITLE} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <!-- ELSE --> <p><strong>{L_UCP_NO_ATTACHMENTS}</strong></p> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html index df80135acb..3b805c4862 100644 --- a/phpBB/styles/prosilver/template/ucp_groups_manage.html +++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html @@ -159,15 +159,13 @@ </tbody> </table> - <ul class="linklist"> - <li class="leftside pagination"> - <!-- IF .pagination --> - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - </ul> + <!-- IF .pagination --> + <div class="action-bar bottom"> + <div class="pagination"> + <!-- INCLUDE pagination.html --> + </div> + </div> + <!-- ENDIF --> </div> </div> diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html index b9e3c16524..f74728bdb3 100644 --- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -75,16 +75,18 @@ </li> <!-- END topicrow --> </ul> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> + + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_TOPICS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <!-- ELSE --> <p><strong>{L_NO_BOOKMARKS}</strong></p> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html index 74ab5226cb..ef03317578 100644 --- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -109,16 +109,18 @@ </li> <!-- END topicrow --> </ul> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF TOTAL_TOPICS --> {TOTAL_TOPICS} • <!-- ENDIF --> - <!-- IF .pagination --> + + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_TOPICS} + <!-- IF .pagination --> <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} + <!-- ELSE --> + • {PAGE_NUMBER} <!-- ENDIF --> - </li> - </ul> + </div> + </div> + <!-- ELSEIF S_TOPIC_NOTIFY --> <ul class="topiclist"> <li class="header"> diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index b400a3c8b1..8910769cce 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -42,19 +42,17 @@ </table> <!-- ELSE --> <!-- IF .notification_list --> - <!-- IF .pagination or TOTAL_COUNT --> - <div class="topic-actions"> + <div class="action-bar top"> <div class="pagination"> - <!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}">{L_NOTIFICATIONS_MARK_ALL_READ}</a> • <!-- ENDIF --> - <!-- IF TOTAL_COUNT -->{L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>] • <!-- ENDIF --> + <!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}" class="mark">{L_NOTIFICATIONS_MARK_ALL_READ}</a> • <!-- ENDIF --> + {L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>] <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> </div> - <!-- ENDIF --> <div class="notification_list"> <ul class="topiclist two-columns"> @@ -91,18 +89,16 @@ </ul> </div> - <!-- IF .pagination or TOTAL_COUNT --> - <div class="topic-actions"> - <div class="pagination"> - <!-- IF TOTAL_COUNT -->{L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>] • <!-- ENDIF --> - <!-- IF .pagination --> - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </div> + <div class="action-bar bottom"> + <div class="pagination"> + {L_NOTIFICATIONS} [<strong>{TOTAL_COUNT}</strong>] + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> </div> - <!-- ENDIF --> + </div> <!-- ELSE --> <p><strong>{L_NO_NOTIFICATIONS}</strong></p> diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index 56e27811c6..d777de908d 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -4,8 +4,9 @@ <div class="panel"> <div class="inner"> - <!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF --> + + <div class="action-bar top"> <!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM --> <div class="buttons"> <!-- IF U_POST_REPLY_PM --> @@ -43,17 +44,17 @@ <!-- ENDIF --> <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE --> - <ul class="linklist"> - <li class="rightside pagination"> - <!-- IF S_VIEW_MESSAGE --><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a><!-- ENDIF --> - <!-- IF FOLDER_CUR_MESSAGES neq 0 --> - <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES} • <!-- ENDIF --> + <div class="pagination"> + <!-- IF S_VIEW_MESSAGE --> + <a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a> + <!-- ELSEIF FOLDER_CUR_MESSAGES neq 0 --> + {TOTAL_MESSAGES} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> <!-- ENDIF --> - </li> - </ul> + </div> <!-- ENDIF --> + </div> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index b081c14498..d93a62282e 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -96,26 +96,24 @@ <!-- ENDIF --> <!-- IF FOLDER_CUR_MESSAGES neq 0 --> - <fieldset class="display-actions"> - <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}{L_COLON} <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div> - <select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" /> - <div><a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a></div> - </fieldset> - - <hr /> - - <ul class="linklist"> - <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE --> - <li class="rightside pagination"> - <!-- IF TOTAL_MESSAGES -->{TOTAL_MESSAGES} • <!-- ENDIF --> - <!-- IF .pagination --> - <!-- INCLUDE pagination.html --> - <!-- ELSE --> - {PAGE_NUMBER} - <!-- ENDIF --> - </li> - <!-- ENDIF --> - </ul> + <fieldset class="display-actions"> + <div class="left-box"><label for="export_option">{L_EXPORT_FOLDER}{L_COLON} <select name="export_option" id="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select></label> <input class="button2" type="submit" name="submit_export" value="{L_GO}" /><br /></div> + <select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select> <input class="button2" type="submit" name="submit_mark" value="{L_GO}" /> + <div><a href="#" onclick="marklist('viewfolder', 'marked_msg', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('viewfolder', 'marked_msg', false); return false;">{L_UNMARK_ALL}</a></div> + </fieldset> + + <hr /> + + <div class="action-bar bottom"> + <div class="pagination"> + {TOTAL_MESSAGES} + <!-- IF .pagination --> + <!-- INCLUDE pagination.html --> + <!-- ELSE --> + • {PAGE_NUMBER} + <!-- ENDIF --> + </div> + </div> <!-- ENDIF --> </div> @@ -123,8 +121,6 @@ <!-- IF FOLDER_CUR_MESSAGES neq 0 --> <fieldset class="display-options"> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <label>{L_DISPLAY}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index c747dd01f5..c44e830b9c 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -35,7 +35,7 @@ <!-- ENDIF --> <!-- IF S_DISPLAY_POST_INFO or .pagination or TOTAL_POSTS or TOTAL_TOPICS --> - <div class="topic-actions" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->> + <div class="action-bar top" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->> <!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> <div class="buttons"> @@ -58,12 +58,12 @@ <!-- ENDIF --> <div class="pagination"> - <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> - {TOTAL_TOPICS} • + <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" class="mark" accesskey="m" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> + {TOTAL_TOPICS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> @@ -208,8 +208,6 @@ <!-- IF S_SELECT_SORT_DAYS and not S_DISPLAY_ACTIVE --> <form method="post" action="{S_FORUM_ACTION}"> <fieldset class="display-options"> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF not S_IS_BOT --> <label>{L_DISPLAY_TOPICS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> @@ -222,7 +220,7 @@ <!-- ENDIF --> <!-- IF .topicrow and not S_DISPLAY_ACTIVE --> - <div class="topic-actions"> + <div class="action-bar bottom"> <!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> <div class="buttons"> <a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"> @@ -233,11 +231,11 @@ <div class="pagination"> <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> - {TOTAL_TOPICS} • + {TOTAL_TOPICS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> </div> diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index 553e322f92..ee1672c6c9 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -3,15 +3,15 @@ <h2 class="viewonline-title">{TOTAL_REGISTERED_USERS_ONLINE}</h2> <p>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> • <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a><!-- ENDIF --></p> -<ul class="linklist"> - <li class="rightside pagination"> +<div class="action-bar top"> + <div class="pagination"> <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> {PAGE_NUMBER} <!-- ENDIF --> - </li> -</ul> + </div> +</div> <div class="forumbg forumbg-table"> <div class="inner"> @@ -47,23 +47,17 @@ </div> </div> -<!-- IF U_PREVIOUS_PAGE or U_NEXT_PAGE --> -<fieldset class="display-options right-box"> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ELSE -->{L_PREVIOUS}<!-- ENDIF --> • <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ELSE -->{L_NEXT}<!-- ENDIF --> -</fieldset> -<!-- ENDIF --> - <!-- IF LEGEND --><p><em>{L_LEGEND}{L_COLON} {LEGEND}</em></p><!-- ENDIF --> -<ul class="linklist"> - <li class="rightside pagination"> +<div class="action-bar bottom"> + <div class="pagination"> <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> {PAGE_NUMBER} <!-- ENDIF --> - </li> -</ul> + </div> +</div> <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 710b42b5e3..38836f3ee4 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -25,7 +25,7 @@ </div> <!-- ENDIF --> -<div class="topic-actions"> +<div class="action-bar top"> <div class="buttons"> <!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO --> @@ -51,11 +51,11 @@ <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} • + <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}" class="mark">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> <!-- ENDIF --> @@ -320,28 +320,26 @@ <hr class="divider" /> <!-- EVENT viewtopic_body_postrow_post_after --> <!-- END postrow --> + <!-- IF S_QUICK_REPLY --> <!-- INCLUDE quickreply_editor.html --> <!-- ENDIF --> -<!-- IF S_NUM_POSTS > 1 or U_PREVIOUS_PAGE or U_NEXT_PAGE --> - <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}"> +<!-- IF S_NUM_POSTS > 1 or .pagination --> + <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}"> <fieldset class="display-options" style="margin-top: 0; "> - <!-- IF U_PREVIOUS_PAGE --><a href="{U_PREVIOUS_PAGE}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF --> - <!-- IF U_NEXT_PAGE --><a href="{U_NEXT_PAGE}" class="right-box arrow-{S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> <!-- IF not S_IS_BOT --> <label>{L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS}</label> <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label> <label>{S_SELECT_SORT_DIR}</label> <input type="submit" name="sort" value="{L_GO}" class="button2" /> <!-- ENDIF --> </fieldset> - </form> <hr /> <!-- ENDIF --> <!-- EVENT viewtopic_body_topic_actions_before --> -<div class="topic-actions"> +<div class="action-bar bottom"> <div class="buttons"> <!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO --> <a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"> @@ -354,11 +352,11 @@ <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - {TOTAL_POSTS} • + {TOTAL_POSTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> - {PAGE_NUMBER} + • {PAGE_NUMBER} <!-- ENDIF --> </div> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 78b95d902e..f3902b363d 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -206,26 +206,39 @@ .rtl .pagination { text-align: left; float: left; - padding-left: 5px; +} + +.rtl .pagination > ul { + margin-left: 0; + margin-right: 5px; } /* Pagination in viewforum for multipage topics */ .rtl .row .pagination { background-position: 100% 50%; float: left; - padding: 1px 15px 1px 0; + padding-left: 0; + padding-right: 15px; +} + +.rtl .row .pagination > ul { + margin: 0; } .rtl .pagination span { direction: ltr; } -.rtl .pagination span.page-sep { - display: inline; - visibility: hidden; - position: absolute; +.pagination li.page-jump { + margin-left: 5px; + margin-right: 0; } +.pagination li.previous a { background-position: -50px 2px; } +.pagination li.next a { background-position: -30px 2px; } +.pagination li.previous a:hover { background-position: -50px -18px; } +.pagination li.next a:hover { background-position: -30px -18px; } + /* Miscellaneous styles ---------------------------------------- */ .rtl #forum-permissions { @@ -245,6 +258,10 @@ width: 99%; /* fix for IE6 */ } +.rtl .member-search { + float: right; +} + /** * links.css */ @@ -624,10 +641,6 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { margin-left: 0; } -.rtl #cp-main .pagination { - float: left; -} - .rtl #cp-main .buttons { margin-right: 0; margin-left: 0; diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 72c8b5f226..875e61020b 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -159,7 +159,7 @@ dl.details dd { /* Pagination ---------------------------------------- */ -.pagination li a, .pagination li a:link, .pagination li a:visited { +.pagination li a { color: #5C758C; background-color: #ECEDEE; border-color: #B4BAC0; @@ -176,16 +176,14 @@ dl.details dd { border-color: #4692BF; } -.pagination li a:hover, .pagination .active a:hover { +.pagination li a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { border-color: #368AD2; background-color: #368AD2; color: #FFFFFF; } -.pagination li a:active, .pagination li.active a:active { - color: #5C758C; - background-color: #ECEDEE; - border-color: #B4BAC0; +.pagination li.next a, .pagination li.previous a, .pagination li.page-jump a { + background-image: url("./images/icons_pagination.png"); } /* Pagination in viewforum for multipage topics */ @@ -193,14 +191,6 @@ dl.details dd { background-image: url("./images/icon_pages.gif"); } -.row .pagination span a, li.pagination span a { - background-color: #FFFFFF; -} - -.row .pagination span a:hover, li.pagination span a:hover { - background-color: #368AD2; -} - /* Miscellaneous styles ---------------------------------------- */ diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index b9728729f9..aa28cd6962 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -802,63 +802,111 @@ fieldset.fields1 dl.pmlist dd.recipients { margin-left: 0 !important; } +/* Action-bars (container for post/reply buttons, pagination, etc.) +---------------------------------------- */ +.action-bar { + font-size: 11px; + margin: 4px 0; +} + +.action-bar:after { + clear: both; + content: ''; + display: block; +} + /* Pagination ---------------------------------------- */ .pagination { - width: auto; - text-align: right; - margin-top: 5px; float: right; + font-size: 11px; + margin-top: 3px; + text-align: right; + width: auto; } -li.pagination { +.action-bar.bottom .pagination { margin-top: 0; } -.pagination img { - vertical-align: middle; -} - -.pagination ul { +.pagination > ul { display: inline-block; - *display: inline; /* IE7 inline-block hack */ - *zoom: 1; - margin-left: 0; - margin-bottom: 0; -} - -li.pagination ul { - margin-top: -2px; - vertical-align: middle; + list-style: none !important; + margin-left: 5px; } -.pagination ul li, dl .pagination ul li, dl.icon .pagination ul li { - display: inline; +.pagination > ul > li { + display: inline-block !important; padding: 0; font-size: 100%; line-height: normal; + vertical-align: middle; } -.pagination li a, .pagnation li span, li .pagination li a, li .pagination li span, .pagination li.active span, .pagination li.ellipsis span { - font-weight: normal; - text-decoration: none; - padding: 0 2px; +.pagination li a, .pagination li span { border: 1px solid transparent; + border-radius: 2px; + display: block; font-size: 0.9em; - line-height: 1.5em; + font-weight: normal; + line-height: 13px; + min-width: 10px; + padding: 3px; + text-align: center; + text-decoration: none; +} + +.pagination li.ellipsis span { + border: none; + padding: 0; } +.pagination li.page-jump { + margin-right: 5px; +} + +.pagination li.page-jump a, .pagination li.next a, .pagination li.previous a { + background-repeat: no-repeat; + font-size: 0; + height: 13px; + width: 11px; +} + +.pagination li.page-jump a { + background-position: 0 2px; + width: 24px; +} + +.pagination li.next a { + background-position: -50px 2px; +} + +.pagination li.previous a { + background-position: -30px 2px; +} + +.pagination li.page-jump a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { background-position: 0 -18px; } +.pagination li.next a:hover { background-position: -50px -18px; } +.pagination li.previous a:hover { background-position: -30px -18px; } + /* Pagination in viewforum for multipage topics */ .row .pagination { display: block; - float: right; - width: auto; margin-top: 0; - padding: 1px 0 1px 8px; + padding: 1px 0 1px 15px; font-size: 0.9em; background: none 0 50% no-repeat; } +.row .pagination > ul { + margin: 0; +} + +.row .pagination li a, .row .pagination li span { + border-radius: 1px; + padding: 1px; +} + /* jQuery popups ---------------------------------------- */ .phpbb_alert { @@ -1039,6 +1087,16 @@ form > p.post-notice strong { position: relative; } +.member-search { + float: left; + margin: 0; + padding: 6px 10px; +} + +.member-search strong { + font-size: 0.95em; +} + .dropdown-extended { display: none; position: absolute; @@ -1155,3 +1213,15 @@ form > p.post-notice strong { .compact .icon-notification > a > strong, .compact .icon-pm > a > strong { padding-left: 2px; } + +.dropdown-page-jump .dropdown { + top: 20px; +} + +.dropdown-page-jump.dropdown-up .dropdown { + bottom: 20px; +} + +.dropdown-page-jump input.tiny { + width: 50px; +} diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 8c1c2c3926..9d87d3217f 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -226,23 +226,6 @@ dd.option { font-size: 1.1em; } -/* Container for post/reply buttons and pagination */ -.topic-actions { - margin-bottom: 3px; - font-size: 1.1em; - height: 28px; - min-height: 28px; -} -div[class].topic-actions { - height: auto; -} - -.topic-actions:after { - content: ''; - clear: both; - display: block; -} - /* Post body styles ----------------------------------------*/ .postbody { @@ -784,7 +767,7 @@ dl.pmlist dd { margin-bottom: 2px; } -.topic-actions div.dl_links { +.action-bar div.dl_links { padding: 10px 0 0 10px; } diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index 61df82c0ce..452c2c625e 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -59,12 +59,6 @@ ul.cplist { border-bottom: none; } -#cp-main .pagination { - float: right; - width: auto; - padding-top: 1px; -} - #cp-main .postbody p { font-size: 1.1em; } diff --git a/phpBB/styles/prosilver/theme/images/icons_pagination.png b/phpBB/styles/prosilver/theme/images/icons_pagination.png Binary files differnew file mode 100644 index 0000000000..872b7308c2 --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icons_pagination.png diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index b76f6b60cd..7117e2c435 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -197,14 +197,12 @@ ul.topiclist li.row dt a.subforum { /* Pagination ----------------------------------------*/ -.pagination { - margin: 5px 0; +.pagination > ul { + margin: 5px 0 0; } -.pagination li a, .pagination li span { - min-width: 10px; - display: inline-block; - text-align: center; +.row .pagination > ul { + margin-top: 0; } /* Responsive tables @@ -507,18 +505,21 @@ fieldset.display-actions { margin: 0; } - .topic-actions > .pagination, fieldset.jumpbox { + .action-bar > .pagination, fieldset.jumpbox { text-align: center; } - .topic-actions > .pagination { + .action-bar > .pagination { float: none; - overflow: hidden; clear: both; padding-bottom: 1px; } - .topic-actions > div.search-box, p.jumpbox-return { + .action-bar > .pagination li.page-jump { + margin: 0 2px; + } + + .action-bar > div.search-box, p.jumpbox-return { display: none; } diff --git a/phpBB/styles/subsilver2/template/pagination.html b/phpBB/styles/subsilver2/template/pagination.html index 550b28d305..b1c1d0e6c9 100644 --- a/phpBB/styles/subsilver2/template/pagination.html +++ b/phpBB/styles/subsilver2/template/pagination.html @@ -1,5 +1,5 @@ <!-- IF .pagination --> - <!-- IF BASE_URL --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a></b><!-- ENDIF --> + <!-- IF BASE_URL --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a></b><!-- ENDIF --> <!-- BEGIN pagination --> <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a> <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong> diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html index 0be71098db..7087414fa8 100644 --- a/phpBB/styles/subsilver2/template/posting_smilies.html +++ b/phpBB/styles/subsilver2/template/posting_smilies.html @@ -18,7 +18,7 @@ <tr> <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /> <!-- IF .pagination --> - <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> + <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a> <!-- BEGIN pagination --> <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a> <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong> diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 320eac3bf3..f3c6888c8d 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -239,6 +239,24 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012')); } + public function test_column_change_with_composite_primary() + { + // Remove the old primary key + $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_id')); + $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_id', array('UINT', 0))); + + // Create a composite key + $this->assertTrue($this->tools->sql_create_primary_key('prefix_table_name', array('c_id', 'c_uint'))); + + // Create column + $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12643')); + $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12643', array('DECIMAL', 0))); + $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12643')); + + // Change type from int to string + $this->assertTrue($this->tools->sql_column_change('prefix_table_name', 'c_bug_12643', array('VCHAR:100', ''))); + } + public function test_column_remove() { $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_int_size')); @@ -248,6 +266,17 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_int_size')); } + public function test_column_remove_similar_name() + { + $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar')); + $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar_size')); + + $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_vchar')); + + $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_vchar')); + $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_vchar_size')); + } + public function test_column_remove_with_index() { // Create column diff --git a/tests/functional/paging_test.php b/tests/functional/paging_test.php index 97ce822fdf..cfaf9104a8 100644 --- a/tests/functional/paging_test.php +++ b/tests/functional/paging_test.php @@ -30,12 +30,12 @@ class phpbb_functional_paging_test extends phpbb_functional_test_case $this->assertContains('post no4', $crawler->text()); $this->assertNotContains('post no16', $crawler->text()); - $next_link = $crawler->filter('#viewtopic > fieldset > a.arrow-right')->attr('href'); + $next_link = $crawler->filter('.pagination > ul > li.next > a')->attr('href'); $crawler = self::request('GET', $next_link); $this->assertNotContains('post no4', $crawler->text()); $this->assertContains('post no16', $crawler->text()); - $prev_link = $crawler->filter('#viewtopic > fieldset > a.arrow-left')->attr('href'); + $prev_link = $crawler->filter('.pagination > ul > li.previous > a')->attr('href'); $crawler = self::request('GET', $prev_link); $this->assertContains('post no4', $crawler->text()); $this->assertNotContains('post no16', $crawler->text()); diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php index 799dcc5e22..27ea8ddb44 100644 --- a/tests/notification/notification_test.php +++ b/tests/notification/notification_test.php @@ -71,6 +71,27 @@ class phpbb_notification_test extends phpbb_tests_notification_base public function test_subscriptions() { + $expected_subscriptions = array( + 'post' => array(''), + 'topic' => array(''), + 'quote' => array(''), + 'bookmark' => array(''), + 'test' => array(''), + 'pm' => array(''), + ); + + $subscriptions = $this->notifications->get_global_subscriptions(2); + + foreach ($expected_subscriptions as $item_type => $methods) + { + $this->assert_array_content_equals($methods, $subscriptions[$item_type]); + } + + foreach ($subscriptions as $item_type => $methods) + { + $this->assert_array_content_equals($methods, $expected_subscriptions[$item_type]); + } + $this->notifications->delete_subscription('post', 0, '', 2); $this->assertArrayNotHasKey('post', $this->notifications->get_global_subscriptions(2)); diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php index f253118253..ace8c1eed0 100644 --- a/tests/pagination/pagination_test.php +++ b/tests/pagination/pagination_test.php @@ -91,7 +91,6 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case :current:3:page.php?start=20 :else:4:page.php?start=30 :else:5:page.php?start=40 - :else:6:page.php?start=50 :ellipsis:9:page.php?start=80 :else:10:page.php?start=90 :next::page.php?start=30 @@ -142,7 +141,6 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case :current:3:test/page/3 :else:4:test/page/4 :else:5:test/page/5 - :else:6:test/page/6 :ellipsis:9:test/page/9 :else:10:test/page/10 :next::test/page/4 diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 05281b1d71..1f3a564205 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -94,6 +94,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test if (self::$schema_file !== '') { copy(self::$phpbb_schema_copy, self::$install_schema_file); + unlink(self::$schema_file); } parent::tearDownAfterClass(); diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php index 2c78391453..95e304dd97 100644 --- a/tests/text_processing/make_clickable_test.php +++ b/tests/text_processing/make_clickable_test.php @@ -104,5 +104,50 @@ class phpbb_text_processing_make_clickable_test extends phpbb_test_case $this->assertEquals($expected, $result, $label); } + public function make_clickable_mixed_serverurl_data() + { + $urls = array( + 'http://thisdomain.org' => array('tag' => 'm', 'url' => false, 'text' => false), + 'http://thisdomain.org/' => array('tag' => 'm', 'url' => false, 'text' => false), + 'http://thisdomain.org/1' => array('tag' => 'm', 'url' => false, 'text' => false), + 'http://thisdomain.org/path/some?query=abc#test' => array('tag' => 'm', 'url' => false, 'text' => false), + + 'https://www.phpbb.com' => array('tag' => 'm', 'url' => false, 'text' => false), + 'https://www.phpbb.com/' => array('tag' => 'm', 'url' => false, 'text' => false), + 'https://www.phpbb.com/1' => array('tag' => 'l', 'url' => false, 'text' => '1'), + 'https://www.phpbb.com/path/some?query=abc#test' => array('tag' => 'l', 'url' => false, 'text' => 'path/some?query=abc#test'), + ); + + $test_data = array(); + + // run the test for each combination + foreach ($urls as $url => $url_type) + { + // false means it's the same as the url, less typing + $url_type['url'] = ($url_type['url']) ? $url_type['url'] : $url; + $url_type['text'] = ($url_type['text']) ? $url_type['text'] : $url; + + $class = ($url_type['tag'] === 'l') ? 'postlink-local' : 'postlink'; + + // replace the url with the desired output format + $output = '<!-- ' . $url_type['tag'] . ' --><a class="' . $class . '" href="' . $url_type['url'] . '">' . $url_type['text'] . '</a><!-- ' . $url_type['tag'] . ' -->'; + + $test_data[] = array($url, $output); + } + + return $test_data; + } + + /** + * @dataProvider make_clickable_mixed_serverurl_data + */ + public function test_make_clickable_mixed_serverurl($input, $expected) + { + $result = make_clickable($input, 'https://www.phpbb.com'); + + $label = 'Making text clickable: ' . $input; + $this->assertEquals($expected, $result, $label); + } + } |