Permalink
Browse files

Throw error on LegacyPubliclet::render() function . Use the migratio…

…n script instead.

 Enforce object class after unserialization from Notification (ignore if not AJXP_Node).
  • Loading branch information...
1 parent 06c92a2 commit 8280debe083a2f94b23a966e91d761f577ac8da2 @cdujeu cdujeu committed May 11, 2016
@@ -48,6 +48,9 @@ private static function renderError($data, $hash, $message = null){
*/
public static function render($data, $options, $shareStore){
+ self::renderError($data, "false", "Link is deprecated and should be migrated to the new format.");
+
+ /*
if(isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true){
self::renderError($data, "false");
return;
@@ -181,11 +184,14 @@ public static function render($data, $options, $shareStore){
}
}
Controller::findActionAndApply($data["ACTION"], $params, null);
- register_shutdown_function(array("AuthService", "clearTemporaryUser"), $shortHash);
+ register_shutdown_function(function() use($shortHash){
+ AuthService::clearTemporaryUser($shortHash);
+ });
} catch (Exception $e) {
AuthService::clearTemporaryUser($shortHash);
die($e->getMessage());
}
+ */
}
@@ -196,6 +196,10 @@ public function loadUserFeed($actionName, $httpVars, $fileVars)
$oldNode = (isSet($args[0]) ? $args[0] : null);
$newNode = (isSet($args[1]) ? $args[1] : null);
$copy = (isSet($args[2]) && $args[2] === true ? true : null);
+ if( ($oldNode != null && !$oldNode instanceof AJXP_Node) || ($newNode != null && !$newNode instanceof AJXP_Node)){
+ error_log("Skipping notification as nodes are not excepted class, probably a deserialization issue");
+ continue;
+ }
$notif = $this->generateNotificationFromChangeHook($oldNode, $newNode, $copy, "unify");
if ($notif !== false && $notif->getNode() !== false) {
$notif->setAuthor($object->author);
@@ -324,6 +328,10 @@ public function loadUserAlerts($actionName, $httpVars, $fileVars)
echo("</li>");
} else {
$node = $notification->getNode();
+ if(!$node instanceof AJXP_Node){
+ error_log("Skipping notification as nodes are not excepted class, probably a deserialization issue");
+ continue;
+ }
$path = $node->getPath();
$nodeRepo = $node->getRepository();

0 comments on commit 8280deb

Please sign in to comment.