From dce60b43126dcaa38e6845ae45e09db87aa7e229 Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 17 Jul 2012 02:46:53 +0200 Subject: Refs #4643. Added unlock upgrade action. --- views/default/widgets/control_panel/content.php | 32 ++++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'views') diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php index d2db54bc6..e6763d851 100644 --- a/views/default/widgets/control_panel/content.php +++ b/views/default/widgets/control_panel/content.php @@ -11,12 +11,32 @@ elgg_register_menu_item('admin_control_panel', array( 'link_class' => 'elgg-button elgg-button-action', )); -elgg_register_menu_item('admin_control_panel', array( - 'name' => 'upgrade', - 'text' => elgg_echo('upgrade'), - 'href' => 'upgrade.php', - 'link_class' => 'elgg-button elgg-button-action', -)); +// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed +global $CONFIG, $DB_QUERY_CACHE; +$is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}locked'")); +// Invalidate query cache +if ($DB_QUERY_CACHE) { + $DB_QUERY_CACHE->clear(); + elgg_log("Query cache invalidated", 'NOTICE'); +} + +if (!$is_locked) { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'upgrade', + 'text' => elgg_echo('upgrade'), + 'href' => 'upgrade.php', + 'link_class' => 'elgg-button elgg-button-action', + )); +} else { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'unlock_upgrade', + 'text' => elgg_echo('upgrade:unlock'), + 'href' => 'action/admin/site/unlock_upgrade', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-delete', + 'confirm' => elgg_echo('upgrade:unlock:confirm'), + )); +} echo elgg_view_menu('admin_control_panel', array( 'class' => 'elgg-menu-hz', -- cgit v1.2.3 From 8916fcdca6a2950d210abd2db7e6fb104abec149 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Fri, 7 Sep 2012 01:38:03 -0400 Subject: Fixes #4789: group_gatekeeper() and river hide closed/invisible group content more reliably --- engine/classes/ElggGroupItemVisibility.php | 93 ++++++++++++++++++++++++++++++ engine/lib/group.php | 56 ++++++++---------- engine/lib/views.php | 8 ++- views/default/page/components/list.php | 15 ++--- 4 files changed, 133 insertions(+), 39 deletions(-) create mode 100644 engine/classes/ElggGroupItemVisibility.php (limited to 'views') diff --git a/engine/classes/ElggGroupItemVisibility.php b/engine/classes/ElggGroupItemVisibility.php new file mode 100644 index 000000000..2c7e2abb4 --- /dev/null +++ b/engine/classes/ElggGroupItemVisibility.php @@ -0,0 +1,93 @@ +guid : 0; + + $container_guid = (int) $container_guid; + + $cache_key = "$container_guid|$user_guid"; + if (empty($cache[$cache_key])) { + // compute + + $container = get_entity($container_guid); + $is_visible = (bool) $container; + + if (!$is_visible) { + // see if it *really* exists... + $prev_access = elgg_set_ignore_access(); + $container = get_entity($container_guid); + elgg_set_ignore_access($prev_access); + } + + if ($container && $container instanceof ElggGroup) { + /* @var ElggGroup $container */ + + if ($is_visible) { + if (!$container->isPublicMembership()) { + if ($user) { + if (!$container->isMember($user) && !$user->isAdmin()) { + $ret->shouldHideItems = true; + $ret->reasonHidden = self::REASON_MEMBERSHIP; + } + } else { + $ret->shouldHideItems = true; + $ret->reasonHidden = self::REASON_LOGGEDOUT; + } + } + } else { + $ret->shouldHideItems = true; + $ret->reasonHidden = self::REASON_NOACCESS; + } + } + $cache[$cache_key] = $ret; + } + return $cache[$cache_key]; + } +} diff --git a/engine/lib/group.php b/engine/lib/group.php index feb1f1e7f..b81146e61 100644 --- a/engine/lib/group.php +++ b/engine/lib/group.php @@ -247,48 +247,42 @@ function get_users_membership($user_guid) { } /** - * Checks access to a group. + * May the current user access item(s) on this page? If the page owner is a group, + * membership, visibility, and logged in status are taken into account. * * @param boolean $forward If set to true (default), will forward the page; * if set to false, will return true or false. * - * @return true|false If $forward is set to false. + * @return bool If $forward is set to false. */ function group_gatekeeper($forward = true) { - $allowed = true; - $url = ''; - - if ($group = elgg_get_page_owner_entity()) { - if ($group instanceof ElggGroup) { - $url = $group->getURL(); - if (!$group->isPublicMembership()) { - // closed group so must be member or an admin - - if (!elgg_is_logged_in()) { - $allowed = false; - if ($forward == true) { - $_SESSION['last_forward_from'] = current_page_url(); - register_error(elgg_echo('loggedinrequired')); - forward('', 'login'); - } - } else if (!$group->isMember(elgg_get_logged_in_user_entity())) { - $allowed = false; - } - // Admin override - if (elgg_is_admin_logged_in()) { - $allowed = true; - } - } - } + $page_owner_guid = elgg_get_page_owner_guid(); + if (!$page_owner_guid) { + return true; } + $visibility = ElggGroupItemVisibility::factory($page_owner_guid); - if ($forward && $allowed == false) { - register_error(elgg_echo('membershiprequired')); - forward($url, 'member'); + if (!$visibility->shouldHideItems) { + return true; } + if ($forward) { + // only forward to group if user can see it + $group = get_entity($page_owner_guid); + $forward_url = $group ? $group->getURL() : ''; + + if ($visibility->reasonHidden !== ElggGroupItemVisibility::REASON_MEMBERSHIP) { + $_SESSION['last_forward_from'] = current_page_url(); + $forward_reason = 'login'; + } else { + $forward_reason = 'member'; + } - return $allowed; + register_error(elgg_echo($visibility->reasonHidden)); + forward($forward_url, $forward_reason); + } + + return false; } /** diff --git a/engine/lib/views.php b/engine/lib/views.php index b00334062..90737c260 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1243,7 +1243,7 @@ function elgg_view_module($type, $title, $body, array $vars = array()) { * @param ElggRiverItem $item A river item object * @param array $vars An array of variables for the view * - * @return string|false Depending on success + * @return string */ function elgg_view_river_item($item, array $vars = array()) { // checking default viewtype since some viewtypes do not have unique views per item (rss) @@ -1256,6 +1256,12 @@ function elgg_view_river_item($item, array $vars = array()) { if (!$subject || !$object) { // subject is disabled or subject/object deleted return ''; + } else { + // hide based on object's container + $visibility = ElggGroupItemVisibility::factory($object->container_guid); + if ($visibility->shouldHideItems) { + return ''; + } } $vars['item'] = $item; diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php index 0cf7d507c..28ed58ddf 100644 --- a/views/default/page/components/list.php +++ b/views/default/page/components/list.php @@ -51,14 +51,15 @@ if ($pagination && $count) { if (is_array($items) && count($items) > 0) { $html .= "'; } -- cgit v1.2.3 From 3bf72994688ad9292bf37444d80ab5ab1a002748 Mon Sep 17 00:00:00 2001 From: Paweł Sroka Date: Sun, 4 Nov 2012 08:25:28 +0100 Subject: Fixes #1479 - Replaces WP autop with implementation from Steve Clay. --- engine/classes/ElggAutop.php | 315 +++++++++++++++++++++ engine/lib/output.php | 83 +++--- engine/tests/api/output.php | 64 +++++ .../test_files/output/autop/block-a.exp.norun.html | 6 + .../test_files/output/autop/block-a.in.norun.html | 9 + .../tests/test_files/output/autop/domdoc_exp.html | 46 +++ .../tests/test_files/output/autop/domdoc_in.html | 80 ++++++ .../test_files/output/autop/typical-post.exp.html | 84 ++++++ .../test_files/output/autop/typical-post.in.html | 89 ++++++ .../test_files/output/autop/wp-welcome.exp.html | 22 ++ .../test_files/output/autop/wp-welcome.in.html | 25 ++ .../test_files/output/autop/wpautop-fails.exp.html | 31 ++ .../test_files/output/autop/wpautop-fails.in.html | 41 +++ .../test_files/output/autop/wysiwyg-test.exp.html | 51 ++++ .../test_files/output/autop/wysiwyg-test.in.html | 79 ++++++ mod/groups/views/rss/object/groupforumtopic.php | 2 +- mod/search/views/default/search/no_results.php | 2 +- mod/thewire/views/rss/object/thewire.php | 2 +- .../forms/uservalidationbyemail/bulk_action.php | 2 +- views/default/forms/profile/fields/add.php | 2 +- views/default/forms/user/passwordreset.php | 2 +- views/default/output/longtext.php | 2 +- views/default/page/elements/messages.php | 2 +- views/installation/install/pages/admin.php | 2 +- views/installation/install/pages/complete.php | 2 +- views/installation/install/pages/database.php | 4 +- views/installation/install/pages/requirements.php | 4 +- views/installation/install/pages/settings.php | 2 +- views/installation/install/pages/welcome.php | 2 +- views/installation/page/elements/messages.php | 2 +- views/opendd/messages/exceptions/exception.php | 2 +- views/rss/group/default.php | 4 +- views/rss/object/default.php | 2 +- views/rss/user/default.php | 2 +- views/xml/messages/exceptions/exception.php | 2 +- 35 files changed, 1008 insertions(+), 63 deletions(-) create mode 100644 engine/classes/ElggAutop.php create mode 100644 engine/tests/api/output.php create mode 100644 engine/tests/test_files/output/autop/block-a.exp.norun.html create mode 100644 engine/tests/test_files/output/autop/block-a.in.norun.html create mode 100644 engine/tests/test_files/output/autop/domdoc_exp.html create mode 100644 engine/tests/test_files/output/autop/domdoc_in.html create mode 100644 engine/tests/test_files/output/autop/typical-post.exp.html create mode 100644 engine/tests/test_files/output/autop/typical-post.in.html create mode 100644 engine/tests/test_files/output/autop/wp-welcome.exp.html create mode 100644 engine/tests/test_files/output/autop/wp-welcome.in.html create mode 100644 engine/tests/test_files/output/autop/wpautop-fails.exp.html create mode 100644 engine/tests/test_files/output/autop/wpautop-fails.in.html create mode 100644 engine/tests/test_files/output/autop/wysiwyg-test.exp.html create mode 100644 engine/tests/test_files/output/autop/wysiwyg-test.in.html (limited to 'views') diff --git a/engine/classes/ElggAutop.php b/engine/classes/ElggAutop.php new file mode 100644 index 000000000..fa0c34225 --- /dev/null +++ b/engine/classes/ElggAutop.php @@ -0,0 +1,315 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT License + */ +class ElggAutop { + + public $encoding = 'UTF-8'; + + /** + * @var DOMDocument + */ + protected $_doc = null; + + /** + * @var DOMXPath + */ + protected $_xpath = null; + + protected $_blocks = 'address article area aside blockquote caption col colgroup dd + details div dl dt fieldset figure figcaption footer form h1 h2 h3 h4 h5 h6 header + hr hgroup legend map math menu nav noscript p pre section select style summary + table tbody td tfoot th thead tr ul ol option li'; + + /** + * @var array + */ + protected $_inlines = 'a abbr audio b button canvas caption cite code command datalist + del dfn em embed i iframe img input ins kbd keygen label map mark meter object + output progress q rp rt ruby s samp script select small source span strong style + sub sup textarea time var video wbr'; + + /** + * Descend into these elements to add Ps + * + * @var array + */ + protected $_descendList = 'article aside blockquote body details div footer form + header section'; + + /** + * Add Ps inside these elements + * + * @var array + */ + protected $_alterList = 'article aside blockquote body details div footer header + section'; + + protected $_unique = ''; + + public function __construct() + { + $this->_blocks = preg_split('@\\s+@', $this->_blocks); + $this->_descendList = preg_split('@\\s+@', $this->_descendList); + $this->_alterList = preg_split('@\\s+@', $this->_alterList); + $this->_inlines = preg_split('@\\s+@', $this->_inlines); + $this->_unique = md5(__FILE__); + } + + /** + * Intance of class for singleton pattern. + * @var ElggAutop + */ + private static $instance; + + /** + * Singleton pattern. + * @return ElggAutop + */ + public static function getInstance() { + $className = __CLASS__; + if (!(self::$instance instanceof $className)) { + self::$instance = new $className(); + } + return self::$instance; + } + + /** + * Create wrapper P and BR elements in HTML depending on newlines. Useful when + * users use newlines to signal line and paragraph breaks. In all cases output + * should be well-formed markup. + * + * In DIV, LI, TD, and TH elements, Ps are only added when their would be at + * least two of them. + * + * @param string $html snippet + * @return string|false output or false if parse error occurred + */ + public function process($html) + { + // normalize whitespace + $html = str_replace(array("\r\n", "\r"), "\n", $html); + + // allows preserving entities untouched + $html = str_replace('&', $this->_unique . 'AMP', $html); + + $this->_doc = new DOMDocument(); + + // parse to DOM, suppressing loadHTML warnings + // http://www.php.net/manual/en/domdocument.loadhtml.php#95463 + libxml_use_internal_errors(true); + if (! @$this->_doc->loadHTML("{$html}" + . "")) { + return false; + } + + $this->_xpath = new DOMXPath($this->_doc); + // start processing recursively at the BODY element + $nodeList = $this->_xpath->query('//body[1]'); + $this->_addParagraphs($nodeList->item(0)); + + // serialize back to HTML + $html = $this->_doc->saveHTML(); + + // split AUTOPs into multiples at /\n\n+/ + $html = preg_replace('/(' . $this->_unique . 'NL){2,}/', '', $html); + $html = str_replace(array($this->_unique . 'BR', $this->_unique . 'NL', '
'), + '
', + $html); + $html = str_replace('
', '', $html); + + // re-parse so we can handle new AUTOP elements + + if (! @$this->_doc->loadHTML($html)) { + return false; + } + // must re-create XPath object after DOM load + $this->_xpath = new DOMXPath($this->_doc); + + // strip AUTOPs that only have comments/whitespace + foreach ($this->_xpath->query('//autop') as $autop) { + $hasContent = false; + if (trim($autop->textContent) !== '') { + $hasContent = true; + } else { + foreach ($autop->childNodes as $node) { + if ($node->nodeType === XML_ELEMENT_NODE) { + $hasContent = true; + break; + } + } + } + if (! $hasContent) { + // strip w/ preg_replace later (faster than moving nodes out) + $autop->setAttribute("r", "1"); + } + } + + // remove a single AUTOP inside certain elements + + foreach ($this->_xpath->query('//div') as $el) { + $autops = $this->_xpath->query('./autop', $el); + if ($autops->length === 1) { + // strip w/ preg_replace later (faster than moving nodes out) + $autops->item(0)->setAttribute("r", "1"); + } + } + + $html = $this->_doc->saveHTML(); + + // trim to the contents of BODY + $bodyStart = strpos($html, ''); + $bodyEnd = strpos($html, '', $bodyStart + 6); + $html = substr($html, $bodyStart + 6, $bodyEnd - $bodyStart - 6); + + // strip AUTOPs that should be removed + $html = preg_replace('@(.*?)@', '\\1', $html); + + // commit to converting AUTOPs to Ps + $html = str_replace('', "\n

", $html); + $html = str_replace('', "

\n", $html); + + $html = str_replace('
', '
', $html); + $html = str_replace($this->_unique . 'AMP', '&', $html); + return $html; + } + + /** + * Add P and BR elements as necessary + * + * @param DOMElement $el + */ + protected function _addParagraphs(DOMElement $el) + { + // no need to recurse, just queue up + $elsToProcess = array($el); + $inlinesToProcess = array(); + while ($el = array_shift($elsToProcess)) { + // if true, we can alter all child nodes, if not, we'll just call + // _addParagraphs on each element in the descendInto list + $alterInline = in_array($el->nodeName, $this->_alterList); + + // inside affected elements, we want to trim leading whitespace from + // the first text node + $ltrimFirstTextNode = true; + + // should we open a new AUTOP element to move inline elements into? + $openP = true; + $autop = null; + + // after BR, ignore a newline + $isFollowingBr = false; + + $node = $el->firstChild; + while (null !== $node) { + if ($alterInline) { + if ($openP) { + $openP = false; + // create a P to move inline content into (this may be removed later) + $autop = $el->insertBefore($this->_doc->createElement('autop'), $node); + } + } + + $isElement = ($node->nodeType === XML_ELEMENT_NODE); + if ($isElement) { + $elName = $node->nodeName; + } + $isBlock = ($isElement && in_array($elName, $this->_blocks)); + + if ($alterInline) { + $isInline = $isElement && ! $isBlock; + $isText = ($node->nodeType === XML_TEXT_NODE); + $isLastInline = (! $node->nextSibling + || ($node->nextSibling->nodeType === XML_ELEMENT_NODE + && in_array($node->nextSibling->nodeName, $this->_blocks))); + if ($isElement) { + $isFollowingBr = ($node->nodeName === 'br'); + } + + if ($isText) { + $nodeText = $node->nodeValue; + if ($ltrimFirstTextNode) { + $nodeText = ltrim($nodeText); + $ltrimFirstTextNode = false; + } + if ($isFollowingBr && preg_match('@^[ \\t]*\\n[ \\t]*@', $nodeText, $m)) { + // if a user ends a line with
, don't add a second BR + $nodeText = substr($nodeText, strlen($m[0])); + } + if ($isLastInline) { + $nodeText = rtrim($nodeText); + } + $nodeText = str_replace("\n", $this->_unique . 'NL', $nodeText); + $tmpNode = $node; + $node = $node->nextSibling; // move loop to next node + + // alter node in place, then move into AUTOP + $tmpNode->nodeValue = $nodeText; + $autop->appendChild($tmpNode); + + continue; + } + } + if ($isBlock || ! $node->nextSibling) { + if ($isBlock) { + if (in_array($node->nodeName, $this->_descendList)) { + $elsToProcess[] = $node; + //$this->_addParagraphs($node); + } + } + $openP = true; + $ltrimFirstTextNode = true; + } + if ($alterInline) { + if (! $isBlock) { + $tmpNode = $node; + if ($isElement && false !== strpos($tmpNode->textContent, "\n")) { + $inlinesToProcess[] = $tmpNode; + } + $node = $node->nextSibling; + $autop->appendChild($tmpNode); + continue; + } + } + + $node = $node->nextSibling; + } + } + + // handle inline nodes + // no need to recurse, just queue up + while ($el = array_shift($inlinesToProcess)) { + $ignoreLeadingNewline = false; + foreach ($el->childNodes as $node) { + if ($node->nodeType === XML_ELEMENT_NODE) { + if ($node->nodeValue === 'BR') { + $ignoreLeadingNewline = true; + } else { + $ignoreLeadingNewline = false; + if (false !== strpos($node->textContent, "\n")) { + $inlinesToProcess[] = $node; + } + } + continue; + } elseif ($node->nodeType === XML_TEXT_NODE) { + $text = $node->nodeValue; + if ($text[0] === "\n" && $ignoreLeadingNewline) { + $text = substr($text, 1); + $ignoreLeadingNewline = false; + } + $node->nodeValue = str_replace("\n", $this->_unique . 'BR', $text); + } + } + } + } +} diff --git a/engine/lib/output.php b/engine/lib/output.php index 0069360f0..d50576b44 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -43,51 +43,25 @@ function parse_urls($text) { /** * Create paragraphs from text with line spacing - * Borrowed from Wordpress. * * @param string $pee The string - * @param bool $br Add BRs? + * @deprecated Use elgg_autop instead * - * @todo Rewrite * @return string **/ -function autop($pee, $br = 1) { - $pee = $pee . "\n"; // just to make things a little easier, pad the end - $pee = preg_replace('|
\s*
|', "\n\n", $pee); - // Space things out a little - $allblocks = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)'; - $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); - $pee = preg_replace('!()!', "$1\n\n", $pee); - $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines - if (strpos($pee, ']*)>\s*|', "", $pee); // no pee inside object/embed - $pee = preg_replace('|\s*\s*|', '', $pee); - } - $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates - $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "

$1

\n", $pee); // make paragraphs, including one at the end - $pee = preg_replace('|

\s*?

|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace - $pee = preg_replace('!

([^<]+)\s*?(]*>)!', "

$1

$2", $pee); - $pee = preg_replace('|

|', "$1

", $pee); - $pee = preg_replace('!

\s*(]*>)\s*

