| Sep | OCT | Nov |
| 23 | ||
| 2014 | 2015 | 2016 |
COLLECTED BY
Collection: Wide Crawl Number 13
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | core-adapted-security.patch | 11.36 KB | Bevan |
| #20 | SDO120198-standalone-feeds.patch | 11.36 KB | Bevan |
| #17 | feeds-1848498-17.patch | 10.81 KB | twistor |
PASSED: [[SimpleTest]]: [MySQL] 7,214 pass(es).
[ View ] | |||
| #17 | interdiff.txt | 501 bytes | twistor |
| #15 | feeds-1848498-15.patch | 10.81 KB | twistor |
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/feeds/plugins/FeedsParser.inc.
[ View ] | |||
<?php
hook_feeds_presave{
//FILE EXTENSION CHECK
If (isset($entity->field_attachments['und'])){
//Make list of extensions seperated by a space.
$extensions = 'rtf doc txt pdf jpg gif png bmp doc docx rtf ppt pptx xls xlsx';
//Regex adopted from : http://api.drupal.org/api/drupal/includes!file.inc/function/file_validate_extensions/7
$regex = '/\.(' . preg_replace('/ +/', '|', preg_quote($extensions)) . ')$/i';
//Loop through array of file field, if match unset from array and delete file
foreach ($entity->field_attachments['und'] as $k => $v){
if (!preg_match($regex, $v['filename'])) {
$file = file_load($v['fid']);
unset($entity->field_attachments['und'][$k]);
file_delete($file, $force = FALSE);
}
}
}
?>
Hope this helps for someone.
Rgds, Roeneman
●Log inorregister to post comments
| Project: | Feeds | » Mailhandler |
| Version: | 7.x-2.0-alpha7 | » 7.x-2.x-dev |
| Component: | Code | » Mailhandler |
<?php
$entity->body["und"][0]["value"] = $entity->body["und"][0]["value"] ."\n" .'Attachment ' .$v['filename'] .' was removed, only the following extensions are allowed: ' .$extensions;
?>
I know that proposing a patch is the best way to do this, but that is (still) outside of my programming capabilities. Sorry for that. Please consider this request, as importing files with certain extensions is a safety risk!
Rgds, Roeneman
●Log inorregister to post comments
| Project: | Mailhandler | » Feeds |
| Component: | Mailhandler | » Code |
| Title: | Allowed file extensions | » Respect allowed file extensions in file mapper. |
| Assigned: | Unassigned | » twistor |
| Category: | Feature request | » Bug report |
| Priority: | Normal | » Major |
| Issue summary: | View changes | |
| Version: | 7.x-2.x-dev | » 7.x-2.0-alpha8 |
| Priority: | Major | » Critical |
| Status | File | Size |
|---|---|---|
| new | feeds-1848498-11.patch | 10.29 KB |
| Status: | Active | » Needs review |
| Status: | Needs review | » Needs work |
| Status: | Needs work | » Needs review |
| Status | File | Size |
|---|---|---|
| new | feeds-1848498-14.patch | 11.93 KB |
PASSED: [[SimpleTest]]: [MySQL] 4,455 pass(es).
[ View ] | ||
| Version: | 7.x-2.0-alpha8 | » 7.x-2.x-dev |
| Status | File | Size |
|---|---|---|
| new | feeds-1848498-15.patch | 10.81 KB |
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/feeds/plugins/FeedsParser.inc.
[ View ] | ||
| Status: | Needs review | » Needs work |
| Status: | Needs work | » Needs review |
| Status | File | Size |
|---|---|---|
| new | interdiff.txt | 501 bytes |
| new | feeds-1848498-17.patch | 10.81 KB |
PASSED: [[SimpleTest]]: [MySQL] 7,214 pass(es).
[ View ] | ||
Issue #1848498 by twistor: Respect allowed file extensions in file...●Log inorregister to post comments
| Status: | Needs review | » Fixed |
| Status | File | Size |
|---|---|---|
| new | SDO120198-standalone-feeds.patch | 11.36 KB |
| new | core-adapted-security.patch | 11.36 KB |
| Version: | 7.x-2.x-dev | » 8.x-3.x-dev |
| Status: | Fixed | » Needs work |
| Version: | 8.x-3.x-dev | » 6.x-1.x-dev |