jenkins-bot has submitted this change and it was merged.

Change subject: Check for $_SESSION being set before sending to FauxRequest
......................................................................


Check for $_SESSION being set before sending to FauxRequest

Fix for PHP notice caused by I1607be3b6

Bug: T89773
Change-Id: I5b731a14b5668cc4f1a92a4d4b95e2423f4dd819
---
M includes/SF_AutoeditAPI.php
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/SF_AutoeditAPI.php b/includes/SF_AutoeditAPI.php
index 44f385b..3cfac3c 100644
--- a/includes/SF_AutoeditAPI.php
+++ b/includes/SF_AutoeditAPI.php
@@ -836,7 +836,11 @@
                if ( $preloadContent !== '' ) {
 
                        // Spoof $wgRequest for SFFormPrinter::formHTML().
-                       $wgRequest = new FauxRequest( $this->mOptions, true, 
$_SESSION );
+                       if ( isset( $_SESSION ) ) {
+                               $wgRequest = new FauxRequest( $this->mOptions, 
true, $_SESSION );
+                       } else {
+                               $wgRequest = new FauxRequest( $this->mOptions, 
true );
+                       }
                        // call SFFormPrinter::formHTML to get at the form html 
of the existing page
                        list ( $formHTML, $formJS, $targetContent, 
$form_page_title, $generatedTargetNameFormula ) =
                                $sfgFormPrinter->formHTML(
@@ -862,7 +866,11 @@
                }
 
                // Spoof $wgRequest for SFFormPrinter::formHTML().
-               $wgRequest = new FauxRequest( $this->mOptions, true, $_SESSION 
);
+               if ( isset( $_SESSION ) ) {
+                       $wgRequest = new FauxRequest( $this->mOptions, true, 
$_SESSION );
+               } else {
+                       $wgRequest = new FauxRequest( $this->mOptions, true );
+               }
 
                // get wikitext for submitted data and form
                list ( $formHTML, $formJS, $targetContent, $generatedFormName, 
$generatedTargetNameFormula ) =

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b731a14b5668cc4f1a92a4d4b95e2423f4dd819
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: tosfos <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-Reviewer: tosfos <[email protected]>

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

Reply via email to