!', "$1", $pee); // don't pee all over a tag - $pee = preg_replace("|

(|", "$1", $pee); // problem with nested lists - $pee = preg_replace('|

]*)>|i', "

", $pee); - $pee = str_replace('

', '

', $pee); - $pee = preg_replace('!

\s*(]*>)!', "$1", $pee); - $pee = preg_replace('!(]*>)\s*

!', "$1", $pee); - if ($br) { - $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "", $matches[0]);'), $pee); - $pee = preg_replace('|(?)\s*\n|', "
\n", $pee); // optionally make line breaks - $pee = str_replace('', "\n", $pee); - } - $pee = preg_replace('!(]*>)\s*
!', "$1", $pee); - $pee = preg_replace('!
(\s*]*>)!', '$1', $pee); - //if (strpos($pee, '. Only there because of the comment. - // $pee = preg_replace_callback('!()(.*?)!is', 'clean_pre', $pee ); - //} - $pee = preg_replace("|\n

$|", '

', $pee); - - return $pee; +function autop($pee) { + return elgg_autop($pee); +} + +/** + * Create paragraphs from text with line spacing + * + * @param string $pee The string + * + * @return string + **/ +function elgg_autop($pee) { + return ElggAutop::getInstance()->process($pee); } /** @@ -398,3 +372,32 @@ function elgg_strip_tags($string) { return $string; } + +/** + * Unit tests for Output + * + * @param sting $hook unit_test + * @param string $type system + * @param mixed $value Array of tests + * @param mixed $params Params + * + * @return array + * @access private + */ +function output_unit_test($hook, $type, $value, $params) { + global $CONFIG; + $value[] = $CONFIG->path . 'engine/tests/api/output.php'; + return $value; +} + +/** + * Initialise the Output subsystem. + * + * @return void + * @access private + */ +function output_init() { + elgg_register_plugin_hook_handler('unit_test', 'system', 'output_unit_test'); +} + +elgg_register_event_handler('init', 'system', 'output_init'); diff --git a/engine/tests/api/output.php b/engine/tests/api/output.php new file mode 100644 index 000000000..eb1a66b29 --- /dev/null +++ b/engine/tests/api/output.php @@ -0,0 +1,64 @@ + + */ +class ElggCoreOutputAutoPTest extends ElggCoreUnitTest { + + /** + * @var ElggAutop + */ + protected $_autop; + + public function setUp() { + $this->_autop = new ElggAutop(); + } + + public function testDomRoundtrip() + { + $d = dir(dirname(__DIR__) . '/test_files/output/autop'); + $in = file_get_contents($d->path . "/domdoc_in.html"); + $exp = file_get_contents($d->path . "/domdoc_exp.html"); + + $doc = new DOMDocument(); + libxml_use_internal_errors(true); + $doc->loadHTML("" + . $in . ''); + $serialized = $doc->saveHTML(); + list(,$out) = explode('', $serialized, 2); + list($out) = explode('', $out, 2); + + $this->assertEqual($exp, $out, "DOMDocument's parsing/serialization roundtrip"); + } + + public function testProcess() + { + $data = $this->provider(); + foreach ($data as $row) { + list($test, $in, $exp) = $row; + $out = $this->_autop->process($in); + $this->assertEqual($exp, $out, "Equality case {$test}"); + } + } + + public function provider() + { + $d = dir(dirname(__DIR__) . '/test_files/output/autop'); + $tests = array(); + while (false !== ($entry = $d->read())) { + if (preg_match('/^([a-z\\-]+)\.in\.html$/i', $entry, $m)) { + $tests[] = $m[1]; + } + } + + $data = array(); + foreach ($tests as $test) { + $data[] = array( + $test, + file_get_contents($d->path . '/' . "{$test}.in.html"), + file_get_contents($d->path . '/' . "{$test}.exp.html"), + ); + } + return $data; + } +} diff --git a/engine/tests/test_files/output/autop/block-a.exp.norun.html b/engine/tests/test_files/output/autop/block-a.exp.norun.html new file mode 100644 index 000000000..addf29dec --- /dev/null +++ b/engine/tests/test_files/output/autop/block-a.exp.norun.html @@ -0,0 +1,6 @@ + +

