Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 8a46f0c

Browse files
authored
check if HTTP_ACCEPT header is set (#19)
* check if HTTP_ACCEPT header is set should fix: > PHP Warning: Undefined array key "HTTP_ACCEPT" in lib/plugins/dokusioc/action.php on line 418 fixes #17 * Update plugin.info.txt * Update CI.yml
1 parent 605f3e8 commit 8a46f0c

File tree

3 files changed

+21
-44
lines changed

3 files changed

+21
-44
lines changed

.github/workflows/CI.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,21 @@
1-
name: CI
1+
name: 'CI'
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request, workflow_dispatch ]
44

55
jobs:
6-
testLinux:
7-
name: PHP Unit
8-
runs-on: ubuntu-latest
9-
10-
strategy:
11-
matrix:
12-
php-version: ['8.0', '8.1', '8.2']
13-
dokuwiki-branch: [ 'master', 'stable']
14-
fail-fast: false
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Setup PHP
20-
uses: shivammathur/setup-php@v2
21-
with:
22-
php-version: ${{ matrix.php-version }}
23-
extensions: mbstring, intl, bz2
24-
25-
- name: Setup problem matchers
26-
run: |
27-
echo ::add-matcher::${{ runner.tool_cache }}/php.json
28-
echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json
29-
30-
- name: Download DokuWiki Test-setup
31-
run: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh
32-
33-
- name: Install DokuWiki
34-
env:
35-
CI_SERVER: 1
36-
DOKUWIKI: ${{ matrix.dokuwiki-branch }}
37-
run: sh travis.sh
38-
39-
- name: Setup PHPUnit
40-
run: |
41-
php _test/fetchphpunit.php
42-
./_test/phpunit.phar --version
43-
44-
- name: Run PHPUnit
45-
run: |
46-
cd _test && PRESERVE_TMP=false ./phpunit.phar --stderr --verbose --debug --group plugin_dokusioc
6+
test:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
php-version: [ '8.1', '8.2' ]
11+
dokuwiki-branch: [ 'master', 'stable' ]
12+
include:
13+
- php-version: '8.0'
14+
dokuwiki-branch: 'stable'
15+
- php-version: '8.3'
16+
dokuwiki-branch: 'master'
17+
18+
uses: mprins/.github/.github/workflows/test.yml@main
19+
with:
20+
php-version: "${{ matrix.php-version }}"
21+
dokuwiki-branch: "${{ matrix.dokuwiki-branch }}"

action.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ private function getDokuUrl($url = null)
414414

415415
public function isRdfXmlRequest(): bool
416416
{
417+
if (!isset($_SERVER['HTTP_ACCEPT']) return false;
418+
417419
// get accepted types
418420
$http_accept = trim($_SERVER['HTTP_ACCEPT']);
419421

plugin.info.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
base dokusioc
22
author Mark C. Prins (previously Michael Haschke)
33
email mprins@users.sf.net
4-
date 2023-06-26
4+
date 2024-06-10
55
name DokuSIOC
66
desc It adds an alternate meta link of the SIOC-RDF/XML document to HTML head, creates SIOC version of wiki content (RDF/XML export), checks the requested application type (content negotiation) and it pings PTSW.com for pushing updates.
77
url https://www.dokuwiki.org/plugin:dokusioc

0 commit comments

Comments
 (0)