Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/110886
Change subject: Fix test broken by Idda8cff80
......................................................................
Fix test broken by Idda8cff80
Change-Id: I8352c4cfc6b776f9282bdf10f20132ad5a2fe11d
---
M docroot/noc/conf/highlight.php
M tests/noc-conf/highlightTest.php
2 files changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/86/110886/1
diff --git a/docroot/noc/conf/highlight.php b/docroot/noc/conf/highlight.php
index 5a7c3cd..a2713be 100644
--- a/docroot/noc/conf/highlight.php
+++ b/docroot/noc/conf/highlight.php
@@ -4,7 +4,7 @@
$selectableFilepaths = glob( __DIR__ . '/*' );
// Name of file from user input
-if( isset($_GET['file']) ){
+if ( isset( $_GET['file'] ) ) {
$selectedFileName = $_GET['file'];
} else {
$selectedFileName = null;
@@ -44,10 +44,8 @@
echo "File not found\n";
exit;
}
-
- //no filename given or filename not existing in this directory
+ // No filename given or filename not existing in this directory
$hlHtml = "<pre>No valid, whitelisted filename in parameter \"file\"
given.</pre>";
-
} else {
// Follow symlink
if ( !file_exists( $selectedFilePath ) ) {
@@ -63,7 +61,6 @@
// Figure out path to selected file in the mediawiki-config
repository
$selectedFileRepoPath = ( basename( dirname( $selectedFilePath
) ) === 'wmf-config' ? 'wmf-config/' : '' ) . $selectedFileName;
if ( substr( $selectedFileName, -4 ) === '.php' ) {
-
$hlHtml = highlight_file( $selectedFilePath, true );
$hlHtml = str_replace( ' ', ' ', $hlHtml ); //
https://bugzilla.wikimedia.org/19253
$hlHtml = str_replace( ' ', "\t", $hlHtml ); //
convert 4 spaces to 1 tab character; bug #36576
diff --git a/tests/noc-conf/highlightTest.php b/tests/noc-conf/highlightTest.php
index 7d7d58f..ac7da5b 100644
--- a/tests/noc-conf/highlightTest.php
+++ b/tests/noc-conf/highlightTest.php
@@ -78,7 +78,7 @@
/**
* @dataProvider provideInvalidCases
*/
- public function testInvalidCases( $q, $expect = 'secretSitePassword' ) {
+ public function testInvalidCases( $q, $expect = 'No valid, whitelisted
filename' ) {
$this->assertContains(
$expect,
$this->runHighlight( $q ),
--
To view, visit https://gerrit.wikimedia.org/r/110886
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8352c4cfc6b776f9282bdf10f20132ad5a2fe11d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits