Bug #29149
Error in link discovery regular expression
| Status: | Closed | Start date: | 2011-08-22 | |
|---|---|---|---|---|
| Priority: | Must have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | 1.5.2 | |||
| Votes: | 0 |
Description
When the link title contains one of the extension in its text, and is generated after href, and the the current file is not in the extension list, but in the secured folder, the link match and the captured text expand to the extension in the title attribute.
An exemple after. The extension PDF is protected, but not the extension DOC.
Link tag : <a href="securedpath/myfile.doc" target="_blank" title="Click to view the document (PDF, DOC, …)"> Transformed tag : <a href="index.php?eID=tx_nawsecuredl&u=1&file=securedpath/myfile.doc" target="_blank" title="Click to view the document (PDF&t=1314093786&hash=31400b51b7ede9637040e406a3eebb36, DOC, …)">
This is due to a .* match in the regex which should be [^"]* instead. (class.tx_nawsecuredl.php:64,66,79)
64: if (preg_match('/"(?:'.$this->modifiyregex($this->extConf['domain']).')?(\/?(?:'.$this->modifiyregex($this->extConf['securedDirs']).')+?[^"]*?(?:'.$this->modifyfiletypes($this->extConf['filetype']).'))"/i', $tag,$match1)){
66: if ($this->extConf['debug'] == '2' || $this->extConf['debug'] == '3') debug('/"(?:'.$this->modifiyregex($this->extConf['domain']).')?(\/?(?:'.$this->modifiyregex($this->extConf['securedDirs']).')+?.[^"]?(?:'.$this->modifyfiletypes($this->extConf['filetype']).'))"/i');
79: if (preg_match('/\'(?:'.$this->modifiyregex($this->extConf['domain']).')?.*?(\/?(?:'.$this->modifiyregex($this->extConf['securedDirs']).')+?[^"]*?(?:'.$this->modifyfiletypes($this->extConf['filetype']).'))\'/i', $tmp,$match1)){
History
Updated by Helmut Hummel over 1 year ago
- Status changed from New to Accepted
Thanks for the report. I will look into this.
Updated by Helmut Hummel over 1 year ago
- Status changed from Accepted to Needs Feedback
Which version of the extension are you using? I cannot confirm this issue with version 1.5.1
Updated by Helmut Hummel over 1 year ago
- Target version changed from 1.5.1 to 1.5.2
Updated by Helmut Hummel 9 months ago
- Status changed from Needs Feedback to Closed
The unit tests show, that there is no problem with the mentioned links. Also there is no feedback by the reporter.
If you still have the problem, please open another ticket.