Opened 14 years ago
Closed 11 years ago
#7539 closed defect (fixed)
Upload of patch files often rejected as Spam
Reported by: | Ryan J Ollos | Owned by: | Michael Renzmann |
---|---|---|---|
Priority: | normal | Component: | TracHacks |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Trac Release: | 0.10 |
Description
Upload of patch files often fails with:
500 Internal Server Error (Submission rejected as potential spam (Maximum number of external links per post exceeded))
See #3921, where upload of ticketstats-r7633.patch was rejected as spam (so the patch had to be uploaded in a gzip archive).
Here is the patch file from that ticket:
-
ticketstats/ticketstats.py
237 237 data['start_date'] = from_date.strftime("%m/%d/%Y") 238 238 data['end_date'] = at_date.strftime("%m/%d/%Y") 239 239 data['resolution'] = str(graph_res) 240 data['baseurl'] = req.base_url240 data['baseurl'] = self.yui_base_url 241 241 data['milestones'] = milestone_list 242 242 data['cmilestone'] = milestone_num 243 243 return 'greensauce.html', data, None -
ticketstats/templates/greensauce.html
12 12 #chart { height: 500px } 13 13 </style> 14 14 15 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script>16 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script>17 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/datasource/datasource-beta-min.js"></script>18 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/json/json-min.js"></script>15 <script type="text/javascript" src="${baseurl}/build/yahoo-dom-event/yahoo-dom-event.js"></script> 16 <script type="text/javascript" src="${baseurl}/build/element/element-beta-min.js"></script> 17 <script type="text/javascript" src="${baseurl}/build/datasource/datasource-beta-min.js"></script> 18 <script type="text/javascript" src="${baseurl}/build/json/json-min.js"></script> 19 19 <!-- OPTIONAL: Connection (enables XHR) --> 20 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/connection/connection-min.js"></script>20 <script type="text/javascript" src="${baseurl}/build/connection/connection-min.js"></script> 21 21 <!-- Source files --> 22 <script type="text/javascript" src=" http://yui.yahooapis.com/2.5.2/build/charts/charts-experimental-min.js"></script>22 <script type="text/javascript" src="${baseurl}/build/charts/charts-experimental-min.js"></script> 23 23 24 24 </head> 25 25 <body class="yui-skin-sam"> … … 97 97 setProvided(); 98 98 updateStaticURL(); 99 99 100 YAHOO.widget.Chart.SWFURL = " http://yui.yahooapis.com/2.5.2/build/charts/assets/charts.swf";100 YAHOO.widget.Chart.SWFURL = "${baseurl}/build/charts/assets/charts.swf"; 101 101 102 102 var myDataSource = new YAHOO.util.DataSource( "?content=chartdata" ); 103 103 -
ticketstats/templates/greensauce.html.sav
1 <!DOCTYPE html2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">4 <html xmlns="http://www.w3.org/1999/xhtml"5 xmlns:py="http://genshi.edgewall.org/"6 xmlns:xi="http://www.w3.org/2001/XInclude">7 <xi:include href="layout.html" />8 <xi:include href="macros.html" />9 <head>10 11 <style type="text/css">12 #chart { height: 500px }13 </style>14 15 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script>16 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script>17 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/datasource/datasource-beta-min.js"></script>18 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/json/json-min.js"></script>19 <!-- OPTIONAL: Connection (enables XHR) -->20 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/connection/connection-min.js"></script>21 <!-- Source files -->22 <script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/charts/charts-experimental-min.js"></script>23 </head>24 <body>25 <p/>26 <span class="chart_title">27 <h1>Ticket Statistics</h1>28 </span>29 <div id="content">30 <div id="chart"></div>31 <form action="" method="post" id="dt_frm">32 <label for="start_date">Start Date: </label>33 <input type="text" name="start_date" id="start_date" value="${start_date}"/>34 <label for="end_date">End Date: </label>35 <input type="text" name="end_date" id="end_date" value="${end_date}"/>36 <label for="resolution">Resolution: </label>37 <input type="text" name="resolution" id="resolution" value="${resolution}"/>38 <input type="submit" value="Update Chart"/>39 </form>40 </div>41 42 <script type = "text/javascript">43 YAHOO.widget.Chart.SWFURL = "http://yui.yahooapis.com/2.5.2/build/charts/assets/charts.swf";44 45 var mychartdata =46 [47 <py:for each="t in ticket_data">48 { date: "${t['date']}", new_tickets: ${t['new']}, closed: ${t['closed']}, open: ${t['open']} },49 </py:for>50 ];51 52 var myDataSource = new YAHOO.util.DataSource( mychartdata );53 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;54 myDataSource.responseSchema =55 {56 fields: [ "date", "new_tickets", "open", "closed" ]57 };58 59 var seriesDef =60 [61 { displayName: "New Tickets", yField: "new_tickets", style: {color: 0xff0000, size: 40} },62 { displayName: "Closed Tickets", yField: "closed", style: {color: 0x00ff00, size:40} },63 { type: "line", displayName: "Open Tickets", yField: "open", style: {color: 0x0000ff} }64 ];65 66 var numtixAxis = new YAHOO.widget.NumericAxis();67 numtixAxis.minimum = 068 69 YAHOO.example.getDataTipText = function( item, index, series )70 {71 var toolTipText = series.displayName + " for " + item.date;72 toolTipText += "\n" + item[series.yField] ;73 return toolTipText;74 }75 76 var mychart = new YAHOO.widget.ColumnChart( "chart", myDataSource,77 {78 xField: "date",79 series: seriesDef,80 yAxis: numtixAxis,81 dataTipFunction: YAHOO.example.getDataTipText,82 style: {legend: {display: "bottom"}}83 });84 85 86 </script>87 88 </body>89 </html>
Attachments (0)
Change History (9)
comment:1 Changed 14 years ago by
Cc: | Steffen Hoffmann added; anonymous removed |
---|---|
Component: | SELECT A HACK → TracHacks |
Owner: | changed from anonymous to Michael Renzmann |
Trac Release: | 0.11 → 0.10 |
comment:2 Changed 14 years ago by
Status: | new → assigned |
---|
comment:3 follow-up: 4 Changed 14 years ago by
comment:4 follow-up: 5 Changed 14 years ago by
Replying to rjollos:
Is that the info you are looking for?
Yes, thanks. In both cases the main issue is that the uploaded (thus POSTed) content contained more than a defined maximum number of external links. Increasing this number or disabling this feature will result in an increased number of spam hitting the site and therefore is no valid option.
Our best bet may be to see if if it's possible to make the spamfilter plugin optionally ignore uploaded files (i.e. ticket and wiki page attachments). Anyone available for looking into that?
comment:5 Changed 14 years ago by
Replying to otaku42:
Our best bet may be to see if if it's possible to make the spamfilter plugin optionally ignore uploaded files (i.e. ticket and wiki page attachments). Anyone available for looking into that?
I opened t:#9583 for this issue and I'll take a look by next weekend to see if it is something I can implement.
comment:7 Changed 14 years ago by
Commented there. I think that such an addition should be regarded as temporary solution for the remaining time we run on Trac 0.10. I agree with dstoecker that after the upgrade there would be better solutions than that.
comment:8 Changed 14 years ago by
SpamFilter now has the wanted option. You need to do backporting to 0.10 yourself.
comment:9 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Seems to be fixed since the upgrade and dstoecker's tuning of the spam filter.
You should have seen a notice about which of the patterns defined in BadContent matched and caused the upload to be declined. Can you please try posting them here, or if that fails send them by e-mail to mrenzmann <at> otak42 <dot> de?