MyBB Community Forums

Full Version: Warning when using a 'MyCode' in a thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello again,
I just found that I'm getting this:
Quote:Warning [2] preg_replace() [function.preg-replace]: Compilation failed: unmatched parentheses at offset 41 - Line: 320 - File: E:\Websites\ithelp.co.il\httpdocs\forum\inc\class_parser.php PHP 5.2.5
(there are some more lines of errors in 'class_parser.php' and 'functions_post.php' and 'showthread.php' - but I can't seem to be able to copy them to here)
this occurres whenever there is a 'MyCode', a link, a picture or any code that uses "[]...[/]" in any of my forum's threads. This shows up when a thread is posted and when a user tries to view it.
Please note that my forum is a RTL oriented.
can you tell me what do do/change?

Ori...
try to upload fresh class_parser.php file, that may help.
What myCode are you trying to use? Is it a custom one?

If so, what is the regular expression that you're using?
As I told in the original message, it, even, happens when trying the "[url][/url]". I call it 'MyCode, as it uses the same functions.
Yes you have an invalid custom MyCode. You need to post here what custom MyCodes you're using so that we can debug it further.
ok,
I found something. I disabled all 'MyCode's (I have the "Google Video", "YouTube" and "MetaCafe"), and a thread with a link and some text are not prompting a warning. But(!), every space (in the original post) is turned into a plus ('+') sign.
<div class="post_body" id="pid_4">
					Lets+try+this...<br />
<a+href="http://www.ithelp.co.il"+target="_blank">ithelp</a><br />
<br />
Ori...
				</div>
(I changed the hebrew text into English, but this is how it looks like - copied from the page source)

Please help
Ori...
Please help me. I need the forums to work up to the start of next week.
Where should I look to debug this?

Ori...
The "URL" MyCode is parsed in ./inc/class_parser.php. The first thing to do would be to upload the latest class_parser.php file to see if that works.

Apart from that, it would need someone to take a closer look at the regex for your MyCodes...
Can you reupload a fresh copy of inc/class_parser.php?
I did upload the original class_parser.php (from my own computer copy - 1.4.2).
No help.
I tried to find the source of this problem so I created a new thread and checked every step the message goes. What I found is that in the moderation step (all messages posted on this forum have to be approved by a Moderator) I see the message ok. Only in the forum itself, the message has pluses ('+') instead of spaces (' ') and using the "[url][/url]" does not work (it shows the text, but not as a link). I did test the message in preview - it shows the pluses ('+'), the same as a full view.

Ori...
Pages: 1 2