Function Process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function Process( $text ) {
$timer = Debug::GetTimer();
$r = '';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method Process
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Process( $text ) {
$timer = Debug::GetTimer();
$r = '';
Function _split_str_by_whitespace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function _split_str_by_whitespace( $string, $goal ) {
$chunks = array();
$string_nullspace = strtr( $string, "\r\n\t\v\f ", "\000\000\000\000\000\000" );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function esc_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
$original_url = $url;
if ( '' == $url )
return $url;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method Process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$ret = " $piece "; // Pad with whitespace to simplify the regexes
$url_clickable = '~
([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method _make_url_clickable_cb uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$suffix = $matches[3];
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method esc_url uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
/*
if ( ! is_array( $protocols ) )
$protocols = wp_allowed_protocols();
$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method Process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$r .= make_clickable( $chunk );
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused parameters such as '$protocols'. Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (function_exists("wp_kses_normalize_entities")) {
$url = wp_kses_normalize_entities( $url );
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 26.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$string = substr( $string, $pos + 1 );
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 21.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$string_nullspace = substr( $string_nullspace, $pos + 1 );
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 21.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 9 locations. Consider refactoring. Open
$strip = array('%0d', '%0a', '%0D', '%0A');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 20.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
$ret = preg_replace_callback( $url_clickable, 'self::_make_url_clickable_cb', $ret );
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 20.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
The parameter $_context is not named in camelCase. Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
$original_url = $url;
if ( '' == $url )
return $url;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Method name "_make_url_clickable_cb" should not be prefixed with an underscore to indicate visibility Open
public static function _make_url_clickable_cb($matches) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( 10000 < strlen( $piece ) ) {
- Exclude checks
Space found after opening bracket of FOREACH loop Open
foreach ( $textarr as $piece ) {
- Exclude checks
Method name "_make_web_ftp_clickable_cb" should not be prefixed with an underscore to indicate visibility Open
public static function _make_web_ftp_clickable_cb($matches) {
- Exclude checks
Space found before closing bracket of FOREACH loop Open
foreach ( self::_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( empty($url) )
- Exclude checks
Expected 0 spaces between argument "$text" and closing bracket; 1 found Open
public static function Process( $text ) {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$text"; 1 found Open
public static function Process( $text ) {
- Exclude checks
Space found after opening bracket of FOREACH loop Open
foreach ( self::_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
- Exclude checks
Space found before closing bracket of FOREACH loop Open
foreach ( $textarr as $piece ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( empty($dest) )
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( empty( $piece ) || ( $piece[0] == '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( 2101 < strlen( $chunk ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
foreach ( self::_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
foreach ( $textarr as $piece ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( ')' == $matches[3] && strpos( $url, '(' ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( false === $pos ) {
- Exclude checks
Method name "_make_email_clickable_cb" should not be prefixed with an underscore to indicate visibility Open
public static function _make_email_clickable_cb($matches) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ( '' == $url )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$good_protocol_url = $url;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ( '/' === $url[0] ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$subject = str_replace( $search, '', $subject, $count );
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$count = 1;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Expected 0 spaces between argument "$_context" and closing bracket; 1 found Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $url;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = self::_deep_replace($strip, $url);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param string $url The URL to be cleaned.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = wp_kses_normalize_entities( $url );
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = str_replace( '&', '&', $url );
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return string The string with the replaced svalues.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public static function _deep_replace( $search, $subject ) {
- Exclude checks
Expected 0 spaces between argument "$goal" and closing bracket; 1 found Open
public static function _split_str_by_whitespace( $string, $goal ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param array $protocols Optional. An array of acceptable protocols.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param string $_context Private. Use esc_url_raw() for database usage.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$strip = array('%0d', '%0a', '%0D', '%0A');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = str_replace(';//', '://', $url);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (function_exists("wp_kses_normalize_entities")) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
while ( $count ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( 'display' == $_context ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Expected 0 spaces between opening bracket and argument "$search"; 1 found Open
public static function _deep_replace( $search, $subject ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $subject;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( '/' === $url[0] ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
while ( $goal < strlen( $string_nullspace ) ) {
- Exclude checks
Method name "_deep_replace" should not be prefixed with an underscore to indicate visibility Open
public static function _deep_replace( $search, $subject ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* via $protocols or the common ones set in the function.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = str_replace( "'", ''', $url );
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return string The cleaned $url after the 'clean_url' filter is applied.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = 'http://' . $url;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @since 2.8.1
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param string|array $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
- Exclude checks
Method name "_split_str_by_whitespace" should not be prefixed with an underscore to indicate visibility Open
public static function _split_str_by_whitespace( $string, $goal ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( false === $pos ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
// Replace ampersands and single quotes only when displaying.
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( $string ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $url;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @access private
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
while ( $count ) {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$string"; 1 found Open
public static function _split_str_by_whitespace( $string, $goal ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Expected 0 spaces between opening bracket and argument "$url"; 1 found Open
public static function esc_url( $url, $protocols = null, $_context = 'display' ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/* If the URL doesn't appear to contain a scheme, we
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
if ( '' == $url )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* str_replace would return
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$original_url = $url;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param string $subject The string being searched and replaced on, otherwise known as the haystack.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Perform a deep string replace operation to ensure the values in $search are no longer present
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ( 'display' == $_context ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
- Exclude checks
Expected 0 spaces between argument "$subject" and closing bracket; 1 found Open
public static function _deep_replace( $search, $subject ) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$subject = (string) $subject;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = preg_replace_callback( $url_clickable, 'self::_make_url_clickable_cb', $ret );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* make_clickable()}.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string HTML A element with URL address.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = substr($dest, -1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url_clickable = '~
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Callback to convert URL match to HTML A element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = self::esc_url($dest);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pos = strpos( $string_nullspace, "\000", $goal + 1 );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ( self::_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @access private
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $matches Single Regex Match.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it, add the closing parenthesis to the URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = $matches[2];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* make_clickable()}.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* within links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function _make_url_clickable_cb($matches) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = $matches[2];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( empty( $piece ) || ( $piece[0] == '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// ... break it up
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = " $piece "; // Pad with whitespace to simplify the regexes
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', 'self::_make_web_ftp_clickable_cb', $ret );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 2.3.2
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Then we can let the parenthesis balancer do its thing below.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// removed trailing [.,;:)] from URL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = substr($dest, 0, strlen($dest)-1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Chunks longer than the goal are guaranteed to not have any inner whitespace.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $text Content to convert URIs.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( ')' == $matches[3] && strpos( $url, '(' ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Inline control structures are not allowed Open
if ( empty($url) )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$email = $matches[2] . '@' . $matches[3];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Long strings might contain expensive edge cases ...
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( 2101 < strlen( $chunk ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r .= $chunk; // Too big, no whitespace: bail.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Include parentheses in the URL only if paired
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$suffix = strrchr( $url, ')' ) . $suffix;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$suffix = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @access private
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string Content with converted URIs.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', 'self::_make_email_clickable_cb', $ret );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$suffix = $matches[3];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 0.71
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function _make_web_ftp_clickable_cb($matches) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $r;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dest = 'http://' . $dest;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( empty($dest) )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* <code>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Convert plaintext URI to HTML links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r .= $ret;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = substr( $url, 0, strrpos( $url, ')' ) );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 2.3.2
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* The length of each returned chunk is as close to the specified length goal as possible,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ( $textarr as $piece ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Inline control structures are not allowed Open
if ( empty($dest) )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Converts URI, www and ftp, and email addresses. Finishes by fixing links
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( 10000 < strlen( $piece ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string HTML A element with URI address.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function Process( $text ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* make_clickable()}.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $matches Single Regex Match.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url .= $matches[3];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $matches Single Regex Match.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Cleanup of accidental links within links
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r .= $piece;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = self::esc_url($url);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ret = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$r .= make_clickable( $chunk );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Callback to convert URI match to HTML A element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( empty($url) )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Callback to convert email address match to HTML A element.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 1 => '1234 ', // 5 characters: '1234 67890a' was too long
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( false === $pos ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* is applied to the returned cleaned URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string HTML A element with email address.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 7 => '1 3 5 7 9', // 9 characters: End of $string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function _split_str_by_whitespace( $string, $goal ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $chunks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$string_nullspace = substr( $string_nullspace, $pos + 1 );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* A number of characters are removed from the URL. If the URL is for displaying
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @uses wp_kses_bad_protocol() To only permit protocols in the URL set
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $goal The desired chunk length.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( false === $pos ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ( $string ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function _make_email_clickable_cb($matches) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* (the default behaviour) ampersands are also replaced. The 'clean_url' filter
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[1] . "<a href=\"mailto:$email\">$email</a>";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Breaks a string into chunks by splitting at whitespace characters.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Inline control structures are not allowed Open
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 4 => '123456789 ', // 10 characters: '123456789 1234567890a' was too long
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $string The string to split.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 2.8.0
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 3.4.0
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* with the caveat that each chunk includes its trailing delimiter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$string = substr( $string, $pos + 1 );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 3 => '1234 890 ', // 11 characters: Perfect split
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 5 => '1234567890a ', // 12 characters: Too long, but no inner whitespace on which to split
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @access private
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$string_nullspace = strtr( $string, "\r\n\t\v\f ", "\000\000\000\000\000\000" );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Joining the returned chunks with empty delimiters reconstructs the input string losslessly.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ( $goal < strlen( $string_nullspace ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Input string must have no null characters (or eventual transformations on output chunks must not care about null characters)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 6 => ' 45678 ', // 11 characters: Perfect split
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pos = strrpos( substr( $string_nullspace, 0, $goal + 1 ), "\000" );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chunks[] = $string;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* via $protocols or the common ones set in the function.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @since 2.3.2
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* _split_str_by_whitespace( "1234 67890 1234 67890a cd 1234 890 123456789 1234567890a 45678 1 3 5 7 90 ", 10 ) ==
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 2 => '67890a cd ', // 10 characters: '67890a cd 1234' was too long
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @access private
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Checks and cleans a URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 0 => '1234 67890 ', // 11 characters: Perfect split
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* </code>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array Numeric array of chunks.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chunks[] = substr( $string, 0, $pos + 1 );
- Exclude checks
Inline control structures are not allowed Open
if ( '' == $url )
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* array (
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chunks = array();
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( 10000 < strlen( $piece ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( ')' == $matches[3] && strpos( $url, '(' ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( empty( $piece ) || ( $piece[0] == '<' && ! preg_match('|^<\s*[\w]{1,20}+://|', $piece) ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
foreach ( $textarr as $piece ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( empty($dest) )
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( empty($url) )
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
foreach ( self::_split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( 2101 < strlen( $chunk ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( false === $pos ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( $string ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( false === $pos ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( '' == $url )
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
while ( $goal < strlen( $string_nullspace ) ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
while ( $count ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( 'display' == $_context ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( '/' === $url[0] ) {
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
- Exclude checks