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

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(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



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( '&nbsp;', ' ', $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: merged
Gerrit-Change-Id: I8352c4cfc6b776f9282bdf10f20132ad5a2fe11d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to