*
* @return boolean hook value
*/
- function onStartRegisterUser(&$user, &$profile)
+ function onStartRegisterUser(User &$user, Profile &$profile)
{
$homepage = strtolower($profile->homepage);
}
}
- function onStartNoticeSave($notice)
+ function onStartNoticeSave(Notice $notice)
{
$args = $this->testArgs($notice);
common_debug("Blogspamnet args = " . print_r($args, TRUE));
*
* @param object $notice notice is going to be saved
*/
- public function onStartNoticeSave($notice){
+ public function onStartNoticeSave(Notice $notice) {
if(!preg_match('/<span class="rtl">/', $notice->rendered) && self::isRTL($notice->content))
$notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>';
return true;
* @param string $content
* @return boolean
*/
- public static function isRTL($content){
+ public static function isRTL($content) {
$content = self::getClearText($content);
$words = explode(' ', $content);
$rtl = 0;
* @param string $str
* @return boolean
*/
- public static function startsWithRTLCharacter($str){
+ public static function startsWithRTLCharacter($str ){
if (strlen($str) < 1) {
return false;
}
* @param string $str
* @return string
*/
- private static function getClearText($str){
+ private static function getClearText($str) {
$str = preg_replace('/@[^ ]+|![^ ]+|#[^ ]+/u', '', $str); // reply, tag, group
$str = preg_replace('/^RT[: ]{1}| RT | RT: |^RD[: ]{1}| RD | RD: |[♺♻:]/u', '', $str); // redent, retweet
$str = preg_replace("/[ \r\t\n]+/", ' ', trim($str)); // remove spaces
*
* @return bool hook result code
*/
- function onStartNoticeSave($notice)
+ function onStartNoticeSave(Notice $notice)
{
$user = User::getKV('id', $notice->profile_id);
if (!empty($user)) { // it's a remote notice
*
* @return bool hook result code
*/
- function onStartRegisterUser(&$user, &$profile)
+ function onStartRegisterUser(User &$user, Profile &$profile)
{
$email = $user->email;
parent::__construct();
}
- function onStartNoticeSave($notice)
+ function onStartNoticeSave(Notice $notice)
{
$notice->rendered = preg_replace_callback('/spotify:[a-z]{5,6}:[a-z0-9]{22}/i',
"renderSpotifyURILink",