HTML5 allows A to contain block-level content

+

A treated as block

+

Read more

+
+

A treated as
inline

diff --git a/engine/tests/test_files/output/autop/block-a.in.norun.html b/engine/tests/test_files/output/autop/block-a.in.norun.html new file mode 100644 index 000000000..fc2dac43a --- /dev/null +++ b/engine/tests/test_files/output/autop/block-a.in.norun.html @@ -0,0 +1,9 @@ +HTML5 allows A to contain block-level content + + +

A treated as block

+ + Read more +
+A treated as + inline diff --git a/engine/tests/test_files/output/autop/domdoc_exp.html b/engine/tests/test_files/output/autop/domdoc_exp.html new file mode 100644 index 000000000..8480c1083 --- /dev/null +++ b/engine/tests/test_files/output/autop/domdoc_exp.html @@ -0,0 +1,46 @@ +› +  +Vietnamese - Tiếng Việt + +

h1

+

Paragraph link Bold italic bolditalic 

+

h2

+

Paragraph size1 size2 size4

+

h3

+

Paragraph underline strikethrough color background

+
+

Blockquoted paragraph

+
+

Paragraph following blockquote

+
  • Unordered
  • +
  • List
  • +

Paragraph between lists

+
  1. Ordered
  2. +
  3. List
  4. +

