Topic on Extension talk:TwitterCards/Flow

Breaks user script and stylesheet pages

3
SoledadKabocha (talkcontribs)

On a non-Wikimedia Foundation wiki I use, this extension caused the following error message when attempting to view, edit, or get history for any page that is user CSS or JS:

MediaWiki internal error.

Exception caught inside exception handler.

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.

...until the administrator "configured LocalSettings.php not to load TwitterCards on pages whose title begins with User: and ends with .css or .js." (I am not the server administrator, so I am unable to provide further details at this time.)

I have not yet tested whether CSS/JS in the MediaWiki: namespace is affected, as no such scripts or stylesheets exist on said wiki.

Should the extension itself be modified to avoid CSS/JS pages similarly? --

Damian Yerrick (talkcontribs)

This is the workaround I came up with. With my luck, I'm probably doing it all wrong:

$lstitleext = strtolower(strrchr(@$_REQUEST['title'], '.'));
$lsiscss = $lstitleext === '.css' || $lstitleext === '.js';
$lsisuser = explode(':', strtolower(@$_REQUEST['title']));
$lsisuser = $lsisuser[0] === 'user';
if (!$lsisuser || !$lsiscss) {
  require_once "$IP/extensions/TwitterCards/TwitterCards.php";
}
71.202.162.80 (talkcontribs)

Thanks for the report, this is filed as phab:T102897 now. Please note that the extension is still in an experimental state.

Reply to "Breaks user script and stylesheet pages"