PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / trunk
MainWP Dashboard: Self-hosted WordPress Management for Agencies vtrunk
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
← All changes | class/class-mainwp-exception.php +10 -3 5.2trunk View file →
@@ -8,8 +8,13 @@
8 8 */
9 9
10 10 namespace MainWP\Dashboard;
11 11
12 +// Exit if accessed directly.
13 +if ( ! defined( 'ABSPATH' ) ) {
14 + exit;
15 +}
16 +
12 17 /**
13 18 * Class MainWP_Exception
14 19 *
15 20 * @package MainWP\Dashboard
@@ -47,9 +52,9 @@
47 52 * @param string $errCode Errors code.
48 53 */
49 54 public function __construct( $message, $extra = null, $errCode = '' ) {
50 55 parent::__construct( $message );
51 - $this->messageExtra = esc_html( $extra ); // add more secure.
56 + $this->messageExtra = $extra; // escape in get method.
52 57 $this->errorCode = esc_html( $errCode );
53 58 }
54 59
55 60 /**
@@ -54,12 +59,14 @@
54 59
55 60 /**
56 61 * Method get_message_extra()
57 62 *
63 + * @param bool $escape_msg Exception message.
64 + *
58 65 * @return $messageExtra Extra messages.
59 66 */
60 - public function get_message_extra() {
61 - return $this->messageExtra;
67 + public function get_message_extra( $escape_msg = true ) {
68 + return $escape_msg ? esc_html( wp_strip_all_tags( $this->messageExtra ) ) : $this->messageExtra;
62 69 }
63 70
64 71 /**
65 72 * Method get_message_error_code()