php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66138 HTML parsing breaks in Opera 12 because of an erroneous BASE tag
Submitted: 2013-11-21 10:11 UTC Modified: 2013-12-04 21:14 UTC
From: mytskine at gmail dot com Assigned: dm (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mytskine at gmail dot com
New email:
PHP Version: OS:

 

 [2013-11-21 10:11 UTC] mytskine at gmail dot com
Description:
------------
When loading the page http://php.net/manual/en/ (and possibly others) no CSS is applied with Opera 12.
Removing the BASE tag from the header fixes the problem.

There are 2 errors in this tag:

1. It should point to a base URL path, yet it ends with "index.php".
2. The tag should not be closed as the doctype isn't xhtml[^1][^2].

An alternative to fixing the tag would be to remove it completly as it is useless (at least on this page).

[^1]: <http://www.w3.org/TR/html-markup/base.html>
[^2]: <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-21 17:12 UTC] bjori@php.net
Wait, the <base> tag ending in a /foobar.php is actually a problem for Opera?
Since when? This part of the website hasn't changed since 2002, maybe 2003...
 [2013-11-21 17:30 UTC] bjori@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bjori
 [2013-11-21 17:30 UTC] bjori@php.net
Should be fixed now, thanks for the report!
 [2013-11-21 18:54 UTC] bjori@php.net
Actually, you are wrong. A <base> tag can totally contain a full URL, including filename.php.
All relative links are then resolved against the tag, which include fragments.
So links like <a href="#foobar"> will become filename.php#foobar.

Removing the filename.php componenent, would then resolve that anchor to /#foobar which is a totally different page.

The link you pointed to also very explicitly say URL, which is clearly defined elsewhere, and can ofcourse contain filename.php
 [2013-11-21 22:29 UTC] mytskine at gmail dot com
Sorry if I was wrong about the "index.php" part, I should have been more careful. I had a look at several pages from php.net, and the BASE was always set to the current URL, which doesn't seem much useful.

But as I said in the ticket, the problem was that this BASE tag broke the CSS loading with Opera 12.51. The problem appeared once the new theme was enabled. It wasn't a big deal for me as other pages from php.net didn't suffer from this. Thanks for your quick reaction.
 [2013-12-04 18:20 UTC] dm@php.net
-Status: Closed +Status: Re-Opened -Assigned To: bjori +Assigned To: dm
 [2013-12-04 21:14 UTC] dm@php.net
-Status: Re-Opened +Status: Closed
 [2013-12-04 21:14 UTC] dm@php.net
Fixed by @bjori \o/
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Nov 21 04:00:02 2025 UTC