coren has submitted this change and it was merged. Change subject: Bugfixes: ......................................................................
Bugfixes: * Fix broken ID attribute generation in table cells in list.php * Fix "dual chrome" situation with error pages. Change-Id: Ifbcda50619cc2cdc7832a76df3603f90808ab654 --- M www/content/403.php M www/content/404.php M www/content/500.php M www/content/list.php 4 files changed, 92 insertions(+), 173 deletions(-) Approvals: coren: Verified; Looks good to me, approved diff --git a/www/content/403.php b/www/content/403.php index ec51491..0b8235a 100644 --- a/www/content/403.php +++ b/www/content/403.php @@ -1,35 +1,18 @@ -<? $uri = $_SERVER['REQUEST_URI']; -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<HTML> - <HEAD> - <TITLE>Tool Labs</TITLE> - <LINK rel="StyleSheet" href="/style.css" type="text/css" media=screen> - <META charset="utf-8"> - <META name="title" content="Tool Labs"> - <META name="description" content="This is the Tool Labs project for community-developed tools assisting the Wikimedia projects."> - <META name="author" content="Wikimedia Foundation"> - <META name="copyright" content="Creative Commons Attribution-Share Alike 3.0"> - <META name="publisher" content="Wikimedia Foundation"> - <META name="language" content="Many"> - <META name="robots" content="index, follow"> - </HEAD> - <BODY> - <H1>Forbidden</H1> - The URI you have requested, - <A href="http://tools.wmflabs.org<?= $uri ?>"><code>http://tools.wmflabs.org<?= $uri ?></code></A>, - might exist but the server has been instructed not to let you reach it.<p> - <? $tool = ''; - if(preg_match("@^/([^/]+)/@", $uri, $part)) { - $gr = posix_getgrnam("local-".$part[1]); - if($gr) { - $tool = $part[1]; - $maintainers = $gr['members']; +<? $uri = $_SERVER['REQUEST_URI']; ?> + <h1>Forbidden</h1> + <p>The URI you have requested, <a href="http://tools.wmflabs.org<?= $uri ?>"><code>http://tools.wmflabs.org<?= $uri ?></code></a>, might exist but the server has been instructed not to let you reach it.</p> + <? $tool = ''; + if(preg_match("@^/([^/]+)/@", $uri, $part)) { + $gr = posix_getgrnam("local-".$part[1]); + if($gr) { + $tool = $part[1]; + $maintainers = $gr['members']; + } } - } - if($tool != ''): - ?> - <H2>If you have reached this page from somewhere else...</H2> - This URI is managed by the <A href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by + if($tool != ''): + ?> + <h2>If you have reached this page from somewhere else...</h2> + <p>This URI is managed by the <a href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by <? foreach($maintainers as $num => $maint): $mu = posix_getpwnam($maint); if($mu): @@ -48,23 +31,12 @@ print ", "; } endforeach; - ?>.<p> - Perhaps this content can only be accessed from the secret underground lair of the maintainers, or the link - you've followed doesn't actually lead somewhere useful? - <p> - If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) - about the error and how you ended up here. - <H2>If you maintain this tool</H2> - The error might be caused by incorrect permissions, or by the absence of an index file (this webserver - does not list directory contents by default). - <? else: ?> - Perhaps the webserver has temporarily lost its mind, or the link you've followed doesn't actually lead - somewhere useful? - <p> - If you're pretty sure this shouldn't be an error, you may wish to notify the - <A href="/?tool=admin">project administrators</A> - about the error and how you ended up here. - <? endif ?> - </BODY> -</HTML> - + ?>.</p> + <p>Perhaps this content can only be accessed from the secret underground lair of the maintainers, or the link you've followed doesn't actually lead somewhere useful?</p> + <p>If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) about the error and how you ended up here.</p> + <h2>If you maintain this tool</h2> + <p>The error might be caused by incorrect permissions, or by the absence of an index file (this webserver does not list directory contents by default).</p> + <? else: ?> + <p>Perhaps the webserver has temporarily lost its mind, or the link you've followed doesn't actually lead somewhere useful?</p> + <p>If you're pretty sure this shouldn't be an error, you may wish to notify the <a href="/?tool=admin">project administrators</a> about the error and how you ended up here.</p> + <? endif ?> diff --git a/www/content/404.php b/www/content/404.php index ec0e64b..b6a3830 100644 --- a/www/content/404.php +++ b/www/content/404.php @@ -1,33 +1,18 @@ -<? $uri = $_SERVER['REQUEST_URI']; -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<HTML> - <HEAD> - <TITLE>Tool Labs</TITLE> - <LINK rel="StyleSheet" href="/style.css" type="text/css" media=screen> - <META charset="utf-8"> - <META name="title" content="Tool Labs"> - <META name="description" content="This is the Tool Labs project for community-developed tools assisting the Wikimedia projects."> - <META name="author" content="Wikimedia Foundation"> - <META name="copyright" content="Creative Commons Attribution-Share Alike 3.0"> - <META name="publisher" content="Wikimedia Foundation"> - <META name="language" content="Many"> - <META name="robots" content="index, follow"> - </HEAD> - <BODY> - <H1>Four hundred and four!</H1> - The URI you have requested, <code>http://tools.wmflabs.org<?= $uri ?></code>, doesn't seem to actually exist. - <? $tool = ''; - if(preg_match("@^/([^/]+)/@", $uri, $part)) { - $gr = posix_getgrnam("local-".$part[1]); - if($gr) { - $tool = $part[1]; - $maintainers = $gr['members']; +<? $uri = $_SERVER['REQUEST_URI']; ?> + <h1>Four hundred and four!</h2> + <p>The URI you have requested, <code>http://tools.wmflabs.org<?= $uri ?></code>, doesn't seem to actually exist.</p> + <? $tool = ''; + if(preg_match("@^/([^/]+)/@", $uri, $part)) { + $gr = posix_getgrnam("local-".$part[1]); + if($gr) { + $tool = $part[1]; + $maintainers = $gr['members']; + } } - } - if($tool != ''): - ?> - <H2>If you have reached this page from somewhere else...</H2> - This URI is managed by the <A href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by + if($tool != ''): + ?> + <h2>If you have reached this page from somewhere else...</h2> + <p>This URI is managed by the <a href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by <? foreach($maintainers as $num => $maint): $mu = posix_getpwnam($maint); if($mu): @@ -46,25 +31,12 @@ print ", "; } endforeach; - ?>.<p> - Perhaps its files are on vacation, or the link you've followed doesn't actually lead - somewhere useful? - <p> - You might want to looks at the <A HREF="/?list">list of tools</A> to find what you were looking for, - or one of the links on the sidebar to the left. - If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) - about the error and how you ended up here. - <? else: ?> - <P> - Perhaps the webserver has temporarily lost its mind, - or the link you've followed doesn't actually lead somewhere useful? - <p> - You might want to looks at the <A HREF="/?list">list of tools</A> to find what you were looking for, - or one of the links on the sidebar to the left. - If you're pretty sure this shouldn't be an error, you may wish to notify the - <A href="/?tool=admin">project administrators</A> - about the error and how you ended up here. - <? endif ?> - </BODY> -</HTML> + ?>.</p> + <p>Perhaps its files are on vacation, or the link you've followed doesn't actually lead somewhere useful?</p> + <p>You might want to looks at the <a href="/?list">list of tools</a> to find what you were looking for, or one of the links on the sidebar to the left. If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) about the error and how you ended up here.</p> + <? else: ?> + <p>Perhaps the webserver has temporarily lost its mind, or the link you've followed doesn't actually lead somewhere useful?</p> + <p>You might want to looks at the <a href="/?list">list of tools</a> to find what you were looking for, or one of the links on the sidebar to the left. If you're pretty sure this shouldn't be an error, you may wish to notify the <a href="/?tool=admin">project administrators</a> about the error and how you ended up here.</p> + <? endif ?> + diff --git a/www/content/500.php b/www/content/500.php index 0466b78..85b3921 100644 --- a/www/content/500.php +++ b/www/content/500.php @@ -1,72 +1,47 @@ -<? $uri = $_SERVER['REQUEST_URI']; -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<HTML> - <HEAD> - <TITLE>Tool Labs</TITLE> - <LINK rel="StyleSheet" href="/style.css" type="text/css" media=screen> - <META charset="utf-8"> - <META name="title" content="Tool Labs"> - <META name="description" content="This is the Tool Labs project for community-developed tools assisting the Wikimedia projects."> - <META name="author" content="Wikimedia Foundation"> - <META name="copyright" content="Creative Commons Attribution-Share Alike 3.0"> - <META name="publisher" content="Wikimedia Foundation"> - <META name="language" content="Many"> - <META name="robots" content="index, follow"> - </HEAD> - <BODY> - <H1>Internal error</H1> - The URI you have requested, - <A href="http://tools.wmflabs.org<?= $uri ?>"><code>http://tools.wmflabs.org<?= $uri ?></code></A>, - appears to be non-functional at this time.<p> - <? $tool = ''; - if(preg_match("@^/([^/]+)/@", $uri, $part)) { - $gr = posix_getgrnam("local-".$part[1]); - if($gr) { - $tool = $part[1]; - $maintainers = $gr['members']; - } - } - if($tool != ''): - ?> - <H2>If you have reached this page from somewhere else...</H2> - This URI is part of the <A href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by - <? foreach($maintainers as $num => $maint): - $mu = posix_getpwnam($maint); - if($mu): - $wtu = $mu['gecos']; - ?><A HREF="https://wikitech.wikimedia.org/wiki/User:<?= $wtu ?>"><?= ucfirst($wtu) ?></A><? - else: - echo ucfirst($maint); - endif; - if($num < count($maintainers)-1) { - if($num == count($maintainers)-2) { - if($num == 0) - print " and "; - else - print ", and "; - } else - print ", "; +<? $uri = $_SERVER['REQUEST_URI']; ?> + <h1>Internal error</h1> + <p>The URI you have requested, <a href="http://tools.wmflabs.org<?= $uri ?>"><code>http://tools.wmflabs.org<?= $uri ?></code></a>, + appears to be non-functional at this time.</p> + <? $tool = ''; + if(preg_match("@^/([^/]+)/@", $uri, $part)) { + $gr = posix_getgrnam("local-".$part[1]); + if($gr) { + $tool = $part[1]; + $maintainers = $gr['members']; } - endforeach; - ?>.<p> - Perhaps its magical script elves are temporarily ill, or the link you've followed doesn't actually lead - somewhere useful? - <p> - If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) - about the error and how you ended up here. - <H2>If you maintain this tool</H2> - The error might be caused by incorrect permission, or by an error in the script or CGI that was meant - to execute here. You may wish to check your logs or - <A href="https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help#Logs">common causes for errors</A> in the help - documentation. - <? else: ?> - Perhaps the webserver has temporarily lost its mind, or the link you've followed doesn't actually lead - somewhere useful? - <p> - If you're pretty sure this shouldn't be an error, you may wish to notify the - <A href="/?tool=admin">project administrators</A> - about the error and how you ended up here. - <? endif ?> - </BODY> -</HTML> - + } + if($tool != ''): + ?> + <h2>If you have reached this page from somewhere else...</h2> + <p>This URI is part of the <a href="/?tool=<?= $tool ?>"><code><?= $tool?></code></a> tool, maintained by + <? foreach($maintainers as $num => $maint): + $mu = posix_getpwnam($maint); + if($mu): + $wtu = $mu['gecos']; + ?><a href="https://wikitech.wikimedia.org/wiki/User:<?= $wtu ?>"><?= ucfirst($wtu) ?></A><? + else: + echo ucfirst($maint); + endif; + if($num < count($maintainers)-1) { + if($num == count($maintainers)-2) { + if($num == 0) + print " and "; + else + print ", and "; + } else + print ", "; + } + endforeach; + ?>.</p> + <p>Perhaps its magical script elves are temporarily ill, or the link you've followed doesn't actually lead + somewhere useful?<p> + <p>If you're pretty sure this shouldn't be an error, you may wish to notify the tool's maintainers (above) + about the error and how you ended up here.</p> + <h2>If you maintain this tool</h2> + <p>The error might be caused by incorrect permission, or by an error in the script or CGI that was meant + to execute here. You may wish to check your logs or <a href="https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools/Help#Logs">common causes for errors</a> in the help documentation.</p> + <? else: ?> + <p>Perhaps the webserver has temporarily lost its mind, or the link you've followed doesn't actually lead + somewhere useful?</p> + <p>If you're pretty sure this shouldn't be an error, you may wish to notify the <a href="/?tool=admin">project administrators</a> about the error and how you ended up here.</p> + <? endif ?> diff --git a/www/content/list.php b/www/content/list.php index 6599fdc..8fc21ac 100644 --- a/www/content/list.php +++ b/www/content/list.php @@ -44,7 +44,7 @@ } ksort($tools); foreach($tools as $tool => $t): ?> - <tr class="tool" id="abot"> + <tr class="tool" id="toollist-<?= $tool ?>"> <td class="tool-name"><? if(array_key_exists('uri', $t)) { print "<a class=\"tool-web\" href=\"" . $t['uri'] . "\">$tool</a>"; -- To view, visit https://gerrit.wikimedia.org/r/104142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifbcda50619cc2cdc7832a76df3603f90808ab654 Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Jorm <[email protected]> Gerrit-Reviewer: Andrew Bogott <[email protected]> Gerrit-Reviewer: coren <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
