News:

Wondering if this will always be free?  See why free is better.

Main Menu

Possible code error - profile-modify.php

Started by Night09, July 28, 2012, 11:44:55 PM

Previous topic - Next topic

Night09

version 2.0.2 - no mods

Hi Guys sorry if this has been posted before.

Was just looking through profile-modify.php and at line 2854 its showing the end of the page nulling the rest of the code. Ive double checked against another 2.0.2 forum and it shows the same issue. The line of code is as follows:

preg_match_all('~<img\s+src=(?:")?((?:http://|ftp://|https://|ftps://).+?)(?:")?(?:\s+alt=(?:")?(.*?)(?:")?)?(?:\s?/)?>~i', $unparsed_signature, $matches2, PREG_PATTERN_ORDER);
            // And stick the HTML in the BBC.


Where the '?' and '>' come together its classing as the finish. I dont think my editor is lying but if someone can confirm if this is a real bug or not. If I remove either of the two mentioned characters the rest of the code becomes live again and my editor shows the correct end point.

Arantor

I think your editor is a bit silly by assuming that's the end of the code because it clearly has no understanding of items inside quotes.

What editor is it that is so poor?
Holder of controversial views, all of which my own.


MrPhil

I haven't tried this particular code, but I have seen some PHP processors interpret ?> in the middle of a string as the end of PHP code. So, it's possible this doesn't work right (on all servers). On the other hand, it's hard to believe that the code survived testing and got this far without someone noticing it failing...

Anyway, if it doesn't in fact work, or you're just concerned about it, split it into two concatenated strings:
... (?:\s+alt=(?:")?(.*?)(?:")?)?(?:\s?/)?' . '>~i', $unparsed_signature, ...

Night09

Looks like the particular editor sees it that way but shouldnt really. Ive swapped to a new one now instead. I dont know why it sees it like that though tbh so figured I would bring it up here. Ive never had a template ever do that before.

@Arantor its just a free one I got off the net a few years back. Now using Notepad++ but the machine I was on last night didnt have it installed.

Advertisement: