strpos() [function.strpos]: Empty needle

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

strpos() [function.strpos]: Empty needle

Post by youngjediknight » Tue May 06, 2014 8:57 pm

Whenever I reply to a forum post, I see the following error message at the top of the screen:

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/posting.php on line 1305: strpos() [function.strpos]: Empty needle
Additionally, I notice some odd formatting of the style on the reply page such as the height of the navbar (with breadcrumbs) appearing squeezed. The posting tabs below the Preview and Submit buttons (Options, Attachments, Polls) are also truncated such that the words do not appear but the top of the tabs do. I can still click on the tabs though if I carefully aim the mouse pointer to the tip of the tab.

A search through these forums came up short but a google search led me to this bug tracker which suggests it has something to do with file compression. I GZip compression is off in the ACP.

Also, this only occurs when replying to topics in the forum. This does not occur on new topics or when replying to PMs or creating PMs.

I've gone through mods that were installed since this error began to appear but could not spot anything:
* Youtube Gallery
* Prime Trash Bin
* Topic cement
* Prime Instant Redirect
* Login After Registration
* Sitemap FX
* Prevent Topic Increase By Author
* phpBB Video (bbcode)
* Reimg Reisizer
* Allowed Extensions Mod
* Manage Attachments Module
* Temporary Shadow Topics

Any guidance would be greatly appreciated.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29252
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: strpos() [function.strpos]: Empty needle

Post by Marshalrusty » Tue May 06, 2014 10:21 pm

Please post a copy of your posting.php file. Just change the extension to .txt and attach it to your reply.

What version of phpBB are you running?
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: strpos() [function.strpos]: Empty needle

Post by youngjediknight » Tue May 06, 2014 10:31 pm

Here you go, Marshalrusty.

I am using 3.0.12. I am still building out the site so it should still be the latest version.
Attachments
posting.txt
(60.71 KiB) Downloaded 17 times

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29252
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: strpos() [function.strpos]: Empty needle

Post by Marshalrusty » Tue May 06, 2014 11:43 pm

Your line 1305:

Code: Select all

$post_data['post_subject'] = ((strpos($post_data['post_subject'], '') !== 0) ? '' : '') . censor_text($post_data['post_subject']);
Vanilla version:

Code: Select all

$post_data['post_subject'] = ((strpos($post_data['post_subject'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($post_data['post_subject']);
Note the missing Re:. I mean, I can't think of any reason why any MOD would make that change.

The most likely answer would seem to be that your text editor stripped this for some reason. What are you using to edit files?

And yes, you should undo that change.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: strpos() [function.strpos]: Empty needle

Post by youngjediknight » Wed May 07, 2014 12:45 am

Oh well this is embarrassing ... I purposefully removed it following this kb article but it appears I removed both instances of "RE."

I am using Notepad++ but I don't think that is the issue. I will give this a try when I get home.

Marshalrusty, thank you SO MUCH.

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29252
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: strpos() [function.strpos]: Empty needle

Post by Marshalrusty » Wed May 07, 2014 12:59 am

Ah, that explains it.

We're here to help :)
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: strpos() [function.strpos]: Empty needle

Post by youngjediknight » Wed May 07, 2014 2:17 am

Well you saved me from having to go through each change line by line from all those mods. And the kicker would have been that none of the changes were from those mods!! Oh that would've been a LOT of head banging for sure.

Again, thank you.

P.S. So long and thanks for all the fish. :mrgreen:

Locked

Return to “[3.0.x] Support Forum”