Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ jobs:
smw_version: dev-master
php_version: 8.1
database_type: mysql
database_image: "mariadb:10"
database_image: "mariadb:10.11"
coverage: true
experimental: false
- mediawiki_version: '1.43'
smw_version: dev-master
php_version: 8.1
php_version: 8.2
database_type: mysql
database_image: "mariadb:10"
database_image: "mariadb:11.4"
coverage: false
experimental: false
- mediawiki_version: '1.44'
smw_version: dev-master
php_version: 8.2
php_version: 8.3
database_type: mysql
database_image: "mariadb:11.8"
coverage: false
experimental: false
- mediawiki_version: '1.45'
smw_version: dev-master
php_version: 8.3
php_version: 8.4
database_type: mysql
database_image: "mariadb:11.8"
database_image: "mariadb:12.3"
coverage: false
experimental: false

Expand All @@ -55,7 +55,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive

Expand All @@ -71,7 +71,7 @@ jobs:
if: matrix.coverage == true

- name: Upload code coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/php/coverage.xml
Expand Down
23 changes: 0 additions & 23 deletions .scrutinizer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ EXTENSION=SemanticMetaTags
MW_VERSION?=1.43
PHP_VERSION?=8.3
DB_TYPE?=mysql
DB_IMAGE?="mariadb:11.2"
DB_IMAGE?="mariadb:11.8"

# extensions
SMW_VERSION?=dev-master
Expand Down
9 changes: 9 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
This file contains the RELEASE-NOTES of the **Semantic Meta Tags** (a.k.a. SMT) extension.

### 7.0.0-alpha

* Added support for Semantic MediaWiki 7.0
* Raised the minimum requirement for
* Semantic MediaWiki to version 7.0 and later
* MediaWiki to version 1.43 and later
* Updated to Semantic MediaWiki 7.0's namespaced data-item classes
* The major version jumps from 4.x to 7.0 to track the Semantic MediaWiki release it supports

### 4.1.1

Released on November 28, 2025.
Expand Down
51 changes: 51 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Security Policy

## Supported versions

Security fixes are provided for the latest major version of Semantic Meta Tags.
Please upgrade to the current release before reporting an issue. Fixes ship in a
new release rather than as backports to older versions.

## Reporting a vulnerability

Please do **not** report security vulnerabilities through public GitHub issues,
pull requests, the mailing list, or the project wiki.

