X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FUserMailer.php;h=7eca76fdf086b1c4118bc8dfc8672c7546d261e7;hb=2849d8a6b3542795d230515a600670533adb2692;hp=6eb9917262c19be9aa01b91caf814dd218c97f26;hpb=8a3a8abbb5b3c8e55b6afe915657bc3d18e31d0c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 6eb9917262..7eca76fdf0 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -119,7 +119,7 @@ class UserMailer { */ static function arrayToHeaderString( $headers, $endl = "\n" ) { $strings = array(); - foreach( $headers as $name => $value ) { + foreach ( $headers as $name => $value ) { $strings[] = "$name: $value"; } return implode( $endl, $strings ); @@ -338,7 +338,7 @@ class UserMailer { # # PHP mail() # - if( count( $to ) > 1 ) { + if ( count( $to ) > 1 ) { $headers['To'] = 'undisclosed-recipients:;'; } $headers = self::arrayToHeaderString( $headers, $endl ); @@ -409,7 +409,7 @@ class UserMailer { */ public static function quotedPrintable( $string, $charset = '' ) { # Probably incomplete; see RFC 2045 - if( empty( $charset ) ) { + if ( empty( $charset ) ) { $charset = 'UTF-8'; } $charset = strtoupper( $charset ); @@ -417,7 +417,7 @@ class UserMailer { $illegal = '\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\xff='; $replace = $illegal . '\t ?_'; - if( !preg_match( "/[$illegal]/", $string ) ) { + if ( !preg_match( "/[$illegal]/", $string ) ) { return $string; } $out = "=?$charset?Q?"; @@ -605,6 +605,7 @@ class EmailNotification { wfRunHooks( 'UpdateUserMailerFormattedPageStatus', array( &$formattedPageStatus ) ); if ( !in_array( $this->pageStatus, $formattedPageStatus ) ) { + wfProfileOut( __METHOD__ ); throw new MWException( 'Not a valid page status!' ); } @@ -696,20 +697,20 @@ class EmailNotification { $keys = array(); $postTransformKeys = array(); - $pageTitleUrl = $this->title->getCanonicalUrl(); + $pageTitleUrl = $this->title->getCanonicalURL(); $pageTitle = $this->title->getPrefixedText(); if ( $this->oldid ) { // Always show a link to the diff which triggered the mail. See bug 32210. $keys['$NEWPAGE'] = "\n\n" . wfMessage( 'enotif_lastdiff', - $this->title->getCanonicalUrl( 'diff=next&oldid=' . $this->oldid ) ) + $this->title->getCanonicalURL( 'diff=next&oldid=' . $this->oldid ) ) ->inContentLanguage()->text(); if ( !$wgEnotifImpersonal ) { // For personal mail, also show a link to the diff of all changes // since last visited. $keys['$NEWPAGE'] .= "\n\n" . wfMessage( 'enotif_lastvisited', - $this->title->getCanonicalUrl( 'diff=0&oldid=' . $this->oldid ) ) + $this->title->getCanonicalURL( 'diff=0&oldid=' . $this->oldid ) ) ->inContentLanguage()->text(); } $keys['$OLDID'] = $this->oldid; @@ -724,10 +725,10 @@ class EmailNotification { } $keys['$PAGETITLE'] = $this->title->getPrefixedText(); - $keys['$PAGETITLE_URL'] = $this->title->getCanonicalUrl(); + $keys['$PAGETITLE_URL'] = $this->title->getCanonicalURL(); $keys['$PAGEMINOREDIT'] = $this->minorEdit ? wfMessage( 'minoredit' )->inContentLanguage()->text() : ''; - $keys['$UNWATCHURL'] = $this->title->getCanonicalUrl( 'action=unwatch' ); + $keys['$UNWATCHURL'] = $this->title->getCanonicalURL( 'action=unwatch' ); if ( $this->editor->isAnon() ) { # real anon (user:xxx.xxx.xxx.xxx) @@ -738,10 +739,10 @@ class EmailNotification { } else { $keys['$PAGEEDITOR'] = $wgEnotifUseRealName ? $this->editor->getRealName() : $this->editor->getName(); $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $this->editor->getName() ); - $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getCanonicalUrl(); + $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getCanonicalURL(); } - $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalUrl(); + $keys['$PAGEEDITOR_WIKI'] = $this->editor->getUserPage()->getCanonicalURL(); # Replace this after transforming the message, bug 35019 $postTransformKeys['$PAGESUMMARY'] = $this->summary == '' ? ' - ' : $this->summary; @@ -790,8 +791,9 @@ class EmailNotification { function compose( $user ) { global $wgEnotifImpersonal; - if ( !$this->composed_common ) + if ( !$this->composed_common ) { $this->composeCommonMailtext(); + } if ( $wgEnotifImpersonal ) { $this->mailTargets[] = new MailAddress( $user );