Ori.livneh has submitted this change and it was merged.

Change subject: Replace easter egg by a more explaining message
......................................................................


Replace easter egg by a more explaining message

and make appearance the same

Bug: 60741
Change-Id: Idda8cff80e211f137429d0d7857937241e3d67db
---
M docroot/noc/conf/highlight.php
1 file changed, 8 insertions(+), 9 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved
  Odder: Looks good to me, but someone else must approve
  Matanya: Looks good to me, but someone else must approve

Objections:
  Hoo man: There's a problem with this change, please improve
  MaxSem: There's a problem with this change, please improve
  Hashar: There's a problem with this change, please improve



diff --git a/docroot/noc/conf/highlight.php b/docroot/noc/conf/highlight.php
index c3e7df4..5a7c3cd 100644
--- a/docroot/noc/conf/highlight.php
+++ b/docroot/noc/conf/highlight.php
@@ -4,7 +4,11 @@
 $selectableFilepaths = glob( __DIR__ . '/*' );
 
 // Name of file from user input
-$selectedFileName = $_GET['file'];
+if( isset($_GET['file']) ){
+       $selectedFileName = $_GET['file'];
+} else {
+       $selectedFileName = null;
+}
 
 // Absolute path to file on disk
 $selectedFilePath = false;
@@ -40,8 +44,9 @@
                echo "File not found\n";
                exit;
        }
-       // Easter egg
-       $hlHtml = highlight_string( '<'."?php\n\$secretSitePassword = 
'jgmeidj28gms';\n", true );
+
+       //no filename given or filename not existing in this directory
+       $hlHtml = "<pre>No valid, whitelisted filename in parameter \"file\" 
given.</pre>";
 
 } else {
        // Follow symlink
@@ -83,17 +88,11 @@
 </head>
 <body>
 <h1><a href="./">&laquo;</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> &bull;
 <a 
href="https://git.wikimedia.org/blame/operations%2Fmediawiki-config.git/HEAD/<?php
 echo urlencode( $selectedFileRepoPathEsc ); ?>">blame</a> &bull;
 <a href="<?php echo $selectedFileViewRawUrlEsc; ?>">raw text</a>
 )</p>
-<?php
-endif;
-?>
 <hr>
 <?php echo $hlHtml; ?>
 </body>

-- 
To view, visit https://gerrit.wikimedia.org/r/110874
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idda8cff80e211f137429d0d7857937241e3d67db
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Se4598 <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: Matanya <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Odder <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Se4598 <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to