- if ($bookmarkservice->bookmarkExists($bAddress, $userservice->getCurrentUserId())) {
- $tplVars['error'] = T_('You have already submitted this bookmark.');
- } else {
- // If bookmark claims to be from the future, set it to be now instead
- if (strtotime($bDatetime) > time()) {
- $bDatetime = gmdate('Y-m-d H:i:s');
- }
+ $attributes = preg_split('/\s+/s', $links[$i]);
+ foreach ($attributes as $attribute) {
+ $att = preg_split('/\s*=\s*/s', $attribute, 2);
+ $attrTitle = $att[0];
+ $attrVal = str_replace('"', '"', preg_replace('/([\'"]?)(.*)\1/', '$2', $att[1]));
+ switch ($attrTitle) {
+ case 'HREF':
+ $bAddress = $attrVal;
+ break;
+ case 'ADD_DATE':
+ $bDatetime = gmdate('Y-m-d H:i:s', $attrVal);
+ break;
+ case 'PRIVATE':
+ $bStatus = (intval($attrVal) == 1) ? 2 : $status;
+ break;
+ case 'TAGS':
+ $bTags = strtolower($attrVal);
+ break;
+ }
+ }
+ $bTitle = str_replace('"', '"', trim($titles[$i]));