core icon indicating copy to clipboard operation
core copied to clipboard

OCP\Util::addHeader() has a $text parameter that is never used

Open KenBW2 opened this issue 12 years ago • 2 comments

Steps to reproduce

  1. Use \OCP\Util::addHeader('title', array(), "Title Text");
  2. Check rendered HTML

Expected behaviour

Tell us what should happen

<title>Title Text</title>

Actual behaviour

Tell us what happens instead

<title />

Server configuration

ownCloud version: (see ownCloud admin page)

7.0.2

Updated from an older ownCloud or fresh install:

Updated from OC6

Client configuration

Browser:

Firefox

Operating system:

Fedora

Relevant Information

Sticking a die in \OCP\Util::addHeader() shows the parameter is being passed in correctly.

The problem appears to be in the template core/templates/layout.base.php

        <?php foreach($_['headers'] as $header): ?>
            <?php
                print_unescaped('<'.$header['tag'].' ');
                foreach($header['attributes'] as $name=>$value) {
                    print_unescaped("$name='$value' ");
                };
                print_unescaped('/>');
            ?>
        <?php endforeach; ?>

KenBW2 avatar Sep 12 '14 13:09 KenBW2

Would you mind providing a PR for this if you have an idea how to fix it ?

PVince81 avatar Sep 15 '14 10:09 PVince81

We already have https://github.com/owncloud/core/pull/7316 - I'll rebase and test it.

LukasReschke avatar Sep 15 '14 10:09 LukasReschke