Instead, report them privately using GitHub's
[private vulnerability reporting](https://github.com/SemanticMediaWiki/SemanticMetaTags/security/advisories/new).
Please include the affected version, steps to reproduce, and the potential
impact.

A maintainer will respond to your report, keep you informed of the progress
towards a fix, and may ask for additional information.

## Disclosure process

To minimise the risk of exploitation, please give us a reasonable opportunity to
release a fix before any public disclosure. After a report is submitted, we aim
to:

- Acknowledge the report within 15 days.
- Confirm the issue and assess its severity and impact.
- Prepare and release a fix, prioritised by severity, keeping the reporter
informed of progress.
- Publish a security advisory once a fix is available, crediting the reporter
unless they prefer to remain anonymous.

Remediation time depends on the severity and complexity of the issue. For
coordinated disclosure we aim to release a fix within 90 days where feasible.

Because the repository is public and can be watched by potential attackers,
please avoid describing the vulnerability in public channels, including commit
messages and issue comments, until a fix has been released.

## Vulnerabilities in MediaWiki or Semantic MediaWiki

Semantic Meta Tags is an extension to MediaWiki that builds on Semantic
MediaWiki. If the issue is actually in one of those rather than in Semantic Meta
Tags itself, please report it there instead:

- For Semantic MediaWiki, use its
[private vulnerability reporting](https://github.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/new).
- For MediaWiki core or another extension, contact the
[Wikimedia security team](https://www.mediawiki.org/wiki/Reporting_security_bugs).
14 changes: 12 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
fixes:
- "/var/www/html/extensions/SemanticMetaTags/::"
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
removed_code_behavior: adjust_base

fixes:
- "/var/www/html/extensions/SemanticMetaTags/::"
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
"dev-master": "7.0.0-dev"
Comment thread
paladox marked this conversation as resolved.
Outdated
}
},
"config": {
Expand All @@ -75,6 +75,8 @@
"@minus-x"
],
"phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist",
"unit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testsuite semantic-meta-tags-unit",
"integration": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testsuite semantic-meta-tags-integration",
"phpunit-coverage": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml",
"post-test-coverage": [
"sed -i 's|/var/www/html/extensions/SemanticMetaTags/||g' coverage/php/coverage.xml",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SemanticMetaTags",
"version": "4.1.1",
"version": "7.0.0-alpha",
"author": [
"James Hong Kong"
],
Expand Down
29 changes: 0 additions & 29 deletions phpmd.xml

This file was deleted.

3 changes: 2 additions & 1 deletion src/JsonLDSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Exception;
use MediaWiki\Html\Html;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\Output\OutputPage;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\Title;
Expand Down Expand Up @@ -65,7 +66,7 @@ public static function setJsonLD( $title, $outputPage ) {
] );

} catch ( Exception $e ) {
self::$Logger->error( 'EasyRdf error: ' . $export_url );
LoggerFactory::getInstance( 'smt' )->error( 'EasyRdf error: ' . $export_url );
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/LazySemanticDataLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace SMT;

use SMW\DataModel\SemanticData;
use SMW\ParserData;
use SMW\RequestOptions;
use SMW\SemanticData;
use SMW\Store;

/**
Expand Down
19 changes: 10 additions & 9 deletions src/PropertyValuesContentAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace SMT;

use SMW\DIProperty;
use SMW\DIWikiPage;
use SMWDIBlob as DIBlob;
use SMWDIUri as DIUri;
use MediaWiki\Output\OutputPage;
use SMW\DataItems\Blob;
use SMW\DataItems\Property;
use SMW\DataItems\Uri;
use SMW\DataItems\WikiPage;

/**
* @license GPL-2.0-or-later
Expand All @@ -21,7 +22,7 @@ class PropertyValuesContentAggregator {
private $lazySemanticDataLookup;

/**
* @var \OutputPage
* @var OutputPage
*/
private $mOutputPage;

Expand All @@ -40,7 +41,7 @@ class PropertyValuesContentAggregator {
* @param LazySemanticDataLookup $lazySemanticDataLookup
* @param OutputPage $outputPage
*/
public function __construct( LazySemanticDataLookup $lazySemanticDataLookup, \OutputPage $outputPage ) {
public function __construct( LazySemanticDataLookup $lazySemanticDataLookup, OutputPage $outputPage ) {
$this->lazySemanticDataLookup = $lazySemanticDataLookup;
$this->mOutputPage = $outputPage;
}
Expand Down Expand Up @@ -92,7 +93,7 @@ private function fetchContentForProperty( $property, array &$values ) {
}
} else {
// This is a real property.
$property = DIProperty::newFromUserLabel( $property );
$property = Property::newFromUserLabel( $property );
$semanticData = $this->lazySemanticDataLookup->getSemanticData();

$this->iterateToCollectPropertyValues(
Expand All @@ -114,9 +115,9 @@ private function iterateToCollectPropertyValues( array $propertyValues, &$values

// Content escaping (htmlspecialchars) is being carried out
// by the instance that adds the content
if ( $value instanceof DIBlob ) {
if ( $value instanceof Blob ) {
$values[$value->getHash()] = $value->getString();
} elseif ( $value instanceof DIWikiPage || $value instanceof DIUri ) {
} elseif ( $value instanceof WikiPage || $value instanceof Uri ) {
$values[$value->getHash()] = $value->getSortKey();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use SMT\HookRegistry;
use SMT\Options;
use SMW\DIWikiPage;
use SMW\DataItems\WikiPage;
use SMW\Tests\SMWIntegrationTestCase;
use SMW\Tests\Utils\UtilityFactory;

Expand Down Expand Up @@ -78,7 +78,7 @@ public function testAddStandardMetaTag() {
$this->markTestSkipped( 'OutputPage::getMetaTags does not exist for this MW version' );
}

$subject = new DIWikiPage( __METHOD__, NS_MAIN );
$subject = new WikiPage( __METHOD__, NS_MAIN );
$requestContext->setTitle( $subject->getTitle() );

$this->pageCreator
Expand Down Expand Up @@ -118,7 +118,7 @@ public function testAddOpenGraphMetaTag() {
$this->markTestSkipped( 'OutputPage::addParserOutputMetadata does not exist for this MW version' );
}

$subject = new DIWikiPage( __METHOD__, NS_MAIN );
$subject = new WikiPage( __METHOD__, NS_MAIN );
$requestContext->setTitle( $subject->getTitle() );

$this->pageCreator
Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/Unit/LazySemanticDataLookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SMT\Tests;

use SMT\LazySemanticDataLookup;
use SMW\DIWikiPage;
use SMW\DataItems\WikiPage;

/**
* @covers \SMT\LazySemanticDataLookup
Expand Down Expand Up @@ -32,7 +32,7 @@ public function testCanConstruct() {
}

public function testGetSemanticDataFromParserOutput() {
$semanticData = $this->getMockBuilder( '\SMW\SemanticData' )
$semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' )
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -63,7 +63,7 @@ public function testGetSemanticDataFromParserOutput() {
}

public function testGetSemanticDataFromStore() {
$semanticData = $this->getMockBuilder( '\SMW\SemanticData' )
$semanticData = $this->getMockBuilder( '\SMW\DataModel\SemanticData' )
->disableOriginalConstructor()
->getMock();

Expand All @@ -72,7 +72,7 @@ public function testGetSemanticDataFromStore() {

$semanticData->expects( $this->once() )
->method( 'getSubject' )
->willReturn( new DIWikiPage( 'Foo', NS_MAIN ) );
->willReturn( new WikiPage( 'Foo', NS_MAIN ) );

$parserData = $this->getMockBuilder( '\SMW\ParserData' )
->disableOriginalConstructor()
Expand Down
Loading