diff options
| -rw-r--r-- | composer.json | 34 | ||||
| -rw-r--r-- | roundcubemail-1.2.1-no_swf.patch | 7 | ||||
| -rw-r--r-- | roundcubemail-pr313.patch | 56 | ||||
| -rw-r--r-- | roundcubemail-pr5820.patch | 22 | ||||
| -rw-r--r-- | roundcubemail.spec | 140 | 
5 files changed, 164 insertions, 95 deletions
diff --git a/composer.json b/composer.json index 33ae8e3..465d2e8 100644 --- a/composer.json +++ b/composer.json @@ -4,40 +4,32 @@      "license": "GPL-3.0+",      "repositories": [          { -            "type": "pear", -            "url": "https://pear.php.net/" -        }, -        {              "type": "composer",              "url": "https://plugins.roundcube.net/"          },          {              "type": "vcs", -            "url": "https://github.com/roundcube/Net_Sieve.git" -        }, -        { -            "type": "vcs",              "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git"          }      ],      "require": { -        "php": ">=5.3.7", +        "php": ">=5.4.0",          "pear/pear-core-minimal": "~1.10.1", +        "pear/net_socket": "~1.2.1", +        "pear/auth_sasl": "~1.1.0", +        "pear/net_idna2": "~0.2.0", +        "pear/mail_mime": "~1.10.0", +        "pear/net_smtp": "~1.7.1", +        "pear/crypt_gpg": "~1.6.0", +        "pear/net_sieve": "~1.4.0",          "roundcube/plugin-installer": "~0.1.6", -        "pear-pear.php.net/net_socket": "~1.0.12", -        "pear-pear.php.net/auth_sasl": "~1.0.6", -        "pear-pear.php.net/net_idna2": "~0.1.1", -        "pear-pear.php.net/mail_mime": "~1.10.0", -        "pear-pear.php.net/net_smtp": "~1.7.1", -        "pear-pear.php.net/crypt_gpg": "~1.4.2", -        "roundcube/net_sieve": "~1.5.0" +        "endroid/qrcode": "~1.6.5"      },      "require-dev": { -        "phpunit/phpunit": "*" +        "phpunit/phpunit": "~5.7.15"      },      "suggest": { -        "pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books", -        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books" -    }, -    "minimum-stability": "dev" +        "pear/net_ldap2": "~2.2.0 required for connecting to LDAP", +        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP" +    }  } diff --git a/roundcubemail-1.2.1-no_swf.patch b/roundcubemail-1.2.1-no_swf.patch deleted file mode 100644 index 68b3c6c..0000000 --- a/roundcubemail-1.2.1-no_swf.patch +++ /dev/null @@ -1,7 +0,0 @@ -diff -up roundcubemail-1.2.1/program/js/tinymce/plugins/media/plugin.min.js.orig roundcubemail-1.2.1/program/js/tinymce/plugins/media/plugin.min.js ---- roundcubemail-1.2.1/program/js/tinymce/plugins/media/plugin.min.js.orig	2016-07-27 07:16:16.198484873 +0200 -+++ roundcubemail-1.2.1/program/js/tinymce/plugins/media/plugin.min.js	2016-07-27 07:18:45.177194918 +0200 -@@ -1 +1 @@ --tinymce.PluginManager.add("media",function(a,b){function c(a){return a=a.toLowerCase(),-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),isNaN(g)||c.value(g)):(f=Math.round(g/j*f),isNaN(f)||b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var m={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};m[p]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},m]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=a.convertURL(b+"/moxieplayer.swf","movie"),tinymce.each(o,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c++)d=d.replace("$"+c,function(){return b[c]});e.source1=d,e.type=a.type,e.allowFullscreen=a.allowFullscreen,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);if(g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type){var i=e.allowFullscreen?' allowFullscreen="1"':"";f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"'+i+"></iframe>"}else"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<script src="'+e.source1+'"></script>':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),"iframe"!=a&&"object"!=a&&"embed"!=a&&"video"!=a&&"audio"!=a||(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c,d=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){d.comment(a)},cdata:function(a){d.cdata(a)},text:function(a,b){d.text(a,b)},start:function(b,e,f){if(c=!0,"script"!=b&&"noscript"!=b){for(var g=0;g<e.length;g++){if(0===e[g].name.indexOf("on"))return;"style"==e[g].name&&(e[g].value=a.dom.serializeStyle(a.dom.parseStyle(e[g].value),b))}d.start(b,e,f),c=!1}},end:function(a){c||d.end(a)}},new tinymce.html.Schema({})).parse(b),d.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}function l(b,c){var d,e,f,g,h;for(f=b.attributes,g=f.length;g--;)d=f[g].name,e=f[g].value,"width"!==d&&"height"!==d&&"style"!==d&&("data"!=d&&"src"!=d||(e=a.convertURL(e,d)),c.attr("data-mce-p-"+d,e));h=b.firstChild&&b.firstChild.value,h&&(c.attr("data-mce-html",escape(h)),c.firstChild=null)}function m(a){var b,c=a.name;return b=new tinymce.html.Node("img",1),b.shortEnded=!0,l(a,b),b.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==c?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),b}function n(a){var b,c,d,e=a.name;return b=new tinymce.html.Node("span",1),b.attr({contentEditable:"false",style:a.attr("style"),"data-mce-object":e,"class":"mce-preview-object mce-object-"+e}),l(a,b),c=new tinymce.html.Node(e,1),c.attr({src:a.attr("src"),allowfullscreen:a.attr("allowfullscreen"),width:a.attr("width")||"300",height:a.attr("height")||("audio"==e?"30":"150"),frameborder:"0"}),d=new tinymce.html.Node("span",1),d.attr("class","mce-shim"),b.append(c),b.append(d),b}var o=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowfullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowfullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],p=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b){for(var c,e,f,g=b.length;g--;)c=b[g],c.parent&&(c.parent.attr("data-mce-object")||("script"!=c.name||(f=d(c.attr("src"))))&&(f&&(f.width&&c.attr("width",f.width.toString()),f.height&&c.attr("height",f.height.toString())),e="iframe"==c.name&&a.settings.media_live_embeds!==!1&&tinymce.Env.ceFalse?n(c):m(c),c.replace(e)))}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k,l=a.length;l--;)if(c=a[l],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&(k=c.attr("class"),k&&-1!==k.indexOf("mce-preview-object")?d.attr({width:c.firstChild.attr("width"),height:c.firstChild.attr("height")}):d.attr({width:c.attr("width"),height:c.attr("height")})),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var m=f[e].name;0===m.indexOf("data-mce-p-")&&d.attr(m.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("click keyup",function(){var b=a.selection.getNode();b&&a.dom.hasClass(b,"mce-preview-object")&&a.dom.getAttrib(b,"data-mce-selected")&&b.setAttribute("data-mce-selected","2")}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");"audio"!=b&&"script"!=b||a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object]","span[data-mce-object]"]}),a.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:e,context:"insert",prependToContext:!0}),a.on("setContent",function(){a.$("span.mce-preview-object").each(function(b,c){var d=a.$(c);0===d.find("span.mce-shim",c).length&&d.append('<span class="mce-shim"></span>')})}),a.addCommand("mceMedia",e),this.showDialog=e}); -\ Pas de fin de ligne à la fin du fichier -+tinymce.PluginManager.add("media",function(a,b){function c(a){return a=a.toLowerCase(),-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),isNaN(g)||c.value(g)):(f=Math.round(g/j*f),isNaN(f)||b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var m={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};m[p]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},m]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=false,tinymce.each(o,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c++)d=d.replace("$"+c,function(){return b[c]});e.source1=d,e.type=a.type,e.allowFullscreen=a.allowFullscreen,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);if(g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type){var i=e.allowFullscreen?' allowFullscreen="1"':"";f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"'+i+"></iframe>"}else"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<script src="'+e.source1+'"></script>':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),"iframe"!=a&&"object"!=a&&"embed"!=a&&"video"!=a&&"audio"!=a||(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c,d=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){d.comment(a)},cdata:function(a){d.cdata(a)},text:function(a,b){d.text(a,b)},start:function(b,e,f){if(c=!0,"script"!=b&&"noscript"!=b){for(var g=0;g<e.length;g++){if(0===e[g].name.indexOf("on"))return;"style"==e[g].name&&(e[g].value=a.dom.serializeStyle(a.dom.parseStyle(e[g].value),b))}d.start(b,e,f),c=!1}},end:function(a){c||d.end(a)}},new tinymce.html.Schema({})).parse(b),d.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}function l(b,c){var d,e,f,g,h;for(f=b.attributes,g=f.length;g--;)d=f[g].name,e=f[g].value,"width"!==d&&"height"!==d&&"style"!==d&&("data"!=d&&"src"!=d||(e=a.convertURL(e,d)),c.attr("data-mce-p-"+d,e));h=b.firstChild&&b.firstChild.value,h&&(c.attr("data-mce-html",escape(h)),c.firstChild=null)}function m(a){var b,c=a.name;return b=new tinymce.html.Node("img",1),b.shortEnded=!0,l(a,b),b.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==c?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),b}function n(a){var b,c,d,e=a.name;return b=new tinymce.html.Node("span",1),b.attr({contentEditable:"false",style:a.attr("style"),"data-mce-object":e,"class":"mce-preview-object mce-object-"+e}),l(a,b),c=new tinymce.html.Node(e,1),c.attr({src:a.attr("src"),allowfullscreen:a.attr("allowfullscreen"),width:a.attr("width")||"300",height:a.attr("height")||("audio"==e?"30":"150"),frameborder:"0"}),d=new tinymce.html.Node("span",1),d.attr("class","mce-shim"),b.append(c),b.append(d),b}var o=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowfullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowfullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],p=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b){for(var c,e,f,g=b.length;g--;)c=b[g],c.parent&&(c.parent.attr("data-mce-object")||("script"!=c.name||(f=d(c.attr("src"))))&&(f&&(f.width&&c.attr("width",f.width.toString()),f.height&&c.attr("height",f.height.toString())),e="iframe"==c.name&&a.settings.media_live_embeds!==!1&&tinymce.Env.ceFalse?n(c):m(c),c.replace(e)))}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k,l=a.length;l--;)if(c=a[l],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&(k=c.attr("class"),k&&-1!==k.indexOf("mce-preview-object")?d.attr({width:c.firstChild.attr("width"),height:c.firstChild.attr("height")}):d.attr({width:c.attr("width"),height:c.attr("height")})),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var m=f[e].name;0===m.indexOf("data-mce-p-")&&d.attr(m.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("click keyup",function(){var b=a.selection.getNode();b&&a.dom.hasClass(b,"mce-preview-object")&&a.dom.getAttrib(b,"data-mce-selected")&&b.setAttribute("data-mce-selected","2")}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");"audio"!=b&&"script"!=b||a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object]","span[data-mce-object]"]}),a.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:e,context:"insert",prependToContext:!0}),a.on("setContent",function(){a.$("span.mce-preview-object").each(function(b,c){var d=a.$(c);0===d.find("span.mce-shim",c).length&&d.append('<span class="mce-shim"></span>')})}),a.addCommand("mceMedia",e),this.showDialog=e}); diff --git a/roundcubemail-pr313.patch b/roundcubemail-pr313.patch index 24dbfae..f68a110 100644 --- a/roundcubemail-pr313.patch +++ b/roundcubemail-pr313.patch @@ -1,17 +1,17 @@ -From e8e951098db781422f7ed557d97b1b218d7529de Mon Sep 17 00:00:00 2001 +From 132a807dff7fc2d173e2e3bebb18ee181c7b27d9 Mon Sep 17 00:00:00 2001  From: Remi Collet <fedora@famillecollet.com>  Date: Mon, 28 Dec 2015 08:47:37 +0100 -Subject: [PATCH] add .log suffix to all log file names +Subject: [PATCH 1/2] add .log suffix to all log file names  ---   program/lib/Roundcube/rcube.php | 2 +-   1 file changed, 1 insertion(+), 1 deletion(-)  diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php -index 7388472..c2fc70f 100644 +index 3694c5c4b..ef5dcb94e 100644  --- a/program/lib/Roundcube/rcube.php  +++ b/program/lib/Roundcube/rcube.php -@@ -1195,7 +1195,7 @@ class rcube +@@ -1246,7 +1246,7 @@ public static function write_log($name, $line)               $log_dir = RCUBE_INSTALL_PATH . 'logs';           } @@ -20,3 +20,51 @@ index 7388472..c2fc70f 100644       }       /** + +From 6ca4eab399adad22ed93b26c5870896425631dfa Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 27 Jun 2017 13:35:01 +0200 +Subject: [PATCH 2/2] add 'log_file_ext' configuration option + +--- + config/defaults.inc.php         | 3 +++ + program/lib/Roundcube/rcube.php | 8 +++++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/config/defaults.inc.php b/config/defaults.inc.php +index e2db2b726..050803231 100644 +--- a/config/defaults.inc.php ++++ b/config/defaults.inc.php +@@ -77,6 +77,9 @@ + // set to 0 to avoid session IDs being logged. + $config['log_session_id'] = 8; +  ++// Default extension used for log file name ++$config['log_file_ext'] = '.log'; ++ + // Syslog ident string to use, if using the 'syslog' log driver. + $config['syslog_id'] = 'roundcube'; +  +diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php +index ef5dcb94e..401cd3f86 100644 +--- a/program/lib/Roundcube/rcube.php ++++ b/program/lib/Roundcube/rcube.php +@@ -1242,11 +1242,17 @@ public static function write_log($name, $line) +             } +         } +  ++        if (self::$instance) { ++            $log_suf = self::$instance->config->get('log_file_ext', '.log'); ++        } else { ++            $log_suf = '.log'; ++        } ++ +         if (empty($log_dir)) { +             $log_dir = RCUBE_INSTALL_PATH . 'logs'; +         } +  +-        return file_put_contents("$log_dir/$name.log", $line, FILE_APPEND) !== false; ++        return file_put_contents("$log_dir/$name$log_suf", $line, FILE_APPEND) !== false; +     } +  +     /** diff --git a/roundcubemail-pr5820.patch b/roundcubemail-pr5820.patch new file mode 100644 index 0000000..0f5cbc5 --- /dev/null +++ b/roundcubemail-pr5820.patch @@ -0,0 +1,22 @@ +From 416eb9b80480b4e07b2868e37fb56fff966b77c7 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 27 Jun 2017 11:40:09 +0200 +Subject: [PATCH] drop ereg dependency, fix compat with PHP 7 + +--- + plugins/password/drivers/cpanel_webmail.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/password/drivers/cpanel_webmail.php b/plugins/password/drivers/cpanel_webmail.php +index a34b6a1f8..8aabd3c6c 100644 +--- a/plugins/password/drivers/cpanel_webmail.php ++++ b/plugins/password/drivers/cpanel_webmail.php +@@ -41,7 +41,7 @@ public function save($curpas, $newpass) +     { +         $user    = $_SESSION['username']; +         $userpwd = "$user:$curpas"; +-        list($login) = split('@', $user); ++        list($login) = explode('@', $user); +  +         $data = array( +             'email'    => $login, diff --git a/roundcubemail.spec b/roundcubemail.spec index d0d3e56..0d9a599 100644 --- a/roundcubemail.spec +++ b/roundcubemail.spec @@ -8,6 +8,7 @@  # Please preserve changelog entries  # +  %if 0%{?fedora} >= 21  # support for apache / nginx / php-fpm  %global with_phpfpm 1 @@ -19,8 +20,8 @@  %global roundcubedir %{_datadir}/roundcubemail  %global _logdir /var/log    Name: roundcubemail -Version:  1.2.5 -Release:  2%{?dist} +Version:  1.3.0 +Release:  1%{?dist}  Summary: Round Cube Webmail is a browser-based multilingual IMAP client  Group: Applications/System @@ -37,15 +38,12 @@ Group: Applications/System  # http://www.tinymce.com/  License: GPLv3+ with exceptions and GPLv3+ and GPLv2 and LGPLv2+ and CC-BY-SA and (MIT or GPLv2)  URL: http://www.roundcube.net -Source0: https://github.com/roundcube/roundcubemail/releases/download/%{version}%{?prever:-%{prever}}/roundcubemail-%{version}%{?prever:-%{prever}}.tar.gz +Source0: https://github.com/roundcube/roundcubemail/releases/download/%{version}%{?prever:-%{prever}}/roundcubemail-%{version}%{?prever:-%{prever}}-complete.tar.gz  Source1: roundcubemail.httpd  Source3: roundcubemail.nginx  Source2: roundcubemail.logrotate  Source4: roundcubemail-README-rpm.txt -# Elegantly handle removal of moxieplayer Flash binary in tinymce -# media plugin (see "Drop precompiled flash" in %%prep) -Patch0: roundcubemail-1.2.1-no_swf.patch  # Non-upstreamable: Adjusts config path to Fedora policy  Patch1: roundcubemail-1.2.1-confpath.patch @@ -54,8 +52,11 @@ Patch1: roundcubemail-1.2.1-confpath.patch  # see https://github.com/roundcube/roundcubemail/pull/313  Patch2: roundcubemail-pr313.patch +# Fix PHP 7 compatibility +# see https://github.com/roundcube/roundcubemail/pull/5820 +Patch3: roundcubemail-pr5820.patch +  BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)  %if %{with_phpfpm}  Requires:  webserver  Requires:  nginx-filesystem @@ -69,6 +70,7 @@ Requires: php-curl  Requires: php-date  Requires: php-dom  Requires: php-fileinfo +Requires: php-filter  Requires: php-gd  Requires: php-hash  Requires: php-iconv @@ -78,7 +80,6 @@ Requires: php-ldap  Requires: php-mbstring  Requires: php-openssl  Requires: php-pcre -Requires: php-posix  Requires: php-pdo  Requires: php-pspell  Requires: php-session @@ -87,39 +88,38 @@ Requires: php-sockets  Requires: php-spl  Requires: php-xml  # From composer.json-dist, require -#        "php": ">=5.3.7", +#        "php": ">=5.4.0",  #        "pear/pear-core-minimal": "~1.10.1", +#        "pear/net_socket": "~1.2.1", +#        "pear/auth_sasl": "~1.1.0", +#        "pear/net_idna2": "~0.2.0", +#        "pear/mail_mime": "~1.10.0", +#        "pear/net_smtp": "~1.7.1", +#        "pear/crypt_gpg": "~1.6.0", +#        "pear/net_sieve": "~1.4.0",  #        "roundcube/plugin-installer": "~0.1.6", -#        "pear-pear.php.net/net_socket": "~1.0.12", -#        "pear-pear.php.net/auth_sasl": "~1.0.6", -#        "pear-pear.php.net/net_idna2": "~0.1.1", -#        "pear-pear.php.net/mail_mime": "~1.10.0", -#        "pear-pear.php.net/net_smtp": "~1.7.1", -#        "pear-pear.php.net/crypt_gpg": "~1.4.1", -#        "roundcube/net_sieve": "~1.5.0" +#        "endroid/qrcode": "~1.6.5"  #   not available and doesn't make sense roundcube/plugin-installer  Requires: php-pear(PEAR)            >= 1.10.1 -Requires: php-pear(Net_Socket)      >= 1.0.12 -Requires: php-pear(Auth_SASL)       >= 1.0.6 -Requires: php-pear(Net_IDNA2)       >= 0.1.1 +Requires: php-pear(Net_Socket)      >= 1.2.1 +Requires: php-pear(Auth_SASL)       >= 1.1.0 +Requires: php-pear(Net_IDNA2)       >= 0.2.0  Requires: php-pear(Mail_Mime)       >= 1.10.0  Requires: php-pear(Net_SMTP)        >= 1.7.1 -Requires: php-pear(Crypt_GPG)       >= 1.4.2 -Requires: php-composer(roundcube/net_sieve) >= 1.5.0 +Requires: php-pear(Crypt_GPG)       >= 1.6.0 +Requires: php-pear(Net_Sieve)       >= 1.4.0 +Requires: php-composer(endroid/qrcode) <  2 +Requires: php-composer(endroid/qrcode) >= 1.6.5  # From composer.json-dist, suggest -#        "pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books", -#        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books" +#        "pear/net_ldap2": "~2.2.0 required for connecting to LDAP", +#        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP"  Requires: php-pear(Net_LDAP2)       >= 2.2.0  Requires: php-composer(kolab/Net_LDAP3)  # mailcap for /etc/mime.types  Requires: mailcap +# Autoloader +Requires: php-composer(fedora/autoloader) -# Optional deps -# Spell check -#Suggests: php-enchant -# Caching -#Suggests: php-apc -#Suggests: php-memcache  # EXIF images  Requires: php-exif  # Upload progress (shock!) @@ -127,10 +127,28 @@ Requires: php-exif  # ZIP download plugin  Requires: php-zip +%if 0%{?fedora} >= 21 +# Optional deps +# Spell check +Suggests: php-enchant +# Caching +Suggests: php-apc +Suggests: php-memcache +Suggests: php-redis  # Gearman support -#Optional: php-gearman +Suggests: php-gearman  # PAM password support  #Optional: php-pam +%endif + +# Bundled JS libraries +# see https://github.com/roundcube/roundcubemail/blob/master/jsdeps.json +Provides: bundled(js-jquery) = 3.2.1 +Provides: bundled(js-jstz) = 1.0.6 +Provides: bundled(js-publickey) +Provides: bundled(js-tinymce) = 4.5.7 +Provides: bundled(js-openpgp) = 1.6.2 +Provides: bundled(js-codemirror) = 5.21.0  %description @@ -146,25 +164,14 @@ CSS 2.  %prep  %setup -q -n roundcubemail-%{version}%{?prever:-%{prever}} -%patch0 -p1  %patch1 -p1  %patch2 -p1 +%patch3 -p1  # fix permissions and remove any .htaccess files  find . -type f -print | xargs chmod a-x  find . -name \.htaccess -print | xargs rm -f -# Fix shebang -chmod +x bin/*sh -sed -e '/^#!/s:/usr/bin/env php:/usr/bin/php:' \ -    -i bin/*sh - -# ??? - Jon, this could do with a comment; fixing carriage returns? (adamw) -sed -i 's/\r//' SQL/mssql.initial.sql - -# Drop precompiled flash -find . -type f -name '*.swf'  -exec rm {} \; -print -  # drop file from patch  find . -type f -name '*.orig' -exec rm {} \; -print @@ -174,19 +181,19 @@ echo "CVE-2012-4230: removing tinymce bbcode plugin, check path if this fails."  test -d program/js/*mce/plugins/bbcode && rm -rf program/js/*mce/plugins/bbcode || exit 1  # Create simple autoloader for PEAR -mkdir vendor +rm -r vendor/*  cat << EOF | tee vendor/autoload.php  <?php -spl_autoload_register( -	function (\$class) { -		if (strpos(\$class, '.') === false) { -			\$file = str_replace('_', '/', \$class).'.php'; -			if (\$path = stream_resolve_include_path(\$file)) { -				require_once(\$path); -			} -		} -	} -); +/* Autoloader for php-phpmyadmin-sql-parser and its dependencies */ +require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; + +# PEAR components +\Fedora\Autoloader\Autoload::addPsr0('', '%{_datadir}/pear'); + +# Composer components +\Fedora\Autoloader\Dependencies::required([ +    '%{_datadir}/php/Endroid/QrCode/autoload.php', +]);  EOF @@ -195,7 +202,6 @@ EOF  %install -rm -rf %{buildroot}  install -d %{buildroot}%{roundcubedir}  cp -pr * %{buildroot}%{roundcubedir} @@ -262,12 +268,7 @@ if [ -f %{_sysconfdir}/%{name}/main.inc.php ]; then  fi -%clean -rm -rf %{buildroot} - -  %files -%defattr(-,root,root,-)  %{!?_licensedir:%global license %%doc}  %license LICENSE  %doc CHANGELOG INSTALL README.md UPGRADING README-rpm.txt @@ -296,6 +297,19 @@ rm -rf %{buildroot}  %changelog +* Tue Jun 27 2017 Remi Collet <remi@remirepo.net> - 1.3.0-1 +- update to 1.3.0 +- open https://github.com/roundcube/roundcubemail/pull/5820 - PHP 7 +- add dependency on endroid/qrcode +- raise dependency on Net_Socket 1.2.1 +- raise dependency on Auth_SASL 1.1.0 +- raise dependency on Net_IDNA2 0.2.0 +- raise dependency on Crypt_GPG 1.6.0 +- switch from roundcube/net_sieve to pear/Net_Sieve +- switch to fedora/autoloader +- add weak dependencies for optional components +- use upstream complete archive for JS libraries +  * Wed May 10 2017 Remi Collet <remi@remirepo.net> - 1.2.5-2  - rename README.rpm -> README-rpm.txt, fix #1449517 @@ -518,10 +532,10 @@ rm -rf %{buildroot}  * Wed Dec 14 2011 Adam Williamson <awilliam@redhat.com> - 0.7-1  - new upstream release  - drop all patches except confpath.patch: -	+ html2text.patch and all CVE fixes were merged upstream -	+ pg-mdb2.patch no longer necessary as all currently supported -	  Fedora releases have a php-pear-MDB2-Driver-pgsql package new -	  enough to work with this option + + html2text.patch and all CVE fixes were merged upstream + + pg-mdb2.patch no longer necessary as all currently supported +   Fedora releases have a php-pear-MDB2-Driver-pgsql package new +   enough to work with this option  * Fri Oct 07 2011 Jon Ciesla <limb@jcomserv.net> = 0.6-1  - New upstream.  | 