Paragraph between lists

+
  • OL list
  • +
  • nested
    1. inside a
    2. +
    3. UL list
    4. +
  • +

Paragraph between lists

+ + + + +
Table with
border=0

Paragraph

+
  1. UL list
  2. +
  3. nested +
    • inside a
    • +
    • OL list
    • +
  4. +

Paragraph between tables

+ + + + +
Table with border=1
cellpadding = 5

Paragraph between tables

+ + + + +
Table with
border=2
\ No newline at end of file diff --git a/engine/tests/test_files/output/autop/domdoc_in.html b/engine/tests/test_files/output/autop/domdoc_in.html new file mode 100644 index 000000000..4c465b435 --- /dev/null +++ b/engine/tests/test_files/output/autop/domdoc_in.html @@ -0,0 +1,80 @@ +› +  +Vietnamese - Tiếng Việt + +

h1

+

Paragraph link Bold italic bolditalic 

+

h2

+

Paragraph size1 size2 size4

+

h3

+

Paragraph underline strikethrough color background

+
+

Blockquoted paragraph

+
+

Paragraph following blockquote

+
    +
  • Unordered
  • +
  • List
  • +
+

Paragraph between lists

+
    +
  1. Ordered
  2. +
  3. List
  4. +
+

Paragraph between lists

+
    +
  • OL list
  • +
  • nested
      +
    1. inside a
    2. +
    3. UL list
    4. +
  • +
+

Paragraph between lists

+ + + + + + + + + + + +
Table with
border=0
+

Paragraph

+
    +
  1. UL list
  2. +
  3. nested +
      +
    • inside a
    • +
    • OL list
    • +
    +
  4. +
+

Paragraph between tables

+ + + + + + + + + + + +
Table with border=1
cellpadding = 5
+

Paragraph between tables

+ + + + + + + + + + + +
Table with
border=2
\ No newline at end of file diff --git a/engine/tests/test_files/output/autop/typical-post.exp.html b/engine/tests/test_files/output/autop/typical-post.exp.html new file mode 100644 index 000000000..f9d75a114 --- /dev/null +++ b/engine/tests/test_files/output/autop/typical-post.exp.html @@ -0,0 +1,84 @@ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+

screenshot of Audition mixing sessionVivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis. Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis. Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.

+ +

Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci. Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor.

+

Donec at massa ante, sagittis fermentum urna.

+

Mauris volutpat est id massa volutpat lacinia. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In in nisl mauris. In aliquet pretium nisl, vel convallis neque cursus vitae. Curabitur id mauris in urna gravida ornare.

+ +

[caption id="attachment_719" align="alignleft" width="150" caption="Ibanez AGB140 Bass"]Ibanez AGB140 Bass[/caption]

+ +

Aenean aliquet cursus purus sed gravida. Cras auctor euismod justo, ac dictum purus facilisis dignissim. Quisque facilisis porta sem, ac suscipit quam molestie nec. Pellentesque quis hendrerit enim. Vivamus tempor erat diam. Sed eu felis nunc. Cras posuere lorem commodo turpis mollis sagittis. Mauris lobortis nunc felis.

+ +

Maecenas elit lorem, varius sed condimentum ac, cursus et magna. Nam ut massa id augue consectetur porttitor eleifend in nunc. Curabitur cursus varius dictum. Vestibulum vel justo et neque tempus placerat a vel sapien.

+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus.

+
<?php
+class DataTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @dataProvider provider
+     */
+    public function testAdd($a, $b, $c)
+    {
+        $this->assertEquals($c, $a + $b);
+    }
+
+    public function provider()
+    {
+        return array(
+          array(0, 0, 0),
+          array(0, 1, 1),
+          array(1, 0, 1),
+          array(1, 1, 3)
+        );
+    }
+}
  • Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis.
  • +
  • Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis.
  • +
  • Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.
  • +
  • Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci.
  • +
