jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Replace easter egg by a more explaining message"
......................................................................
Revert "Replace easter egg by a more explaining message"
As well as follow up "Fix test broken by Idda8cff80".
For years and years we have build trust among our community by reaching
consensus on change. Handling review and merging change on a Sunday
despite minus votes is not friendly.
Additionally that patch touch a very sensible part of code which need to
be carefully reviewed for security issues. Even if it look harmless, it
can lead to leak of private data.
This reverts commits:
f4f834ba0ffdc653e9219035be46a3fffa6a5367
a37d2b42299a7fab75e6dd786374c2ae65d6ceeb
Change-Id: I016718c8cb55b250d4cb535141069a6e553528e6
---
M docroot/noc/conf/highlight.php
M tests/noc-conf/highlightTest.php
2 files changed, 10 insertions(+), 3 deletions(-)
Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docroot/noc/conf/highlight.php b/docroot/noc/conf/highlight.php
index a2713be..3963508 100644
--- a/docroot/noc/conf/highlight.php
+++ b/docroot/noc/conf/highlight.php
@@ -44,8 +44,9 @@
echo "File not found\n";
exit;
}
- // No filename given or filename not existing in this directory
- $hlHtml = "<pre>No valid, whitelisted filename in parameter \"file\"
given.</pre>";
+ // Easter egg
+ $hlHtml = highlight_string( '<'."?php\n\$secretSitePassword =
'jgmeidj28gms';\n", true );
+
} else {
// Follow symlink
if ( !file_exists( $selectedFilePath ) ) {
@@ -85,11 +86,17 @@
</head>
<body>
<h1><a href="./">«</a> <?php echo $selectedFileNameEsc; ?></h1>
+<?php
+if ( $selectedFilePath !== false ) :
+?>
<p>(
<a
href="https://git.wikimedia.org/history/operations%2Fmediawiki-config.git/HEAD/<?php
echo urlencode( $selectedFileRepoPathEsc ); ?>">version control</a> •
<a
href="https://git.wikimedia.org/blame/operations%2Fmediawiki-config.git/HEAD/<?php
echo urlencode( $selectedFileRepoPathEsc ); ?>">blame</a> •
<a href="<?php echo $selectedFileViewRawUrlEsc; ?>">raw text</a>
)</p>
+<?php
+endif;
+?>
<hr>
<?php echo $hlHtml; ?>
</body>
diff --git a/tests/noc-conf/highlightTest.php b/tests/noc-conf/highlightTest.php
index ac7da5b..7d7d58f 100644
--- a/tests/noc-conf/highlightTest.php
+++ b/tests/noc-conf/highlightTest.php
@@ -78,7 +78,7 @@
/**
* @dataProvider provideInvalidCases
*/
- public function testInvalidCases( $q, $expect = 'No valid, whitelisted
filename' ) {
+ public function testInvalidCases( $q, $expect = 'secretSitePassword' ) {
$this->assertContains(
$expect,
$this->runHighlight( $q ),
--
To view, visit https://gerrit.wikimedia.org/r/110925
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I016718c8cb55b250d4cb535141069a6e553528e6
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Se4598 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits