| Index: trunk/phase3/includes/Title.php |
| — | — | @@ -1037,13 +1037,15 @@ |
| 1038 | 1038 | * e-mail notifications. Uses $wgCanonicalServer and the |
| 1039 | 1039 | * GetCanonicalURL hook. |
| 1040 | 1040 | * |
| | 1041 | + * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment |
| | 1042 | + * |
| 1041 | 1043 | * @param $query string An optional query string |
| 1042 | 1044 | * @param $variant string Language variant of URL (for sr, zh, ...) |
| 1043 | 1045 | * @return string The URL |
| 1044 | 1046 | */ |
| 1045 | 1047 | public function getCanonicalURL( $query = '', $variant = false ) { |
| 1046 | 1048 | global $wgCanonicalServer; |
| 1047 | | - $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ); |
| | 1049 | + $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(); |
| 1048 | 1050 | wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) ); |
| 1049 | 1051 | return $url; |
| 1050 | 1052 | } |