}
$groupRights = '';
+ $noFollow = '';
if ( $this->groupPermissions ) {
$groupRights .= "# The following permissions were set based on your choice in the installer\n";
foreach ( $this->groupPermissions as $group => $rightArr ) {
wfBoolToStr( $perm ) . ";\n";
}
}
- $noFollow = '';
if ( $this->groupPermissions['*']['edit'] === false
&& $this->groupPermissions['*']['createaccount'] === false
&& $this->groupPermissions['*']['read'] !== false ) {
- $noFollow = "# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n"
+ $noFollow = "\n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n"
. "# the general public and wish to apply nofollow to external links as a\n"
. "# deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n"
. "# and open wikis will generally require other anti-spam measures; for more\n"
# Path to the GNU diff3 utility. Used for conflict resolution.
\$wgDiff3 = \"{$this->values['wgDiff3']}\";
-{$groupRights}
-{$noFollow}";
+{$groupRights}{$noFollow}";
}
}
return false; # No error
}
- /**
- * Log an error that occurred in an external process
- *
- * @param $retval int
- * @param $err int
- * @param $cmd string
- */
- protected function logErrorForExternalProcess( $retval, $err, $cmd ) {
- wfDebugLog( 'thumbnail',
- sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
- wfHostname(), $retval, trim( $err ), $cmd ) );
- }
-
/**
* Get a MediaTransformError with error 'thumbnail_error'
*
$removed = $this->removeBadFile( $dstPath, $retval );
if ( $retval != 0 || $removed ) {
- wfDebugLog( 'thumbnail',
- sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
- wfHostname(), $retval, trim( $err ), $cmd ) );
-
+ $this->logErrorForExternalProcess( $retval, $err, $cmd );
return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
} else {
$params = array(
* @return bool
*/
function getMetaTree( $image, $gettext = false ) {
- if ( isset( $image->dejaMetaTree ) ) {
+ if ( $gettext && isset( $image->djvuTextTree ) ) {
+ return $image->djvuTextTree;
+ }
+ if ( !$gettext && isset( $image->dejaMetaTree ) ) {
return $image->dejaMetaTree;
}
const METADATA_GOOD = true;
const METADATA_BAD = false;
const METADATA_COMPATIBLE = 2; // for old but backwards compatible.
+ /**
+ * Max length of error logged by logErrorForExternalProcess()
+ */
+ const MAX_ERR_LOG_SIZE = 65535;
/** @var MediaHandler[] Instance cache with array of MediaHandler */
protected static $handlers = array();
public function getRotation( $file ) {
return 0;
}
+
+ /**
+ * Log an error that occurred in an external process
+ *
+ * Moved from BitmapHandler to MediaHandler with MediaWiki 1.23
+ *
+ * @since 1.23
+ * @param $retval int
+ * @param $err string Error reported by command. Anything longer than
+ * MediaHandler::MAX_ERR_LOG_SIZE is stripped off.
+ * @param $cmd string
+ */
+ protected function logErrorForExternalProcess( $retval, $err, $cmd ) {
+ # Keep error output limited (bug 57985)
+ $errMessage = trim( substr( $err, 0, self::MAX_ERR_LOG_SIZE ) );
+
+ wfDebugLog( 'thumbnail',
+ sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
+ wfHostname(), $retval, $errMessage, $cmd ) );
+ }
+
}
}
$removed = $this->removeBadFile( $dstPath, $retval );
if ( $retval != 0 || $removed ) {
- wfDebugLog( 'thumbnail', sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
- wfHostname(), $retval, trim( $err ), $cmd ) );
-
+ $this->logErrorForExternalProcess( $retval, $err, $cmd );
return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
}
( $options['underline'] ? 'underline' : 'none' ) . "; }";
} else {
# The scripts of these languages are very hard to read with underlines
- $rules[] = 'a:lang(ar), a:lang(ckb), a:lang(kk-arab), ' .
- 'a:lang(mzn), a:lang(ps), a:lang(ur) { text-decoration: none; }';
+ $rules[] = 'a:lang(ar), a:lang(kk-arab), a:lang(mzn), ' .
+ 'a:lang(ps), a:lang(ur) { text-decoration: none; }';
}
if ( $options['justify'] ) {
$rules[] = "#article, #bodyContent, #mw_content { text-align: justify; }\n";
'user-mail-no-body' => 'Tried to send email with an empty or unreasonably short body.',
# Change password dialog
-'resetpass' => 'Change password',
+'changepassword' => 'Change password',
+'changepassword-summary' => '', # do not translate or duplicate this message to other languages
'resetpass_announce' => 'You logged in with a temporary emailed code.
To finish logging in, you must set a new password here:',
'resetpass_text' => '<!-- Add text here -->', # only translate this message to other languages if you have to change it
'mypreferences' => 'Preferences',
'prefs-edits' => 'Number of edits:',
'prefsnologintext2' => 'Please $1 to set user preferences.',
-'changepassword' => 'Change password',
-'changepassword-summary' => '', # do not translate or duplicate this message to other languages
'prefs-skin' => 'Skin',
'skin-preview' => 'Preview',
'datedefault' => 'No preference',
'allpagesto' => 'Display pages ending at:',
'allarticles' => 'All pages',
'allinnamespace' => 'All pages ($1 namespace)',
-'allnotinnamespace' => 'All pages (not in $1 namespace)',
-'allpagesprev' => 'Previous',
-'allpagesnext' => 'Next',
'allpagessubmit' => 'Go',
'allpagesprefix' => 'Display pages with prefix:',
'allpagesbadtitle' => 'The given page title was invalid or had an inter-language or inter-wiki prefix.
In those cases, you will have to move or merge the page manually if desired.",
'movearticle' => 'Move page:',
'moveuserpage-warning' => "'''Warning:''' You are about to move a user page. Please note that only the page will be moved and the user will ''not'' be renamed.",
-'movenologin' => 'Not logged in',
'movenologintext' => 'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.',
'movenotallowed' => 'You do not have permission to move pages.',
'movenotallowedfile' => 'You do not have permission to move files.',
'articleexists' => 'A page of that name already exists, or the name you have chosen is not valid.
Please choose another name.',
'cantmove-titleprotected' => 'You cannot move a page to this location because the new title has been protected from creation',
-'talkexists' => "'''The page itself was moved successfully, but the talk page could not be moved because one already exists at the new title.
-Please merge them manually.'''",
-'movedto' => 'moved to',
'movetalk' => 'Move associated talk page',
'move-subpages' => 'Move subpages (up to $1)',
'move-talk-subpages' => 'Move subpages of talk page (up to $1)',
'changepassword-success' => 'Used in [[Special:ChangePassword]].',
'resetpass_forbidden' => "Used as error message in changing password. Maybe the external auth plugin won't allow local password changes.",
'resetpass-no-info' => 'Error message for [[Special:ChangePassword]].',
-'resetpass-submit-loggedin' => 'Button on [[Special:ResetPass]] to submit new password.
+'resetpass-submit-loggedin' => 'Button on [[Special:ChangePassword]] to submit new password.
{{Identical|Change password}}',
-'resetpass-submit-cancel' => 'Used on [[Special:ResetPass]].
+'resetpass-submit-cancel' => 'Used on [[Special:ChangePassword]].
{{Identical|Cancel}}',
'resetpass-wrong-oldpass' => 'Error message shown on [[Special:ChangePassword]] when the old password is not valid.',
'resetpass-temp-password' => 'The label of the input box for the temporary password (received by email) on the form displayed after logging in with a temporary password.',
'prefs-edits' => 'In user preferences.',
'prefsnologintext2' => 'Parameters:
* $1 - a link to [[Special:UserLogin]] with {{msg-mw|loginreqlink}} as link description',
-'changepassword' => "Section heading on [[Special:Preferences]], tab 'User profile'.
-{{Identical|Change password}}",
+'changepassword' => 'Title of [[Special:ChangePassword]].
+{{Identical|Change password}}',
'prefs-skin' => 'Used in user preferences.
{{Identical|Skin}}',
'skin-preview' => '{{doc-actionlink}}
'prefs-watchlist-edits-max' => 'Shown as hint in [[Special:Preferences]], tab "Watchlist"',
'prefs-watchlist-token' => 'Used in [[Special:Preferences]], tab Watchlist.',
'prefs-misc' => 'Tab used on the [[Special:Preferences|user preferences]] special page.',
-'prefs-resetpass' => 'Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ResetPass]].
+'prefs-resetpass' => 'Button on user data tab in user preferences. When you click the button you go to the special page [[Special:ChangePassword]].
{{Identical|Change password}}',
'prefs-changeemail' => 'Link on [[Special:Preferences]] to [[Special:ChangeEmail]].
'user-mail-no-body',
),
'resetpass' => array(
- 'resetpass',
+ 'changepassword',
+ 'changepassword-summary',
'resetpass_announce',
'resetpass_text',
'resetpass_header',
'mypreferences',
'prefs-edits',
'prefsnologintext2',
- 'changepassword',
- 'changepassword-summary',
'prefs-skin',
'skin-preview',
'datedefault',
'allpagesto',
'allarticles',
'allinnamespace',
- 'allnotinnamespace',
- 'allpagesprev',
- 'allpagesnext',
'allpagessubmit',
'allpagesprefix',
'allpagesbadtitle',
'movepagetalktext',
'movearticle',
'moveuserpage-warning',
- 'movenologin',
'movenologintext',
'movenotallowed',
'movenotallowedfile',
'movepage-moved-noredirect',
'articleexists',
'cantmove-titleprotected',
- 'talkexists',
- 'movedto',
'movetalk',
'move-subpages',
'move-talk-subpages',
)
) );
}
-
- /**
- * Recursively merges the expected values in the $item into the $all
- */
- private function mergeExpected( &$all, $item ) {
- foreach ( $item as $k => $v ) {
- if ( array_key_exists( $k, $all ) ) {
- if ( is_array( $all[$k] ) ) {
- $this->mergeExpected( $all[$k], $v );
- } else {
- $this->assertEquals( $all[$k], $v );
- }
- } else {
- $all[$k] = $v;
- }
- }
- }
-
- /**
- * Recursively compare arrays, ignoring mismatches in numeric key and pageids.
- *
- * @param $expectedArray array expected values
- * @param $resultArray array returned values
- */
- private function assertQueryResults( $expectedArray, $resultArray ) {
- reset( $expectedArray );
- reset( $resultArray );
- while ( true ) {
- $expectedValue = each( $expectedArray );
- $resultValue = each( $resultArray );
- // If either of the arrays is shorter, abort. If both are done, success.
- $this->assertEquals( (bool)$expectedValue, (bool)$resultValue );
- if ( !$expectedValue ) {
- break; // done
- }
- // continue only if keys are identical or both keys are numeric
- $this->assertTrue( $expectedValue['key'] === $resultValue['key'] || ( is_numeric( $expectedValue['key'] ) && is_numeric( $resultValue['key'] ) ) );
- // don't compare pageids
- if ( $expectedValue['key'] !== 'pageid' ) {
- // If values are arrays, compare recursively, otherwise compare with ===
- if ( is_array( $expectedValue['value'] ) && is_array( $resultValue['value'] ) ) {
- $this->assertQueryResults( $expectedValue['value'], $resultValue['value'] );
- } else {
- $this->assertEquals( $expectedValue['value'], $resultValue['value'] );
- }
- }
- }
- }
}