$sql
);
+ // last check for invalid utf8
+ $sql = UtfNormal\Validator::cleanUp( $sql );
+
self::$query[] = [
'sql' => $sql,
'function' => $function,
foreach ( $fields as $key => $value ) {
if ( $value instanceof HTMLFormField ) {
- $v = isset( $this->mFieldData[$key] )
+ $v = array_key_exists( $key, $this->mFieldData )
? $this->mFieldData[$key]
: $value->getDefault();
$tmp = $m[1];
}
if ( substr( $tmp, 0, 2 ) == 'wp' &&
- !isset( $alldata[$tmp] ) &&
- isset( $alldata[substr( $tmp, 2 )] )
+ !array_key_exists( $tmp, $alldata ) &&
+ array_key_exists( substr( $tmp, 2 ), $alldata )
) {
// Adjust for name mangling.
$tmp = substr( $tmp, 2 );
$data = $alldata;
while ( $keys ) {
$key = array_shift( $keys );
- if ( !is_array( $data ) || !isset( $data[$key] ) ) {
+ if ( !is_array( $data ) || !array_key_exists( $key, $data ) ) {
continue 2;
}
$data = $data[$key];
$fields = $this->createFieldsForKey( $key );
foreach ( $fields as $fieldname => $field ) {
- $v = isset( $values[$fieldname] )
+ $v = array_key_exists( $fieldname, $values )
? $values[$fieldname]
: $field->getDefault();
*
* return CatConfig::newFromRow( $dbr->selectRow( ... ) );
* },
- * array(
+ * [
* // Calling touchCheckKey() on this key invalidates the cache
- * 'checkKeys' => array( $cache->makeKey( 'site-cat-config' ) ),
+ * 'checkKeys' => [ $cache->makeKey( 'site-cat-config' ) ],
* // Try to only let one datacenter thread manage cache updates at a time
* 'lockTSE' => 30
- * )
+ * ]
* );
* @endcode
*
*
* return CatState::newFromResults( $dbr->select( ... ) );
* },
- * array(
+ * [
* // The "check" keys that represent things the value depends on;
* // Calling touchCheckKey() on any of them invalidates the cache
- * 'checkKeys' => array(
+ * 'checkKeys' => [
* $cache->makeKey( 'sustenance-bowls', $cat->getRoomId() ),
* $cache->makeKey( 'people-present', $cat->getHouseId() ),
* $cache->makeKey( 'cat-laws', $cat->getCityId() ),
- * )
- * )
+ * ]
+ * ]
* );
* @endcode
*
* $setOpts += Database::getCacheSetOptions( $dbr );
*
* // Start off with the last cached list
- * $list = $oldValue ?: array();
+ * $list = $oldValue ?: [];
* // Fetch the last 100 relevant rows in descending order;
* // only fetch rows newer than $list[0] to reduce scanning
* $rows = iterator_to_array( $dbr->select( ... ) );
* return array_slice( array_merge( $new, $list ), 0, 100 );
* },
* // Try to only let one datacenter thread manage cache updates at a time
- * array( 'lockTSE' => 30 )
+ * [ 'lockTSE' => 30 ]
* );
* @endcode
*
/**
* Get a localised Title object for a specified special page name
*
+ * @since 1.9
+ * @since 1.21 $fragment parameter added
+ *
* @param string $name
* @param string|bool $subpage Subpage string, or false to not use a subpage
* @param string $fragment The link fragment (after the "#")
"userpage-userdoesnotexist": "User account \"$1\" is not registered.\nPlease check if you want to create/edit this page.",
"userpage-userdoesnotexist-view": "User account \"$1\" is not registered.",
"blocked-notice-logextract": "This user is currently blocked.\nThe latest block log entry is provided below for reference:",
- "clearyourcache": "<strong>Note:</strong> After saving, you may have to bypass your browser's cache to see the changes.\n* <strong>Firefox / Safari:</strong> Hold <em>Shift</em> while clicking <em>Reload</em>, or press either <em>Ctrl-F5</em> or <em>Ctrl-R</em> (<em>⌘-R</em> on a Mac)\n* <strong>Google Chrome:</strong> Press <em>Ctrl-Shift-R</em> (<em>⌘-Shift-R</em> on a Mac)\n* <strong>Internet Explorer:</strong> Hold <em>Ctrl</em> while clicking <em>Refresh</em>, or press <em>Ctrl-F5</em>\n* <strong>Opera:</strong> Clear the cache in <em>Tools → Preferences</em>",
+ "clearyourcache": "<strong>Note:</strong> After saving, you may have to bypass your browser's cache to see the changes.\n* <strong>Firefox / Safari:</strong> Hold <em>Shift</em> while clicking <em>Reload</em>, or press either <em>Ctrl-F5</em> or <em>Ctrl-R</em> (<em>⌘-R</em> on a Mac)\n* <strong>Google Chrome:</strong> Press <em>Ctrl-Shift-R</em> (<em>⌘-Shift-R</em> on a Mac)\n* <strong>Internet Explorer:</strong> Hold <em>Ctrl</em> while clicking <em>Refresh</em>, or press <em>Ctrl-F5</em>\n* <strong>Opera:</strong> Go to <em>Menu → Settings</em> (<em>Opera → Preferences</em> on a Mac) and then to <em>Privacy & security → Clear browsing data → Cached images and files</em>.",
"usercssyoucanpreview": "<strong>Tip:</strong> Use the \"{{int:showpreview}}\" button to test your new CSS before saving.",
"userjsyoucanpreview": "<strong>Tip:</strong> Use the \"{{int:showpreview}}\" button to test your new JavaScript before saving.",
"usercsspreview": "<strong>Remember that you are only previewing your user CSS.\nIt has not yet been saved!</strong>",
);
$this->addOption( 'force', 'Run on all rows, even if the collation is ' .
- 'supposed to be up-to-date.' );
+ 'supposed to be up-to-date.', false, false, 'f' );
$this->addOption( 'previous-collation', 'Set the previous value of ' .
'$wgCategoryCollation here to speed up this script, especially if your ' .
'categorylinks table is large. This will only update rows with that ' .