Problem with posting links

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Registered User
Posts: 7
Joined: Mon May 20, 2019 6:23 pm

Problem with posting links

Post by dkman123 » Wed May 22, 2019 11:54 am

When i post a link on my forum with [ url]MyLink[ /url] (NOTE: I spaced it out so it wouldn't try to parse the link here) it comes out on ViewTopic as
<a class="" href="">MyLink</a>
So when you hover over the link it shows the post you're in, and when you click it the page reloads (as expected from the hover), but it won't link you out to were you want the link to go.
In the table it's being stored as <URL url="MyLink"><s>[ url]</s>MyLink<e>[ /url]</e></URL>
I don't know if that looks right or not.

If I specify the address by using [ url=MyLink]MyLink[ /url] the ViewTopic output looks the same, but the table stored value has a little extra:
<URL url="MyLink"><s>[ url=MyLink]</s>MyLink<e>[ /url]</e></URL>

Obviously links are allowed in the admin control panel. Is this related to the documentElement vs firstChild thing? It doesn't seem like it should be to me.

I tried a quick glace at viewtopic.php to see if I could find where it's building the address tag (a href= ) but it didn't jump out at me. If I'm pointed in the right direction I can mess with it.


Edit: I did a test post throwing a little bit of everything at it.
What doesn't work (spacing so this forum doesn't format things):
[ img][ /img]
results in <img src="" class="" alt=""> which is just blank on the post.
The font color tag
[ color=#4080FF]font color test[ /color] results in <span style="">font color test</span>
Smilies result in <img class="" src="" alt="" title="" width="" height=""> which is blank of the post.
And the url tag discussed above.

Edit 2: Tested PMs, they have the same issue.

So it comes down to whatever function takes the post field and translates it into html. Can someone point me there?

Registered User
Posts: 7
Joined: Mon May 20, 2019 6:23 pm

Re: Problem with posting links

Post by dkman123 » Wed May 22, 2019 11:00 pm

So I jumped through hoops to get PHP debugging set up. This is a sort-of trace of the path it's going to give me the result.

In viewtopic
$rowset_data->post_text on line 1370 [has the table field with post data]
It is assigned to $row on line 1719
generate_text_for_display on 1732 converts the field data to html (defined in includes/functions_content)

in functions_content line 584 shows
$renderer->static->URL is <a href="" class="">

$text = $renderer->render($text); on line 600 (defined in s9e/textformatter/renderer)

$html = ...render($xml) on line 250 (defined in s9e/textformatter/src/Renderer)

loadXML on line 20

renderRichText on line 31 (from s9e/textformatter/src/Renderers/PHP)

$this->at($dom->firstChild) on line 132 in my case because of the documentElement vs firstChild issue

renderNode on line 37 <--- and the problem is there. the URLs and IMGs are not being filled out correctly, empty img tag smilies, etc

If I follow renderNode I go into s9e_renderer_gibberish.php where I can see the empty html tags

$html = $this.out; on line 133 in my case gives me the html I'm seeing

I also took a screenshot of what my $dom object looks like. It does not have a documentElement property. ... 8364195271

Registered User
Posts: 227
Joined: Fri Jun 08, 2012 12:38 pm
Location: US

Re: Problem with posting links

Post by Lady_G » Thu May 23, 2019 2:16 am

There's not enough information here to understand your configuration. For example, what is your phpBB version? When did the problem start? Do you have any modifications (extensions or styles) installed?

I recommend supplying information of your configuration with the Support Request Template Generator

I think something is interfering with the creation of links. The first step in any debugging problem is to start with the latest version (phpBB 3.2.7) in the 'clean' (unmodified) configuration. Links must be working at this step.

Once you have established working links in the clean configuration, incorporate your board's customizations (style and extensions) - one at a time - until the links stop working.

Also be sure your extensions are updated to the latest version.

FYI - The OP has a detailed description here: phpBB • My entire site went blank after autoupdate 325 to 327. It may be an installation problem related to auto-update.

Registered User
Posts: 7
Joined: Mon May 20, 2019 6:23 pm

Re: Problem with posting links

Post by dkman123 » Thu May 23, 2019 2:51 pm

Sorry, it was related to a recent ticket so I didn't plug in all of the details.

Support Request Template
What version of phpBB are you using? phpBB 3.2.7
What is your board's URL?
Who do you host your board with? NFO
How did you install your board? I used the download package from
What is the most recent action performed on your board? Fresh Install
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? No
What styles do you currently have installed? digi, acidtech
What language(s) is your board currently using? gb english
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
What username can be used to view this issue? testuser
What password can be used to view this issue? badPassword^6
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I had the s9e Configurator problem so I had to do the documentElement to firstChild conversion.
Please describe your problem. Some BBCode (links, images, font colors, and smilies [which are really just images]) do not show correctly in html. Images are blank, the link href is empty so the link just reloads the current page.
So anything that replaces with html that has an attribute in quotes transforms with empty quotes.
Generated by SRT Generator

It's related to this topic viewtopic.php?f=556&t=2512326

What is the latest version of PHP known to work correctly?

Registered User
Posts: 7
Joined: Mon May 20, 2019 6:23 pm

Re: Problem with posting links

Post by dkman123 » Thu May 23, 2019 3:27 pm

I set up a test box and updated to PHP7.3 and it works. No need to fiddle with documentElement and links work. So the details here ... in-ubuntu/ about installing different version of PHP can be used to fix.

NOTE: If the "sudo apt install python-software-properties" says "not found" you can ignore it

I'm working on testing that theory on the server.
That works, though for some strange reason I need to leave the extensions commented in the 7.3 php.ini or I get different errors.

To give the brief version:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php php7.3 php7.3-xml php7.3-json php7.3-mysql
# at first that didn't work then i ran a "sudo apt-get upgrade" (be careful with that), then I went to software updater and it pulled down 7.3
# that seems weird to me, so YMMV

# set the default version for the cli
sudo update-alternatives --set php /usr/bin/php7.3
# set the default version for apache
sudo a2dismod php7.2
sudo a2enmod php7.3
sudo systemctl restart apache2

Like I said, it bugged if I updated the 7.3 php.ini to uncomment extensions, but worked if I did not. I'm not sure why that is.

Post Reply

Return to “[3.2.x] Support Forum”