@@ 2102-2121 (lines=20) @@ | ||
2099 | * @param string $content The content to modify. |
|
2100 | * @return string The de-slashed content. |
|
2101 | */ |
|
2102 | function deslash($content) { |
|
2103 | // Note: \\\ inside a regex denotes a single backslash. |
|
2104 | ||
2105 | /* |
|
2106 | * Replace one or more backslashes followed by a single quote with |
|
2107 | * a single quote. |
|
2108 | */ |
|
2109 | $content = preg_replace("/\\\+'/", "'", $content); |
|
2110 | ||
2111 | /* |
|
2112 | * Replace one or more backslashes followed by a double quote with |
|
2113 | * a double quote. |
|
2114 | */ |
|
2115 | $content = preg_replace('/\\\+"/', '"', $content); |
|
2116 | ||
2117 | // Replace one or more backslashes with one backslash. |
|
2118 | $content = preg_replace("/\\\+/", "\\", $content); |
|
2119 | ||
2120 | return $content; |
|
2121 | } |
|
2122 | ||
2123 | /** |
|
2124 | * Modifies the database based on specified SQL statements. |
@@ 504-509 (lines=6) @@ | ||
501 | * @param string $content XML-RPC XML Request content. |
|
502 | * @return string XMLRPC XML Request content without title and category elements. |
|
503 | */ |
|
504 | function xmlrpc_removepostdata( $content ) { |
|
505 | $content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content ); |
|
506 | $content = preg_replace( '/<category>(.+?)<\/category>/si', '', $content ); |
|
507 | $content = trim( $content ); |
|
508 | return $content; |
|
509 | } |
|
510 | ||
511 | /** |
|
512 | * Use RegEx to extract URLs from arbitrary content. |