+

Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. Donec at massa ante, sagittis fermentum urna.

+ +

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+

screenshot of Audition mixing sessionVivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis. Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis. Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.

+ +

Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci. Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor.

+

Donec at massa ante, sagittis fermentum urna.

+

Mauris volutpat est id massa volutpat lacinia. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In in nisl mauris. In aliquet pretium nisl, vel convallis neque cursus vitae. Curabitur id mauris in urna gravida ornare.

+ +

[caption id="attachment_719" align="alignleft" width="150" caption="Ibanez AGB140 Bass"]Ibanez AGB140 Bass[/caption]

+ +

Aenean aliquet cursus purus sed gravida. Cras auctor euismod justo, ac dictum purus facilisis dignissim. Quisque facilisis porta sem, ac suscipit quam molestie nec. Pellentesque quis hendrerit enim. Vivamus tempor erat diam. Sed eu felis nunc. Cras posuere lorem commodo turpis mollis sagittis. Mauris lobortis nunc felis.

+ +

Maecenas elit lorem, varius sed condimentum ac, cursus et magna. Nam ut massa id augue consectetur porttitor eleifend in nunc. Curabitur cursus varius dictum. Vestibulum vel justo et neque tempus placerat a vel sapien.

+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus.

+
<?php
+class DataTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @dataProvider provider
+     */
+    public function testAdd($a, $b, $c)
+    {
+        $this->assertEquals($c, $a + $b);
+    }
+
+    public function provider()
+    {
+        return array(
+          array(0, 0, 0),
+          array(0, 1, 1),
+          array(1, 0, 1),
+          array(1, 1, 3)
+        );
+    }
+}
  • Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis.
  • +
  • Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis.
  • +
  • Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.
  • +
  • Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci.
  • +
+

Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. Donec at massa ante, sagittis fermentum urna.

+ +

diff --git a/engine/tests/test_files/output/autop/typical-post.in.html b/engine/tests/test_files/output/autop/typical-post.in.html new file mode 100644 index 000000000..6e4984cc4 --- /dev/null +++ b/engine/tests/test_files/output/autop/typical-post.in.html @@ -0,0 +1,89 @@ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+screenshot of Audition mixing sessionVivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis. Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis. Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum. + +Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci. Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. +

Donec at massa ante, sagittis fermentum urna.

+
Mauris volutpat est id massa volutpat lacinia. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In in nisl mauris. In aliquet pretium nisl, vel convallis neque cursus vitae. Curabitur id mauris in urna gravida ornare. + +[caption id="attachment_719" align="alignleft" width="150" caption="Ibanez AGB140 Bass"]Ibanez AGB140 Bass[/caption] + +Aenean aliquet cursus purus sed gravida. Cras auctor euismod justo, ac dictum purus facilisis dignissim. Quisque facilisis porta sem, ac suscipit quam molestie nec. Pellentesque quis hendrerit enim. Vivamus tempor erat diam. Sed eu felis nunc. Cras posuere lorem commodo turpis mollis sagittis. Mauris lobortis nunc felis. + +Maecenas elit lorem, varius sed condimentum ac, cursus et magna. Nam ut massa id augue consectetur porttitor eleifend in nunc. Curabitur cursus varius dictum. Vestibulum vel justo et neque tempus placerat a vel sapien.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. + +
<?php
+class DataTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @dataProvider provider
+     */
+    public function testAdd($a, $b, $c)
+    {
+        $this->assertEquals($c, $a + $b);
+    }
+
+    public function provider()
+    {
+        return array(
+          array(0, 0, 0),
+          array(0, 1, 1),
+          array(1, 0, 1),
+          array(1, 1, 3)
+        );
+    }
+}
+
    +
  • Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis.
  • +
  • Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis.
  • +
  • Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.
  • +
  • Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci.
  • +
+Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. Donec at massa ante, sagittis fermentum urna. + + + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+screenshot of Audition mixing sessionVivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis. Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis. Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum. + +Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci. Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. +

Donec at massa ante, sagittis fermentum urna.

+
Mauris volutpat est id massa volutpat lacinia. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In in nisl mauris. In aliquet pretium nisl, vel convallis neque cursus vitae. Curabitur id mauris in urna gravida ornare. + +[caption id="attachment_719" align="alignleft" width="150" caption="Ibanez AGB140 Bass"]Ibanez AGB140 Bass[/caption] + +Aenean aliquet cursus purus sed gravida. Cras auctor euismod justo, ac dictum purus facilisis dignissim. Quisque facilisis porta sem, ac suscipit quam molestie nec. Pellentesque quis hendrerit enim. Vivamus tempor erat diam. Sed eu felis nunc. Cras posuere lorem commodo turpis mollis sagittis. Mauris lobortis nunc felis. + +Maecenas elit lorem, varius sed condimentum ac, cursus et magna. Nam ut massa id augue consectetur porttitor eleifend in nunc. Curabitur cursus varius dictum. Vestibulum vel justo et neque tempus placerat a vel sapien.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus enim ante, mattis eget imperdiet nec, pharetra vel velit. Sed at euismod nibh. Praesent lacus tellus, posuere et convallis a, mollis et tellus. + +
<?php
+class DataTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @dataProvider provider
+     */
+    public function testAdd($a, $b, $c)
+    {
+        $this->assertEquals($c, $a + $b);
+    }
+
+    public function provider()
+    {
+        return array(
+          array(0, 0, 0),
+          array(0, 1, 1),
+          array(1, 0, 1),
+          array(1, 1, 3)
+        );
+    }
+}
+
    +
  • Suspendisse potenti. Phasellus tincidunt dignissim est eget mattis.
  • +
  • Vestibulum lacinia condimentum tellus, non vestibulum erat dapibus quis.
  • +
  • Aliquam arcu nibh, viverra adipiscing eleifend quis, pretium vitae ipsum.
  • +
  • Curabitur turpis ante, congue ac dapibus quis, vehicula ac orci.
  • +
