Comments (4)
Hmm.. You're trying to match HTML with regular expressions.
https://stackoverflow.com/a/1732454/276663
Having said that, people do it all the time. I notice you aren't matching the <
& >
of the "table" tags. Which might cause some corruption in the output.. but without some source to play with, I can't really be sure.
Also of note, the plugin uses text from the MessageBody object: (string) $val->body
etc.. which may or may not be after osTicket runs this:
// Capture a list of inline images
$images_before = $images_after = array();
preg_match_all('/src=("|\'|\b)cid:(\S+)\1/', $this->body, $images_before,
PREG_PATTERN_ORDER);
So, it's possible that the image has been replaced with a cid inline-attachment code.. (Looks like mailfetch & mailparse both call that
If you're comfortable forwarding me an email that is failing to match, I'll have a look. [email protected] Or, and this might be the ticket, find a ticket with that attached image, and see what cid code it get's, then match that! ;-)
from plugin-fwd-rewriter.
The images are hosted so they weren't effected by that, turns out my regex skills were just a bit rusty and when I was testing the email body was a single line, I needed to add the s (PCRE_DOTALL) modifier then it worked.
It's now picking up too much but that's a regex issue (your image is right, already regretting starting this! ha) but plugin itself working perfectly so thanks :)
Edit: Actually the problem wasn't my regex but because it was using a colon which is your separator between $pattern and $replacement, so I just updated both class.RewriterPlugin.php and config.php to use another separator character now all is working for me, thanks again :)
from plugin-fwd-rewriter.
Oh cool, what separator worked? Or just make a pull with the change mate.
from plugin-fwd-rewriter.
I'm using the pipe character although just looked it up and that is also reserved in regex so still needs to be something else.
from plugin-fwd-rewriter.
Related Issues (11)
- Does it work for you? HOT 24
- Is this plugin dead development wise ? I'd be interested in it supporting osticket 1.16 HOT 1
- re-addressing users
- Osticket v1.17.1 (58bf538) HOT 2
- Forward matches too much
- Replies to tickets are ignored HOT 3
- Zendesk
- Help with re-writing email headers HOT 6
- RE: and FWD: issue
- 1.9 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-fwd-rewriter.