Page MenuHomePhabricator

Illegal string offset 'ltr' in ResourceLoaderEchoImageModule.php on line 45
Closed, ResolvedPublic

Description

Hi, i am getting these

Illegal string offset 'ltr' in /home/randomwi/public_html/en/extensions/Echo/includes/ResourceLoaderEchoImageModule.php on line 45

Errors in my error_log file.

Event Timeline

Paladox created this task.Mar 25 2017, 10:16 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Paladox updated the task description. (Show Details)Mar 26 2017, 11:32 PM

https://github.com/wikimedia/mediawiki-extensions-Echo/blob/7749ac4684d0839d541f4f922727613dfaeca7ac/includes/ResourceLoaderEchoImageModule.php#L40-L45

ResourceLoaderEchoImageModule.php
$paths = '';
if ( isset( $definition[ 'path' ] ) ) {
	if ( is_array( $definition[ 'path' ] ) ) {
		foreach ( $definition[ 'path' ] as $dir => $p ) {
			// Has both rtl and ltr definitions
			$paths[ $dir ] = $p;
		}
	} else {
		$paths = $definition[ 'path' ];

Looks like the first branch needs to first define $paths as an array before assigning a key to it.

Krinkle edited subscribers, added: Mooeypoo; removed: Krinkle.

Change 345070 had a related patch set (by Paladox) published:
[mediawiki/extensions/Echo@master] Fix Illegal string offset 'ltr' in ResourceLoaderEchoImageModule.php

https://gerrit.wikimedia.org/r/345070

https://github.com/wikimedia/mediawiki-extensions-Echo/blob/7749ac4684d0839d541f4f922727613dfaeca7ac/includes/ResourceLoaderEchoImageModule.php#L40-L45

ResourceLoaderEchoImageModule.php
$paths = '';
if ( isset( $definition[ 'path' ] ) ) {
	if ( is_array( $definition[ 'path' ] ) ) {
		foreach ( $definition[ 'path' ] as $dir => $p ) {
			// Has both rtl and ltr definitions
			$paths[ $dir ] = $p;
		}
	} else {
		$paths = $definition[ 'path' ];

Looks like the first branch needs to first define $paths as an array before assigning a key to it.

Thanks

Change 345070 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Fix Illegal string offset 'ltr' in ResourceLoaderEchoImageModule.php

https://gerrit.wikimedia.org/r/345070

Catrope closed this task as Resolved.Mar 28 2017, 5:46 PM
Catrope assigned this task to Paladox.
Paladox removed a subscriber: gerritbot.