Right now it is possible to emit a raw \n or \r to the UDP feed by
encoding it as an HTML entity, e.g. This could be used for
arbitrary IRC command execution in bots which do not subsequently
perform their own escaping. This commit changes it so that entities are
decoded first before \n and \r are stripped.
Change-Id: I3f7005abded3fbafb586754d763a00a4018f0954
* Make MachineReadableRCFeedFormatter use it
* Some unit tests
* Also fixed some line-too-long warnings in RecentChange.php
Change-Id: I443d14f5d4cdac0945cb9c03608d55745bbb865b
Code moved from MWLoggerLegacyLogger::emit(), which was formerly
in wfErrorLog().
Bug: T74572
Bug: T78599
Change-Id: I9e0e63d41bed6ccb468f3a9f1d52f156acc355a8
The RecentChange does not guarantee that all attributes are populated.
Handily it provides a safe getter function in
RecentChange::getAttribute() that will return null with out triggering
an undefined index warning for missing attributes. Protects against log
spam like "Notice: Undefined index: rc_id".
Change-Id: Idee844f0d40a2a084e17f201b5e1501d59a0464d
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I8ebfbcea0e2ae2670553822acedde49c1aa7e98d
Like we do in ApiQueryRecentChanges as well, expose the named
rc.type property, not the internal integer constants.
Change-Id: I89a948eee999032bb2e42cc23345affa879afb42
Reviewers of Id819246a9 (Tim, Timo, Chad) have commented that it
would be preferable to identify wikis by their canonical hostname
rather than the value of $wgDBname. Exposing it here so that
the rcstream server can filter subscriptions by it.
Change-Id: I503a0134a8613daddaae9d8df29a1e27fbfd93bc
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: I8c9f30128b46086064326708a4878228ba459447
* Harmonize spacing
* Use // for comments rather than #
* Harmonize call style for 'require', 'include' etc.
* Add missing profileinfo.php5
* Use "./" for path to api.php in api.php5 (to match other php5 files).
* Move documentation related to Setup.php from index.php to WebStart.php
* Remove "Initialise common code." comment in api.php (was already remove
in most entry points)
Change-Id: I8dc4a79fd13cee49e34f250a4039b3666bd42aca
The Flow extension has need to change the url output by
the IRC formatter. As a temporary fix this allows flow
to conditionally replace the url until RC can be adjusted
to inteligently generate URL's in a cross-extension way.
Change-Id: Ie951e52833a578fecd9423c2e6d3cc10816d7fef
This is akin to $wgSkipSkin/$wgSkipSkins. It is quite plausible for a wiki
to have more than one self prefix (e.g. enwiki has w: en: wikipedia: and
maybe others).
Some recent changes code seems to use $wgLocalInterwiki for quite unclear
purposes:
- I removed the line using $wgLocalInterwiki from the RecentChange
class, as the 'lang' field of $mExtra is not used anywhere in core code.
Extensions may use it, but it would seem more appropriate for them to
use something like $wgDBname (or indeed to consult $wgLocalInterwikis
directly) if they need to identify a particular wiki.
- In the IRC formatter, the first prefix in the array is used (if set).
Appropriate documentation is added to DefaultSettings.php.
Related to bug 954 comment 3.
Bug: 954
Bug: 955
Change-Id: I9dbb566385b464402c5e78510b95dd2ffb4d9489
Endpoints like XMPP natively support sending XML,
which can be advantageous in some cases.
Since most of the logic is the same as the existing
JSONRCFeedFormatter, it was moved into an abstract
MachineReadableRCFeedFormatter class, which simply
creates the array and lets the implementations format
it.
Change-Id: I44f22777cb55fc1ca6527b79ef40b340e2afbd58
* Added license headers to everything
* Added @since tags for all classes
* Use wfParseUrl instead of parse_url
* Check for RedisConnectionPool::getConnection returning false
Change-Id: I7db808c0465bd869de3f2daa82444b5e3d1268c2
This patch adds a class which implements the RCFeedEngine interface by
publishing recent change notifications to Redis. The class handles the
'redis://' URI scheme. Recent changes are PUBLISHed to the channel 'rc'; a
different channel name may be specified as a path component.
Change-Id: I846036c091c45059a8947245a1efe92c9800dcf4
This introduces a new configuration variable, $wgRCFeeds, which allows the user
to configure multiple destinations for RC notifications. It also allows the
notification format to be customized. Two formats are included by default: the
older IRC format and a new JSON format.
Change-Id: I270bde418a82985c94372ac4579100435b6ee026