+Nunc luctus neque non massa porta sed pharetra ante accumsan. Nam suscipit risus quis libero convallis viverra. Ut at arcu enim, vel pharetra dolor. Donec at massa ante, sagittis fermentum urna. + + \ No newline at end of file diff --git a/engine/tests/test_files/output/autop/wp-welcome.exp.html b/engine/tests/test_files/output/autop/wp-welcome.exp.html new file mode 100644 index 000000000..2f612e3dd --- /dev/null +++ b/engine/tests/test_files/output/autop/wp-welcome.exp.html @@ -0,0 +1,22 @@ + +

Welcome to WordPress! This post contains important information. After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.

+ +

First things first:

+ +

As a subscriber, you will receive an email every time an update is available (and only then). This will make it easier to keep your site up to date, and secure from evildoers.
When a new version is released, log in to the Dashboard and follow the instructions.
Upgrading is a couple of clicks!

+ +

Then you can start enjoying the WordPress experience:

+ +

To keep this post for reference, click to edit it, go to the Publish box and change its Visibility from Public to Private.

+ +

Thank you for selecting WordPress. We wish you happy publishing!

+ +

PS. Not yet subscribed for update notifications? Do it now!

diff --git a/engine/tests/test_files/output/autop/wp-welcome.in.html b/engine/tests/test_files/output/autop/wp-welcome.in.html new file mode 100644 index 000000000..338ede73f --- /dev/null +++ b/engine/tests/test_files/output/autop/wp-welcome.in.html @@ -0,0 +1,25 @@ +Welcome to WordPress! This post contains important information. After you read it, you can make it private to hide it from visitors but still have the information handy for future reference. + +First things first: + +As a subscriber, you will receive an email every time an update is available (and only then). This will make it easier to keep your site up to date, and secure from evildoers. +When a new version is released, log in to the Dashboard and follow the instructions. +Upgrading is a couple of clicks! + +Then you can start enjoying the WordPress experience: + +To keep this post for reference, click to edit it, go to the Publish box and change its Visibility from Public to Private. + +Thank you for selecting WordPress. We wish you happy publishing! + +PS. Not yet subscribed for update notifications? Do it now! diff --git a/engine/tests/test_files/output/autop/wpautop-fails.exp.html b/engine/tests/test_files/output/autop/wpautop-fails.exp.html new file mode 100644 index 000000000..d018db4ff --- /dev/null +++ b/engine/tests/test_files/output/autop/wpautop-fails.exp.html @@ -0,0 +1,31 @@ + +

paragraph

+ +

paragraph

+
+

paragraph

+
+

line

+
+

paragraph

+
  • line
  • +
  • paragraph + +paragraph
  • +
+

paragraph
line
line

+
Honor
+this whitespace
+
+

paragraph

+ +

paragraph

+
term
paragraph + + + +paragraph
+

Hello

World

+

Paragraph

Line
\ No newline at end of file diff --git a/engine/tests/test_files/output/autop/wpautop-fails.in.html b/engine/tests/test_files/output/autop/wpautop-fails.in.html new file mode 100644 index 000000000..9aa24be59 --- /dev/null +++ b/engine/tests/test_files/output/autop/wpautop-fails.in.html @@ -0,0 +1,41 @@ + +paragraph + +paragraph
+ paragraph +
+ line +
+ +paragraph +
    +
  • line
  • +
  • paragraph + +paragraph
  • +
+paragraph +line
+ line +
Honor
+this whitespace
+
+paragraph + +paragraph +
term
paragraph + + + +paragraph
+ + +Hello + +World + +

Paragraph

+ +
Line
\ No newline at end of file diff --git a/engine/tests/test_files/output/autop/wysiwyg-test.exp.html b/engine/tests/test_files/output/autop/wysiwyg-test.exp.html new file mode 100644 index 000000000..1f23d6154 --- /dev/null +++ b/engine/tests/test_files/output/autop/wysiwyg-test.exp.html @@ -0,0 +1,51 @@ + +

&nbps;

+

h1

+

Paragraph link Bold italic bolditalic 

+

h2

+

Paragraph size1 size2 size4

+

h3

+

Paragraph underline strikethrough color background

+
+

Blockquoted paragraph

+
+

Paragraph following blockquote

+
  • Unordered
  • +
  • List
  • +
+

Paragraph between lists

+
  1. Ordered
  2. +
  3. List
  4. +
+

Paragraph between lists

+
  • OL list
  • +
  • nested +
    1. inside a
    2. +
    3. UL list
    4. +
  • +
+

Paragraph between lists

+ + + + +
Table with
border=0
+

Paragraph

+
  1. UL list
  2. +
  3. nested +
    • inside a
    • +
    • OL list
    • +
  4. +
+

Paragraph between tables

+ + + + +
Table with border=1
cellpadding = 5
+

Paragraph between tables

+ + + + +
Table with
border=2
\ No newline at end of file diff --git a/engine/tests/test_files/output/autop/wysiwyg-test.in.html b/engine/tests/test_files/output/autop/wysiwyg-test.in.html new file mode 100644 index 000000000..733b0e2ec --- /dev/null +++ b/engine/tests/test_files/output/autop/wysiwyg-test.in.html @@ -0,0 +1,79 @@ +&nbps; +≴ +

h1

+Paragraph link Bold italic bolditalic  +

h2

+Paragraph size1 size2 size4 +

h3

+Paragraph underline strikethrough color background +
Blockquoted paragraph
+Paragraph following blockquote +
    +
  • Unordered
  • +
  • List
  • +
+Paragraph between lists +
    +
  1. Ordered
  2. +
  3. List
  4. +
+Paragraph between lists +
    +
  • OL list
  • +
  • nested +
      +
    1. inside a
    2. +
    3. UL list
    4. +
  • +
+Paragraph between lists + + + + + + + + + + + + + +
Table with
border=0
+Paragraph +
    +
  1. UL list
  2. +
  3. nested +
      +
    • inside a
    • +
    • OL list
    • +
    +
  4. +
