Extracted URL-query-append logic from Title to wfAppendQuery(), using this in two places now.
* Introduce PageHistoryBeforeList and PageHistoryLineEnding hooks; see docs/hooks.txt
for more information
* (bug 9299) Allow user timezones to work with Postgres
+* (bug 9411) Fix for shared image descriptions using query-string titles
+
== Maintenance ==
* New script maintenance/language/checkExtensioni18n.php used to check i18n
return $cgi;
}
+/**
+ * Append a query string to an existing URL, which may or may not already
+ * have query string parameters already. If so, they will be combined.
+ *
+ * @param string $url
+ * @param string $query
+ * @return string
+ */
+function wfAppendQuery( $url, $query ) {
+ if( $query != '' ) {
+ if( false === strpos( $url, '?' ) ) {
+ $url .= '?';
+ } else {
+ $url .= '&';
+ }
+ $url .= $query;
+ }
+ return $url;
+}
+
/**
* This is obsolete, use SquidUpdate::purge()
* @deprecated
$wgOut->addHTML($sharedtext);
if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
- $text = Http::get($url . '?action=render');
+ $renderUrl = wfAppendQuery( $url, 'action=render' );
+ wfDebug( "Fetching shared description from $renderUrl\n" );
+ $text = Http::get( $renderUrl );
if ($text)
$this->mExtraDescription = $text;
}
$namespace .= ':';
}
$url = str_replace( '$1', $namespace . $this->mUrlform, $baseUrl );
- if( $query != '' ) {
- if( false === strpos( $url, '?' ) ) {
- $url .= '?';
- } else {
- $url .= '&';
- }
- $url .= $query;
- }
+ $url = wfAppendQuery( $url, $query );
}
# Finally, add the fragment.