+Paragraph between tables + + + + + + + + + + + +
Table with border=1
cellpadding = 5
+Paragraph between tables + + + + + + + + + + + +
Table with
border=2
\ No newline at end of file diff --git a/mod/groups/views/rss/object/groupforumtopic.php b/mod/groups/views/rss/object/groupforumtopic.php index d730ef796..b2d05d488 100644 --- a/mod/groups/views/rss/object/groupforumtopic.php +++ b/mod/groups/views/rss/object/groupforumtopic.php @@ -14,7 +14,7 @@ if (empty($title)) { $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); $pubdate = date('r', $vars['entity']->getTimeCreated()); -$description = autop($vars['entity']->description); +$description = elgg_autop($vars['entity']->description); $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); diff --git a/mod/search/views/default/search/no_results.php b/mod/search/views/default/search/no_results.php index 74b5b2cfa..0e9a5e295 100644 --- a/mod/search/views/default/search/no_results.php +++ b/mod/search/views/default/search/no_results.php @@ -3,4 +3,4 @@ * No results from search */ -echo autop(elgg_echo('search:no_results')); +echo elgg_autop(elgg_echo('search:no_results')); diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php index 494c2c8dc..8fddb8aa8 100644 --- a/mod/thewire/views/rss/object/thewire.php +++ b/mod/thewire/views/rss/object/thewire.php @@ -15,7 +15,7 @@ $title = elgg_echo('thewire:by', array($owner->name)); $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); $pubdate = date('r', $vars['entity']->getTimeCreated()); -$description = autop($vars['entity']->description); +$description = elgg_autop($vars['entity']->description); $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); diff --git a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php index cbd13a709..9199922d6 100644 --- a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php +++ b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php @@ -27,7 +27,7 @@ if (!$count) { access_show_hidden_entities($hidden_entities); elgg_set_ignore_access($ia); - echo autop(elgg_echo('uservalidationbyemail:admin:no_unvalidated_users')); + echo elgg_autop(elgg_echo('uservalidationbyemail:admin:no_unvalidated_users')); return TRUE; } diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 1ea9c57a9..2087ec299 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -25,5 +25,5 @@ $formbody = <<< END $submit_control END; -echo autop(elgg_echo('profile:explainchangefields')); +echo elgg_autop(elgg_echo('profile:explainchangefields')); echo $formbody; diff --git a/views/default/forms/user/passwordreset.php b/views/default/forms/user/passwordreset.php index 3c89776f6..5946fa7c0 100644 --- a/views/default/forms/user/passwordreset.php +++ b/views/default/forms/user/passwordreset.php @@ -3,7 +3,7 @@ * Reset user password form */ -echo autop(elgg_echo('user:resetpassword:reset_password_confirm')); +echo elgg_autop(elgg_echo('user:resetpassword:reset_password_confirm')); echo elgg_view('input/hidden', array( 'name' => 'u', diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index 200f27de5..589100c4f 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -31,7 +31,7 @@ if ($parse_urls) { $text = filter_tags($text); -$text = autop($text); +$text = elgg_autop($text); $attributes = elgg_format_attributes($vars); diff --git a/views/default/page/elements/messages.php b/views/default/page/elements/messages.php index a35a48586..edd40d71e 100644 --- a/views/default/page/elements/messages.php +++ b/views/default/page/elements/messages.php @@ -18,7 +18,7 @@ if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object' foreach ($vars['object'] as $type => $list ) { foreach ($list as $message) { echo "
  • "; - echo autop($message); + echo elgg_autop($message); echo '
  • '; } } diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php index 9456e682f..e810aa701 100644 --- a/views/installation/install/pages/admin.php +++ b/views/installation/install/pages/admin.php @@ -3,7 +3,7 @@ * Install create admin account page */ -echo autop(elgg_echo('install:admin:instructions')); +echo elgg_autop(elgg_echo('install:admin:instructions')); $vars['type'] = 'admin'; diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php index 2f5a04854..80f8e7434 100644 --- a/views/installation/install/pages/complete.php +++ b/views/installation/install/pages/complete.php @@ -3,7 +3,7 @@ * Install completion page */ -echo autop(elgg_echo('install:complete:instructions')); +echo elgg_autop(elgg_echo('install:complete:instructions')); ?> diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php index d3011c9e3..d24b4f57b 100644 --- a/views/installation/install/pages/database.php +++ b/views/installation/install/pages/database.php @@ -6,12 +6,12 @@ */ if (isset($vars['failure']) && $vars['failure']) { - echo autop(elgg_echo('install:database:error')); + echo elgg_autop(elgg_echo('install:database:error')); $vars['refresh'] = TRUE; $vars['advance'] = FALSE; echo elgg_view('install/nav', $vars); } else { - echo autop(elgg_echo('install:database:instructions')); + echo elgg_autop(elgg_echo('install:database:instructions')); $vars['type'] = 'database'; diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php index e3689e761..06f309c90 100644 --- a/views/installation/install/pages/requirements.php +++ b/views/installation/install/pages/requirements.php @@ -14,7 +14,7 @@ if ($vars['num_failures'] != 0) { $instruct_text = elgg_echo('install:requirements:instructions:success'); } -echo autop($instruct_text); +echo elgg_autop($instruct_text); $report = $vars['report']; foreach ($report as $category => $checks) { @@ -23,7 +23,7 @@ foreach ($report as $category => $checks) { echo "
      "; foreach ($checks as $check) { echo "
    • "; - echo autop($check['message']); + echo elgg_autop($check['message']); echo "
    • "; } echo "
    "; diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php index 30a1deb5a..04f23c0ea 100644 --- a/views/installation/install/pages/settings.php +++ b/views/installation/install/pages/settings.php @@ -1,6 +1,6 @@ $list ) { foreach ($list as $message) { echo "
  • "; - echo autop($message); + echo elgg_autop($message); echo '
  • '; } } diff --git a/views/opendd/messages/exceptions/exception.php b/views/opendd/messages/exceptions/exception.php index 54868f1f4..dc0f48a8d 100644 --- a/views/opendd/messages/exceptions/exception.php +++ b/views/opendd/messages/exceptions/exception.php @@ -11,7 +11,7 @@ ?>